Skip to content

Commit

Permalink
fixed DCP set values display during inhibit
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Feb 10, 2021
1 parent 29ccaa9 commit a5dfcf6
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/eez/modules/psu/gui/data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1718,18 +1718,16 @@ void data_slot_micro_view(DataOperationEnum operation, Cursor cursor, Value &val
void data_channel_display_value1(DataOperationEnum operation, Cursor cursor, Value &value) {
int iChannel = cursor >= 0 ? cursor : (g_channel ? g_channel->channelIndex : 0);
Channel &channel = Channel::get(iChannel);
if (operation == DATA_OPERATION_GET) {
if (operation == DATA_OPERATION_GET) {
if (channel.displayValues[0].type == DISPLAY_VALUE_VOLTAGE) {
data_channel_u_mon(operation, cursor, value);
} else if (channel.displayValues[0].type == DISPLAY_VALUE_CURRENT) {
data_channel_i_mon(operation, cursor, value);
} else if (channel.displayValues[0].type == DISPLAY_VALUE_POWER) {
data_channel_p_mon(operation, cursor, value);
}
}
} else if (operation == DATA_OPERATION_GET_DISPLAY_VALUE_RANGE) {
if (operation == DATA_OPERATION_GET_DISPLAY_VALUE_RANGE) {
value = Value(channel.displayValues[0].getRange(&channel), channel.displayValues[0].getUnit());
} else {
if (channel.displayValues[0].type == DISPLAY_VALUE_VOLTAGE) {
data_channel_u_mon(operation, cursor, value);
} else if (channel.displayValues[0].type == DISPLAY_VALUE_CURRENT) {
data_channel_i_mon(operation, cursor, value);
} else if (channel.displayValues[0].type == DISPLAY_VALUE_POWER) {
data_channel_p_mon(operation, cursor, value);
}
}
}

Expand Down Expand Up @@ -1768,16 +1766,16 @@ void data_channel_display_value1_limit(DataOperationEnum operation, Cursor curso
void data_channel_display_value2(DataOperationEnum operation, Cursor cursor, Value &value) {
int iChannel = cursor >= 0 ? cursor : (g_channel ? g_channel->channelIndex : 0);
Channel &channel = Channel::get(iChannel);
if (operation == DATA_OPERATION_GET) {
if (operation == DATA_OPERATION_GET_DISPLAY_VALUE_RANGE) {
value = Value(channel.displayValues[1].getRange(&channel), channel.displayValues[1].getUnit());
} else {
if (channel.displayValues[1].type == DISPLAY_VALUE_VOLTAGE) {
data_channel_u_mon(operation, cursor, value);
} else if (channel.displayValues[1].type == DISPLAY_VALUE_CURRENT) {
data_channel_i_mon(operation, cursor, value);
} else if (channel.displayValues[1].type == DISPLAY_VALUE_POWER) {
data_channel_p_mon(operation, cursor, value);
}
} else if (operation == DATA_OPERATION_GET_DISPLAY_VALUE_RANGE) {
value = Value(channel.displayValues[1].getRange(&channel), channel.displayValues[1].getUnit());
}
}

Expand Down

0 comments on commit a5dfcf6

Please sign in to comment.