From ee5a87ae15f7dbf2fa1888b15668855445e1c623 Mon Sep 17 00:00:00 2001 From: Johannes Wendel Date: Tue, 7 Jan 2020 00:47:59 +0100 Subject: [PATCH] Fixes some issues with sounds and the appropriate factory. Further moved the calculation of pin addresses with pin base into the factories --- .../json_example/output/Sound_Config.json | 206 ++++++++---------- .../src/output/OutputDriverFactory.cpp | 3 +- .../src/output/detail/OutputDriver.cpp | 2 + .../output/detail/SoundBoardPinController.cpp | 12 +- .../src/output/factories/FlipperFactory.cpp | 2 +- .../src/output/factories/LampFactory.cpp | 3 +- .../src/output/factories/SolenoidFactory.cpp | 2 +- .../src/output/factories/SoundFactory.cpp | 20 +- .../output/items/detail/DriverBoardItem.cpp | 4 +- .../src/output/items/detail/DriverBoardItem.h | 2 +- .../src/output/items/detail/Flipper.cpp | 6 +- .../src/output/items/detail/Flipper.h | 2 +- .../src/output/items/detail/Lamp.cpp | 6 +- FlippR-Driver/src/output/items/detail/Lamp.h | 2 +- .../src/output/items/detail/Solenoid.cpp | 4 +- .../src/output/items/detail/Solenoid.h | 2 +- .../src/output/items/detail/Sound.cpp | 6 +- FlippR-Driver/src/output/items/detail/Sound.h | 2 +- 18 files changed, 145 insertions(+), 141 deletions(-) diff --git a/FlippR-Driver/contrib/json_example/output/Sound_Config.json b/FlippR-Driver/contrib/json_example/output/Sound_Config.json index c0d19a9..9be1d56 100644 --- a/FlippR-Driver/contrib/json_example/output/Sound_Config.json +++ b/FlippR-Driver/contrib/json_example/output/Sound_Config.json @@ -3,8 +3,8 @@ "port_extenders" : [ { - "name" : "extender_0", "i2c_address" : 34, + "name" : "extender_0", "pin_base" : 81 } ], @@ -13,339 +13,321 @@ "address" : 13, "extender" : "extender_0" }, - "address_pins" : [ 15, 14, 12, 10, 8, 9, 11 ], + "address_pins" : + [ + { + "id" : 0, + "address" : 15, + "extender" : "extender_0" + }, + { + "id" : 1, + "address" : 14, + "extender" : "extender_0" + }, + { + "id" : 2, + "address" : 12, + "extender" : "extender_0" + }, + { + "id" : 3, + "address" : 10, + "extender" : "extender_0" + }, + { + "id" : 4, + "address" : 8, + "extender" : "extender_0" + }, + { + "id" : 5, + "address" : 9, + "extender" : "extender_0" + }, + { + "id" : 6, + "address" : 11, + "extender" : "extender_0" + } + ], "sounds" : [ { "id" : 0, "address" : 22, "name" : "Sound 1", - "extender" : "extender_0", "deactivation_time_milliseconds" : 10 }, { "id" : 1, "address" : 23, - "name" : "Sound 2", - "extender" : "extender_0" + "name" : "Sound 2" }, { "id" : 2, "address" : 24, - "name" : "Sound 3", - "extender" : "extender_0" + "name" : "Sound 3" }, { "id" : 3, "address" : 25, - "name" : "Sound 4", - "extender" : "extender_0" + "name" : "Sound 4" }, { "id" : 4, "address" : 26, - "name" : "Sound 5", - "extender" : "extender_0" + "name" : "Sound 5" }, { "id" : 5, "address" : 27, - "name" : "Sound 6", - "extender" : "extender_0" + "name" : "Sound 6" }, { "id" : 6, "address" : 28, - "name" : "Sound 7", - "extender" : "extender_0" + "name" : "Sound 7" }, { "id" : 7, "address" : 29, - "name" : "Sound 8", - "extender" : "extender_0" + "name" : "Sound 8" }, { "id" : 8, "address" : 30, - "name" : "Sound 9", - "extender" : "extender_0" + "name" : "Sound 9" }, { "id" : 9, "address" : 31, - "name" : "Sound 10", - "extender" : "extender_0" + "name" : "Sound 10" }, { "id" : 10, "address" : 32, - "name" : "Sound 11", - "extender" : "extender_0" + "name" : "Sound 11" }, { "id" : 11, "address" : 33, - "name" : "Sound 12", - "extender" : "extender_0" + "name" : "Sound 12" }, { "id" : 12, "address" : 34, - "name" : "Sound 13", - "extender" : "extender_0" + "name" : "Sound 13" }, { "id" : 13, "address" : 35, - "name" : "Sound 14", - "extender" : "extender_0" + "name" : "Sound 14" }, { "id" : 14, "address" : 36, - "name" : "Sound 15", - "extender" : "extender_0" + "name" : "Sound 15" }, { "id" : 15, "address" : 37, - "name" : "Sound 16", - "extender" : "extender_0" + "name" : "Sound 16" }, { "id" : 16, "address" : 38, - "name" : "Sound 17", - "extender" : "extender_0" + "name" : "Sound 17" }, { "id" : 17, "address" : 39, - "name" : "Sound 18", - "extender" : "extender_0" + "name" : "Sound 18" }, { "id" : 18, "address" : 40, - "name" : "Sound 19", - "extender" : "extender_0" + "name" : "Sound 19" }, { "id" : 19, "address" : 41, - "name" : "Sound 20", - "extender" : "extender_0" + "name" : "Sound 20" }, { "id" : 20, "address" : 42, - "name" : "Sound 21", - "extender" : "extender_0" + "name" : "Sound 21" }, { "id" : 21, "address" : 43, - "name" : "Sound 22", - "extender" : "extender_0" + "name" : "Sound 22" }, { "id" : 22, "address" : 44, - "name" : "Sound 23", - "extender" : "extender_0" + "name" : "Sound 23" }, { "id" : 23, "address" : 45, - "name" : "Sound 24", - "extender" : "extender_0" + "name" : "Sound 24" }, { "id" : 24, "address" : 46, - "name" : "Sound 25", - "extender" : "extender_0" + "name" : "Sound 25" }, { "id" : 25, "address" : 47, - "name" : "Sound 26", - "extender" : "extender_0" + "name" : "Sound 26" }, { "id" : 26, "address" : 48, - "name" : "Sound 27", - "extender" : "extender_0" + "name" : "Sound 27" }, { "id" : 27, "address" : 49, - "name" : "Sound 28", - "extender" : "extender_0" + "name" : "Sound 28" }, { "id" : 28, "address" : 50, - "name" : "Speech 1: \"You're good! But I'm still the Champ!\"", - "extender" : "extender_0" + "name" : "Speech 1: \"You're good! But I'm still the Champ!\"" }, { "id" : 29, "address" : 51, - "name" : "Speech 2: \"Twenty\"", - "extender" : "extender_0" + "name" : "Speech 2: \"Twenty\"" }, { "id" : 30, "address" : 52, - "name" : "Speech 3: \"Seconds\"", - "extender" : "extender_0" + "name" : "Speech 3: \"Seconds\"" }, { "id" : 31, "address" : 53, - "name" : "Speech 4: \"Five, Four, Three, Two, One.\"", - "extender" : "extender_0" + "name" : "Speech 4: \"Five, Four, Three, Two, One.\"" }, { "id" : 32, "address" : 54, - "name" : "Speech 5: \"Challenge the champ!\"", - "extender" : "extender_0" + "name" : "Speech 5: \"Challenge the champ!\"" }, { "id" : 33, "address" : 55, - "name" : "Speech 6: \"Good. You're a champ!\"", - "extender" : "extender_0" - }, + "name" : "Speech 6: \"Good. You're a champ!\"" + }, { "id" : 34, "address" : 56, - "name" : "Speech 7: \"Wow.\"", - "extender" : "extender_0" + "name" : "Speech 7: \"Wow.\"" }, { "id" : 35, "address" : 57, - "name" : "Speech 8: \"This is a maximum score.\"", - "extender" : "extender_0" + "name" : "Speech 8: \"This is a maximum score.\"" }, { "id" : 36, "address" : 58, - "name" : "Speech 9: \"What a low score!\"", - "extender" : "extender_0" + "name" : "Speech 9: \"What a low score!\"" }, { "id" : 37, "address" : 59, - "name" : "Speech 10: \"Try harder!\"", - "extender" : "extender_0" + "name" : "Speech 10: \"Try harder!\"" }, { "id" : 38, "address" : 60, - "name" : "Speech 11: \"Be careful.\"", - "extender" : "extender_0" + "name" : "Speech 11: \"Be careful.\"" }, { "id" : 39, "address" : 61, - "name" : "Speech 12: \"The last ball.\"", - "extender" : "extender_0" + "name" : "Speech 12: \"The last ball.\"" }, { "id" : 40, "address" : 62, - "name" : "Speech 13: \"Be ready for the Game Time Bonus.\"", - "extender" : "extender_0" + "name" : "Speech 13: \"Be ready for the Game Time Bonus.\"" }, { "id" : 41, "address" : 63, - "name" : "Speech 14: \"That's naughty!\"", - "extender" : "extender_0" + "name" : "Speech 14: \"That's naughty!\"" }, { "id" : 42, "address" : 64, - "name" : "Speech 15: \"Another coin please.\"", - "extender" : "extender_0" + "name" : "Speech 15: \"Another coin please.\"" }, { "id" : 43, "address" : 65, - "name" : "Speech 16: \"Sorry. The time is over.\"", - "extender" : "extender_0" + "name" : "Speech 16: \"Sorry. The time is over.\"" }, { "id" : 44, "address" : 66, - "name" : "Speech 17: \"I am the champ! Challenge me!\"", - "extender" : "extender_0" + "name" : "Speech 17: \"I am the champ! Challenge me!\"" }, { "id" : 45, "address" : 67, - "name" : "Speech 18: \"Time is short.\"", - "extender" : "extender_0" + "name" : "Speech 18: \"Time is short.\"" }, { "id" : 46, "address" : 68, - "name" : "Speech 19: \"Once again for the special.\"", - "extender" : "extender_0" + "name" : "Speech 19: \"Once again for the special.\"" }, { "id" : 47, "address" : 69, - "name" : "Speech 20: \"Go for the high level board.\"", - "extender" : "extender_0" + "name" : "Speech 20: \"Go for the high level board.\"" }, { "id" : 48, "address" : 70, - "name" : "Speech 21: \"Play gently to beat me.\"", - "extender" : "extender_0" + "name" : "Speech 21: \"Play gently to beat me.\"" }, { "id" : 49, "address" : 71, - "name" : "Speech 22: \"Quick! Hit the special.\"", - "extender" : "extender_0" + "name" : "Speech 22: \"Quick! Hit the special.\"" }, { "id" : 50, "address" : 72, - "name" : "Speech 23: \"Shoot the special.\"", - "extender" : "extender_0" + "name" : "Speech 23: \"Shoot the special.\"" }, { "id" : 51, "address" : 73, - "name" : "Speech 24: \"Thirty\"", - "extender" : "extender_0" + "name" : "Speech 24: \"Thirty\"" }, { "id" : 52, "address" : 74, - "name" : "Speech 25: \"Red\"", - "extender" : "extender_0" + "name" : "Speech 25: \"Red\"" }, { "id" : 53, "address" : 75, - "name" : "Speech 27: \"Yellow\"", - "extender" : "extender_0" + "name" : "Speech 27: \"Yellow\"" }, { "id" : 54, "address" : 76, - "name" : "Speech 28: \"Go for the Special.\"", - "extender" : "extender_0" + "name" : "Speech 28: \"Go for the Special.\"" } ] } diff --git a/FlippR-Driver/src/output/OutputDriverFactory.cpp b/FlippR-Driver/src/output/OutputDriverFactory.cpp index 68d154f..b715f7b 100644 --- a/FlippR-Driver/src/output/OutputDriverFactory.cpp +++ b/FlippR-Driver/src/output/OutputDriverFactory.cpp @@ -59,10 +59,9 @@ std::map> get_items(const std::string &co nlohmann::json config_json; config_stream >> config_json; - FactoryType factory{config_json, std::static_pointer_cast(pin_controller)}; - std::map> map; try{ + FactoryType factory{config_json, std::static_pointer_cast(pin_controller)}; map = factory.getItemMap(); } catch(json::exception & e) diff --git a/FlippR-Driver/src/output/detail/OutputDriver.cpp b/FlippR-Driver/src/output/detail/OutputDriver.cpp index 107df31..8027b2e 100644 --- a/FlippR-Driver/src/output/detail/OutputDriver.cpp +++ b/FlippR-Driver/src/output/detail/OutputDriver.cpp @@ -158,6 +158,8 @@ void OutputDriver::shut_down_driver() const this->deactivate_all_flipper_relays(); this->deactivate_all_lamps(); this->deactivate_displays(); + + CLOG(INFO, OUTPUT_LOGGER) << "Deactivated all output items."; } diff --git a/FlippR-Driver/src/output/detail/SoundBoardPinController.cpp b/FlippR-Driver/src/output/detail/SoundBoardPinController.cpp index 1117131..90995e4 100644 --- a/FlippR-Driver/src/output/detail/SoundBoardPinController.cpp +++ b/FlippR-Driver/src/output/detail/SoundBoardPinController.cpp @@ -71,18 +71,28 @@ void SoundBoardPinController::write_pin(const uint8_t &pin, const bool &value) c { PinController::write_pin(pin, value); PinController::write_pin(this->fire_address, true); - PinController::write_pin(this->fire_address, false); } void SoundBoardPinController::set_address_pins(std::vector address_pins) { this->address_pins = address_pins; + + //print string in a nice manner + std::stringstream ss; + for (auto & p : address_pins) + { + ss << int{p} << ", "; + } + ss << std::string(2, 0x08); + + CLOG(DEBUG, OUTPUT_LOGGER) << "Pin addresses for sounds set to: [" << ss.str() << "]"; } void SoundBoardPinController::set_fire_address(const uint8_t &fire_address) { this->fire_address = fire_address; + CLOG(DEBUG, OUTPUT_LOGGER) << "Fire-pin address for sounds set to: " << int{fire_address}; } } diff --git a/FlippR-Driver/src/output/factories/FlipperFactory.cpp b/FlippR-Driver/src/output/factories/FlipperFactory.cpp index b384a1a..3d5e15a 100644 --- a/FlippR-Driver/src/output/factories/FlipperFactory.cpp +++ b/FlippR-Driver/src/output/factories/FlipperFactory.cpp @@ -29,7 +29,7 @@ std::map> FlipperFactory::getItemMa auto extender = flipper.at(config_path::item_extender).get(); auto pin_base = this->get_extender_pin_base(extender); - auto flipper_item = std::make_shared(std::static_pointer_cast(this->pin_controller), address, pin_base, name); + auto flipper_item = std::make_shared(std::static_pointer_cast(this->pin_controller), address + pin_base, name); flipper_map.emplace(name, flipper_item); } return flipper_map; diff --git a/FlippR-Driver/src/output/factories/LampFactory.cpp b/FlippR-Driver/src/output/factories/LampFactory.cpp index 8f990e3..f0d70e6 100644 --- a/FlippR-Driver/src/output/factories/LampFactory.cpp +++ b/FlippR-Driver/src/output/factories/LampFactory.cpp @@ -28,7 +28,8 @@ std::map> LampFactory::getItemMap() auto address = lamp.at(config_path::item_address).get(); auto extender = lamp.at(config_path::item_extender).get(); auto pin_base = this->get_extender_pin_base(extender); - auto lamp_item = std::make_shared(std::static_pointer_cast(this->pin_controller), address, pin_base, name); + + auto lamp_item = std::make_shared(std::static_pointer_cast(this->pin_controller), address + pin_base, name); lamp_map.emplace(name, lamp_item); } return lamp_map; diff --git a/FlippR-Driver/src/output/factories/SolenoidFactory.cpp b/FlippR-Driver/src/output/factories/SolenoidFactory.cpp index 3193058..88aca6f 100644 --- a/FlippR-Driver/src/output/factories/SolenoidFactory.cpp +++ b/FlippR-Driver/src/output/factories/SolenoidFactory.cpp @@ -40,7 +40,7 @@ std::map> SolenoidFactory::getItem deactivation_time_chrono = std::chrono::milliseconds{solenoid.at(config_path::deactivation_time).get()}; } - auto solenoid_item = std::make_shared(std::static_pointer_cast(this->pin_controller), address, pin_base, name, deactivation_time_chrono); + auto solenoid_item = std::make_shared(std::static_pointer_cast(this->pin_controller), address + pin_base, name, deactivation_time_chrono); solenoid_map.emplace(name, solenoid_item); } return solenoid_map; diff --git a/FlippR-Driver/src/output/factories/SoundFactory.cpp b/FlippR-Driver/src/output/factories/SoundFactory.cpp index 18bc269..38a524b 100644 --- a/FlippR-Driver/src/output/factories/SoundFactory.cpp +++ b/FlippR-Driver/src/output/factories/SoundFactory.cpp @@ -33,8 +33,6 @@ std::map> SoundFactory::getItemMap() { auto name = sound.at(config_path::item_name).get(); auto address = sound.at(config_path::item_address).get(); - auto extender = sound.at(config_path::item_extender).get(); - auto pin_base = this->get_extender_pin_base(extender); auto id = sound.at(config_path::item_identifier).get(); std::chrono::milliseconds deactivation_time_chrono{this->deactivation_time}; @@ -42,7 +40,7 @@ std::map> SoundFactory::getItemMap() { deactivation_time_chrono = std::chrono::milliseconds{sound.at(config_path::deactivation_time).get()}; } - auto sound_item = std::make_shared(std::static_pointer_cast(this->pin_controller), address, pin_base, name, deactivation_time_chrono, id); + auto sound_item = std::make_shared(std::static_pointer_cast(this->pin_controller), address, name, deactivation_time_chrono, id); sound_map.emplace(name, sound_item); } @@ -67,9 +65,21 @@ void SoundFactory::set_address_pins() std::vector pins; - for (auto & pin : address_pins) + for (auto & pin_json : address_pins) { - pins.push_back(pin.get()); + pins.push_back(0); + } + for (auto & pin_json : address_pins) + { + uint8_t pin = pin_json.at(config_path::item_address).get(); + if (pin_json.find(config_path::item_extender) != pin_json.end()) + { + auto extender_name = pin_json.at(config_path::item_extender).get(); + pin += this->get_extender_pin_base(extender_name); + } + uint8_t id = pin_json.at(config_path::item_identifier).get(); + + pins[id] = pin; } std::dynamic_pointer_cast(this->pin_controller)->set_address_pins(pins); diff --git a/FlippR-Driver/src/output/items/detail/DriverBoardItem.cpp b/FlippR-Driver/src/output/items/detail/DriverBoardItem.cpp index 27594df..f5ccab8 100644 --- a/FlippR-Driver/src/output/items/detail/DriverBoardItem.cpp +++ b/FlippR-Driver/src/output/items/detail/DriverBoardItem.cpp @@ -6,8 +6,8 @@ using namespace flippR_driver::output; -items::detail::DriverBoardItem::DriverBoardItem(std::shared_ptr pin_controller, const uint8_t & address, const uint8_t & pin_base) : - address(pin_base + address) +items::detail::DriverBoardItem::DriverBoardItem(std::shared_ptr pin_controller, const uint8_t & address) : + address(address) { pin_controller->initialize_output_pin(this->address); } diff --git a/FlippR-Driver/src/output/items/detail/DriverBoardItem.h b/FlippR-Driver/src/output/items/detail/DriverBoardItem.h index ddf3b7e..6c853c4 100644 --- a/FlippR-Driver/src/output/items/detail/DriverBoardItem.h +++ b/FlippR-Driver/src/output/items/detail/DriverBoardItem.h @@ -21,7 +21,7 @@ namespace detail class DriverBoardItem : public output::items::DriverBoardItem { public: - DriverBoardItem(std::shared_ptr pin_controller, const uint8_t & address, const uint8_t & pin_base); + DriverBoardItem(std::shared_ptr pin_controller, const uint8_t & address); ~DriverBoardItem() override = default; diff --git a/FlippR-Driver/src/output/items/detail/Flipper.cpp b/FlippR-Driver/src/output/items/detail/Flipper.cpp index 8540329..b85c6d3 100644 --- a/FlippR-Driver/src/output/items/detail/Flipper.cpp +++ b/FlippR-Driver/src/output/items/detail/Flipper.cpp @@ -20,10 +20,10 @@ namespace items namespace detail { -Flipper::Flipper(std::shared_ptr pin_controller, const uint8_t & address, const uint8_t & pin_base, const std::string & name) : - Item(std::move(name)), DriverBoardItem(pin_controller, address, pin_base), pin_controller(std::move(pin_controller)) +Flipper::Flipper(std::shared_ptr pin_controller, const uint8_t & address, const std::string & name) : + Item(std::move(name)), DriverBoardItem(pin_controller, address), pin_controller(std::move(pin_controller)) { - CLOG(DEBUG, OUTPUT_LOGGER) << "Created flipper \"" << name << "\" with pin-base " << int(pin_base) << " and address " << int(address); + CLOG(DEBUG, OUTPUT_LOGGER) << "Created flipper \"" << name << "\" with address " << int(address); } Flipper::~Flipper() diff --git a/FlippR-Driver/src/output/items/detail/Flipper.h b/FlippR-Driver/src/output/items/detail/Flipper.h index 9a7d044..89f8084 100644 --- a/FlippR-Driver/src/output/items/detail/Flipper.h +++ b/FlippR-Driver/src/output/items/detail/Flipper.h @@ -23,7 +23,7 @@ namespace detail class Flipper : public detail::Item, public items::Flipper, public detail::DriverBoardItem { public: - Flipper(std::shared_ptr pin_controller, const uint8_t & address, const uint8_t & pin_base, const std::string & name); + Flipper(std::shared_ptr pin_controller, const uint8_t & address, const std::string & name); ~Flipper() override; void activate() override; diff --git a/FlippR-Driver/src/output/items/detail/Lamp.cpp b/FlippR-Driver/src/output/items/detail/Lamp.cpp index 94fa503..5cff0e7 100644 --- a/FlippR-Driver/src/output/items/detail/Lamp.cpp +++ b/FlippR-Driver/src/output/items/detail/Lamp.cpp @@ -19,14 +19,14 @@ namespace items namespace detail { -Lamp::Lamp(std::shared_ptr pin_controller, const uint8_t & address, const uint8_t & pin_base, const std::string & name) : +Lamp::Lamp(std::shared_ptr pin_controller, const uint8_t & address, const std::string & name) : detail::Item(std::move(name)), - DriverBoardItem(pin_controller, address, pin_base), + DriverBoardItem(pin_controller, address), pin_controller(std::move(pin_controller)), activated(false), activation_time(10) { - CLOG(DEBUG, OUTPUT_LOGGER) << "Created lamp \"" << name << "\" with pin-base " << int(pin_base) << " and address " << int(address); + CLOG(DEBUG, OUTPUT_LOGGER) << "Created lamp \"" << name << "\" with address " << int(address); } void Lamp::activate() diff --git a/FlippR-Driver/src/output/items/detail/Lamp.h b/FlippR-Driver/src/output/items/detail/Lamp.h index 7bb1575..af7ff13 100644 --- a/FlippR-Driver/src/output/items/detail/Lamp.h +++ b/FlippR-Driver/src/output/items/detail/Lamp.h @@ -27,7 +27,7 @@ namespace detail class Lamp : public detail::DriverBoardItem, public detail::Item, public items::Lamp { public: - Lamp(std::shared_ptr pin_controller, const uint8_t & address, const uint8_t & pin_base, const std::string & name); + Lamp(std::shared_ptr pin_controller, const uint8_t & address, const std::string & name); ~Lamp() override = default; void activate() override; diff --git a/FlippR-Driver/src/output/items/detail/Solenoid.cpp b/FlippR-Driver/src/output/items/detail/Solenoid.cpp index 06c8309..d72ade6 100644 --- a/FlippR-Driver/src/output/items/detail/Solenoid.cpp +++ b/FlippR-Driver/src/output/items/detail/Solenoid.cpp @@ -18,8 +18,8 @@ namespace items namespace detail { -Solenoid::Solenoid(std::shared_ptr pin_controller, const uint8_t & address, const uint8_t & pin_base, const std::string & name, const std::chrono::milliseconds & deactivation_time) -: detail::Item(std::move(name)), DriverBoardItem(pin_controller, address, pin_base), pin_controller(pin_controller), deactivation_time(deactivation_time) +Solenoid::Solenoid(std::shared_ptr pin_controller, const uint8_t & address, const std::string & name, const std::chrono::milliseconds & deactivation_time) +: detail::Item(std::move(name)), DriverBoardItem(pin_controller, address), pin_controller(pin_controller), deactivation_time(deactivation_time) { CLOG(DEBUG, OUTPUT_LOGGER) << "Created solenoid " << name << " with address " << int{address} << " and deactivation-time: " << deactivation_time.count(); } diff --git a/FlippR-Driver/src/output/items/detail/Solenoid.h b/FlippR-Driver/src/output/items/detail/Solenoid.h index 4959676..e73fc92 100644 --- a/FlippR-Driver/src/output/items/detail/Solenoid.h +++ b/FlippR-Driver/src/output/items/detail/Solenoid.h @@ -29,7 +29,7 @@ namespace detail class Solenoid : public DriverBoardItem, public detail::Item, public items::Solenoid { public: - Solenoid(std::shared_ptr pin_controller, const uint8_t & address, const uint8_t & pin_base, const std::string & name, const std::chrono::milliseconds & deactivation_time); + Solenoid(std::shared_ptr pin_controller, const uint8_t & address, const std::string & name, const std::chrono::milliseconds & deactivation_time); ~Solenoid() override = default; void trigger() override; diff --git a/FlippR-Driver/src/output/items/detail/Sound.cpp b/FlippR-Driver/src/output/items/detail/Sound.cpp index c1dd550..cd01926 100644 --- a/FlippR-Driver/src/output/items/detail/Sound.cpp +++ b/FlippR-Driver/src/output/items/detail/Sound.cpp @@ -20,10 +20,10 @@ namespace items namespace detail { -Sound::Sound(std::shared_ptr pin_controller, const uint8_t & address, const uint8_t & pin_base, const std::string & name, const std::chrono::milliseconds & deactivation_time, const u_int id) -: detail::Item(std::move(name)), DriverBoardItem(pin_controller, address, pin_base), pin_controller(std::move(pin_controller)), deactivation_time(deactivation_time), id(id) +Sound::Sound(std::shared_ptr pin_controller, const uint8_t & address, const std::string & name, const std::chrono::milliseconds & deactivation_time, const u_int id) +: detail::Item(std::move(name)), DriverBoardItem(pin_controller, address), pin_controller(std::move(pin_controller)), deactivation_time(deactivation_time), id(id) { - CLOG(DEBUG, OUTPUT_LOGGER) << "Created sound " << id << " \"" << name << "\" with pin-base " << int(pin_base) << " and address " << int(address) << ". Deactivation time is: " << deactivation_time.count(); + CLOG(DEBUG, OUTPUT_LOGGER) << "Created sound " << id << " \"" << name << "\" with address " << int(address) << ". Deactivation time is: " << deactivation_time.count(); } void Sound::play() diff --git a/FlippR-Driver/src/output/items/detail/Sound.h b/FlippR-Driver/src/output/items/detail/Sound.h index c7d83ef..9d4c52b 100644 --- a/FlippR-Driver/src/output/items/detail/Sound.h +++ b/FlippR-Driver/src/output/items/detail/Sound.h @@ -35,7 +35,7 @@ public: u_int id; public: - Sound(std::shared_ptr pin_controller, const uint8_t & address, const uint8_t & pin_base, const std::string & name, const std::chrono::milliseconds & deactivation_time, const u_int id); + Sound(std::shared_ptr pin_controller, const uint8_t & address, const std::string & name, const std::chrono::milliseconds & deactivation_time, const u_int id); ~Sound() override = default; void play() override;