Device component initialization done more intelligently

This commit is contained in:
Paul Hollinsky
2018-10-26 19:28:09 -04:00
parent 7e6282a7ad
commit a331a2afa8
24 changed files with 255 additions and 213 deletions
+8 -6
View File
@@ -11,19 +11,21 @@ class NeoVIPLASMA : public Plasion {
public:
static constexpr DeviceType::Enum DEVICE_TYPE = DeviceType::PLASMA;
static constexpr const uint16_t PRODUCT_ID = 0x0801;
NeoVIPLASMA(neodevice_t neodevice) : Plasion(neodevice) {
getWritableNeoDevice().type = DEVICE_TYPE;
productId = PRODUCT_ID;
}
static std::vector<std::shared_ptr<Device>> Find() {
std::vector<std::shared_ptr<Device>> found;
for(auto neodevice : FTDI::FindByProduct(PRODUCT_ID))
found.push_back(std::make_shared<NeoVIPLASMA>(neodevice));
found.emplace_back(new NeoVIPLASMA(neodevice));
return found;
}
private:
NeoVIPLASMA(neodevice_t neodevice) : Plasion(neodevice) {
initialize<FTDI>();
getWritableNeoDevice().type = DEVICE_TYPE;
productId = PRODUCT_ID;
}
};
}