| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
#pragma once |
| 22 |
|
| 23 |
#include "Logger/Logger.h" |
| 24 |
#include "Manager.h" |
| 25 |
#include "Server/Web/WebClient.h" |
| 26 |
|
| 27 |
namespace Server { namespace Web |
| 28 |
{ |
| 29 |
class WebClient; |
| 30 |
|
| 31 |
class WebClientRoute |
| 32 |
{ |
| 33 |
public: |
| 34 |
WebClientRoute() = delete; |
| 35 |
WebClientRoute(const WebClientRoute&) = delete; |
| 36 |
WebClientRoute& operator=(const WebClientRoute&) = delete; |
| 37 |
|
| 38 |
inline WebClientRoute(Manager& manager, WebClient& client, Logger::Logger* logger) |
| 39 |
: manager(manager), |
| 40 |
client(client), |
| 41 |
logger(logger) |
| 42 |
{ |
| 43 |
} |
| 44 |
|
| 45 |
void HandleRouteEdit(const std::map<std::string,std::string>& arguments); |
| 46 |
void HandleRouteSave(const std::map<std::string,std::string>& arguments); |
| 47 |
void HandleRouteList(); |
| 48 |
void HandleRouteAskDelete(const std::map<std::string,std::string>& arguments); |
| 49 |
void HandleRouteDelete(const std::map<std::string,std::string>& arguments); |
| 50 |
void HandleRouteGet(const std::map<std::string,std::string>& arguments); |
| 51 |
void HandleRouteExecute(const std::map<std::string,std::string>& arguments); |
| 52 |
void HandleRouteRelease(const std::map<std::string,std::string>& arguments); |
| 53 |
void HandleRelationAdd(const std::map<std::string,std::string>& arguments); |
| 54 |
void HandleRelationObject(const std::map<std::string, std::string>& arguments); |
| 55 |
void HandleRelationSwitchStates(const std::map<std::string,std::string>& arguments); |
| 56 |
void HandleFeedbacksOfTrack(const std::map<std::string,std::string>& arguments); |
| 57 |
|
| 58 |
private: |
| 59 |
HtmlTag HtmlTagRelation(const std::string& atlock, |
| 60 |
const Priority priority, |
| 61 |
const ObjectType objectType = ObjectTypeSwitch, |
| 62 |
const ObjectID objectId = ObjectNone, |
| 63 |
const DataModel::Relation::Data = DataModel::Relation::DefaultData); |
| 64 |
|
| 65 |
HtmlTag HtmlTagRelationObject(const std::string& atlock, |
| 66 |
const std::string& priorityString, |
| 67 |
const ObjectType objectType, |
| 68 |
const ObjectID objectId = ObjectNone, |
| 69 |
const DataModel::Relation::Data state = DataModel::Relation::DefaultData); |
| 70 |
|
| 71 |
HtmlTag HtmlTagRelationSwitchState(const std::string& name, |
| 72 |
const SwitchID switchId, |
| 73 |
const DataModel::Relation::Data data = DataModel::SwitchStateStraight); |
| 74 |
|
| 75 |
HtmlTag HtmlTagSelectTrack(const std::string& name, |
| 76 |
const Languages::TextSelector label, |
| 77 |
const TrackID trackID, |
| 78 |
const Orientation orientation, |
| 79 |
const std::string& onchange = "") const; |
| 80 |
|
| 81 |
HtmlTag HtmlTagSelectFeedbacksOfTrack(const TrackID trackID, |
| 82 |
const RouteID followUpRoute = RouteNone, |
| 83 |
const FeedbackID feedbackIdReduced = FeedbackNone, |
| 84 |
const Delay reducedDelay = 0, |
| 85 |
const FeedbackID feedbackIdCreep = FeedbackNone, |
| 86 |
const Delay creepDelay = 0, |
| 87 |
const FeedbackID feedbackIdStop = FeedbackNone, |
| 88 |
const Delay stopDelay = 0, |
| 89 |
const FeedbackID feedbackIdOver = FeedbackNone) const; |
| 90 |
|
| 91 |
Manager& manager; |
| 92 |
WebClient& client; |
| 93 |
Logger::Logger* logger; |
| 94 |
}; |
| 95 |
}} |
| 96 |
|