@@ -1515,52 +1515,37 @@ void data_no_channel_index(int slotIndex, DataOperationEnum operation, Cursor cu
15151515 }
15161516}
15171517
1518- void data_slot_channel_index (int slotIndex, DataOperationEnum operation, Cursor cursor, Value &value) {
1518+ void data_slot_channel_index (int slotIndex, Channel *channel, DataOperationEnum operation, Cursor cursor, Value &value) {
15191519 auto testResult = g_slots[slotIndex]->getTestResult ();
1520- if (g_slots[slotIndex]-> moduleInfo -> moduleCategory == MODULE_CATEGORY_DCPSUPPLY && (testResult == TEST_OK || testResult == TEST_SKIPPED)) {
1521- data_channel_index (*Channel::getBySlotIndex (slotIndex) , operation, cursor, value);
1520+ if (channel && (testResult == TEST_OK || testResult == TEST_SKIPPED)) {
1521+ data_channel_index (*channel , operation, cursor, value);
15221522 } else {
15231523 data_no_channel_index (slotIndex, operation, cursor, value);
15241524 }
15251525}
15261526
15271527void data_slot1_channel_index (DataOperationEnum operation, Cursor cursor, Value &value) {
1528- data_slot_channel_index (g_slotIndexes[0 ], operation, cursor, value);
1528+ data_slot_channel_index (g_slotIndexes[0 ], Channel::getBySlotIndex (g_slotIndexes[ 0 ]), operation, cursor, value);
15291529}
15301530
15311531void data_slot2_channel_index (DataOperationEnum operation, Cursor cursor, Value &value) {
1532- data_slot_channel_index (g_slotIndexes[1 ], operation, cursor, value);
1532+ data_slot_channel_index (g_slotIndexes[1 ], Channel::getBySlotIndex (g_slotIndexes[ 1 ]), operation, cursor, value);
15331533}
15341534
15351535void data_slot3_channel_index (DataOperationEnum operation, Cursor cursor, Value &value) {
1536- data_slot_channel_index (g_slotIndexes[2 ], operation, cursor, value);
1536+ data_slot_channel_index (g_slotIndexes[2 ], Channel::getBySlotIndex (g_slotIndexes[ 2 ]), operation, cursor, value);
15371537}
15381538
15391539void data_slot_max_channel_index (DataOperationEnum operation, Cursor cursor, Value &value) {
1540- auto testResult = g_slots[persist_conf::getMaxSlotIndex ()]->getTestResult ();
1541- if (g_slots[persist_conf::getMaxSlotIndex ()]->moduleInfo ->moduleCategory == MODULE_CATEGORY_DCPSUPPLY && (testResult == TEST_OK || testResult == TEST_SKIPPED)) {
1542- data_channel_index (Channel::get (persist_conf::getMaxChannelIndex ()), operation, cursor, value);
1543- } else {
1544- data_no_channel_index (persist_conf::getMaxSlotIndex (), operation, cursor, value);
1545- }
1540+ data_slot_channel_index (persist_conf::getMaxSlotIndex (), &Channel::get (persist_conf::getMaxChannelIndex ()), operation, cursor, value);
15461541}
15471542
15481543void data_slot_min1_channel_index (DataOperationEnum operation, Cursor cursor, Value &value) {
1549- auto testResult = g_slots[persist_conf::getMin1SlotIndex ()]->getTestResult ();
1550- if (g_slots[persist_conf::getMin1SlotIndex ()]->moduleInfo ->moduleCategory == MODULE_CATEGORY_DCPSUPPLY && (testResult == TEST_OK || testResult == TEST_SKIPPED)) {
1551- data_channel_index (Channel::get (persist_conf::getMin1ChannelIndex ()), operation, cursor, value);
1552- } else {
1553- data_no_channel_index (persist_conf::getMin1SlotIndex (), operation, cursor, value);
1554- }
1544+ data_slot_channel_index (persist_conf::getMin1SlotIndex (), &Channel::get (persist_conf::getMin1ChannelIndex ()), operation, cursor, value);
15551545}
15561546
15571547void data_slot_min2_channel_index (DataOperationEnum operation, Cursor cursor, Value &value) {
1558- auto testResult = g_slots[persist_conf::getMin2SlotIndex ()]->getTestResult ();
1559- if (g_slots[persist_conf::getMin2SlotIndex ()]->moduleInfo ->moduleCategory == MODULE_CATEGORY_DCPSUPPLY && (testResult == TEST_OK || testResult == TEST_SKIPPED)) {
1560- data_channel_index (Channel::get (persist_conf::getMin2ChannelIndex ()), operation, cursor, value);
1561- } else {
1562- data_no_channel_index (persist_conf::getMin2SlotIndex (), operation, cursor, value);
1563- }
1548+ data_slot_channel_index (persist_conf::getMin2SlotIndex (), &Channel::get (persist_conf::getMin2ChannelIndex ()), operation, cursor, value);
15641549}
15651550
15661551void data_slot_default_view (int slotIndex, DataOperationEnum operation, Cursor cursor, Value &value) {
0 commit comments