Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Nov 9, 2020
1 parent 4acf6d0 commit 6ffe321
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/eez/modules/psu/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,14 @@ float Channel::getCurrentResolution(float value) const {
return precision;
}

float Channel::getCurrentResolution() const {
if (flags.currentCurrentRange == CURRENT_RANGE_LOW) {
return calibration::g_editor.isEnabled() ? params.I_LOW_RESOLUTION_DURING_CALIBRATION : params.I_LOW_RESOLUTION; // 5uA
}

return calibration::g_editor.isEnabled() ? params.I_RESOLUTION_DURING_CALIBRATION : params.I_RESOLUTION; // 0.5mA
}

float Channel::getPowerResolution() const {
return params.P_RESOLUTION; // 1 mW;
}
Expand Down Expand Up @@ -854,15 +862,15 @@ void Channel::addIMonAdcValue(float value) {
value = 0;
}

i.addMonValue(value, getCurrentResolution(value));
i.addMonValue(value, getCurrentResolution());
}

void Channel::addUMonDacAdcValue(float value) {
u.addMonDacValue(value, getVoltageResolution());
}

void Channel::addIMonDacAdcValue(float value) {
i.addMonDacValue(value, getCurrentResolution(value));
i.addMonDacValue(value, getCurrentResolution());
}

void Channel::onAdcData(AdcDataType adcDataType, float value) {
Expand Down
1 change: 1 addition & 0 deletions src/eez/modules/psu/channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ struct Channel {

float getVoltageResolution() const;
float getCurrentResolution(float value) const;
float getCurrentResolution() const;
float getPowerResolution() const;

bool isMicroAmperAllowed() const;
Expand Down

0 comments on commit 6ffe321

Please sign in to comment.