Skip to content

Commit

Permalink
step values refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Apr 1, 2020
1 parent 0a2d034 commit b2f668c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/eez/gui/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ struct Value {
return puint8_;
}

const StepValues *getStepValues() const {
StepValues *getStepValues() const {
return (StepValues *)pVoid_;
}

Expand Down
14 changes: 7 additions & 7 deletions src/eez/modules/psu/gui/data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2393,6 +2393,13 @@ void data_channel_protection_ovp_level(DataOperationEnum operation, Cursor curso
}
}

void getProtectionDelayStepValues(StepValues *stepValues) {
static float values[] = { 20.0f, 10.0f, 5.0f, 1.0f };
stepValues->values = values;
stepValues->count = sizeof(values) / sizeof(float);
stepValues->unit = UNIT_SECOND;
}

void data_channel_protection_ovp_delay(DataOperationEnum operation, Cursor cursor, Value &value) {
int iChannel = cursor >= 0 ? cursor : (g_channel ? g_channel->channelIndex : 0);
Channel &channel = Channel::get(iChannel);
Expand Down Expand Up @@ -2582,13 +2589,6 @@ void data_channel_protection_opp_level(DataOperationEnum operation, Cursor curso
}
}

void getProtectionDelayStepValues(StepValues *stepValues) {
static float values[] = { 20.0f, 10.0f, 5.0f, 1.0f };
stepValues->values = values;
stepValues->count = sizeof(values) / sizeof(float);
stepValues->unit = UNIT_SECOND;
}

void data_channel_protection_opp_delay(DataOperationEnum operation, Cursor cursor, Value &value) {
int iChannel = cursor >= 0 ? cursor : (g_channel ? g_channel->channelIndex : 0);
Channel &channel = Channel::get(iChannel);
Expand Down

0 comments on commit b2f668c

Please sign in to comment.