mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Add Keysight branding where applicable
Because there is now more than one "product name" per device type, we have a concept of a "generic product name" which singularly maps onto a device type. This change comes with a few small breaking changes within the C++ API: DeviceType::GetDeviceTypeString has been renamed to DeviceType::GetGenericProductName to denote that the returned value is not device specific and device->getProductName() is preferable. The member function DeviceType::toString has been renamed to DeviceType::getGenericProductName for the same reason. The DeviceType std::ostream& operator<< has been removed to avoid accidental use of the generic product name.
This commit is contained in:
@@ -16,6 +16,11 @@ public:
|
||||
static constexpr DeviceType::Enum DEVICE_TYPE = DeviceType::VCAN4_2;
|
||||
static constexpr const char* SERIAL_START = "V2";
|
||||
|
||||
enum class SKU {
|
||||
Standard,
|
||||
AP0200A, // USB A and Keysight Branding
|
||||
};
|
||||
|
||||
static std::vector<std::shared_ptr<Device>> Find() {
|
||||
std::vector<std::shared_ptr<Device>> found;
|
||||
|
||||
@@ -35,6 +40,25 @@ public:
|
||||
return supportedNetworks;
|
||||
}
|
||||
|
||||
SKU getSKU() const {
|
||||
switch(getSerial().back()) {
|
||||
case 'A':
|
||||
case 'B':
|
||||
return SKU::AP0200A;
|
||||
default:
|
||||
return SKU::Standard;
|
||||
}
|
||||
}
|
||||
|
||||
std::string getProductName() const override {
|
||||
switch(getSKU()) {
|
||||
case SKU::Standard: break;
|
||||
case SKU::AP0200A:
|
||||
return "Keysight AP0200A";
|
||||
}
|
||||
return Device::getProductName();
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void setupSupportedRXNetworks(std::vector<Network>& rxNetworks) override {
|
||||
for(auto& netid : GetSupportedNetworks())
|
||||
|
||||
@@ -15,6 +15,39 @@ public:
|
||||
static constexpr DeviceType::Enum DEVICE_TYPE = DeviceType::VCAN4_2EL;
|
||||
static constexpr const char* SERIAL_START = "VE";
|
||||
|
||||
enum class SKU {
|
||||
Standard,
|
||||
AP04E0A_D26, // HDB26, USB A, and Keysight Branding
|
||||
AP04E0A_MUL, // Multi-connectors, USB A, and Keysight Branding
|
||||
AP04E0A_OBD, // OBD, USB A, and Keysight Branding
|
||||
};
|
||||
|
||||
SKU getSKU() const {
|
||||
switch(getSerial().back()) {
|
||||
case 'A':
|
||||
return SKU::AP04E0A_D26;
|
||||
case 'B':
|
||||
return SKU::AP04E0A_MUL;
|
||||
case 'C':
|
||||
return SKU::AP04E0A_OBD;
|
||||
default:
|
||||
return SKU::Standard;
|
||||
}
|
||||
}
|
||||
|
||||
std::string getProductName() const override {
|
||||
switch(getSKU()) {
|
||||
case SKU::Standard: break;
|
||||
case SKU::AP04E0A_D26:
|
||||
return "Keysight AP04E0A-D26";
|
||||
case SKU::AP04E0A_MUL:
|
||||
return "Keysight AP04E0A-MUL";
|
||||
case SKU::AP04E0A_OBD:
|
||||
return "Keysight AP04E0A-OBD";
|
||||
}
|
||||
return Device::getProductName();
|
||||
}
|
||||
|
||||
protected:
|
||||
ValueCAN4_2EL(neodevice_t neodevice) : ValueCAN4(neodevice) {
|
||||
getWritableNeoDevice().type = DEVICE_TYPE;
|
||||
|
||||
@@ -16,6 +16,13 @@ public:
|
||||
static constexpr DeviceType::Enum DEVICE_TYPE = DeviceType::VCAN4_4;
|
||||
static constexpr const char* SERIAL_START = "V4";
|
||||
|
||||
enum class SKU {
|
||||
Standard,
|
||||
AP0400A_D26, // HDB26, USB A, and Keysight Branding
|
||||
AP0400A_DB9, // 4xDB9, USB A, and Keysight Branding
|
||||
AP0400A_OBD, // OBD, USB A, and Keysight Branding
|
||||
};
|
||||
|
||||
static std::vector<std::shared_ptr<Device>> Find() {
|
||||
std::vector<std::shared_ptr<Device>> found;
|
||||
|
||||
@@ -37,6 +44,32 @@ public:
|
||||
return supportedNetworks;
|
||||
}
|
||||
|
||||
SKU getSKU() const {
|
||||
switch(getSerial().back()) {
|
||||
case 'A':
|
||||
return SKU::AP0400A_D26;
|
||||
case 'B':
|
||||
return SKU::AP0400A_DB9;
|
||||
case 'C':
|
||||
return SKU::AP0400A_OBD;
|
||||
default:
|
||||
return SKU::Standard;
|
||||
}
|
||||
}
|
||||
|
||||
std::string getProductName() const override {
|
||||
switch(getSKU()) {
|
||||
case SKU::Standard: break;
|
||||
case SKU::AP0400A_D26:
|
||||
return "Keysight AP0400A-D26";
|
||||
case SKU::AP0400A_DB9:
|
||||
return "Keysight AP0400A-DB9";
|
||||
case SKU::AP0400A_OBD:
|
||||
return "Keysight AP0400A-OBD";
|
||||
}
|
||||
return Device::getProductName();
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void setupSupportedRXNetworks(std::vector<Network>& rxNetworks) override {
|
||||
for(auto& netid : GetSupportedNetworks())
|
||||
|
||||
Reference in New Issue
Block a user