Skip to content

Commit

Permalink
#42
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Oct 30, 2020
1 parent 7c9630a commit 5f7a0b9
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/eez/modules/dib-mio168/dib-mio168.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2139,7 +2139,14 @@ void data_dib_mio168_ain_channels(DataOperationEnum operation, Cursor cursor, Va
void data_dib_mio168_ain_label(DataOperationEnum operation, Cursor cursor, Value &value) {
if (operation == DATA_OPERATION_GET) {
static const char *labels[4] = { "AIN1", "AIN2", "AIN3", "AIN4" };
value = labels[cursor % 4];
int ainChannelIndex;
AinConfigurationPage *page = (AinConfigurationPage *)getPage(PAGE_ID_DIB_MIO168_AIN_CONFIGURATION);
if (page) {
ainChannelIndex = page->g_selectedChannelIndex - AIN_1_SUBCHANNEL_INDEX;
} else {
ainChannelIndex = cursor % 4;
}
value = labels[ainChannelIndex];
}
}

Expand Down Expand Up @@ -2253,7 +2260,12 @@ void data_dib_mio168_aout_label(DataOperationEnum operation, Cursor cursor, Valu
if (page) {
aoutChannelIndex = AoutDac7760ConfigurationPage::g_selectedChannelIndex - AOUT_1_SUBCHANNEL_INDEX;
} else {
aoutChannelIndex = cursor % 4;
AoutDac7563ConfigurationPage *page = (AoutDac7563ConfigurationPage *)getPage(PAGE_ID_DIB_MIO168_AOUT_DAC7563_CONFIGURATION);
if (page) {
aoutChannelIndex = AoutDac7563ConfigurationPage::g_selectedChannelIndex - AOUT_1_SUBCHANNEL_INDEX;
} else {
aoutChannelIndex = cursor % 4;
}
}

value = aoutLabels[aoutChannelIndex];
Expand Down

0 comments on commit 5f7a0b9

Please sign in to comment.