Skip to content

Commit b738e39

Browse files
committed
admt: Styles cleanup
- Added sequence mode 2 graph checkboxes - Updated calibration graphs to align with styles infrastructure - Added formatter for graphs - Added colored checkbox - Disabled SPI CRC and Flag - Set default motor RPM to 30 - Changed uint16_t to quint16 for slot and signals Signed-off-by: John Lloyd Juanillo <[email protected]>
1 parent e16b4a2 commit b738e39

File tree

2 files changed

+678
-406
lines changed

2 files changed

+678
-406
lines changed

plugins/admt/include/admt/harmoniccalibration.h

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -76,24 +76,21 @@
7676
#include <widgets/horizontalspinbox.h>
7777
#include <widgets/registerblockwidget.h>
7878

79-
enum AcquisitionDataKey
79+
enum SensorDataKey
8080
{
81-
RADIUS,
82-
ANGLE,
83-
TURNCOUNT,
8481
ABSANGLE,
82+
ANGLE,
83+
ANGLESEC,
8584
SINE,
8685
COSINE,
8786
SECANGLI,
8887
SECANGLQ,
89-
ANGLESEC,
88+
RADIUS,
9089
DIAG1,
9190
DIAG2,
9291
TMP0,
9392
TMP1,
94-
CNVCNT,
95-
SCRADIUS,
96-
SPIFAULT
93+
CNVCNT
9794
};
9895

