MCPcopy Create free account
hub / github.com/analogdevicesinc/scopy / update

Method update

gui/src/widgets/plotcursorreadouts.cpp:63–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63void PlotCursorReadouts::update()
64{
65 const uint precision = 3;
66
67 if(yFormatter && !xUnit.isEmpty()) {
68 x1_val->setText(yFormatter->format(x1, xUnit, precision));
69 x2_val->setText(yFormatter->format(x2, xUnit, precision));
70 deltaX_val->setText(yFormatter->format(x2 - x1, xUnit, precision));
71 invDeltaX_val->setText(yFormatter->format(1 / (x2 - x1), xUnit, precision));
72 } else {
73 x1_val->setText(QString::number(x1, 'g', precision) + " " + xUnit);
74 x2_val->setText(QString::number(x2, 'g', precision) + " " + xUnit);
75 deltaX_val->setText(QString::number(x2 - x1, 'g', precision) + " " + xUnit);
76 invDeltaX_val->setText(QString::number(1 / (x2 - x1), 'g', precision) + " " + xUnit);
77 }
78
79 if(yFormatter && !yUnit.isEmpty()) {
80 y1_val->setText(yFormatter->format(y1, yUnit, precision));
81 y2_val->setText(yFormatter->format(y2, yUnit, precision));
82 deltaY_val->setText(yFormatter->format(y2 - y1, yUnit, precision));
83 } else {
84 y1_val->setText(QString::number(y1, 'g', precision) + " " + yUnit);
85 y2_val->setText(QString::number(y2, 'g', precision) + " " + yUnit);
86 deltaY_val->setText(QString::number(y2 - y1, 'g', precision) + " " + yUnit);
87 }
88}
89
90void PlotCursorReadouts::initContent()
91{

Callers

nothing calls this directly

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected