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:
Paul Hollinsky
2021-04-12 19:01:43 -04:00
parent d79f735df8
commit e29d63b08c
12 changed files with 186 additions and 12 deletions
@@ -16,6 +16,12 @@ public:
static constexpr const uint16_t PRODUCT_ID = 0x1202;
static constexpr const char* SERIAL_START = "RM";
enum class SKU {
Standard,
APM1000E, // Keysight Branding
APM1000E_CLK, // Clock Option and Keysight Branding
};
static std::vector<std::shared_ptr<Device>> Find() {
std::vector<std::shared_ptr<Device>> found;
@@ -25,6 +31,30 @@ public:
return found;
}
SKU getSKU() const {
switch(getSerial().back()) {
case 'A':
case 'B':
return SKU::APM1000E;
case 'C':
case 'D':
return SKU::APM1000E_CLK;
default:
return SKU::Standard;
}
}
std::string getProductName() const override {
switch(getSKU()) {
case SKU::Standard: break;
case SKU::APM1000E:
return "Keysight APM1000E";
case SKU::APM1000E_CLK:
return "Keysight APM1000E-CLK";
}
return Device::getProductName();
}
// RADMoon 2 does not go online, you can only set settings and
// view PHY information (when supported)
bool goOnline() override {