Skip to content

Commit 708fc66

Browse files
committed
nplc
1 parent c2db005 commit 708fc66

30 files changed

+29024
-27102
lines changed

modular-psu-firmware.eez-project

Lines changed: 410 additions & 102 deletions
Large diffs are not rendered by default.

src/eez/action_impl.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,6 +1312,11 @@ void action_module_resync() {
13121312
sendMessageToPsu(PSU_MESSAGE_MODULE_RESYNC, hmi::g_selectedSlotIndex);
13131313
}
13141314

1315+
void action_select_ac_mains() {
1316+
SysSettingsDateTimePage *page = (SysSettingsDateTimePage *)getPage(PAGE_ID_SYS_SETTINGS_DATE_TIME);
1317+
page->powerLineFrequency = page->powerLineFrequency == 50 ? 60 : 50;
1318+
}
1319+
13151320
} // namespace gui
13161321
} // namespace eez
13171322

src/eez/gui/document_simulator.cpp

Lines changed: 4933 additions & 4886 deletions
Large diffs are not rendered by default.

src/eez/gui/document_simulator.h

Lines changed: 360 additions & 330 deletions
Large diffs are not rendered by default.

src/eez/gui/document_stm32.cpp

Lines changed: 20966 additions & 20922 deletions
Large diffs are not rendered by default.

src/eez/gui/document_stm32.h

Lines changed: 330 additions & 300 deletions
Large diffs are not rendered by default.

