57 lines
758 B
C++
57 lines
758 B
C++
#ifndef STATE_h
|
|
#define STATE_h
|
|
|
|
#include "json/single_include/nlohmann/json.hpp"
|
|
#include <iostream>
|
|
|
|
using json = nlohmann::json;
|
|
using namespace std;
|
|
|
|
enum Action {
|
|
LOAD,
|
|
DISPLAY,
|
|
STOP
|
|
};
|
|
|
|
enum Mode {
|
|
RGB,
|
|
BW,
|
|
|
|
INVERT,
|
|
BW_INVERT,
|
|
|
|
RGB_CHANNELS,
|
|
INVERT_CHANNELS
|
|
};
|
|
|
|
class MessageIn {
|
|
private:
|
|
Action action;
|
|
string file;
|
|
|
|
Mode mode;
|
|
vector<uint64_t> exposure;
|
|
bool start;
|
|
public:
|
|
MessageIn(json msgJson);
|
|
Action getAction () { return action;}
|
|
};
|
|
/*
|
|
class MessageOut {
|
|
public:
|
|
MessageOut(Action a, bool s);
|
|
Action action;
|
|
bool success;
|
|
string toString();
|
|
};
|
|
|
|
class State {
|
|
public :
|
|
MessageIn active;
|
|
State();
|
|
void processMessage(string msgString);
|
|
void createMessage(Action action, bool success);
|
|
};
|
|
*/
|
|
#endif
|