add possibility to write content unfitted

This commit is contained in:
Jonas Zeunert
2022-06-06 17:42:56 +02:00
parent f6c7403aa8
commit f68f9fc8cc
5 changed files with 6 additions and 5 deletions

View File

@@ -24,6 +24,7 @@ public:
virtual ~Display() = default; virtual ~Display() = default;
virtual void write_score(uint64_t score) = 0; virtual void write_score(uint64_t score) = 0;
virtual void write_content(std::string & content) = 0;
}; };
} }

View File

@@ -20,8 +20,6 @@ class EightDigitDisplay : public virtual Display
{ {
public: public:
virtual ~EightDigitDisplay() = default; virtual ~EightDigitDisplay() = default;
virtual void write_content(std::string content) = 0;
}; };
} }

View File

@@ -20,8 +20,6 @@ class SevenDigitDisplay : public virtual Display
{ {
public: public:
virtual ~SevenDigitDisplay() = default; virtual ~SevenDigitDisplay() = default;
virtual void write_content(std::string & content) = 0;
}; };
} }

View File

@@ -262,6 +262,10 @@ boost::optional<Poco::JSON::Object> OutputRequestHandler::parseDisplay(const std
throw new Poco::InvalidArgumentException("Could not convert " + score + " to a number!\n" + e.what()); throw new Poco::InvalidArgumentException("Could not convert " + score + " to a number!\n" + e.what());
} }
} }
else if(action == "write_content")
{
display->write_content(score);
}
else else
{ {
throw new Poco::NotFoundException("No Action with name \"" + action + "\" on sounds!"); throw new Poco::NotFoundException("No Action with name \"" + action + "\" on sounds!");

View File

@@ -45,7 +45,7 @@ class Networking:
self.get("/flippers/" + name + "/activate") self.get("/flippers/" + name + "/activate")
def deactivateFlipper(self, name): def deactivateFlipper(self, name):
self.get("/flippers/" + name + "deactivate") self.get("/flippers/" + name + "/deactivate")
def lampStatus(self, lamp): def lampStatus(self, lamp):
return json.loads(self.get("/lamps/" + lamp + "/status")) return json.loads(self.get("/lamps/" + lamp + "/status"))