added 2 output_tests + some add to output_driver
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
#include <boost/range/adaptor/map.hpp>
|
||||
#include <boost/range/algorithm/copy.hpp>
|
||||
#include <thread>
|
||||
|
||||
#include "OutputDriver.h"
|
||||
|
||||
@@ -37,6 +38,28 @@ void OutputDriver::deactivate_displays() const
|
||||
display_controller->deactivate_displays();
|
||||
}
|
||||
|
||||
|
||||
void OutputDriver::deactivate_all_lamps() const
|
||||
{
|
||||
std::for_each(lamps.begin(), lamps.end(), [](items::Lamp& lamp){lamp.deactivate();});
|
||||
}
|
||||
|
||||
void OutputDriver::activate_all_lamps() const
|
||||
{
|
||||
std::for_each(lamps.begin(), lamps.end(), [](items::Lamp& lamp){lamp.activate();});
|
||||
}
|
||||
|
||||
void OutputDriver::rotate_all_lamps() const
|
||||
{
|
||||
for(auto lamp = lamps.begin(); lamp != lamps.end(); lamp++)
|
||||
{
|
||||
lamp->second->activate();
|
||||
// ToDo sleep time + is this thread safe??
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
lamp->second->deactivate();
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<Sound>> OutputDriver::get_sounds() const
|
||||
{
|
||||
std::vector<std::shared_ptr<Sound>> sounds;
|
||||
@@ -93,6 +116,7 @@ boost::optional<std::shared_ptr<items::Display>> OutputDriver::get_display(uint8
|
||||
return this->displays.find(number)->second;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} /* namespace output */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user