Skip to content

Commit

Permalink
#84
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Oct 21, 2020
1 parent d75903c commit 799786b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/eez/modules/psu/channel_dispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,28 +140,31 @@ bool setCouplingType(CouplingType couplingType, int *err) {
}

bool additionalCheckForCouplingType(CouplingType couplingType, int *err) {
if (!Channel::get(0).isCalibrationExists()) {
Channel &ch1 = Channel::get(0);
Channel &ch2 = Channel::get(1);

if (!ch1.isVoltageCalibrationExists() || !ch1.isCurrentCalibrationExists(0) || !ch1.isCurrentCalibrationExists(1)) {
if (err) {
*err = SCPI_ERROR_CH1_NOT_CALIBRATED;
}
return false;
}

if (!Channel::get(1).isCalibrationExists()) {
if (!ch2.isVoltageCalibrationExists() || !ch2.isCurrentCalibrationExists() || !ch1.isCurrentCalibrationExists(1)) {
if (err) {
*err = SCPI_ERROR_CH2_NOT_CALIBRATED;
}
return false;
}

if (!Channel::get(0).isCalibrationEnabled()) {
if (!ch1.isCalibrationEnabled()) {
if (err) {
*err = SCPI_ERROR_CH1_CALIBRATION_NOT_ENABLED;
}
return false;
}

if (!Channel::get(1).isCalibrationEnabled()) {
if (!ch2.isCalibrationEnabled()) {
if (err) {
*err = SCPI_ERROR_CH2_CALIBRATION_NOT_ENABLED;
}
Expand Down

0 comments on commit 799786b

Please sign in to comment.