|
|
@ -29,7 +29,7 @@
|
|
|
|
#include "sensor.h"
|
|
|
|
#include "sensor.h"
|
|
|
|
#include "interface.h"
|
|
|
|
#include "interface.h"
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
|
|
enum SSTATUS {
|
|
|
|
SSTATUS_STARTUP,
|
|
|
|
SSTATUS_STARTUP,
|
|
|
|
SSTATUS_RESET,
|
|
|
|
SSTATUS_RESET,
|
|
|
|
SSTATUS_MANUAL,
|
|
|
|
SSTATUS_MANUAL,
|
|
|
@ -38,7 +38,7 @@ enum {
|
|
|
|
SSTATUS_MAX
|
|
|
|
SSTATUS_MAX
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
|
|
enum MRESET {
|
|
|
|
MRESET_STEP_INTERFACES,
|
|
|
|
MRESET_STEP_INTERFACES,
|
|
|
|
MRESET_STEP_LOCOMOTIVES,
|
|
|
|
MRESET_STEP_LOCOMOTIVES,
|
|
|
|
MRESET_STEP_TURNOUTS,
|
|
|
|
MRESET_STEP_TURNOUTS,
|
|
|
@ -47,8 +47,8 @@ enum {
|
|
|
|
MRESET_STEP_MAX
|
|
|
|
MRESET_STEP_MAX
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct {
|
|
|
|
struct s_ModeResetData{
|
|
|
|
int mr_step; // current step
|
|
|
|
int mr_step; // current step
|
|
|
|
int mr_timestamp; // timestamp ( needed for times )
|
|
|
|
int mr_timestamp; // timestamp ( needed for times )
|
|
|
|
int mr_idx; // mode index
|
|
|
|
int mr_idx; // mode index
|
|
|
|
} typedef ModeResetData;
|
|
|
|
} typedef ModeResetData;
|
|
|
@ -57,8 +57,8 @@ struct {
|
|
|
|
|
|
|
|
|
|
|
|
class Server {
|
|
|
|
class Server {
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
int status; // holds the current mode
|
|
|
|
int mode; // holds the current mode
|
|
|
|
int status_progress; // to return a value from 0-100
|
|
|
|
int mode_progress; // to return a value from 0-100
|
|
|
|
string status_text; // some text
|
|
|
|
string status_text; // some text
|
|
|
|
|
|
|
|
|
|
|
|
ModeResetData data_reset;
|
|
|
|
ModeResetData data_reset;
|
|
|
@ -119,10 +119,11 @@ public:
|
|
|
|
// FIXME:
|
|
|
|
// FIXME:
|
|
|
|
// FIXME:
|
|
|
|
// FIXME:
|
|
|
|
JSONParse GetJSONServerStatus();
|
|
|
|
JSONParse GetJSONServerStatus();
|
|
|
|
void ModeReset(); // mode Reset if finished will go to Manual
|
|
|
|
void ModeReset(); // mode Reset if finished will go to Manual
|
|
|
|
void ModeManual(); // Manual Mode
|
|
|
|
void ModeManual(); // Manual Mode
|
|
|
|
void ModeAuto(); // only allowed if Manual was set
|
|
|
|
void ModeAuto(); // only allowed if Manual was set
|
|
|
|
void ModeError(); // will cut power and keep this mode, until reset or Mode Manual
|
|
|
|
void ModeError(string text); // will cut power and keep this mode, until reset or Mode Manual
|
|
|
|
|
|
|
|
string GetStatus(); // return status
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////
|
|
|
|
/////////////////////////////////////////
|
|
|
|
// Railway
|
|
|
|
// Railway
|
|
|
@ -139,7 +140,6 @@ public:
|
|
|
|
int TurnoutDelete(string name) { return turnouts.Delete(name); };
|
|
|
|
int TurnoutDelete(string name) { return turnouts.Delete(name); };
|
|
|
|
int TurnoutSet(string name, int active) { return turnouts.Set(name, active); };
|
|
|
|
int TurnoutSet(string name, int active) { return turnouts.Set(name, active); };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////
|
|
|
|
/////////////////////////////////////////
|
|
|
|
// Interface
|
|
|
|
// Interface
|
|
|
|
int InterfaceChange(Interface *i) { return interfaces.Change(i); };
|
|
|
|
int InterfaceChange(Interface *i) { return interfaces.Change(i); };
|
|
|
|