5 #include "TelemetryOverlay.h" 7 #include <mcrt_dataio/engine/mcrt/McrtNodeInfo.h> 8 #include <mcrt_messages/BaseFrame.h> 21 using Arg = scene_rdl2::grid_util::Arg;
22 using Parser = scene_rdl2::grid_util::Parser;
24 LayoutBase(std::shared_ptr<Overlay> overlay, std::shared_ptr<Font> font);
27 virtual const char* getName()
const = 0;
31 Parser& getParser() {
return mParser; }
35 void parserConfigure();
40 std::string colFg(
const C3& c)
const;
41 std::string colBg(
const C3& c)
const;
42 std::string colReset()
const {
return colFg(mCharFg) + colBg(mCharBg); }
43 std::string strFps(
float v)
const;
44 std::string strPct(
float fraction)
const;
45 std::string strSec(
float sec)
const;
46 std::string strMillisec(
float millisec)
const;
47 std::string strByte(
size_t size)
const;
48 std::string strBps(
float bps)
const;
49 std::string strBar(
unsigned barWidth,
51 const std::string& title,
54 unsigned* barStartOffsetPixX =
nullptr,
55 unsigned* barEndOffsetPixX =
nullptr,
56 unsigned* barHeight =
nullptr)
const;
57 std::string strBool(
bool flag)
const;
58 std::string strFrameStatus(
const mcrt::BaseFrame::Status& status,
59 const float renderPrepProgress)
const;
60 std::string strPassStatus(
bool isCoarsePass)
const;
61 std::string strExecMode(
const McrtNodeInfo::ExecMode& execMode)
const;
63 void drawBoxBar(
unsigned leftX,
unsigned leftY,
64 unsigned barStartOffsetPixX,
unsigned barEndOffsetPixX,
67 const C3& c,
unsigned char alpha);
69 std::string showC3(
const C3& c)
const;
71 unsigned char getArgC0255(Arg& arg)
const;
72 C3 getArgC3(Arg& arg)
const;
76 C3 mCharFg {255, 255, 255};
79 C3 mPanelBg {32, 32, 32};
80 float mPanelBgAlpha {200};
82 std::shared_ptr<Overlay> mOverlay;
83 std::shared_ptr<Font> mFont;
85 unsigned mMaxYLines {0};
86 unsigned mOffsetBottomPixY {0};
87 unsigned mStepPixY {0};
97 LayoutUtil(std::shared_ptr<Overlay> overlay, std::shared_ptr<Font> font)
102 void drawUtilGlobalInfo(
const std::string& msg,
105 Overlay::BBox2i& bboxGlobalInfo);
106 void drawUtilGlobalProgressBar(
unsigned barLeftBottomX,
107 unsigned barLeftBottomY,
110 Overlay::BBox2i& bboxGlobalProgressBar);
116 using Arg = scene_rdl2::grid_util::Arg;
117 using Parser = scene_rdl2::grid_util::Parser;
119 LayoutDevel(std::shared_ptr<Overlay> overlay, std::shared_ptr<Font> font)
125 const char* getName()
const override {
return "devel"; }
132 void drawDispatchMergeComputation(
const DisplayInfo& info);
133 void drawGlobalProgressBar(
const DisplayInfo& info);
136 void parserConfigure();
140 Overlay::BBox2i mBBoxGlobalInfo;
141 Overlay::BBox2i mBBoxGlobalProgressBar;
142 Overlay::BBox2i mBBoxDispatchMergeComputation;
143 Overlay::BBox2i mBBoxMcrtComputation;
147 unsigned mXoffset[3] {0,0,0};
148 unsigned mXmin[3] {0,0,0};
149 unsigned mXmax[3] {0,0,0};
150 unsigned mHeight[3] {0,0,0};
151 float mFraction[3] {0.0f, 0.0f, 0.0f};
153 std::vector<BarPos> mBarPosArray;
159 LayoutCorePerf(std::shared_ptr<Overlay> overlay, std::shared_ptr<Font> font)
163 const char* getName()
const override {
return "corePerf"; }
172 unsigned mRowCoreNum {0};
173 unsigned mNumOfRows {0};
175 unsigned mTitleWidthChar {0};
177 unsigned mCoreWinXMin {0};
178 unsigned mCoreWinXMax {0};
179 unsigned mCoreWinYMin {0};
180 unsigned mCoreWinYMax {0};
181 unsigned mSingleCoreGapX {0};
182 unsigned mSingleCoreWidth {0};
186 void drawGlobalProgressBar(
const DisplayInfo& info);
189 bool setupCorePerfRowInfo(
const GlobalNodeInfo* gNodeinfo,
unsigned yMax);
190 unsigned calcMinRowCoreNum(
const GlobalNodeInfo* gNodeInfo,
unsigned yMax)
const;
191 unsigned calcMinRowMcrtComputation(
const GlobalNodeInfo* gNodeInfo)
const;
193 std::string drawSingleNodeTitle(
size_t mcrtTotal,
194 std::shared_ptr<McrtNodeInfo> node,
195 unsigned numOfRow)
const;
196 void drawCorePerfSingleNode(std::shared_ptr<McrtNodeInfo> node,
const McrtPos& mcrtPos);
200 unsigned mComputeRowInfoMcrtTotal {0};
201 unsigned mRowCoreNum {0};
202 unsigned mMinRowMcrtComputation {0};
204 Overlay::BBox2i mBBoxGlobalInfo;
205 Overlay::BBox2i mBBoxGlobalProgressBar;
206 Overlay::BBox2i mBBoxMcrtComputation;
208 std::vector<McrtPos> mMcrtPosArray;
Definition: TelemetryOverlay.h:25
Definition: TelemetryDisplay.h:20
Definition: TelemetryLayout.h:94
Definition: TelemetryLayout.h:18
Definition: TelemetryLayout.h:113
Definition: ClientReceiverConsoleDriver.cc:9
Definition: TelemetryLayout.h:156