src/eez/gui/widgets/select.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ EnumFunctionType SELECT_enum = [](WidgetCursor &widgetCursor, EnumWidgetsCallbac
6262

6363
const ContainerWidget *containerWidget = GET_WIDGET_PROPERTY(widgetCursor.widget, specific, const ContainerWidget *);
6464

65-
widgetCursor.widget = GET_WIDGET_LIST_ELEMENT(containerWidget->widgets, + indexValue.getInt());
65+
widgetCursor.widget = GET_WIDGET_LIST_ELEMENT(containerWidget->widgets, indexValue.getInt());
6666

6767
enumWidget(widgetCursor, callback);
6868

src/eez/index.cpp

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -452,29 +452,29 @@ bool Module::setMeasureVoltageRange(int subchannelIndex, uint8_t range, int *err
452452
return false;
453453
}
454454

455-
bool Module::getMeasureCurrentNumPowerLineCycles(int subchannelIndex, uint8_t &numPowerLineCycles, int *err) {
455+
bool Module::getMeasureCurrentNPLC(int subchannelIndex, float &nplc, int *err) {
456456
if (err) {
457457
*err = SCPI_ERROR_HARDWARE_MISSING;
458458
}
459459
return false;
460460
}
461461

462-
bool Module::setMeasureCurrentNumPowerLineCycles(int subchannelIndex, uint8_t numPowerLineCycles, int *err) {
462+
bool Module::setMeasureCurrentNPLC(int subchannelIndex, float nplc, int *err) {
463463
if (err) {
464464
*err = SCPI_ERROR_HARDWARE_MISSING;
465465
}
466466
return false;
467467
}
468468

469-
bool Module::getMeasureVoltageNumPowerLineCycles(int subchannelIndex, uint8_t &numPowerLineCycles, int *err) {
469+
bool Module::getMeasureVoltageNPLC(int subchannelIndex, float &nplc, int *err) {
470470
if (err) {
471471
*err = SCPI_ERROR_HARDWARE_MISSING;
472472
}
473473
return false;
474474
}
475475

476-
bool Module::setMeasureVoltageNumPowerLineCycles(int subchannelIndex, uint8_t numPowerLineCycles, int *err) {
477-
if (err) {
476+
bool Module::setMeasureVoltageNPLC(int subchannelIndex, float nplc, int *err) {
477+
if (err) {
478478
*err = SCPI_ERROR_HARDWARE_MISSING;
479479
}
480480
return false;
@@ -687,9 +687,24 @@ bool Module::saveChannelCalibration(int subchannelIndex, int *err) {
687687
return false;
688688
}
689689

690+
void Module::initChannelCalibration(int subchannelIndex) {
691+
}
692+
690693
void Module::startChannelCalibration(int subchannelIndex) {
691694
}
692695

696+
bool Module::calibrationReadAdcValue(int subchannelIndex, float &adcValue, int *err) {
697+
adcValue = 0.0f;
698+
return true;
699+
}
700+
701+
bool Module::calibrationMeasure(int subchannelIndex, float &measuredValue, int *err) {
702+
if (err) {
703+
*err = SCPI_ERROR_BAD_SEQUENCE_OF_CALIBRATION_COMMANDS;
704+
}
705+
return false;
706+
}
707+
693708
void Module::stopChannelCalibration(int subchannelIndex) {
694709
}
695710

@@ -701,6 +716,14 @@ CalibrationValueType Module::getCalibrationValueType(int subchannelIndex) {
701716
return CALIBRATION_VALUE_U;
702717
}
703718

719+
const char *Module::getCalibrationValueRangeDescription(int subchannelIndex) {
720+
return nullptr;
721+
}
722+
723+
bool Module::isCalibrationValueSource(int subchannelIndex) {
724+
return true;
725+
}
726+
704727
void Module::getDefaultCalibrationPoints(int subchannelIndex, CalibrationValueType type, unsigned int &numPoints, float *&points) {
705728
numPoints = 0;
706729
points = nullptr;

src/eez/index.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,11 @@ struct Module {
308308
virtual bool getMeasureVoltageRange(int subchannelIndex, uint8_t &range, int *err);
309309
virtual bool setMeasureVoltageRange(int subchannelIndex, uint8_t range, int *err);
310310

311-
virtual bool getMeasureCurrentNumPowerLineCycles(int subchannelIndex, uint8_t &numPowerLineCycles, int *err);
312-
virtual bool setMeasureCurrentNumPowerLineCycles(int subchannelIndex, uint8_t numPowerLineCycles, int *err);
311+
virtual bool getMeasureCurrentNPLC(int subchannelIndex, float &nplc, int *err);
312+
virtual bool setMeasureCurrentNPLC(int subchannelIndex, float nplc, int *err);
313313

314-
virtual bool getMeasureVoltageNumPowerLineCycles(int subchannelIndex, uint8_t &numPowerLineCycles, int *err);
315-
virtual bool setMeasureVoltageNumPowerLineCycles(int subchannelIndex, uint8_t numPowerLineCycles, int *err);
314+
virtual bool getMeasureVoltageNPLC(int subchannelIndex, float &nplc, int *err);
315+
virtual bool setMeasureVoltageNPLC(int subchannelIndex, float nplc, int *err);
316316

317317
virtual bool isRouteOpen(int subchannelIndex, bool &isRouteOpen, int *err);
318318
virtual bool routeOpen(ChannelList channelList, int *err);
@@ -356,10 +356,15 @@ struct Module {
356356

357357
virtual bool loadChannelCalibration(int subchannelIndex, int *err);
358358
virtual bool saveChannelCalibration(int subchannelIndex, int *err);
359+
virtual void initChannelCalibration(int subchannelIndex);
359360
virtual void startChannelCalibration(int subchannelIndex);
361+
virtual bool calibrationReadAdcValue(int subchannelIndex, float &adcValue, int *err);
362+
virtual bool calibrationMeasure(int subchannelIndex, float &measuredValue, int *err);
360363
virtual void stopChannelCalibration(int subchannelIndex);
361364
virtual unsigned int getMaxCalibrationPoints(int m_subchannelIndex);
362365
virtual CalibrationValueType getCalibrationValueType(int subchannelIndex);
366+
virtual const char *getCalibrationValueRangeDescription(int subchannelIndex);
367+
virtual bool isCalibrationValueSource(int subchannelIndex);
363368
virtual void getDefaultCalibrationPoints(int subchannelIndex, CalibrationValueType type, unsigned int &numPoints, float *&points);
364369
virtual bool getCalibrationConfiguration(int subchannelIndex, CalibrationConfiguration &calConf, int *err);
365370
virtual bool setCalibrationConfiguration(int subchannelIndex, const CalibrationConfiguration &calConf, int *err);

src/eez/modules/bp3c/flash_slave.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,9 @@ void leaveBootloaderMode() {
369369
osDelay(5);
370370
io_exp::hardResetModules();
371371

372+
// give some time to the modules to initialize
373+
osDelay(100);
374+
372375
psu::initChannels();
373376
psu::testChannels();
374377
#endif

0 commit comments

Comments
 (0)