Skip to content

Commit 5428967

Browse files
committed
removed module category
1 parent 1612912 commit 5428967

File tree

7 files changed

+16
-37
lines changed

7 files changed

+16
-37
lines changed

src/eez/index.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ namespace eez {
3737
bool g_isCol2Mode = false;
3838
int g_slotIndexes[3] = { 0, 1, 2 };
3939

40-
ModuleInfo::ModuleInfo(uint16_t moduleType_, uint16_t moduleCategory_, const char *moduleName_, const char *moduleBrand_, uint16_t latestModuleRevision_, FlashMethod flashMethod_, uint32_t flashDuration_, uint32_t spiBaudRatePrescaler_, bool spiCrcCalculationEnable_, uint8_t numChannels_)
40+
ModuleInfo::ModuleInfo(uint16_t moduleType_, const char *moduleName_, const char *moduleBrand_, uint16_t latestModuleRevision_, FlashMethod flashMethod_, uint32_t flashDuration_, uint32_t spiBaudRatePrescaler_, bool spiCrcCalculationEnable_, uint8_t numChannels_)
4141
: moduleType(moduleType_)
42-
, moduleCategory(moduleCategory_)
4342
, moduleName(moduleName_)
4443
, moduleBrand(moduleBrand_)
4544
, latestModuleRevision(latestModuleRevision_)
@@ -133,7 +132,7 @@ void Module::onSpiDmaTransferCompleted(int status) {
133132
struct NoneModuleInfo : public ModuleInfo {
134133
public:
135134
NoneModuleInfo()
136-
: ModuleInfo(MODULE_TYPE_NONE, MODULE_CATEGORY_NONE, "None", "None", 0, FLASH_METHOD_NONE, 0, 0, false, 0)
135+
: ModuleInfo(MODULE_TYPE_NONE, "None", "None", 0, FLASH_METHOD_NONE, 0, 0, false, 0)
137136
{
138137
}
139138

src/eez/index.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ static const uint16_t MODULE_TYPE_DIB_MIO168 = 168;
3232
static const uint16_t MODULE_TYPE_DIB_PREL6 = 6;
3333
static const uint16_t MODULE_TYPE_DIB_SMX46 = 46;
3434

35-
static const uint16_t MODULE_CATEGORY_NONE = 0;
36-
static const uint16_t MODULE_CATEGORY_DCPSUPPLY = 1;
37-
static const uint16_t MODULE_CATEGORY_OTHER = 2;
38-
3935
enum SlotViewType {
4036
SLOT_VIEW_TYPE_DEFAULT,
4137
SLOT_VIEW_TYPE_DEFAULT_2COL,
@@ -58,7 +54,6 @@ namespace psu {
5854

5955
struct ModuleInfo {
6056
uint16_t moduleType;
61-
uint16_t moduleCategory;
6257
const char *moduleName;
6358
const char *moduleBrand;
6459
uint16_t latestModuleRevision;
@@ -68,7 +63,7 @@ struct ModuleInfo {
6863
bool spiCrcCalculationEnable;
6964
uint8_t numChannels;
7065

71-
ModuleInfo(uint16_t moduleType, uint16_t moduleCategory, const char *moduleName, const char *moduleBrand, uint16_t latestModuleRevision, FlashMethod flashMethod, uint32_t flashDuration_, uint32_t spiBaudRatePrescaler_, bool spiCrcCalculationEnable_, uint8_t numChannels_);
66+
ModuleInfo(uint16_t moduleType, const char *moduleName, const char *moduleBrand, uint16_t latestModuleRevision, FlashMethod flashMethod, uint32_t flashDuration_, uint32_t spiBaudRatePrescaler_, bool spiCrcCalculationEnable_, uint8_t numChannels_);
7267

7368
virtual Module *createModule(uint8_t slotIndex, uint16_t moduleRevision, bool firmwareInstalled) = 0;
7469
virtual psu::Channel *createChannel(int slotIndex, int channelIndex, int subchannelIndex);

src/eez/modules/dib-mio168/dib-mio168.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ struct Mio168DoutChannel : public Channel {
115115
struct Mio168ModuleInfo : public ModuleInfo {
116116
public:
117117
Mio168ModuleInfo()
118-
: ModuleInfo(MODULE_TYPE_DIB_MIO168, MODULE_CATEGORY_OTHER, "MIO168", "Envox", MODULE_REVISION_R1B2, FLASH_METHOD_STM32_BOOTLOADER_SPI, 10000,
118+
: ModuleInfo(MODULE_TYPE_DIB_MIO168, "MIO168", "Envox", MODULE_REVISION_R1B2, FLASH_METHOD_STM32_BOOTLOADER_SPI, 10000,
119119
#if defined(EEZ_PLATFORM_STM32)
120120
SPI_BAUDRATEPRESCALER_4,
121121
true,

src/eez/modules/dib-prel6/dib-prel6.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace dib_prel6 {
3939
struct Prel6ModuleInfo : public ModuleInfo {
4040
public:
4141
Prel6ModuleInfo()
42-
: ModuleInfo(MODULE_TYPE_DIB_PREL6, MODULE_CATEGORY_OTHER, "PREL6", "Envox", MODULE_REVISION_R1B2, FLASH_METHOD_STM32_BOOTLOADER_UART, 0,
42+
: ModuleInfo(MODULE_TYPE_DIB_PREL6, "PREL6", "Envox", MODULE_REVISION_R1B2, FLASH_METHOD_STM32_BOOTLOADER_UART, 0,
4343
#if defined(EEZ_PLATFORM_STM32)
4444
SPI_BAUDRATEPRESCALER_64,
4545
true,

src/eez/modules/dib-smx46/dib-smx46.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace dib_smx46 {
4040
struct Smx46ModuleInfo : public ModuleInfo {
4141
public:
4242
Smx46ModuleInfo()
43-
: ModuleInfo(MODULE_TYPE_DIB_SMX46, MODULE_CATEGORY_OTHER, "SMX46", "Envox", MODULE_REVISION_R1B2, FLASH_METHOD_STM32_BOOTLOADER_UART, 0,
43+
: ModuleInfo(MODULE_TYPE_DIB_SMX46, "SMX46", "Envox", MODULE_REVISION_R1B2, FLASH_METHOD_STM32_BOOTLOADER_UART, 0,
4444
#if defined(EEZ_PLATFORM_STM32)
4545
SPI_BAUDRATEPRESCALER_64,
4646
true,

src/eez/modules/psu/gui/data.cpp

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -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

15271527
void 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

15311531
void 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

15351535
void 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

15391539
void 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

15481543
void 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

15571547
void 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

15661551
void data_slot_default_view(int slotIndex, DataOperationEnum operation, Cursor cursor, Value &value) {

src/eez/modules/psu/psu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ bool g_adcMeasureAllFinished = false;
191191
////////////////////////////////////////////////////////////////////////////////
192192

193193
PsuModuleInfo::PsuModuleInfo(uint16_t moduleType, const char *moduleName, const char *moduleBrend, uint16_t latestModuleRevision, FlashMethod flashMethod, uint32_t flashDuration, uint32_t spiBaudRatePrescaler, bool spiCrcCalculationEnable, uint8_t numChannels_)
194-
: ModuleInfo(moduleType, MODULE_CATEGORY_DCPSUPPLY, moduleName, moduleBrend, latestModuleRevision, flashMethod, flashDuration, spiBaudRatePrescaler, spiCrcCalculationEnable, numChannels_)
194+
: ModuleInfo(moduleType, moduleName, moduleBrend, latestModuleRevision, flashMethod, flashDuration, spiBaudRatePrescaler, spiCrcCalculationEnable, numChannels_)
195195
{
196196
}
197197

0 commit comments

Comments
 (0)