Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Nov 1, 2020
1 parent f5cdc69 commit 19f1e59
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/eez/modules/psu/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -844,15 +844,15 @@ void Channel::addIMonAdcValue(float value) {
value = remapAdcValue(value, cal_conf.i[flags.currentCurrentRange]);
}

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

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

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

void Channel::onAdcData(AdcDataType adcDataType, float value) {
Expand Down
2 changes: 1 addition & 1 deletion src/eez/modules/psu/channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ struct Channel {
void setCurrentRange(uint8_t currentRange);

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

bool isMicroAmperAllowed() const;
Expand Down
2 changes: 1 addition & 1 deletion src/eez/modules/psu/channel_dispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2313,7 +2313,7 @@ void getCurrentStepValues(int slotIndex, int subchannelIndex, StepValues *stepVa
float getCurrentResolution(int slotIndex, int subchannelIndex) {
Channel *channel = Channel::getBySlotIndex(slotIndex, subchannelIndex);
if (channel) {
return channel->getCurrentResolution();
return channel->getCurrentResolution(NAN);
} else {
return g_slots[slotIndex]->getCurrentResolution(subchannelIndex);
}
Expand Down
4 changes: 4 additions & 0 deletions src/eez/modules/psu/gui/psu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,8 @@ void NumberInputParams::onCancel() {
float PsuAppContext::numberInput(const char *label, Unit unit, float min, float max, float value) {
m_inputLabel = label[0] ? label : nullptr;

m_numberInputParams.m_options = NumericKeypadOptions();

m_numberInputParams.m_options.editValueUnit = unit;
m_numberInputParams.m_options.min = min;
m_numberInputParams.m_options.enableMinButton();
Expand Down Expand Up @@ -860,6 +862,8 @@ void IntegerInputParams::onCancel() {
bool PsuAppContext::integerInput(const char *label, int32_t min, int32_t max, int32_t &value) {
m_inputLabel = label[0] ? label : nullptr;

m_numberInputParams.m_options = NumericKeypadOptions();

m_integerInputParams.m_options.editValueUnit = UNIT_UNKNOWN;
m_integerInputParams.m_options.min = (float)min;
m_integerInputParams.m_options.enableMinButton();
Expand Down

0 comments on commit 19f1e59

Please sign in to comment.