1 #ifndef CALIBRATIONWINDOW_H
2 #define CALIBRATIONWINDOW_H
10 #include <QTableWidgetItem>
11 #include <QProgressBar>
16 #define MARCO_ACCAME_19SEP2018
48 bool calibration_load_v3 (
char* filename,
int selected_bus,
int selected_id,
int index,
int regset);
56 #if defined(MARCO_ACCAME_19SEP2018)
60 static void logger(
void *caller,
const std::string &msg);
65 static const uint16_t defaultStrain2AmplOffsets[6];
66 static const uint16_t defaultStrain1DACoffsets[6];
68 const int currentMatrixIndex = 0;
69 Ui::CalibrationWindow *ui;
72 icubCanProto_boardType_t boardtype;
73 bool offsetSliderPressed[6];
80 bool refresh_serialnumber;
81 unsigned int offset[6];
82 unsigned int amp_gain1[6];
83 unsigned int amp_gain2[6];
87 uint16_t amp_offsets[6];
90 unsigned int matrix[3][6][6];
91 unsigned int calib_matrix[3][6][6];
92 unsigned int full_scale_calib[3][6];
93 unsigned int calibration_value;
94 unsigned int calib_const[3];
95 unsigned int full_scale_const[3][6];
98 bool fullScaleChanged;
99 bool matrix_changed[3];
100 bool serial_number_changed;
101 bool something_changed;
102 bool eeprom_saved_status;
104 QList<CustomSpinBox*>slider_offset;
105 QList<QLineEdit*>matrixGain;
106 QList<QTableWidget*>matrices;
107 QList<QTableWidget*>fullScales;
113 QProgressBar *progress;
115 volatile bool clearStats;
117 void onTargetValueChanged(
int);
118 void onTabMatrixCahnged(
int);
120 void onMatrixChanged(QTableWidgetItem*);
121 void onSerialChanged(QString);
122 void onLoading(
bool);
123 void onSetText(QLineEdit*,QString text);
124 void onSetText(QTableWidgetItem*,QString text);
125 void onOffsetSpinnerValue(
CustomSpinBox *spinner,
int value);
126 void onSetCalibBias(
bool click);
127 void onResetCalibBias(
bool click);
128 void onSetCurrBias(
bool click);
129 void onResetCurrBias(
bool click);
130 void onSetSerial(
bool click);
131 void onSetSerialChanged(
bool);
132 void onResetCalibMatrix(
bool);
134 void onSetMatrix(
int index);
135 void onSetFullScale();
136 void onSaveToEeprom(
bool click);
137 void onClear_Statistics(
bool click);
138 void onClear_FullRegulation(
bool click);
139 void onClear_Regulation(
bool click);
140 void onSetCalibration(
bool click);
141 void onLoadCalibrationFile(
bool click);
142 void onSaveCalibrationFile(
bool click);
143 void onImportCalibrationFile(
bool click);
144 void resetMatricesState(
int index = -1);
145 void onUpdateTitle();
146 void onOffsetSliderPressed();
147 void onOffsetSliderReleased();
149 void onAppendLogMsg(QString);
150 void onOffsetEditingFinished();
151 void onParametersApply(
bool);
152 void onParametersClear(
bool);
153 void onCheckAutoTune(
bool);
155 void onDigitalRegulation(
bool);
156 void onChangeRegSet(
int regSet);
157 void onChangeRegSetBoot(
int regset);
158 void onSetTableVisible(QTableWidget*,
bool);
bool SetDefaultRegulationSet(int regset, bool alsoserialnumber=false)
void setMatrix(int index)
void appendLogMsg(QString)
void Clear_AllRegulations()
void setTableVisible(QTableWidget *, bool)
void resetMatrices(int index=-1)
bool calibration_load_v3(char *filename, int selected_bus, int selected_id, int index, int regset)
void setOffsetSliderValue(CustomSpinBox *, int value)
void setOffset(int chan, int value)
void closeEvent(QCloseEvent *e)
void importCalibrationFile(QString fileName)
void setText(QLineEdit *, QString text)
CalibrationWindow(FirmwareUpdaterCore *core, icubCanProto_boardType_t b, CustomTreeWidgetItem *item, QWidget *parent=0)
void setText(QTableWidgetItem *, QString text)
void setSerialChanged(bool)
void importCalibrationFileHEX(QString fileName)
void loadCalibrationFile(QString fileName)
void useMatrix(int, bool boot)
static void logger(void *caller, const std::string &msg)
void saveCalibrationFile(QString filePath)
strain2_ampl_discretegain_t