9996
namespace scopy {
@@ -117,10 +114,10 @@ public Q_SLOTS:
117114
void commandLogWrite(QString message = "");
118115
void updateFaultStatus(bool value);
119116
void updateMotorPosition(double position);
120-
void updateDIGIOUI(uint16_t *registerValue);
121-
void updateFaultRegisterUI(uint16_t *registerValue);
122-
void updateMTDiagnosticRegisterUI(uint16_t *registerValue);
123-
void updateMTDiagnosticsUI(uint16_t *registerValue);
117+
void updateDIGIOUI(quint16 registerValue);
118+
void updateFaultRegisterUI(quint16 registerValue);
119+
void updateMTDiagnosticRegisterUI(quint16 registerValue);
120+
void updateMTDiagnosticsUI(quint16 registerValue);
124121
Q_SIGNALS:
125122
void runningChanged(bool);
126123
void canCalibrateChanged(bool);
@@ -129,10 +126,10 @@ public Q_SLOTS:
129126
void commandLogWriteSignal(QString message);
130127
void updateFaultStatusSignal(bool value);
131128
void motorPositionChanged(double position);
132-
void DIGIORegisterChanged(uint16_t *registerValue);
133-
void FaultRegisterChanged(uint16_t *registerValue);
134-
void DIAG1RegisterChanged(uint16_t *registerValue);
135-
void DIAG2RegisterChanged(uint16_t *registerValue);
129+
void DIGIORegisterChanged(quint16 registerValue);
130+
void FaultRegisterChanged(quint16 registerValue);
131+
void DIAG1RegisterChanged(quint16 registerValue);
132+
void DIAG2RegisterChanged(quint16 registerValue);
136133

137134
private:
138135
ADMTController *m_admtController;
@@ -181,7 +178,9 @@ public Q_SLOTS:
181178

182179
QPlainTextEdit *logsPlainTextEdit, *commandLogPlainTextEdit;
183180

184-
QCheckBox *acquisitionFaultRegisterLEDWidget, *calibrationFaultRegisterLEDWidget, *DIGIOBusyStatusLED,
181+
QCheckBox *angleCheckBox, *absAngleCheckBox, *temp0CheckBox, *sineCheckBox, *cosineCheckBox, *radiusCheckBox,
182+
*angleSecCheckBox, *secAnglQCheckBox, *secAnglICheckBox, *temp1CheckBox,
183+
*acquisitionFaultRegisterLEDWidget, *calibrationFaultRegisterLEDWidget, *DIGIOBusyStatusLED,
185184
*DIGIOCNVStatusLED, *DIGIOSENTStatusLED, *DIGIOACALCStatusLED, *DIGIOFaultStatusLED,
186185
*DIGIOBootloaderStatusLED, *R0StatusLED, *R1StatusLED, *R2StatusLED, *R3StatusLED, *R4StatusLED,
187186
*R5StatusLED, *R6StatusLED, *R7StatusLED, *VDDUnderVoltageStatusLED, *VDDOverVoltageStatusLED,
@@ -192,18 +191,25 @@ public Q_SLOTS:
192191

193192
QScrollArea *MTDiagnosticsScrollArea;
194193

194+
QWidget *acquisitionGraphChannelWidget;
195+
196+
QGridLayout *acquisitionGraphChannelGridLayout;
197+
195198
PlotWidget *acquisitionGraphPlotWidget, *angleErrorPlotWidget, *calibrationRawDataPlotWidget,
196-
*FFTAngleErrorPlotWidget, *correctedErrorPlotWidget, *postCalibrationRawDataPlotWidget,
197-
*FFTCorrectedErrorPlotWidget;
199+
*FFTAngleErrorMagnitudePlotWidget, *FFTAngleErrorPhasePlotWidget, *correctedErrorPlotWidget,
200+
*postCalibrationRawDataPlotWidget, *FFTCorrectedErrorMagnitudePlotWidget,
201+
*FFTCorrectedErrorPhasePlotWidget;
198202
PlotAxis *acquisitionXPlotAxis, *acquisitionYPlotAxis, *calibrationRawDataXPlotAxis,
199-
*calibrationRawDataYPlotAxis, *angleErrorXPlotAxis, *angleErrorYPlotAxis, *FFTAngleErrorXPlotAxis,
200-
*FFTAngleErrorYPlotAxis, *correctedErrorXPlotAxis, *correctedErrorYPlotAxis,
201-
*FFTCorrectedErrorXPlotAxis, *FFTCorrectedErrorYPlotAxis, *postCalibrationRawDataXPlotAxis,
203+
*calibrationRawDataYPlotAxis, *angleErrorXPlotAxis, *angleErrorYPlotAxis,
204+
*FFTAngleErrorMagnitudeXPlotAxis, *FFTAngleErrorMagnitudeYPlotAxis, *FFTAngleErrorPhaseXPlotAxis,
205+
*FFTAngleErrorPhaseYPlotAxis, *correctedErrorXPlotAxis, *correctedErrorYPlotAxis,
206+
*FFTCorrectedErrorMagnitudeXPlotAxis, *FFTCorrectedErrorMagnitudeYPlotAxis,
207+
*FFTCorrectedErrorPhaseXPlotAxis, *FFTCorrectedErrorPhaseYPlotAxis, *postCalibrationRawDataXPlotAxis,
202208
*postCalibrationRawDataYPlotAxis;
203-
PlotChannel *acquisitionAnglePlotChannel, *acquisitionABSAnglePlotChannel, *acquisitionTurnCountPlotChannel,
204-
*acquisitionTmp0PlotChannel, *acquisitionTmp1PlotChannel, *acquisitionSinePlotChannel,
205-
*acquisitionCosinePlotChannel, *acquisitionRadiusPlotChannel, *acquisitionSecAnglQPlotChannel,
206-
*acquisitionSecAnglIPlotChannel, *angleErrorPlotChannel, *preCalibrationFFTPhasePlotChannel,
209+
PlotChannel *acquisitionAnglePlotChannel, *acquisitionABSAnglePlotChannel, *acquisitionTmp0PlotChannel,
210+
*acquisitionTmp1PlotChannel, *acquisitionSinePlotChannel, *acquisitionCosinePlotChannel,
211+
*acquisitionRadiusPlotChannel, *acquisitionSecAnglQPlotChannel, *acquisitionSecAnglIPlotChannel,
212+
*acquisitionAngleSecPlotChannel, *angleErrorPlotChannel, *preCalibrationFFTPhasePlotChannel,
207213
*calibrationRawDataPlotChannel, *calibrationSineDataPlotChannel, *calibrationCosineDataPlotChannel,
208214
*FFTAngleErrorMagnitudeChannel, *FFTAngleErrorPhaseChannel, *correctedErrorPlotChannel,
209215
*postCalibrationRawDataPlotChannel, *postCalibrationSineDataPlotChannel,
@@ -266,7 +272,7 @@ public Q_SLOTS:
266272
void updateAcquisitionMotorRPM();
267273
void updateAcquisitionMotorRotationDirection();
268274
void getAcquisitionSamples(int sampleRate);
269-
double getAcquisitionParameterValue(const AcquisitionDataKey &key);
275+
double getSensorDataAcquisitionValue(const ADMTController::SensorRegister &key);
270276
void plotAcquisition(QVector<double> &list, PlotChannel *channel);
271277
void prependAcquisitionData(const double &data, QVector<double> &list);
272278
void resetAcquisitionYAxisScale();
@@ -275,9 +281,10 @@ public Q_SLOTS:
275281
void startAcquisitionUITask();
276282
void stopAcquisitionUITask();
277283
void updateSequenceWidget();
284+
void updateCapturedDataCheckBoxes();
278285
void applySequenceAndUpdate();
279286
void updateGeneralSettingEnabled(bool value);
280-
void connectCheckBoxToAcquisitionGraph(QCheckBox *widget, PlotChannel *channel, AcquisitionDataKey key);
287+
void connectCheckBoxToAcquisitionGraph(QCheckBox *widget, PlotChannel *channel, SensorDataKey key);
281288
void GMRReset();
282289
#pragma endregion
283290

@@ -326,7 +333,7 @@ public Q_SLOTS:
326333
void clearCalibrationSineCosine();
327334
void clearPostCalibrationSamples();
328335
void clearAngleErrorGraphs();
329-
void clearCorrectedAngleErrorGraphs();
336+
void clearFFTAngleErrorGraphs();
330337
#pragma endregion
331338

332339
#pragma region Motor Methods
@@ -376,7 +383,6 @@ public Q_SLOTS:
376383
void changeCustomSwitchLabel(CustomSwitch *customSwitch, QString onLabel, QString offLabel);
377384
QCheckBox *createStatusLEDWidget(const QString &text, QVariant variant = true, bool checked = false,
378385
QWidget *parent = nullptr);
379-
MenuControlButton *createChannelToggleWidget(const QString title, QColor color, QWidget *parent = nullptr);
380386
#pragma endregion
381387

382388
#pragma region Connect Methods

0 commit comments

Comments
 (0)