MotorControlModuleSDFM_TMS3.../Projects/EFC_Communication/UMLibrary/technological/drivecontrol/ControlStateExternal.hh
2024-06-07 11:12:56 +03:00

52 lines
1.6 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* ControlStateExternal.hh
*
* Created on: 27 сент. 2021 г.
* Author: titov
*/
#ifndef UMLIBRARY_TECHNOLOGICAL_DRIVECONTROL_CONTROLSTATEEXTERNAL_HH_
#define UMLIBRARY_TECHNOLOGICAL_DRIVECONTROL_CONTROLSTATEEXTERNAL_HH_
#include "../IExecutorState.hh"
#include "../../systemic/IStatus.hh"
#include "../../systemic/SharedData.hh"
namespace technological { namespace drivecontrol {
struct ControlStateExternalComplite : public IExecutorState {
bool on_entry() { return state.on_entry(); }
bool execute( CommandCode code, const char * args, std::size_t size ) { return state.execute(code, args, size); }
CommandCode isComplite() const { return status ? self_code : disable_code; }
void reset() { return state.reset(); }
void on_exit() { return state.on_exit(); }
ControlStateExternalComplite( IExecutorState & state, systemic::IStatus & status, CommandCode self_code, CommandCode disable_code = 0 );
private:
systemic::IStatus & status;
IExecutorState & state;
CommandCode self_code;
CommandCode disable_code;
};
struct ControlStateExternalArgs : public IExecutorState {
bool on_entry() { return state.on_entry(); }
bool execute( CommandCode code, const char * args, std::size_t size );
CommandCode isComplite() const { return state.isComplite(); }
void reset() { return state.reset(); }
void on_exit() { return state.on_exit(); }
ControlStateExternalArgs( IExecutorState & state, systemic::SharedData args );
private:
systemic::SharedData args;
IExecutorState & state;
};
}}
#endif /* UMLIBRARY_TECHNOLOGICAL_DRIVECONTROL_CONTROLSTATEEXTERNAL_HH_ */