From 34c76e6cd58ef9820b17b43a8af86182452fd710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=B6ftner?= Date: Sun, 12 Nov 2023 14:06:35 +0100 Subject: [PATCH] proof of concept impl of commands over 0mq --- src/emc/flatbuf/emc_cmd.fbs | 543 ++ src/emc/flatbuf/emc_cmd_generated.h | 6624 +++++++++++++++++++++++- src/emc/flatbuf/emc_common.fbs | 6 + src/emc/flatbuf/emc_common_generated.h | 31 + src/emc/task/emctaskmain.cc | 146 +- 5 files changed, 7100 insertions(+), 250 deletions(-) diff --git a/src/emc/flatbuf/emc_cmd.fbs b/src/emc/flatbuf/emc_cmd.fbs index 9915ec47e29..2ec9c53513a 100644 --- a/src/emc/flatbuf/emc_cmd.fbs +++ b/src/emc/flatbuf/emc_cmd.fbs @@ -15,26 +15,569 @@ struct JointSetBacklash { backlash: double; } +// gui struct JointSetMinPositionLimit { joint: int; limit: double; } +// gui struct JointSetMaxPositionLimit { joint: int; limit: double; } +struct JointSetFerror { + joint: int; + ferror: double; +} + +struct JointSetMinFerror { + joint: int; + ferror: double; +} + +struct JointSetHomingParams { + joint: int; + home: double; + offset: double; + home_final_vel: double; + search_vel: double; + latch_vel: double; + use_index: int; + encoder_does_not_reset: int; + ignore_limits: int; + home_sequence: int; + volatile_home: int; + locking_indexer: int; + absolute_encoder: int; +} + +struct JointHalt { + joint: int; +} + +// gui +struct JointHome { + joint: int; +} + +// gui +struct JointUnhome { + joint: int; +} + +// gui +struct JogCont { + joint: int; + vel: double; + jjogmode: int; +} + +// gui +struct JogIncr { + joint: int; + incr: double; + vel: double; + jjogmode: int; +} + +struct JogAbs { + joint: int; + pos: double; + vel: double; + jjogmode: int; +} + +// gui +struct JogStop { + joint: int; + jjogmode: int; +} + +// gui +struct JoinOverrideLimits { + joint: int; +} + +table JoinLoadComp { + file: string; + type: int; +} + +// gui +struct TrajSetMode { + mode: int; +} + +struct TrajSetVelocity { + velocity: double; + ini_maxvel: double; +} + +struct TrajSetAcceleration { + acceleration: double; +} + +// gui +struct TrajSetMaxVelocity { + velocity: double; +} + +// gui +struct TrajSetScale { + scale: double; +} + +// gui +struct TrajSetRapidScale { + scale: double; +} + +// gui +struct TrajSetSpindleScale { + spindle: int; + scale: double; +} + +// gui +struct TrajSetFOEnable { + mode: int; +} + +// gui +struct TrajSetSOEnable { + spindle: int; + mode: int; +} + +// gui +struct TrajSetFHEnable { + mode: int; +} + +struct TrajAbort { + dummy: int; +} + +struct TrajPause { + dummy: int; +} + +struct TrajResume { + dummy: int; +} + +struct TrajDelay { + delay: double; +} + +struct TrajLinearMove { + type: int; + end: Pose; + vel: double; + ini_maxvel: double; + acc: double; + feed_mode: int; + indexer_jnum: int; +} + +table TrajCircularMove { + end: Pose; + center: Cartesian; + normal: Cartesian; + turn: int; + type: int; + vel: double; + ini_maxvel: double; + acc: double; + feed_mode: int; +} + +struct TrajSetTermCond { + cond: int; + tolerance: double; +} + +struct TrajSetSpindleSync { + spindle: int; + feed_per_revolution: double; + velocity_mode: bool; +} + +struct TrajSetOffset { + offset: Pose; +} + +struct TrajSetG5x { + g5x_index: int; + origin: Pose; +} + +struct TrajSetG92 { + origin: Pose; +} + +struct TrajSetRotation { + rotation: double; +} + +struct TrajClearProbeTrippedFlag { + dummy: int; +} + +// gui +struct TrajSetTeleopEnable { + enable: int; +} + +struct TrajProbe { + pos: Pose; + type: int; + vel: double; + ini_maxvel: double; + acc: double; + probe_type: int; +} + +struct TrajRigidTap { + pos: Pose; + vel: double; + ini_maxvel: double; + acc: double; + scale: double; +} + +// gui +struct MotionSetAOut { + index: int; + start: double; + end: double; + now: int; +} + +// gui +struct MotionSetDOut { + index: int; + start: int; + end: int; + now: int; +} + +// gui +struct MotionAdaptive { + status: int; +} + +struct TaskAbort { + dummy: int; +} + +// gui +struct TaskSetMode { + mode: int; +} + +// gui +struct TaskSetState { + state: int; // estop, estop_reset, on, off +} + +// gui +table TaskPlanOpen { + file: string; +} + +// gui +struct TaskPlanRun { + line: int; +} + +// gui +table TaskPlanExecute { + command: string; +} + +// gui +struct TaskPlanReverse { + dummy: int; +} + +// gui +struct TaskPlanForward { + dummy: int; +} + +// gui +struct TaskPlanStep { + dummy: int; +} + +// gui +struct TaskPlanResume { + dummy: int; +} + +struct TaskPlanEnd { + dummy: int; +} + +// gui +struct TaskPlanClose { + dummy: int; +} + +// gui +struct TaskPlanInit { + dummy: int; +} + +// gui +struct TaskPlanSynch { + dummy: int; +} + +// gui +struct TaskPlanSetOptionalStop { + state: bool; +} + +// gui +struct TaskPlanSetBlockDelete { + state: bool; +} + +struct TaskPlanOptionalStop { + dummy: int; +} + +struct ToolCmd { + dummy: int; +} + +struct ToolHalt { + dummy: int; +} + +// gui +struct ToolAbort { + reason: int; +} + +struct ToolPrepare { + tool: int; +} + +struct ToolLoad { + dummy: int; +} + +// gui +table ToolLoadToolTable { + file: string; +} + +// gui +struct ToolSetOffset { + pocket: int; + toolno: int; + offset: Pose; + diameter: double; + frontangle: double; + backangle: double; + orientation: int; +} + +struct ToolSetNumber { + tool: int; +} + +struct AuxInputWait { + index: int; + input_type: int; + wait_type: int; + timeout: double; +} + +struct SpindleSpeed { + spindle: int; + speed: double; + factor: double; + xoffset: double; +} + +struct SpindleOrient { + spindle: int; + orientation: double; + mode: int; +} + +struct SpindleWaitOrient { + spindle: int; + timeout: double; +} + +// gui +struct SpindleOn { + spindle: int; + speed: double; + factor: double; + xoffset: double; + wait_for_spindle_at_speed: int; +} + +// gui +struct SpindleOff { + spindle: int; +} + +// gui +struct SpindleIncrease { + spindle: int; + speed: double; +} + +// gui +struct SpindleDecrease { + spindle: int; + speed: double; +} + +// gui +struct SpindleConstant { + spindle: int; + speed: double; +} + +// gui +struct SpindleBrakeRelease { + spindle: int; +} + +// gui +struct SpindleBrakeEngage { + spindle: int; +} + +// gui +struct CoolandMistOn { + dummy: int; +} + +// gui +struct CoolandMistOff { + dummy: int; +} + +// gui +struct CoolandFloodOn { + dummy: int; +} + +// gui +struct CoolandFloodOff { + dummy: int; +} + union Command { set_debug: SetDebug, jog_cmd: JogCmd, join_set_backlash: JointSetBacklash, joint_set_min_position_limit: JointSetMinPositionLimit, joint_set_max_position_limit: JointSetMaxPositionLimit, + joint_set_ferror: JointSetFerror, + joint_set_min_ferror: JointSetMinFerror, + joint_set_homing_params: JointSetHomingParams, + joint_home: JointHome, + joint_unhome: JointUnhome, + joint_halt: JointHalt, + jog_cont: JogCont, + jog_incr: JogIncr, + jog_abs: JogAbs, + jog_stop: JogStop, + join_override_limits: JoinOverrideLimits, + join_load_comp: JoinLoadComp, + traj_set_mode: TrajSetMode, + traj_set_velocity: TrajSetVelocity, + tral_set_acceleration: TrajSetAcceleration, + traj_set_max_velocity: TrajSetMaxVelocity, + traj_set_scale: TrajSetScale, + traj_set_rapid_scale: TrajSetRapidScale, + traj_set_spindl_scale: TrajSetSpindleScale, + traj_set_fo_enable: TrajSetFOEnable, + traj_set_so_enable: TrajSetSOEnable, + traj_set_fh_enable: TrajSetFHEnable, + traj_abort: TrajAbort, + traj_pause: TrajPause, + traj_resume: TrajResume, + traj_delay: TrajDelay, + traj_linear_move: TrajLinearMove, + traj_circular_move: TrajCircularMove, + traj_set_term_cond: TrajSetTermCond, + traj_set_spindle_sync: TrajSetSpindleSync, + traj_set_offset: TrajSetOffset, + traj_set_g5x: TrajSetG5x, + traj_set_g92: TrajSetG92, + traj_set_rotation: TrajSetRotation, + traj_clear_probe_tripped_flag: TrajClearProbeTrippedFlag, + traj_set_teleop_enable: TrajSetTeleopEnable, + traj_probe: TrajProbe, + traj_rigid_tap: TrajRigidTap, + motion_set_aout: MotionSetAOut, + motion_set_dout: MotionSetDOut, + motion_adaptive: MotionAdaptive, + task_abort: TaskAbort, + task_set_mode: TaskSetMode, + task_set_state: TaskSetState, + task_plan_open: TaskPlanOpen, + task_plan_run: TaskPlanRun, + task_plan_execute: TaskPlanExecute, + task_plan_reverse: TaskPlanReverse, + task_plan_forward: TaskPlanForward, + task_plan_step: TaskPlanStep, + task_plan_resume: TaskPlanResume, + task_plan_end: TaskPlanEnd, + task_plan_close: TaskPlanClose, + task_plan_init: TaskPlanInit, + task_plan_synch: TaskPlanSynch, + task_plan_set_optional_stop: TaskPlanSetOptionalStop, + task_plan_set_block_delete: TaskPlanSetBlockDelete, + task_plan_optional_stop: TaskPlanOptionalStop, + tool_cmd: ToolCmd, + tool_halt: ToolHalt, + tool_abort: ToolAbort, + tool_prepare: ToolPrepare, + tool_load: ToolLoad, + tool_load_tool_table: ToolLoadToolTable, + tool_set_offset: ToolSetOffset, + tool_set_number: ToolSetNumber, + aux_input_wait: AuxInputWait, + spindle_speed: SpindleSpeed, + spindle_orient: SpindleOrient, + spindle_wait_orient: SpindleWaitOrient, + spindle_on: SpindleOn, + spindle_off: SpindleOff, + spindle_increase: SpindleIncrease, + spindle_decrease: SpindleDecrease, + spindle_constant: SpindleConstant, + spindle_brake_release: SpindleBrakeRelease, + spindle_brake_engage: SpindleBrakeEngage, + coolant_mist_on: CoolandMistOn, + coolant_mist_off: CoolandMistOff, + coolant_flood_on: CoolandFloodOn, + cooland_flood_off: CoolandFloodOff } table CmdChannelMsg { command: Command; } +table DebugLevel { + debug_level: int; +} + +table Result { + result: int; +} + root_type CmdChannelMsg; \ No newline at end of file diff --git a/src/emc/flatbuf/emc_cmd_generated.h b/src/emc/flatbuf/emc_cmd_generated.h index 8addd738b3a..ea62533ce45 100644 --- a/src/emc/flatbuf/emc_cmd_generated.h +++ b/src/emc/flatbuf/emc_cmd_generated.h @@ -20,10 +20,190 @@ struct JointSetMinPositionLimit; struct JointSetMaxPositionLimit; +struct JointSetFerror; + +struct JointSetMinFerror; + +struct JointSetHomingParams; + +struct JointHalt; + +struct JointHome; + +struct JointUnhome; + +struct JogCont; + +struct JogIncr; + +struct JogAbs; + +struct JogStop; + +struct JoinOverrideLimits; + +struct JoinLoadComp; +struct JoinLoadCompBuilder; +struct JoinLoadCompT; + +struct TrajSetMode; + +struct TrajSetVelocity; + +struct TrajSetAcceleration; + +struct TrajSetMaxVelocity; + +struct TrajSetScale; + +struct TrajSetRapidScale; + +struct TrajSetSpindleScale; + +struct TrajSetFOEnable; + +struct TrajSetSOEnable; + +struct TrajSetFHEnable; + +struct TrajAbort; + +struct TrajPause; + +struct TrajResume; + +struct TrajDelay; + +struct TrajLinearMove; + +struct TrajCircularMove; +struct TrajCircularMoveBuilder; +struct TrajCircularMoveT; + +struct TrajSetTermCond; + +struct TrajSetSpindleSync; + +struct TrajSetOffset; + +struct TrajSetG5x; + +struct TrajSetG92; + +struct TrajSetRotation; + +struct TrajClearProbeTrippedFlag; + +struct TrajSetTeleopEnable; + +struct TrajProbe; + +struct TrajRigidTap; + +struct MotionSetAOut; + +struct MotionSetDOut; + +struct MotionAdaptive; + +struct TaskAbort; + +struct TaskSetMode; + +struct TaskSetState; + +struct TaskPlanOpen; +struct TaskPlanOpenBuilder; +struct TaskPlanOpenT; + +struct TaskPlanRun; + +struct TaskPlanExecute; +struct TaskPlanExecuteBuilder; +struct TaskPlanExecuteT; + +struct TaskPlanReverse; + +struct TaskPlanForward; + +struct TaskPlanStep; + +struct TaskPlanResume; + +struct TaskPlanEnd; + +struct TaskPlanClose; + +struct TaskPlanInit; + +struct TaskPlanSynch; + +struct TaskPlanSetOptionalStop; + +struct TaskPlanSetBlockDelete; + +struct TaskPlanOptionalStop; + +struct ToolCmd; + +struct ToolHalt; + +struct ToolAbort; + +struct ToolPrepare; + +struct ToolLoad; + +struct ToolLoadToolTable; +struct ToolLoadToolTableBuilder; +struct ToolLoadToolTableT; + +struct ToolSetOffset; + +struct ToolSetNumber; + +struct AuxInputWait; + +struct SpindleSpeed; + +struct SpindleOrient; + +struct SpindleWaitOrient; + +struct SpindleOn; + +struct SpindleOff; + +struct SpindleIncrease; + +struct SpindleDecrease; + +struct SpindleConstant; + +struct SpindleBrakeRelease; + +struct SpindleBrakeEngage; + +struct CoolandMistOn; + +struct CoolandMistOff; + +struct CoolandFloodOn; + +struct CoolandFloodOff; + struct CmdChannelMsg; struct CmdChannelMsgBuilder; struct CmdChannelMsgT; +struct DebugLevel; +struct DebugLevelBuilder; +struct DebugLevelT; + +struct Result; +struct ResultBuilder; +struct ResultT; + enum Command { Command_NONE = 0, Command_set_debug = 1, @@ -31,37 +211,280 @@ enum Command { Command_join_set_backlash = 3, Command_joint_set_min_position_limit = 4, Command_joint_set_max_position_limit = 5, + Command_joint_set_ferror = 6, + Command_joint_set_min_ferror = 7, + Command_joint_set_homing_params = 8, + Command_joint_home = 9, + Command_joint_unhome = 10, + Command_joint_halt = 11, + Command_jog_cont = 12, + Command_jog_incr = 13, + Command_jog_abs = 14, + Command_jog_stop = 15, + Command_join_override_limits = 16, + Command_join_load_comp = 17, + Command_traj_set_mode = 18, + Command_traj_set_velocity = 19, + Command_tral_set_acceleration = 20, + Command_traj_set_max_velocity = 21, + Command_traj_set_scale = 22, + Command_traj_set_rapid_scale = 23, + Command_traj_set_spindl_scale = 24, + Command_traj_set_fo_enable = 25, + Command_traj_set_so_enable = 26, + Command_traj_set_fh_enable = 27, + Command_traj_abort = 28, + Command_traj_pause = 29, + Command_traj_resume = 30, + Command_traj_delay = 31, + Command_traj_linear_move = 32, + Command_traj_circular_move = 33, + Command_traj_set_term_cond = 34, + Command_traj_set_spindle_sync = 35, + Command_traj_set_offset = 36, + Command_traj_set_g5x = 37, + Command_traj_set_g92 = 38, + Command_traj_set_rotation = 39, + Command_traj_clear_probe_tripped_flag = 40, + Command_traj_set_teleop_enable = 41, + Command_traj_probe = 42, + Command_traj_rigid_tap = 43, + Command_motion_set_aout = 44, + Command_motion_set_dout = 45, + Command_motion_adaptive = 46, + Command_task_abort = 47, + Command_task_set_mode = 48, + Command_task_set_state = 49, + Command_task_plan_open = 50, + Command_task_plan_run = 51, + Command_task_plan_execute = 52, + Command_task_plan_reverse = 53, + Command_task_plan_forward = 54, + Command_task_plan_step = 55, + Command_task_plan_resume = 56, + Command_task_plan_end = 57, + Command_task_plan_close = 58, + Command_task_plan_init = 59, + Command_task_plan_synch = 60, + Command_task_plan_set_optional_stop = 61, + Command_task_plan_set_block_delete = 62, + Command_task_plan_optional_stop = 63, + Command_tool_cmd = 64, + Command_tool_halt = 65, + Command_tool_abort = 66, + Command_tool_prepare = 67, + Command_tool_load = 68, + Command_tool_load_tool_table = 69, + Command_tool_set_offset = 70, + Command_tool_set_number = 71, + Command_aux_input_wait = 72, + Command_spindle_speed = 73, + Command_spindle_orient = 74, + Command_spindle_wait_orient = 75, + Command_spindle_on = 76, + Command_spindle_off = 77, + Command_spindle_increase = 78, + Command_spindle_decrease = 79, + Command_spindle_constant = 80, + Command_spindle_brake_release = 81, + Command_spindle_brake_engage = 82, + Command_coolant_mist_on = 83, + Command_coolant_mist_off = 84, + Command_coolant_flood_on = 85, + Command_cooland_flood_off = 86, Command_MIN = Command_NONE, - Command_MAX = Command_joint_set_max_position_limit + Command_MAX = Command_cooland_flood_off }; -inline const Command (&EnumValuesCommand())[6] { +inline const Command (&EnumValuesCommand())[87] { static const Command values[] = { Command_NONE, Command_set_debug, Command_jog_cmd, Command_join_set_backlash, Command_joint_set_min_position_limit, - Command_joint_set_max_position_limit + Command_joint_set_max_position_limit, + Command_joint_set_ferror, + Command_joint_set_min_ferror, + Command_joint_set_homing_params, + Command_joint_home, + Command_joint_unhome, + Command_joint_halt, + Command_jog_cont, + Command_jog_incr, + Command_jog_abs, + Command_jog_stop, + Command_join_override_limits, + Command_join_load_comp, + Command_traj_set_mode, + Command_traj_set_velocity, + Command_tral_set_acceleration, + Command_traj_set_max_velocity, + Command_traj_set_scale, + Command_traj_set_rapid_scale, + Command_traj_set_spindl_scale, + Command_traj_set_fo_enable, + Command_traj_set_so_enable, + Command_traj_set_fh_enable, + Command_traj_abort, + Command_traj_pause, + Command_traj_resume, + Command_traj_delay, + Command_traj_linear_move, + Command_traj_circular_move, + Command_traj_set_term_cond, + Command_traj_set_spindle_sync, + Command_traj_set_offset, + Command_traj_set_g5x, + Command_traj_set_g92, + Command_traj_set_rotation, + Command_traj_clear_probe_tripped_flag, + Command_traj_set_teleop_enable, + Command_traj_probe, + Command_traj_rigid_tap, + Command_motion_set_aout, + Command_motion_set_dout, + Command_motion_adaptive, + Command_task_abort, + Command_task_set_mode, + Command_task_set_state, + Command_task_plan_open, + Command_task_plan_run, + Command_task_plan_execute, + Command_task_plan_reverse, + Command_task_plan_forward, + Command_task_plan_step, + Command_task_plan_resume, + Command_task_plan_end, + Command_task_plan_close, + Command_task_plan_init, + Command_task_plan_synch, + Command_task_plan_set_optional_stop, + Command_task_plan_set_block_delete, + Command_task_plan_optional_stop, + Command_tool_cmd, + Command_tool_halt, + Command_tool_abort, + Command_tool_prepare, + Command_tool_load, + Command_tool_load_tool_table, + Command_tool_set_offset, + Command_tool_set_number, + Command_aux_input_wait, + Command_spindle_speed, + Command_spindle_orient, + Command_spindle_wait_orient, + Command_spindle_on, + Command_spindle_off, + Command_spindle_increase, + Command_spindle_decrease, + Command_spindle_constant, + Command_spindle_brake_release, + Command_spindle_brake_engage, + Command_coolant_mist_on, + Command_coolant_mist_off, + Command_coolant_flood_on, + Command_cooland_flood_off }; return values; } inline const char * const *EnumNamesCommand() { - static const char * const names[7] = { + static const char * const names[88] = { "NONE", "set_debug", "jog_cmd", "join_set_backlash", "joint_set_min_position_limit", "joint_set_max_position_limit", + "joint_set_ferror", + "joint_set_min_ferror", + "joint_set_homing_params", + "joint_home", + "joint_unhome", + "joint_halt", + "jog_cont", + "jog_incr", + "jog_abs", + "jog_stop", + "join_override_limits", + "join_load_comp", + "traj_set_mode", + "traj_set_velocity", + "tral_set_acceleration", + "traj_set_max_velocity", + "traj_set_scale", + "traj_set_rapid_scale", + "traj_set_spindl_scale", + "traj_set_fo_enable", + "traj_set_so_enable", + "traj_set_fh_enable", + "traj_abort", + "traj_pause", + "traj_resume", + "traj_delay", + "traj_linear_move", + "traj_circular_move", + "traj_set_term_cond", + "traj_set_spindle_sync", + "traj_set_offset", + "traj_set_g5x", + "traj_set_g92", + "traj_set_rotation", + "traj_clear_probe_tripped_flag", + "traj_set_teleop_enable", + "traj_probe", + "traj_rigid_tap", + "motion_set_aout", + "motion_set_dout", + "motion_adaptive", + "task_abort", + "task_set_mode", + "task_set_state", + "task_plan_open", + "task_plan_run", + "task_plan_execute", + "task_plan_reverse", + "task_plan_forward", + "task_plan_step", + "task_plan_resume", + "task_plan_end", + "task_plan_close", + "task_plan_init", + "task_plan_synch", + "task_plan_set_optional_stop", + "task_plan_set_block_delete", + "task_plan_optional_stop", + "tool_cmd", + "tool_halt", + "tool_abort", + "tool_prepare", + "tool_load", + "tool_load_tool_table", + "tool_set_offset", + "tool_set_number", + "aux_input_wait", + "spindle_speed", + "spindle_orient", + "spindle_wait_orient", + "spindle_on", + "spindle_off", + "spindle_increase", + "spindle_decrease", + "spindle_constant", + "spindle_brake_release", + "spindle_brake_engage", + "coolant_mist_on", + "coolant_mist_off", + "coolant_flood_on", + "cooland_flood_off", nullptr }; return names; } inline const char *EnumNameCommand(Command e) { - if (flatbuffers::IsOutRange(e, Command_NONE, Command_joint_set_max_position_limit)) return ""; + if (flatbuffers::IsOutRange(e, Command_NONE, Command_cooland_flood_off)) return ""; const size_t index = static_cast(e); return EnumNamesCommand()[index]; } @@ -90,6 +513,330 @@ template<> struct CommandTraits { static const Command enum_value = Command_joint_set_max_position_limit; }; +template<> struct CommandTraits { + static const Command enum_value = Command_joint_set_ferror; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_joint_set_min_ferror; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_joint_set_homing_params; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_joint_home; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_joint_unhome; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_joint_halt; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_jog_cont; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_jog_incr; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_jog_abs; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_jog_stop; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_join_override_limits; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_join_load_comp; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_traj_set_mode; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_traj_set_velocity; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_tral_set_acceleration; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_traj_set_max_velocity; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_traj_set_scale; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_traj_set_rapid_scale; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_traj_set_spindl_scale; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_traj_set_fo_enable; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_traj_set_so_enable; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_traj_set_fh_enable; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_traj_abort; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_traj_pause; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_traj_resume; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_traj_delay; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_traj_linear_move; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_traj_circular_move; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_traj_set_term_cond; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_traj_set_spindle_sync; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_traj_set_offset; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_traj_set_g5x; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_traj_set_g92; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_traj_set_rotation; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_traj_clear_probe_tripped_flag; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_traj_set_teleop_enable; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_traj_probe; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_traj_rigid_tap; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_motion_set_aout; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_motion_set_dout; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_motion_adaptive; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_task_abort; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_task_set_mode; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_task_set_state; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_task_plan_open; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_task_plan_run; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_task_plan_execute; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_task_plan_reverse; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_task_plan_forward; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_task_plan_step; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_task_plan_resume; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_task_plan_end; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_task_plan_close; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_task_plan_init; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_task_plan_synch; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_task_plan_set_optional_stop; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_task_plan_set_block_delete; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_task_plan_optional_stop; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_tool_cmd; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_tool_halt; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_tool_abort; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_tool_prepare; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_tool_load; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_tool_load_tool_table; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_tool_set_offset; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_tool_set_number; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_aux_input_wait; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_spindle_speed; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_spindle_orient; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_spindle_wait_orient; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_spindle_on; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_spindle_off; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_spindle_increase; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_spindle_decrease; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_spindle_constant; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_spindle_brake_release; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_spindle_brake_engage; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_coolant_mist_on; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_coolant_mist_off; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_coolant_flood_on; +}; + +template<> struct CommandTraits { + static const Command enum_value = Command_cooland_flood_off; +}; + struct CommandUnion { Command type; void *value; @@ -162,17 +909,665 @@ struct CommandUnion { return type == Command_joint_set_max_position_limit ? reinterpret_cast(value) : nullptr; } -}; - -bool VerifyCommand(flatbuffers::Verifier &verifier, const void *obj, Command type); -bool VerifyCommandVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); - -FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) SetDebug FLATBUFFERS_FINAL_CLASS { - private: - int32_t debug_level_; - - public: - SetDebug() + EMC::JointSetFerror *Asjoint_set_ferror() { + return type == Command_joint_set_ferror ? + reinterpret_cast(value) : nullptr; + } + const EMC::JointSetFerror *Asjoint_set_ferror() const { + return type == Command_joint_set_ferror ? + reinterpret_cast(value) : nullptr; + } + EMC::JointSetMinFerror *Asjoint_set_min_ferror() { + return type == Command_joint_set_min_ferror ? + reinterpret_cast(value) : nullptr; + } + const EMC::JointSetMinFerror *Asjoint_set_min_ferror() const { + return type == Command_joint_set_min_ferror ? + reinterpret_cast(value) : nullptr; + } + EMC::JointSetHomingParams *Asjoint_set_homing_params() { + return type == Command_joint_set_homing_params ? + reinterpret_cast(value) : nullptr; + } + const EMC::JointSetHomingParams *Asjoint_set_homing_params() const { + return type == Command_joint_set_homing_params ? + reinterpret_cast(value) : nullptr; + } + EMC::JointHome *Asjoint_home() { + return type == Command_joint_home ? + reinterpret_cast(value) : nullptr; + } + const EMC::JointHome *Asjoint_home() const { + return type == Command_joint_home ? + reinterpret_cast(value) : nullptr; + } + EMC::JointUnhome *Asjoint_unhome() { + return type == Command_joint_unhome ? + reinterpret_cast(value) : nullptr; + } + const EMC::JointUnhome *Asjoint_unhome() const { + return type == Command_joint_unhome ? + reinterpret_cast(value) : nullptr; + } + EMC::JointHalt *Asjoint_halt() { + return type == Command_joint_halt ? + reinterpret_cast(value) : nullptr; + } + const EMC::JointHalt *Asjoint_halt() const { + return type == Command_joint_halt ? + reinterpret_cast(value) : nullptr; + } + EMC::JogCont *Asjog_cont() { + return type == Command_jog_cont ? + reinterpret_cast(value) : nullptr; + } + const EMC::JogCont *Asjog_cont() const { + return type == Command_jog_cont ? + reinterpret_cast(value) : nullptr; + } + EMC::JogIncr *Asjog_incr() { + return type == Command_jog_incr ? + reinterpret_cast(value) : nullptr; + } + const EMC::JogIncr *Asjog_incr() const { + return type == Command_jog_incr ? + reinterpret_cast(value) : nullptr; + } + EMC::JogAbs *Asjog_abs() { + return type == Command_jog_abs ? + reinterpret_cast(value) : nullptr; + } + const EMC::JogAbs *Asjog_abs() const { + return type == Command_jog_abs ? + reinterpret_cast(value) : nullptr; + } + EMC::JogStop *Asjog_stop() { + return type == Command_jog_stop ? + reinterpret_cast(value) : nullptr; + } + const EMC::JogStop *Asjog_stop() const { + return type == Command_jog_stop ? + reinterpret_cast(value) : nullptr; + } + EMC::JoinOverrideLimits *Asjoin_override_limits() { + return type == Command_join_override_limits ? + reinterpret_cast(value) : nullptr; + } + const EMC::JoinOverrideLimits *Asjoin_override_limits() const { + return type == Command_join_override_limits ? + reinterpret_cast(value) : nullptr; + } + EMC::JoinLoadCompT *Asjoin_load_comp() { + return type == Command_join_load_comp ? + reinterpret_cast(value) : nullptr; + } + const EMC::JoinLoadCompT *Asjoin_load_comp() const { + return type == Command_join_load_comp ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajSetMode *Astraj_set_mode() { + return type == Command_traj_set_mode ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajSetMode *Astraj_set_mode() const { + return type == Command_traj_set_mode ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajSetVelocity *Astraj_set_velocity() { + return type == Command_traj_set_velocity ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajSetVelocity *Astraj_set_velocity() const { + return type == Command_traj_set_velocity ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajSetAcceleration *Astral_set_acceleration() { + return type == Command_tral_set_acceleration ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajSetAcceleration *Astral_set_acceleration() const { + return type == Command_tral_set_acceleration ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajSetMaxVelocity *Astraj_set_max_velocity() { + return type == Command_traj_set_max_velocity ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajSetMaxVelocity *Astraj_set_max_velocity() const { + return type == Command_traj_set_max_velocity ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajSetScale *Astraj_set_scale() { + return type == Command_traj_set_scale ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajSetScale *Astraj_set_scale() const { + return type == Command_traj_set_scale ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajSetRapidScale *Astraj_set_rapid_scale() { + return type == Command_traj_set_rapid_scale ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajSetRapidScale *Astraj_set_rapid_scale() const { + return type == Command_traj_set_rapid_scale ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajSetSpindleScale *Astraj_set_spindl_scale() { + return type == Command_traj_set_spindl_scale ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajSetSpindleScale *Astraj_set_spindl_scale() const { + return type == Command_traj_set_spindl_scale ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajSetFOEnable *Astraj_set_fo_enable() { + return type == Command_traj_set_fo_enable ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajSetFOEnable *Astraj_set_fo_enable() const { + return type == Command_traj_set_fo_enable ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajSetSOEnable *Astraj_set_so_enable() { + return type == Command_traj_set_so_enable ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajSetSOEnable *Astraj_set_so_enable() const { + return type == Command_traj_set_so_enable ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajSetFHEnable *Astraj_set_fh_enable() { + return type == Command_traj_set_fh_enable ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajSetFHEnable *Astraj_set_fh_enable() const { + return type == Command_traj_set_fh_enable ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajAbort *Astraj_abort() { + return type == Command_traj_abort ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajAbort *Astraj_abort() const { + return type == Command_traj_abort ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajPause *Astraj_pause() { + return type == Command_traj_pause ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajPause *Astraj_pause() const { + return type == Command_traj_pause ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajResume *Astraj_resume() { + return type == Command_traj_resume ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajResume *Astraj_resume() const { + return type == Command_traj_resume ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajDelay *Astraj_delay() { + return type == Command_traj_delay ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajDelay *Astraj_delay() const { + return type == Command_traj_delay ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajLinearMove *Astraj_linear_move() { + return type == Command_traj_linear_move ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajLinearMove *Astraj_linear_move() const { + return type == Command_traj_linear_move ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajCircularMoveT *Astraj_circular_move() { + return type == Command_traj_circular_move ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajCircularMoveT *Astraj_circular_move() const { + return type == Command_traj_circular_move ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajSetTermCond *Astraj_set_term_cond() { + return type == Command_traj_set_term_cond ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajSetTermCond *Astraj_set_term_cond() const { + return type == Command_traj_set_term_cond ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajSetSpindleSync *Astraj_set_spindle_sync() { + return type == Command_traj_set_spindle_sync ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajSetSpindleSync *Astraj_set_spindle_sync() const { + return type == Command_traj_set_spindle_sync ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajSetOffset *Astraj_set_offset() { + return type == Command_traj_set_offset ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajSetOffset *Astraj_set_offset() const { + return type == Command_traj_set_offset ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajSetG5x *Astraj_set_g5x() { + return type == Command_traj_set_g5x ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajSetG5x *Astraj_set_g5x() const { + return type == Command_traj_set_g5x ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajSetG92 *Astraj_set_g92() { + return type == Command_traj_set_g92 ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajSetG92 *Astraj_set_g92() const { + return type == Command_traj_set_g92 ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajSetRotation *Astraj_set_rotation() { + return type == Command_traj_set_rotation ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajSetRotation *Astraj_set_rotation() const { + return type == Command_traj_set_rotation ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajClearProbeTrippedFlag *Astraj_clear_probe_tripped_flag() { + return type == Command_traj_clear_probe_tripped_flag ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajClearProbeTrippedFlag *Astraj_clear_probe_tripped_flag() const { + return type == Command_traj_clear_probe_tripped_flag ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajSetTeleopEnable *Astraj_set_teleop_enable() { + return type == Command_traj_set_teleop_enable ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajSetTeleopEnable *Astraj_set_teleop_enable() const { + return type == Command_traj_set_teleop_enable ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajProbe *Astraj_probe() { + return type == Command_traj_probe ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajProbe *Astraj_probe() const { + return type == Command_traj_probe ? + reinterpret_cast(value) : nullptr; + } + EMC::TrajRigidTap *Astraj_rigid_tap() { + return type == Command_traj_rigid_tap ? + reinterpret_cast(value) : nullptr; + } + const EMC::TrajRigidTap *Astraj_rigid_tap() const { + return type == Command_traj_rigid_tap ? + reinterpret_cast(value) : nullptr; + } + EMC::MotionSetAOut *Asmotion_set_aout() { + return type == Command_motion_set_aout ? + reinterpret_cast(value) : nullptr; + } + const EMC::MotionSetAOut *Asmotion_set_aout() const { + return type == Command_motion_set_aout ? + reinterpret_cast(value) : nullptr; + } + EMC::MotionSetDOut *Asmotion_set_dout() { + return type == Command_motion_set_dout ? + reinterpret_cast(value) : nullptr; + } + const EMC::MotionSetDOut *Asmotion_set_dout() const { + return type == Command_motion_set_dout ? + reinterpret_cast(value) : nullptr; + } + EMC::MotionAdaptive *Asmotion_adaptive() { + return type == Command_motion_adaptive ? + reinterpret_cast(value) : nullptr; + } + const EMC::MotionAdaptive *Asmotion_adaptive() const { + return type == Command_motion_adaptive ? + reinterpret_cast(value) : nullptr; + } + EMC::TaskAbort *Astask_abort() { + return type == Command_task_abort ? + reinterpret_cast(value) : nullptr; + } + const EMC::TaskAbort *Astask_abort() const { + return type == Command_task_abort ? + reinterpret_cast(value) : nullptr; + } + EMC::TaskSetMode *Astask_set_mode() { + return type == Command_task_set_mode ? + reinterpret_cast(value) : nullptr; + } + const EMC::TaskSetMode *Astask_set_mode() const { + return type == Command_task_set_mode ? + reinterpret_cast(value) : nullptr; + } + EMC::TaskSetState *Astask_set_state() { + return type == Command_task_set_state ? + reinterpret_cast(value) : nullptr; + } + const EMC::TaskSetState *Astask_set_state() const { + return type == Command_task_set_state ? + reinterpret_cast(value) : nullptr; + } + EMC::TaskPlanOpenT *Astask_plan_open() { + return type == Command_task_plan_open ? + reinterpret_cast(value) : nullptr; + } + const EMC::TaskPlanOpenT *Astask_plan_open() const { + return type == Command_task_plan_open ? + reinterpret_cast(value) : nullptr; + } + EMC::TaskPlanRun *Astask_plan_run() { + return type == Command_task_plan_run ? + reinterpret_cast(value) : nullptr; + } + const EMC::TaskPlanRun *Astask_plan_run() const { + return type == Command_task_plan_run ? + reinterpret_cast(value) : nullptr; + } + EMC::TaskPlanExecuteT *Astask_plan_execute() { + return type == Command_task_plan_execute ? + reinterpret_cast(value) : nullptr; + } + const EMC::TaskPlanExecuteT *Astask_plan_execute() const { + return type == Command_task_plan_execute ? + reinterpret_cast(value) : nullptr; + } + EMC::TaskPlanReverse *Astask_plan_reverse() { + return type == Command_task_plan_reverse ? + reinterpret_cast(value) : nullptr; + } + const EMC::TaskPlanReverse *Astask_plan_reverse() const { + return type == Command_task_plan_reverse ? + reinterpret_cast(value) : nullptr; + } + EMC::TaskPlanForward *Astask_plan_forward() { + return type == Command_task_plan_forward ? + reinterpret_cast(value) : nullptr; + } + const EMC::TaskPlanForward *Astask_plan_forward() const { + return type == Command_task_plan_forward ? + reinterpret_cast(value) : nullptr; + } + EMC::TaskPlanStep *Astask_plan_step() { + return type == Command_task_plan_step ? + reinterpret_cast(value) : nullptr; + } + const EMC::TaskPlanStep *Astask_plan_step() const { + return type == Command_task_plan_step ? + reinterpret_cast(value) : nullptr; + } + EMC::TaskPlanResume *Astask_plan_resume() { + return type == Command_task_plan_resume ? + reinterpret_cast(value) : nullptr; + } + const EMC::TaskPlanResume *Astask_plan_resume() const { + return type == Command_task_plan_resume ? + reinterpret_cast(value) : nullptr; + } + EMC::TaskPlanEnd *Astask_plan_end() { + return type == Command_task_plan_end ? + reinterpret_cast(value) : nullptr; + } + const EMC::TaskPlanEnd *Astask_plan_end() const { + return type == Command_task_plan_end ? + reinterpret_cast(value) : nullptr; + } + EMC::TaskPlanClose *Astask_plan_close() { + return type == Command_task_plan_close ? + reinterpret_cast(value) : nullptr; + } + const EMC::TaskPlanClose *Astask_plan_close() const { + return type == Command_task_plan_close ? + reinterpret_cast(value) : nullptr; + } + EMC::TaskPlanInit *Astask_plan_init() { + return type == Command_task_plan_init ? + reinterpret_cast(value) : nullptr; + } + const EMC::TaskPlanInit *Astask_plan_init() const { + return type == Command_task_plan_init ? + reinterpret_cast(value) : nullptr; + } + EMC::TaskPlanSynch *Astask_plan_synch() { + return type == Command_task_plan_synch ? + reinterpret_cast(value) : nullptr; + } + const EMC::TaskPlanSynch *Astask_plan_synch() const { + return type == Command_task_plan_synch ? + reinterpret_cast(value) : nullptr; + } + EMC::TaskPlanSetOptionalStop *Astask_plan_set_optional_stop() { + return type == Command_task_plan_set_optional_stop ? + reinterpret_cast(value) : nullptr; + } + const EMC::TaskPlanSetOptionalStop *Astask_plan_set_optional_stop() const { + return type == Command_task_plan_set_optional_stop ? + reinterpret_cast(value) : nullptr; + } + EMC::TaskPlanSetBlockDelete *Astask_plan_set_block_delete() { + return type == Command_task_plan_set_block_delete ? + reinterpret_cast(value) : nullptr; + } + const EMC::TaskPlanSetBlockDelete *Astask_plan_set_block_delete() const { + return type == Command_task_plan_set_block_delete ? + reinterpret_cast(value) : nullptr; + } + EMC::TaskPlanOptionalStop *Astask_plan_optional_stop() { + return type == Command_task_plan_optional_stop ? + reinterpret_cast(value) : nullptr; + } + const EMC::TaskPlanOptionalStop *Astask_plan_optional_stop() const { + return type == Command_task_plan_optional_stop ? + reinterpret_cast(value) : nullptr; + } + EMC::ToolCmd *Astool_cmd() { + return type == Command_tool_cmd ? + reinterpret_cast(value) : nullptr; + } + const EMC::ToolCmd *Astool_cmd() const { + return type == Command_tool_cmd ? + reinterpret_cast(value) : nullptr; + } + EMC::ToolHalt *Astool_halt() { + return type == Command_tool_halt ? + reinterpret_cast(value) : nullptr; + } + const EMC::ToolHalt *Astool_halt() const { + return type == Command_tool_halt ? + reinterpret_cast(value) : nullptr; + } + EMC::ToolAbort *Astool_abort() { + return type == Command_tool_abort ? + reinterpret_cast(value) : nullptr; + } + const EMC::ToolAbort *Astool_abort() const { + return type == Command_tool_abort ? + reinterpret_cast(value) : nullptr; + } + EMC::ToolPrepare *Astool_prepare() { + return type == Command_tool_prepare ? + reinterpret_cast(value) : nullptr; + } + const EMC::ToolPrepare *Astool_prepare() const { + return type == Command_tool_prepare ? + reinterpret_cast(value) : nullptr; + } + EMC::ToolLoad *Astool_load() { + return type == Command_tool_load ? + reinterpret_cast(value) : nullptr; + } + const EMC::ToolLoad *Astool_load() const { + return type == Command_tool_load ? + reinterpret_cast(value) : nullptr; + } + EMC::ToolLoadToolTableT *Astool_load_tool_table() { + return type == Command_tool_load_tool_table ? + reinterpret_cast(value) : nullptr; + } + const EMC::ToolLoadToolTableT *Astool_load_tool_table() const { + return type == Command_tool_load_tool_table ? + reinterpret_cast(value) : nullptr; + } + EMC::ToolSetOffset *Astool_set_offset() { + return type == Command_tool_set_offset ? + reinterpret_cast(value) : nullptr; + } + const EMC::ToolSetOffset *Astool_set_offset() const { + return type == Command_tool_set_offset ? + reinterpret_cast(value) : nullptr; + } + EMC::ToolSetNumber *Astool_set_number() { + return type == Command_tool_set_number ? + reinterpret_cast(value) : nullptr; + } + const EMC::ToolSetNumber *Astool_set_number() const { + return type == Command_tool_set_number ? + reinterpret_cast(value) : nullptr; + } + EMC::AuxInputWait *Asaux_input_wait() { + return type == Command_aux_input_wait ? + reinterpret_cast(value) : nullptr; + } + const EMC::AuxInputWait *Asaux_input_wait() const { + return type == Command_aux_input_wait ? + reinterpret_cast(value) : nullptr; + } + EMC::SpindleSpeed *Asspindle_speed() { + return type == Command_spindle_speed ? + reinterpret_cast(value) : nullptr; + } + const EMC::SpindleSpeed *Asspindle_speed() const { + return type == Command_spindle_speed ? + reinterpret_cast(value) : nullptr; + } + EMC::SpindleOrient *Asspindle_orient() { + return type == Command_spindle_orient ? + reinterpret_cast(value) : nullptr; + } + const EMC::SpindleOrient *Asspindle_orient() const { + return type == Command_spindle_orient ? + reinterpret_cast(value) : nullptr; + } + EMC::SpindleWaitOrient *Asspindle_wait_orient() { + return type == Command_spindle_wait_orient ? + reinterpret_cast(value) : nullptr; + } + const EMC::SpindleWaitOrient *Asspindle_wait_orient() const { + return type == Command_spindle_wait_orient ? + reinterpret_cast(value) : nullptr; + } + EMC::SpindleOn *Asspindle_on() { + return type == Command_spindle_on ? + reinterpret_cast(value) : nullptr; + } + const EMC::SpindleOn *Asspindle_on() const { + return type == Command_spindle_on ? + reinterpret_cast(value) : nullptr; + } + EMC::SpindleOff *Asspindle_off() { + return type == Command_spindle_off ? + reinterpret_cast(value) : nullptr; + } + const EMC::SpindleOff *Asspindle_off() const { + return type == Command_spindle_off ? + reinterpret_cast(value) : nullptr; + } + EMC::SpindleIncrease *Asspindle_increase() { + return type == Command_spindle_increase ? + reinterpret_cast(value) : nullptr; + } + const EMC::SpindleIncrease *Asspindle_increase() const { + return type == Command_spindle_increase ? + reinterpret_cast(value) : nullptr; + } + EMC::SpindleDecrease *Asspindle_decrease() { + return type == Command_spindle_decrease ? + reinterpret_cast(value) : nullptr; + } + const EMC::SpindleDecrease *Asspindle_decrease() const { + return type == Command_spindle_decrease ? + reinterpret_cast(value) : nullptr; + } + EMC::SpindleConstant *Asspindle_constant() { + return type == Command_spindle_constant ? + reinterpret_cast(value) : nullptr; + } + const EMC::SpindleConstant *Asspindle_constant() const { + return type == Command_spindle_constant ? + reinterpret_cast(value) : nullptr; + } + EMC::SpindleBrakeRelease *Asspindle_brake_release() { + return type == Command_spindle_brake_release ? + reinterpret_cast(value) : nullptr; + } + const EMC::SpindleBrakeRelease *Asspindle_brake_release() const { + return type == Command_spindle_brake_release ? + reinterpret_cast(value) : nullptr; + } + EMC::SpindleBrakeEngage *Asspindle_brake_engage() { + return type == Command_spindle_brake_engage ? + reinterpret_cast(value) : nullptr; + } + const EMC::SpindleBrakeEngage *Asspindle_brake_engage() const { + return type == Command_spindle_brake_engage ? + reinterpret_cast(value) : nullptr; + } + EMC::CoolandMistOn *Ascoolant_mist_on() { + return type == Command_coolant_mist_on ? + reinterpret_cast(value) : nullptr; + } + const EMC::CoolandMistOn *Ascoolant_mist_on() const { + return type == Command_coolant_mist_on ? + reinterpret_cast(value) : nullptr; + } + EMC::CoolandMistOff *Ascoolant_mist_off() { + return type == Command_coolant_mist_off ? + reinterpret_cast(value) : nullptr; + } + const EMC::CoolandMistOff *Ascoolant_mist_off() const { + return type == Command_coolant_mist_off ? + reinterpret_cast(value) : nullptr; + } + EMC::CoolandFloodOn *Ascoolant_flood_on() { + return type == Command_coolant_flood_on ? + reinterpret_cast(value) : nullptr; + } + const EMC::CoolandFloodOn *Ascoolant_flood_on() const { + return type == Command_coolant_flood_on ? + reinterpret_cast(value) : nullptr; + } + EMC::CoolandFloodOff *Ascooland_flood_off() { + return type == Command_cooland_flood_off ? + reinterpret_cast(value) : nullptr; + } + const EMC::CoolandFloodOff *Ascooland_flood_off() const { + return type == Command_cooland_flood_off ? + reinterpret_cast(value) : nullptr; + } +}; + +bool VerifyCommand(flatbuffers::Verifier &verifier, const void *obj, Command type); +bool VerifyCommandVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) SetDebug FLATBUFFERS_FINAL_CLASS { + private: + int32_t debug_level_; + + public: + SetDebug() : debug_level_(0) { } SetDebug(int32_t _debug_level) @@ -282,275 +1677,5064 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) JointSetMaxPositionLimit FLATBUFFERS_FINA }; FLATBUFFERS_STRUCT_END(JointSetMaxPositionLimit, 16); -struct CmdChannelMsgT : public flatbuffers::NativeTable { - typedef CmdChannelMsg TableType; - EMC::CommandUnion command; - CmdChannelMsgT() { - } -}; +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) JointSetFerror FLATBUFFERS_FINAL_CLASS { + private: + int32_t joint_; + int32_t padding0__; + double ferror_; -struct CmdChannelMsg FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef CmdChannelMsgT NativeTableType; - typedef CmdChannelMsgBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_COMMAND_TYPE = 4, - VT_COMMAND = 6 - }; - EMC::Command command_type() const { - return static_cast(GetField(VT_COMMAND_TYPE, 0)); + public: + JointSetFerror() + : joint_(0), + padding0__(0), + ferror_(0) { + (void)padding0__; } - const void *command() const { - return GetPointer(VT_COMMAND); + JointSetFerror(int32_t _joint, double _ferror) + : joint_(flatbuffers::EndianScalar(_joint)), + padding0__(0), + ferror_(flatbuffers::EndianScalar(_ferror)) { } - template const T *command_as() const; - const EMC::SetDebug *command_as_set_debug() const { - return command_type() == EMC::Command_set_debug ? static_cast(command()) : nullptr; + int32_t joint() const { + return flatbuffers::EndianScalar(joint_); } - const EMC::JogCmd *command_as_jog_cmd() const { - return command_type() == EMC::Command_jog_cmd ? static_cast(command()) : nullptr; + double ferror() const { + return flatbuffers::EndianScalar(ferror_); } - const EMC::JointSetBacklash *command_as_join_set_backlash() const { - return command_type() == EMC::Command_join_set_backlash ? static_cast(command()) : nullptr; +}; +FLATBUFFERS_STRUCT_END(JointSetFerror, 16); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) JointSetMinFerror FLATBUFFERS_FINAL_CLASS { + private: + int32_t joint_; + int32_t padding0__; + double ferror_; + + public: + JointSetMinFerror() + : joint_(0), + padding0__(0), + ferror_(0) { + (void)padding0__; } - const EMC::JointSetMinPositionLimit *command_as_joint_set_min_position_limit() const { - return command_type() == EMC::Command_joint_set_min_position_limit ? static_cast(command()) : nullptr; + JointSetMinFerror(int32_t _joint, double _ferror) + : joint_(flatbuffers::EndianScalar(_joint)), + padding0__(0), + ferror_(flatbuffers::EndianScalar(_ferror)) { } - const EMC::JointSetMaxPositionLimit *command_as_joint_set_max_position_limit() const { - return command_type() == EMC::Command_joint_set_max_position_limit ? static_cast(command()) : nullptr; + int32_t joint() const { + return flatbuffers::EndianScalar(joint_); } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_COMMAND_TYPE) && - VerifyOffset(verifier, VT_COMMAND) && - VerifyCommand(verifier, command(), command_type()) && - verifier.EndTable(); + double ferror() const { + return flatbuffers::EndianScalar(ferror_); } - CmdChannelMsgT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; - void UnPackTo(CmdChannelMsgT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; - static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const CmdChannelMsgT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; +FLATBUFFERS_STRUCT_END(JointSetMinFerror, 16); -template<> inline const EMC::SetDebug *CmdChannelMsg::command_as() const { - return command_as_set_debug(); -} - -template<> inline const EMC::JogCmd *CmdChannelMsg::command_as() const { - return command_as_jog_cmd(); -} - -template<> inline const EMC::JointSetBacklash *CmdChannelMsg::command_as() const { - return command_as_join_set_backlash(); -} - -template<> inline const EMC::JointSetMinPositionLimit *CmdChannelMsg::command_as() const { - return command_as_joint_set_min_position_limit(); -} +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) JointSetHomingParams FLATBUFFERS_FINAL_CLASS { + private: + int32_t joint_; + int32_t padding0__; + double home_; + double offset_; + double home_final_vel_; + double search_vel_; + double latch_vel_; + int32_t use_index_; + int32_t encoder_does_not_reset_; + int32_t ignore_limits_; + int32_t home_sequence_; + int32_t volatile_home_; + int32_t locking_indexer_; + int32_t absolute_encoder_; + int32_t padding1__; -template<> inline const EMC::JointSetMaxPositionLimit *CmdChannelMsg::command_as() const { - return command_as_joint_set_max_position_limit(); -} + public: + JointSetHomingParams() + : joint_(0), + padding0__(0), + home_(0), + offset_(0), + home_final_vel_(0), + search_vel_(0), + latch_vel_(0), + use_index_(0), + encoder_does_not_reset_(0), + ignore_limits_(0), + home_sequence_(0), + volatile_home_(0), + locking_indexer_(0), + absolute_encoder_(0), + padding1__(0) { + (void)padding0__; + (void)padding1__; + } + JointSetHomingParams(int32_t _joint, double _home, double _offset, double _home_final_vel, double _search_vel, double _latch_vel, int32_t _use_index, int32_t _encoder_does_not_reset, int32_t _ignore_limits, int32_t _home_sequence, int32_t _volatile_home, int32_t _locking_indexer, int32_t _absolute_encoder) + : joint_(flatbuffers::EndianScalar(_joint)), + padding0__(0), + home_(flatbuffers::EndianScalar(_home)), + offset_(flatbuffers::EndianScalar(_offset)), + home_final_vel_(flatbuffers::EndianScalar(_home_final_vel)), + search_vel_(flatbuffers::EndianScalar(_search_vel)), + latch_vel_(flatbuffers::EndianScalar(_latch_vel)), + use_index_(flatbuffers::EndianScalar(_use_index)), + encoder_does_not_reset_(flatbuffers::EndianScalar(_encoder_does_not_reset)), + ignore_limits_(flatbuffers::EndianScalar(_ignore_limits)), + home_sequence_(flatbuffers::EndianScalar(_home_sequence)), + volatile_home_(flatbuffers::EndianScalar(_volatile_home)), + locking_indexer_(flatbuffers::EndianScalar(_locking_indexer)), + absolute_encoder_(flatbuffers::EndianScalar(_absolute_encoder)), + padding1__(0) { + } + int32_t joint() const { + return flatbuffers::EndianScalar(joint_); + } + double home() const { + return flatbuffers::EndianScalar(home_); + } + double offset() const { + return flatbuffers::EndianScalar(offset_); + } + double home_final_vel() const { + return flatbuffers::EndianScalar(home_final_vel_); + } + double search_vel() const { + return flatbuffers::EndianScalar(search_vel_); + } + double latch_vel() const { + return flatbuffers::EndianScalar(latch_vel_); + } + int32_t use_index() const { + return flatbuffers::EndianScalar(use_index_); + } + int32_t encoder_does_not_reset() const { + return flatbuffers::EndianScalar(encoder_does_not_reset_); + } + int32_t ignore_limits() const { + return flatbuffers::EndianScalar(ignore_limits_); + } + int32_t home_sequence() const { + return flatbuffers::EndianScalar(home_sequence_); + } + int32_t volatile_home() const { + return flatbuffers::EndianScalar(volatile_home_); + } + int32_t locking_indexer() const { + return flatbuffers::EndianScalar(locking_indexer_); + } + int32_t absolute_encoder() const { + return flatbuffers::EndianScalar(absolute_encoder_); + } +}; +FLATBUFFERS_STRUCT_END(JointSetHomingParams, 80); -struct CmdChannelMsgBuilder { - typedef CmdChannelMsg Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_command_type(EMC::Command command_type) { - fbb_.AddElement(CmdChannelMsg::VT_COMMAND_TYPE, static_cast(command_type), 0); +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) JointHalt FLATBUFFERS_FINAL_CLASS { + private: + int32_t joint_; + + public: + JointHalt() + : joint_(0) { } - void add_command(flatbuffers::Offset command) { - fbb_.AddOffset(CmdChannelMsg::VT_COMMAND, command); + JointHalt(int32_t _joint) + : joint_(flatbuffers::EndianScalar(_joint)) { } - explicit CmdChannelMsgBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); + int32_t joint() const { + return flatbuffers::EndianScalar(joint_); } - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; +}; +FLATBUFFERS_STRUCT_END(JointHalt, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) JointHome FLATBUFFERS_FINAL_CLASS { + private: + int32_t joint_; + + public: + JointHome() + : joint_(0) { + } + JointHome(int32_t _joint) + : joint_(flatbuffers::EndianScalar(_joint)) { + } + int32_t joint() const { + return flatbuffers::EndianScalar(joint_); } }; +FLATBUFFERS_STRUCT_END(JointHome, 4); -inline flatbuffers::Offset CreateCmdChannelMsg( - flatbuffers::FlatBufferBuilder &_fbb, - EMC::Command command_type = EMC::Command_NONE, - flatbuffers::Offset command = 0) { - CmdChannelMsgBuilder builder_(_fbb); - builder_.add_command(command); - builder_.add_command_type(command_type); - return builder_.Finish(); -} +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) JointUnhome FLATBUFFERS_FINAL_CLASS { + private: + int32_t joint_; -flatbuffers::Offset CreateCmdChannelMsg(flatbuffers::FlatBufferBuilder &_fbb, const CmdChannelMsgT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); + public: + JointUnhome() + : joint_(0) { + } + JointUnhome(int32_t _joint) + : joint_(flatbuffers::EndianScalar(_joint)) { + } + int32_t joint() const { + return flatbuffers::EndianScalar(joint_); + } +}; +FLATBUFFERS_STRUCT_END(JointUnhome, 4); -inline CmdChannelMsgT *CmdChannelMsg::UnPack(const flatbuffers::resolver_function_t *_resolver) const { - std::unique_ptr _o = std::unique_ptr(new CmdChannelMsgT()); - UnPackTo(_o.get(), _resolver); - return _o.release(); -} +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) JogCont FLATBUFFERS_FINAL_CLASS { + private: + int32_t joint_; + int32_t padding0__; + double vel_; + int32_t jjogmode_; + int32_t padding1__; -inline void CmdChannelMsg::UnPackTo(CmdChannelMsgT *_o, const flatbuffers::resolver_function_t *_resolver) const { - (void)_o; - (void)_resolver; - { auto _e = command_type(); _o->command.type = _e; } - { auto _e = command(); if (_e) _o->command.value = EMC::CommandUnion::UnPack(_e, command_type(), _resolver); } -} + public: + JogCont() + : joint_(0), + padding0__(0), + vel_(0), + jjogmode_(0), + padding1__(0) { + (void)padding0__; + (void)padding1__; + } + JogCont(int32_t _joint, double _vel, int32_t _jjogmode) + : joint_(flatbuffers::EndianScalar(_joint)), + padding0__(0), + vel_(flatbuffers::EndianScalar(_vel)), + jjogmode_(flatbuffers::EndianScalar(_jjogmode)), + padding1__(0) { + } + int32_t joint() const { + return flatbuffers::EndianScalar(joint_); + } + double vel() const { + return flatbuffers::EndianScalar(vel_); + } + int32_t jjogmode() const { + return flatbuffers::EndianScalar(jjogmode_); + } +}; +FLATBUFFERS_STRUCT_END(JogCont, 24); -inline flatbuffers::Offset CmdChannelMsg::Pack(flatbuffers::FlatBufferBuilder &_fbb, const CmdChannelMsgT* _o, const flatbuffers::rehasher_function_t *_rehasher) { - return CreateCmdChannelMsg(_fbb, _o, _rehasher); -} +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) JogIncr FLATBUFFERS_FINAL_CLASS { + private: + int32_t joint_; + int32_t padding0__; + double incr_; + double vel_; + int32_t jjogmode_; + int32_t padding1__; -inline flatbuffers::Offset CreateCmdChannelMsg(flatbuffers::FlatBufferBuilder &_fbb, const CmdChannelMsgT *_o, const flatbuffers::rehasher_function_t *_rehasher) { - (void)_rehasher; - (void)_o; - struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const CmdChannelMsgT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; - auto _command_type = _o->command.type; - auto _command = _o->command.Pack(_fbb); - return EMC::CreateCmdChannelMsg( - _fbb, - _command_type, - _command); -} + public: + JogIncr() + : joint_(0), + padding0__(0), + incr_(0), + vel_(0), + jjogmode_(0), + padding1__(0) { + (void)padding0__; + (void)padding1__; + } + JogIncr(int32_t _joint, double _incr, double _vel, int32_t _jjogmode) + : joint_(flatbuffers::EndianScalar(_joint)), + padding0__(0), + incr_(flatbuffers::EndianScalar(_incr)), + vel_(flatbuffers::EndianScalar(_vel)), + jjogmode_(flatbuffers::EndianScalar(_jjogmode)), + padding1__(0) { + } + int32_t joint() const { + return flatbuffers::EndianScalar(joint_); + } + double incr() const { + return flatbuffers::EndianScalar(incr_); + } + double vel() const { + return flatbuffers::EndianScalar(vel_); + } + int32_t jjogmode() const { + return flatbuffers::EndianScalar(jjogmode_); + } +}; +FLATBUFFERS_STRUCT_END(JogIncr, 32); -inline bool VerifyCommand(flatbuffers::Verifier &verifier, const void *obj, Command type) { - switch (type) { - case Command_NONE: { - return true; +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) JogAbs FLATBUFFERS_FINAL_CLASS { + private: + int32_t joint_; + int32_t padding0__; + double pos_; + double vel_; + int32_t jjogmode_; + int32_t padding1__; + + public: + JogAbs() + : joint_(0), + padding0__(0), + pos_(0), + vel_(0), + jjogmode_(0), + padding1__(0) { + (void)padding0__; + (void)padding1__; + } + JogAbs(int32_t _joint, double _pos, double _vel, int32_t _jjogmode) + : joint_(flatbuffers::EndianScalar(_joint)), + padding0__(0), + pos_(flatbuffers::EndianScalar(_pos)), + vel_(flatbuffers::EndianScalar(_vel)), + jjogmode_(flatbuffers::EndianScalar(_jjogmode)), + padding1__(0) { + } + int32_t joint() const { + return flatbuffers::EndianScalar(joint_); + } + double pos() const { + return flatbuffers::EndianScalar(pos_); + } + double vel() const { + return flatbuffers::EndianScalar(vel_); + } + int32_t jjogmode() const { + return flatbuffers::EndianScalar(jjogmode_); + } +}; +FLATBUFFERS_STRUCT_END(JogAbs, 32); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) JogStop FLATBUFFERS_FINAL_CLASS { + private: + int32_t joint_; + int32_t jjogmode_; + + public: + JogStop() + : joint_(0), + jjogmode_(0) { + } + JogStop(int32_t _joint, int32_t _jjogmode) + : joint_(flatbuffers::EndianScalar(_joint)), + jjogmode_(flatbuffers::EndianScalar(_jjogmode)) { + } + int32_t joint() const { + return flatbuffers::EndianScalar(joint_); + } + int32_t jjogmode() const { + return flatbuffers::EndianScalar(jjogmode_); + } +}; +FLATBUFFERS_STRUCT_END(JogStop, 8); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) JoinOverrideLimits FLATBUFFERS_FINAL_CLASS { + private: + int32_t joint_; + + public: + JoinOverrideLimits() + : joint_(0) { + } + JoinOverrideLimits(int32_t _joint) + : joint_(flatbuffers::EndianScalar(_joint)) { + } + int32_t joint() const { + return flatbuffers::EndianScalar(joint_); + } +}; +FLATBUFFERS_STRUCT_END(JoinOverrideLimits, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) TrajSetMode FLATBUFFERS_FINAL_CLASS { + private: + int32_t mode_; + + public: + TrajSetMode() + : mode_(0) { + } + TrajSetMode(int32_t _mode) + : mode_(flatbuffers::EndianScalar(_mode)) { + } + int32_t mode() const { + return flatbuffers::EndianScalar(mode_); + } +}; +FLATBUFFERS_STRUCT_END(TrajSetMode, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) TrajSetVelocity FLATBUFFERS_FINAL_CLASS { + private: + double velocity_; + double ini_maxvel_; + + public: + TrajSetVelocity() + : velocity_(0), + ini_maxvel_(0) { + } + TrajSetVelocity(double _velocity, double _ini_maxvel) + : velocity_(flatbuffers::EndianScalar(_velocity)), + ini_maxvel_(flatbuffers::EndianScalar(_ini_maxvel)) { + } + double velocity() const { + return flatbuffers::EndianScalar(velocity_); + } + double ini_maxvel() const { + return flatbuffers::EndianScalar(ini_maxvel_); + } +}; +FLATBUFFERS_STRUCT_END(TrajSetVelocity, 16); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) TrajSetAcceleration FLATBUFFERS_FINAL_CLASS { + private: + double acceleration_; + + public: + TrajSetAcceleration() + : acceleration_(0) { + } + TrajSetAcceleration(double _acceleration) + : acceleration_(flatbuffers::EndianScalar(_acceleration)) { + } + double acceleration() const { + return flatbuffers::EndianScalar(acceleration_); + } +}; +FLATBUFFERS_STRUCT_END(TrajSetAcceleration, 8); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) TrajSetMaxVelocity FLATBUFFERS_FINAL_CLASS { + private: + double velocity_; + + public: + TrajSetMaxVelocity() + : velocity_(0) { + } + TrajSetMaxVelocity(double _velocity) + : velocity_(flatbuffers::EndianScalar(_velocity)) { + } + double velocity() const { + return flatbuffers::EndianScalar(velocity_); + } +}; +FLATBUFFERS_STRUCT_END(TrajSetMaxVelocity, 8); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) TrajSetScale FLATBUFFERS_FINAL_CLASS { + private: + double scale_; + + public: + TrajSetScale() + : scale_(0) { + } + TrajSetScale(double _scale) + : scale_(flatbuffers::EndianScalar(_scale)) { + } + double scale() const { + return flatbuffers::EndianScalar(scale_); + } +}; +FLATBUFFERS_STRUCT_END(TrajSetScale, 8); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) TrajSetRapidScale FLATBUFFERS_FINAL_CLASS { + private: + double scale_; + + public: + TrajSetRapidScale() + : scale_(0) { + } + TrajSetRapidScale(double _scale) + : scale_(flatbuffers::EndianScalar(_scale)) { + } + double scale() const { + return flatbuffers::EndianScalar(scale_); + } +}; +FLATBUFFERS_STRUCT_END(TrajSetRapidScale, 8); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) TrajSetSpindleScale FLATBUFFERS_FINAL_CLASS { + private: + int32_t spindle_; + int32_t padding0__; + double scale_; + + public: + TrajSetSpindleScale() + : spindle_(0), + padding0__(0), + scale_(0) { + (void)padding0__; + } + TrajSetSpindleScale(int32_t _spindle, double _scale) + : spindle_(flatbuffers::EndianScalar(_spindle)), + padding0__(0), + scale_(flatbuffers::EndianScalar(_scale)) { + } + int32_t spindle() const { + return flatbuffers::EndianScalar(spindle_); + } + double scale() const { + return flatbuffers::EndianScalar(scale_); + } +}; +FLATBUFFERS_STRUCT_END(TrajSetSpindleScale, 16); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) TrajSetFOEnable FLATBUFFERS_FINAL_CLASS { + private: + int32_t mode_; + + public: + TrajSetFOEnable() + : mode_(0) { + } + TrajSetFOEnable(int32_t _mode) + : mode_(flatbuffers::EndianScalar(_mode)) { + } + int32_t mode() const { + return flatbuffers::EndianScalar(mode_); + } +}; +FLATBUFFERS_STRUCT_END(TrajSetFOEnable, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) TrajSetSOEnable FLATBUFFERS_FINAL_CLASS { + private: + int32_t spindle_; + int32_t mode_; + + public: + TrajSetSOEnable() + : spindle_(0), + mode_(0) { + } + TrajSetSOEnable(int32_t _spindle, int32_t _mode) + : spindle_(flatbuffers::EndianScalar(_spindle)), + mode_(flatbuffers::EndianScalar(_mode)) { + } + int32_t spindle() const { + return flatbuffers::EndianScalar(spindle_); + } + int32_t mode() const { + return flatbuffers::EndianScalar(mode_); + } +}; +FLATBUFFERS_STRUCT_END(TrajSetSOEnable, 8); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) TrajSetFHEnable FLATBUFFERS_FINAL_CLASS { + private: + int32_t mode_; + + public: + TrajSetFHEnable() + : mode_(0) { + } + TrajSetFHEnable(int32_t _mode) + : mode_(flatbuffers::EndianScalar(_mode)) { + } + int32_t mode() const { + return flatbuffers::EndianScalar(mode_); + } +}; +FLATBUFFERS_STRUCT_END(TrajSetFHEnable, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) TrajAbort FLATBUFFERS_FINAL_CLASS { + private: + int32_t dummy_; + + public: + TrajAbort() + : dummy_(0) { + } + TrajAbort(int32_t _dummy) + : dummy_(flatbuffers::EndianScalar(_dummy)) { + } + int32_t dummy() const { + return flatbuffers::EndianScalar(dummy_); + } +}; +FLATBUFFERS_STRUCT_END(TrajAbort, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) TrajPause FLATBUFFERS_FINAL_CLASS { + private: + int32_t dummy_; + + public: + TrajPause() + : dummy_(0) { + } + TrajPause(int32_t _dummy) + : dummy_(flatbuffers::EndianScalar(_dummy)) { + } + int32_t dummy() const { + return flatbuffers::EndianScalar(dummy_); + } +}; +FLATBUFFERS_STRUCT_END(TrajPause, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) TrajResume FLATBUFFERS_FINAL_CLASS { + private: + int32_t dummy_; + + public: + TrajResume() + : dummy_(0) { + } + TrajResume(int32_t _dummy) + : dummy_(flatbuffers::EndianScalar(_dummy)) { + } + int32_t dummy() const { + return flatbuffers::EndianScalar(dummy_); + } +}; +FLATBUFFERS_STRUCT_END(TrajResume, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) TrajDelay FLATBUFFERS_FINAL_CLASS { + private: + double delay_; + + public: + TrajDelay() + : delay_(0) { + } + TrajDelay(double _delay) + : delay_(flatbuffers::EndianScalar(_delay)) { + } + double delay() const { + return flatbuffers::EndianScalar(delay_); + } +}; +FLATBUFFERS_STRUCT_END(TrajDelay, 8); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) TrajLinearMove FLATBUFFERS_FINAL_CLASS { + private: + int32_t type_; + int32_t padding0__; + EMC::Pose end_; + double vel_; + double ini_maxvel_; + double acc_; + int32_t feed_mode_; + int32_t indexer_jnum_; + + public: + TrajLinearMove() + : type_(0), + padding0__(0), + end_(), + vel_(0), + ini_maxvel_(0), + acc_(0), + feed_mode_(0), + indexer_jnum_(0) { + (void)padding0__; + } + TrajLinearMove(int32_t _type, const EMC::Pose &_end, double _vel, double _ini_maxvel, double _acc, int32_t _feed_mode, int32_t _indexer_jnum) + : type_(flatbuffers::EndianScalar(_type)), + padding0__(0), + end_(_end), + vel_(flatbuffers::EndianScalar(_vel)), + ini_maxvel_(flatbuffers::EndianScalar(_ini_maxvel)), + acc_(flatbuffers::EndianScalar(_acc)), + feed_mode_(flatbuffers::EndianScalar(_feed_mode)), + indexer_jnum_(flatbuffers::EndianScalar(_indexer_jnum)) { + } + int32_t type() const { + return flatbuffers::EndianScalar(type_); + } + const EMC::Pose &end() const { + return end_; + } + double vel() const { + return flatbuffers::EndianScalar(vel_); + } + double ini_maxvel() const { + return flatbuffers::EndianScalar(ini_maxvel_); + } + double acc() const { + return flatbuffers::EndianScalar(acc_); + } + int32_t feed_mode() const { + return flatbuffers::EndianScalar(feed_mode_); + } + int32_t indexer_jnum() const { + return flatbuffers::EndianScalar(indexer_jnum_); + } +}; +FLATBUFFERS_STRUCT_END(TrajLinearMove, 112); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) TrajSetTermCond FLATBUFFERS_FINAL_CLASS { + private: + int32_t cond_; + int32_t padding0__; + double tolerance_; + + public: + TrajSetTermCond() + : cond_(0), + padding0__(0), + tolerance_(0) { + (void)padding0__; + } + TrajSetTermCond(int32_t _cond, double _tolerance) + : cond_(flatbuffers::EndianScalar(_cond)), + padding0__(0), + tolerance_(flatbuffers::EndianScalar(_tolerance)) { + } + int32_t cond() const { + return flatbuffers::EndianScalar(cond_); + } + double tolerance() const { + return flatbuffers::EndianScalar(tolerance_); + } +}; +FLATBUFFERS_STRUCT_END(TrajSetTermCond, 16); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) TrajSetSpindleSync FLATBUFFERS_FINAL_CLASS { + private: + int32_t spindle_; + int32_t padding0__; + double feed_per_revolution_; + uint8_t velocity_mode_; + int8_t padding1__; int16_t padding2__; int32_t padding3__; + + public: + TrajSetSpindleSync() + : spindle_(0), + padding0__(0), + feed_per_revolution_(0), + velocity_mode_(0), + padding1__(0), + padding2__(0), + padding3__(0) { + (void)padding0__; + (void)padding1__; + (void)padding2__; + (void)padding3__; + } + TrajSetSpindleSync(int32_t _spindle, double _feed_per_revolution, bool _velocity_mode) + : spindle_(flatbuffers::EndianScalar(_spindle)), + padding0__(0), + feed_per_revolution_(flatbuffers::EndianScalar(_feed_per_revolution)), + velocity_mode_(flatbuffers::EndianScalar(static_cast(_velocity_mode))), + padding1__(0), + padding2__(0), + padding3__(0) { + } + int32_t spindle() const { + return flatbuffers::EndianScalar(spindle_); + } + double feed_per_revolution() const { + return flatbuffers::EndianScalar(feed_per_revolution_); + } + bool velocity_mode() const { + return flatbuffers::EndianScalar(velocity_mode_) != 0; + } +}; +FLATBUFFERS_STRUCT_END(TrajSetSpindleSync, 24); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) TrajSetOffset FLATBUFFERS_FINAL_CLASS { + private: + EMC::Pose offset_; + + public: + TrajSetOffset() + : offset_() { + } + TrajSetOffset(const EMC::Pose &_offset) + : offset_(_offset) { + } + const EMC::Pose &offset() const { + return offset_; + } +}; +FLATBUFFERS_STRUCT_END(TrajSetOffset, 72); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) TrajSetG5x FLATBUFFERS_FINAL_CLASS { + private: + int32_t g5x_index_; + int32_t padding0__; + EMC::Pose origin_; + + public: + TrajSetG5x() + : g5x_index_(0), + padding0__(0), + origin_() { + (void)padding0__; + } + TrajSetG5x(int32_t _g5x_index, const EMC::Pose &_origin) + : g5x_index_(flatbuffers::EndianScalar(_g5x_index)), + padding0__(0), + origin_(_origin) { + } + int32_t g5x_index() const { + return flatbuffers::EndianScalar(g5x_index_); + } + const EMC::Pose &origin() const { + return origin_; + } +}; +FLATBUFFERS_STRUCT_END(TrajSetG5x, 80); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) TrajSetG92 FLATBUFFERS_FINAL_CLASS { + private: + EMC::Pose origin_; + + public: + TrajSetG92() + : origin_() { + } + TrajSetG92(const EMC::Pose &_origin) + : origin_(_origin) { + } + const EMC::Pose &origin() const { + return origin_; + } +}; +FLATBUFFERS_STRUCT_END(TrajSetG92, 72); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) TrajSetRotation FLATBUFFERS_FINAL_CLASS { + private: + double rotation_; + + public: + TrajSetRotation() + : rotation_(0) { + } + TrajSetRotation(double _rotation) + : rotation_(flatbuffers::EndianScalar(_rotation)) { + } + double rotation() const { + return flatbuffers::EndianScalar(rotation_); + } +}; +FLATBUFFERS_STRUCT_END(TrajSetRotation, 8); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) TrajClearProbeTrippedFlag FLATBUFFERS_FINAL_CLASS { + private: + int32_t dummy_; + + public: + TrajClearProbeTrippedFlag() + : dummy_(0) { + } + TrajClearProbeTrippedFlag(int32_t _dummy) + : dummy_(flatbuffers::EndianScalar(_dummy)) { + } + int32_t dummy() const { + return flatbuffers::EndianScalar(dummy_); + } +}; +FLATBUFFERS_STRUCT_END(TrajClearProbeTrippedFlag, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) TrajSetTeleopEnable FLATBUFFERS_FINAL_CLASS { + private: + int32_t enable_; + + public: + TrajSetTeleopEnable() + : enable_(0) { + } + TrajSetTeleopEnable(int32_t _enable) + : enable_(flatbuffers::EndianScalar(_enable)) { + } + int32_t enable() const { + return flatbuffers::EndianScalar(enable_); + } +}; +FLATBUFFERS_STRUCT_END(TrajSetTeleopEnable, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) TrajProbe FLATBUFFERS_FINAL_CLASS { + private: + EMC::Pose pos_; + int32_t type_; + int32_t padding0__; + double vel_; + double ini_maxvel_; + double acc_; + int32_t probe_type_; + int32_t padding1__; + + public: + TrajProbe() + : pos_(), + type_(0), + padding0__(0), + vel_(0), + ini_maxvel_(0), + acc_(0), + probe_type_(0), + padding1__(0) { + (void)padding0__; + (void)padding1__; + } + TrajProbe(const EMC::Pose &_pos, int32_t _type, double _vel, double _ini_maxvel, double _acc, int32_t _probe_type) + : pos_(_pos), + type_(flatbuffers::EndianScalar(_type)), + padding0__(0), + vel_(flatbuffers::EndianScalar(_vel)), + ini_maxvel_(flatbuffers::EndianScalar(_ini_maxvel)), + acc_(flatbuffers::EndianScalar(_acc)), + probe_type_(flatbuffers::EndianScalar(_probe_type)), + padding1__(0) { + } + const EMC::Pose &pos() const { + return pos_; + } + int32_t type() const { + return flatbuffers::EndianScalar(type_); + } + double vel() const { + return flatbuffers::EndianScalar(vel_); + } + double ini_maxvel() const { + return flatbuffers::EndianScalar(ini_maxvel_); + } + double acc() const { + return flatbuffers::EndianScalar(acc_); + } + int32_t probe_type() const { + return flatbuffers::EndianScalar(probe_type_); + } +}; +FLATBUFFERS_STRUCT_END(TrajProbe, 112); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) TrajRigidTap FLATBUFFERS_FINAL_CLASS { + private: + EMC::Pose pos_; + double vel_; + double ini_maxvel_; + double acc_; + double scale_; + + public: + TrajRigidTap() + : pos_(), + vel_(0), + ini_maxvel_(0), + acc_(0), + scale_(0) { + } + TrajRigidTap(const EMC::Pose &_pos, double _vel, double _ini_maxvel, double _acc, double _scale) + : pos_(_pos), + vel_(flatbuffers::EndianScalar(_vel)), + ini_maxvel_(flatbuffers::EndianScalar(_ini_maxvel)), + acc_(flatbuffers::EndianScalar(_acc)), + scale_(flatbuffers::EndianScalar(_scale)) { + } + const EMC::Pose &pos() const { + return pos_; + } + double vel() const { + return flatbuffers::EndianScalar(vel_); + } + double ini_maxvel() const { + return flatbuffers::EndianScalar(ini_maxvel_); + } + double acc() const { + return flatbuffers::EndianScalar(acc_); + } + double scale() const { + return flatbuffers::EndianScalar(scale_); + } +}; +FLATBUFFERS_STRUCT_END(TrajRigidTap, 104); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) MotionSetAOut FLATBUFFERS_FINAL_CLASS { + private: + int32_t index_; + int32_t padding0__; + double start_; + double end_; + int32_t now_; + int32_t padding1__; + + public: + MotionSetAOut() + : index_(0), + padding0__(0), + start_(0), + end_(0), + now_(0), + padding1__(0) { + (void)padding0__; + (void)padding1__; + } + MotionSetAOut(int32_t _index, double _start, double _end, int32_t _now) + : index_(flatbuffers::EndianScalar(_index)), + padding0__(0), + start_(flatbuffers::EndianScalar(_start)), + end_(flatbuffers::EndianScalar(_end)), + now_(flatbuffers::EndianScalar(_now)), + padding1__(0) { + } + int32_t index() const { + return flatbuffers::EndianScalar(index_); + } + double start() const { + return flatbuffers::EndianScalar(start_); + } + double end() const { + return flatbuffers::EndianScalar(end_); + } + int32_t now() const { + return flatbuffers::EndianScalar(now_); + } +}; +FLATBUFFERS_STRUCT_END(MotionSetAOut, 32); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) MotionSetDOut FLATBUFFERS_FINAL_CLASS { + private: + int32_t index_; + int32_t start_; + int32_t end_; + int32_t now_; + + public: + MotionSetDOut() + : index_(0), + start_(0), + end_(0), + now_(0) { + } + MotionSetDOut(int32_t _index, int32_t _start, int32_t _end, int32_t _now) + : index_(flatbuffers::EndianScalar(_index)), + start_(flatbuffers::EndianScalar(_start)), + end_(flatbuffers::EndianScalar(_end)), + now_(flatbuffers::EndianScalar(_now)) { + } + int32_t index() const { + return flatbuffers::EndianScalar(index_); + } + int32_t start() const { + return flatbuffers::EndianScalar(start_); + } + int32_t end() const { + return flatbuffers::EndianScalar(end_); + } + int32_t now() const { + return flatbuffers::EndianScalar(now_); + } +}; +FLATBUFFERS_STRUCT_END(MotionSetDOut, 16); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) MotionAdaptive FLATBUFFERS_FINAL_CLASS { + private: + int32_t status_; + + public: + MotionAdaptive() + : status_(0) { + } + MotionAdaptive(int32_t _status) + : status_(flatbuffers::EndianScalar(_status)) { + } + int32_t status() const { + return flatbuffers::EndianScalar(status_); + } +}; +FLATBUFFERS_STRUCT_END(MotionAdaptive, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) TaskAbort FLATBUFFERS_FINAL_CLASS { + private: + int32_t dummy_; + + public: + TaskAbort() + : dummy_(0) { + } + TaskAbort(int32_t _dummy) + : dummy_(flatbuffers::EndianScalar(_dummy)) { + } + int32_t dummy() const { + return flatbuffers::EndianScalar(dummy_); + } +}; +FLATBUFFERS_STRUCT_END(TaskAbort, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) TaskSetMode FLATBUFFERS_FINAL_CLASS { + private: + int32_t mode_; + + public: + TaskSetMode() + : mode_(0) { + } + TaskSetMode(int32_t _mode) + : mode_(flatbuffers::EndianScalar(_mode)) { + } + int32_t mode() const { + return flatbuffers::EndianScalar(mode_); + } +}; +FLATBUFFERS_STRUCT_END(TaskSetMode, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) TaskSetState FLATBUFFERS_FINAL_CLASS { + private: + int32_t state_; + + public: + TaskSetState() + : state_(0) { + } + TaskSetState(int32_t _state) + : state_(flatbuffers::EndianScalar(_state)) { + } + int32_t state() const { + return flatbuffers::EndianScalar(state_); + } +}; +FLATBUFFERS_STRUCT_END(TaskSetState, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) TaskPlanRun FLATBUFFERS_FINAL_CLASS { + private: + int32_t line_; + + public: + TaskPlanRun() + : line_(0) { + } + TaskPlanRun(int32_t _line) + : line_(flatbuffers::EndianScalar(_line)) { + } + int32_t line() const { + return flatbuffers::EndianScalar(line_); + } +}; +FLATBUFFERS_STRUCT_END(TaskPlanRun, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) TaskPlanReverse FLATBUFFERS_FINAL_CLASS { + private: + int32_t dummy_; + + public: + TaskPlanReverse() + : dummy_(0) { + } + TaskPlanReverse(int32_t _dummy) + : dummy_(flatbuffers::EndianScalar(_dummy)) { + } + int32_t dummy() const { + return flatbuffers::EndianScalar(dummy_); + } +}; +FLATBUFFERS_STRUCT_END(TaskPlanReverse, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) TaskPlanForward FLATBUFFERS_FINAL_CLASS { + private: + int32_t dummy_; + + public: + TaskPlanForward() + : dummy_(0) { + } + TaskPlanForward(int32_t _dummy) + : dummy_(flatbuffers::EndianScalar(_dummy)) { + } + int32_t dummy() const { + return flatbuffers::EndianScalar(dummy_); + } +}; +FLATBUFFERS_STRUCT_END(TaskPlanForward, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) TaskPlanStep FLATBUFFERS_FINAL_CLASS { + private: + int32_t dummy_; + + public: + TaskPlanStep() + : dummy_(0) { + } + TaskPlanStep(int32_t _dummy) + : dummy_(flatbuffers::EndianScalar(_dummy)) { + } + int32_t dummy() const { + return flatbuffers::EndianScalar(dummy_); + } +}; +FLATBUFFERS_STRUCT_END(TaskPlanStep, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) TaskPlanResume FLATBUFFERS_FINAL_CLASS { + private: + int32_t dummy_; + + public: + TaskPlanResume() + : dummy_(0) { + } + TaskPlanResume(int32_t _dummy) + : dummy_(flatbuffers::EndianScalar(_dummy)) { + } + int32_t dummy() const { + return flatbuffers::EndianScalar(dummy_); + } +}; +FLATBUFFERS_STRUCT_END(TaskPlanResume, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) TaskPlanEnd FLATBUFFERS_FINAL_CLASS { + private: + int32_t dummy_; + + public: + TaskPlanEnd() + : dummy_(0) { + } + TaskPlanEnd(int32_t _dummy) + : dummy_(flatbuffers::EndianScalar(_dummy)) { + } + int32_t dummy() const { + return flatbuffers::EndianScalar(dummy_); + } +}; +FLATBUFFERS_STRUCT_END(TaskPlanEnd, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) TaskPlanClose FLATBUFFERS_FINAL_CLASS { + private: + int32_t dummy_; + + public: + TaskPlanClose() + : dummy_(0) { + } + TaskPlanClose(int32_t _dummy) + : dummy_(flatbuffers::EndianScalar(_dummy)) { + } + int32_t dummy() const { + return flatbuffers::EndianScalar(dummy_); + } +}; +FLATBUFFERS_STRUCT_END(TaskPlanClose, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) TaskPlanInit FLATBUFFERS_FINAL_CLASS { + private: + int32_t dummy_; + + public: + TaskPlanInit() + : dummy_(0) { + } + TaskPlanInit(int32_t _dummy) + : dummy_(flatbuffers::EndianScalar(_dummy)) { + } + int32_t dummy() const { + return flatbuffers::EndianScalar(dummy_); + } +}; +FLATBUFFERS_STRUCT_END(TaskPlanInit, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) TaskPlanSynch FLATBUFFERS_FINAL_CLASS { + private: + int32_t dummy_; + + public: + TaskPlanSynch() + : dummy_(0) { + } + TaskPlanSynch(int32_t _dummy) + : dummy_(flatbuffers::EndianScalar(_dummy)) { + } + int32_t dummy() const { + return flatbuffers::EndianScalar(dummy_); + } +}; +FLATBUFFERS_STRUCT_END(TaskPlanSynch, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) TaskPlanSetOptionalStop FLATBUFFERS_FINAL_CLASS { + private: + uint8_t state_; + + public: + TaskPlanSetOptionalStop() + : state_(0) { + } + TaskPlanSetOptionalStop(bool _state) + : state_(flatbuffers::EndianScalar(static_cast(_state))) { + } + bool state() const { + return flatbuffers::EndianScalar(state_) != 0; + } +}; +FLATBUFFERS_STRUCT_END(TaskPlanSetOptionalStop, 1); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) TaskPlanSetBlockDelete FLATBUFFERS_FINAL_CLASS { + private: + uint8_t state_; + + public: + TaskPlanSetBlockDelete() + : state_(0) { + } + TaskPlanSetBlockDelete(bool _state) + : state_(flatbuffers::EndianScalar(static_cast(_state))) { + } + bool state() const { + return flatbuffers::EndianScalar(state_) != 0; + } +}; +FLATBUFFERS_STRUCT_END(TaskPlanSetBlockDelete, 1); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) TaskPlanOptionalStop FLATBUFFERS_FINAL_CLASS { + private: + int32_t dummy_; + + public: + TaskPlanOptionalStop() + : dummy_(0) { + } + TaskPlanOptionalStop(int32_t _dummy) + : dummy_(flatbuffers::EndianScalar(_dummy)) { + } + int32_t dummy() const { + return flatbuffers::EndianScalar(dummy_); + } +}; +FLATBUFFERS_STRUCT_END(TaskPlanOptionalStop, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) ToolCmd FLATBUFFERS_FINAL_CLASS { + private: + int32_t dummy_; + + public: + ToolCmd() + : dummy_(0) { + } + ToolCmd(int32_t _dummy) + : dummy_(flatbuffers::EndianScalar(_dummy)) { + } + int32_t dummy() const { + return flatbuffers::EndianScalar(dummy_); + } +}; +FLATBUFFERS_STRUCT_END(ToolCmd, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) ToolHalt FLATBUFFERS_FINAL_CLASS { + private: + int32_t dummy_; + + public: + ToolHalt() + : dummy_(0) { + } + ToolHalt(int32_t _dummy) + : dummy_(flatbuffers::EndianScalar(_dummy)) { + } + int32_t dummy() const { + return flatbuffers::EndianScalar(dummy_); + } +}; +FLATBUFFERS_STRUCT_END(ToolHalt, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) ToolAbort FLATBUFFERS_FINAL_CLASS { + private: + int32_t reason_; + + public: + ToolAbort() + : reason_(0) { + } + ToolAbort(int32_t _reason) + : reason_(flatbuffers::EndianScalar(_reason)) { + } + int32_t reason() const { + return flatbuffers::EndianScalar(reason_); + } +}; +FLATBUFFERS_STRUCT_END(ToolAbort, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) ToolPrepare FLATBUFFERS_FINAL_CLASS { + private: + int32_t tool_; + + public: + ToolPrepare() + : tool_(0) { + } + ToolPrepare(int32_t _tool) + : tool_(flatbuffers::EndianScalar(_tool)) { + } + int32_t tool() const { + return flatbuffers::EndianScalar(tool_); + } +}; +FLATBUFFERS_STRUCT_END(ToolPrepare, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) ToolLoad FLATBUFFERS_FINAL_CLASS { + private: + int32_t dummy_; + + public: + ToolLoad() + : dummy_(0) { + } + ToolLoad(int32_t _dummy) + : dummy_(flatbuffers::EndianScalar(_dummy)) { + } + int32_t dummy() const { + return flatbuffers::EndianScalar(dummy_); + } +}; +FLATBUFFERS_STRUCT_END(ToolLoad, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) ToolSetOffset FLATBUFFERS_FINAL_CLASS { + private: + int32_t pocket_; + int32_t toolno_; + EMC::Pose offset_; + double diameter_; + double frontangle_; + double backangle_; + int32_t orientation_; + int32_t padding0__; + + public: + ToolSetOffset() + : pocket_(0), + toolno_(0), + offset_(), + diameter_(0), + frontangle_(0), + backangle_(0), + orientation_(0), + padding0__(0) { + (void)padding0__; + } + ToolSetOffset(int32_t _pocket, int32_t _toolno, const EMC::Pose &_offset, double _diameter, double _frontangle, double _backangle, int32_t _orientation) + : pocket_(flatbuffers::EndianScalar(_pocket)), + toolno_(flatbuffers::EndianScalar(_toolno)), + offset_(_offset), + diameter_(flatbuffers::EndianScalar(_diameter)), + frontangle_(flatbuffers::EndianScalar(_frontangle)), + backangle_(flatbuffers::EndianScalar(_backangle)), + orientation_(flatbuffers::EndianScalar(_orientation)), + padding0__(0) { + } + int32_t pocket() const { + return flatbuffers::EndianScalar(pocket_); + } + int32_t toolno() const { + return flatbuffers::EndianScalar(toolno_); + } + const EMC::Pose &offset() const { + return offset_; + } + double diameter() const { + return flatbuffers::EndianScalar(diameter_); + } + double frontangle() const { + return flatbuffers::EndianScalar(frontangle_); + } + double backangle() const { + return flatbuffers::EndianScalar(backangle_); + } + int32_t orientation() const { + return flatbuffers::EndianScalar(orientation_); + } +}; +FLATBUFFERS_STRUCT_END(ToolSetOffset, 112); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) ToolSetNumber FLATBUFFERS_FINAL_CLASS { + private: + int32_t tool_; + + public: + ToolSetNumber() + : tool_(0) { + } + ToolSetNumber(int32_t _tool) + : tool_(flatbuffers::EndianScalar(_tool)) { + } + int32_t tool() const { + return flatbuffers::EndianScalar(tool_); + } +}; +FLATBUFFERS_STRUCT_END(ToolSetNumber, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) AuxInputWait FLATBUFFERS_FINAL_CLASS { + private: + int32_t index_; + int32_t input_type_; + int32_t wait_type_; + int32_t padding0__; + double timeout_; + + public: + AuxInputWait() + : index_(0), + input_type_(0), + wait_type_(0), + padding0__(0), + timeout_(0) { + (void)padding0__; + } + AuxInputWait(int32_t _index, int32_t _input_type, int32_t _wait_type, double _timeout) + : index_(flatbuffers::EndianScalar(_index)), + input_type_(flatbuffers::EndianScalar(_input_type)), + wait_type_(flatbuffers::EndianScalar(_wait_type)), + padding0__(0), + timeout_(flatbuffers::EndianScalar(_timeout)) { + } + int32_t index() const { + return flatbuffers::EndianScalar(index_); + } + int32_t input_type() const { + return flatbuffers::EndianScalar(input_type_); + } + int32_t wait_type() const { + return flatbuffers::EndianScalar(wait_type_); + } + double timeout() const { + return flatbuffers::EndianScalar(timeout_); + } +}; +FLATBUFFERS_STRUCT_END(AuxInputWait, 24); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) SpindleSpeed FLATBUFFERS_FINAL_CLASS { + private: + int32_t spindle_; + int32_t padding0__; + double speed_; + double factor_; + double xoffset_; + + public: + SpindleSpeed() + : spindle_(0), + padding0__(0), + speed_(0), + factor_(0), + xoffset_(0) { + (void)padding0__; + } + SpindleSpeed(int32_t _spindle, double _speed, double _factor, double _xoffset) + : spindle_(flatbuffers::EndianScalar(_spindle)), + padding0__(0), + speed_(flatbuffers::EndianScalar(_speed)), + factor_(flatbuffers::EndianScalar(_factor)), + xoffset_(flatbuffers::EndianScalar(_xoffset)) { + } + int32_t spindle() const { + return flatbuffers::EndianScalar(spindle_); + } + double speed() const { + return flatbuffers::EndianScalar(speed_); + } + double factor() const { + return flatbuffers::EndianScalar(factor_); + } + double xoffset() const { + return flatbuffers::EndianScalar(xoffset_); + } +}; +FLATBUFFERS_STRUCT_END(SpindleSpeed, 32); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) SpindleOrient FLATBUFFERS_FINAL_CLASS { + private: + int32_t spindle_; + int32_t padding0__; + double orientation_; + int32_t mode_; + int32_t padding1__; + + public: + SpindleOrient() + : spindle_(0), + padding0__(0), + orientation_(0), + mode_(0), + padding1__(0) { + (void)padding0__; + (void)padding1__; + } + SpindleOrient(int32_t _spindle, double _orientation, int32_t _mode) + : spindle_(flatbuffers::EndianScalar(_spindle)), + padding0__(0), + orientation_(flatbuffers::EndianScalar(_orientation)), + mode_(flatbuffers::EndianScalar(_mode)), + padding1__(0) { + } + int32_t spindle() const { + return flatbuffers::EndianScalar(spindle_); + } + double orientation() const { + return flatbuffers::EndianScalar(orientation_); + } + int32_t mode() const { + return flatbuffers::EndianScalar(mode_); + } +}; +FLATBUFFERS_STRUCT_END(SpindleOrient, 24); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) SpindleWaitOrient FLATBUFFERS_FINAL_CLASS { + private: + int32_t spindle_; + int32_t padding0__; + double timeout_; + + public: + SpindleWaitOrient() + : spindle_(0), + padding0__(0), + timeout_(0) { + (void)padding0__; + } + SpindleWaitOrient(int32_t _spindle, double _timeout) + : spindle_(flatbuffers::EndianScalar(_spindle)), + padding0__(0), + timeout_(flatbuffers::EndianScalar(_timeout)) { + } + int32_t spindle() const { + return flatbuffers::EndianScalar(spindle_); + } + double timeout() const { + return flatbuffers::EndianScalar(timeout_); + } +}; +FLATBUFFERS_STRUCT_END(SpindleWaitOrient, 16); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) SpindleOn FLATBUFFERS_FINAL_CLASS { + private: + int32_t spindle_; + int32_t padding0__; + double speed_; + double factor_; + double xoffset_; + int32_t wait_for_spindle_at_speed_; + int32_t padding1__; + + public: + SpindleOn() + : spindle_(0), + padding0__(0), + speed_(0), + factor_(0), + xoffset_(0), + wait_for_spindle_at_speed_(0), + padding1__(0) { + (void)padding0__; + (void)padding1__; + } + SpindleOn(int32_t _spindle, double _speed, double _factor, double _xoffset, int32_t _wait_for_spindle_at_speed) + : spindle_(flatbuffers::EndianScalar(_spindle)), + padding0__(0), + speed_(flatbuffers::EndianScalar(_speed)), + factor_(flatbuffers::EndianScalar(_factor)), + xoffset_(flatbuffers::EndianScalar(_xoffset)), + wait_for_spindle_at_speed_(flatbuffers::EndianScalar(_wait_for_spindle_at_speed)), + padding1__(0) { + } + int32_t spindle() const { + return flatbuffers::EndianScalar(spindle_); + } + double speed() const { + return flatbuffers::EndianScalar(speed_); + } + double factor() const { + return flatbuffers::EndianScalar(factor_); + } + double xoffset() const { + return flatbuffers::EndianScalar(xoffset_); + } + int32_t wait_for_spindle_at_speed() const { + return flatbuffers::EndianScalar(wait_for_spindle_at_speed_); + } +}; +FLATBUFFERS_STRUCT_END(SpindleOn, 40); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) SpindleOff FLATBUFFERS_FINAL_CLASS { + private: + int32_t spindle_; + + public: + SpindleOff() + : spindle_(0) { + } + SpindleOff(int32_t _spindle) + : spindle_(flatbuffers::EndianScalar(_spindle)) { + } + int32_t spindle() const { + return flatbuffers::EndianScalar(spindle_); + } +}; +FLATBUFFERS_STRUCT_END(SpindleOff, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) SpindleIncrease FLATBUFFERS_FINAL_CLASS { + private: + int32_t spindle_; + int32_t padding0__; + double speed_; + + public: + SpindleIncrease() + : spindle_(0), + padding0__(0), + speed_(0) { + (void)padding0__; + } + SpindleIncrease(int32_t _spindle, double _speed) + : spindle_(flatbuffers::EndianScalar(_spindle)), + padding0__(0), + speed_(flatbuffers::EndianScalar(_speed)) { + } + int32_t spindle() const { + return flatbuffers::EndianScalar(spindle_); + } + double speed() const { + return flatbuffers::EndianScalar(speed_); + } +}; +FLATBUFFERS_STRUCT_END(SpindleIncrease, 16); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) SpindleDecrease FLATBUFFERS_FINAL_CLASS { + private: + int32_t spindle_; + int32_t padding0__; + double speed_; + + public: + SpindleDecrease() + : spindle_(0), + padding0__(0), + speed_(0) { + (void)padding0__; + } + SpindleDecrease(int32_t _spindle, double _speed) + : spindle_(flatbuffers::EndianScalar(_spindle)), + padding0__(0), + speed_(flatbuffers::EndianScalar(_speed)) { + } + int32_t spindle() const { + return flatbuffers::EndianScalar(spindle_); + } + double speed() const { + return flatbuffers::EndianScalar(speed_); + } +}; +FLATBUFFERS_STRUCT_END(SpindleDecrease, 16); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) SpindleConstant FLATBUFFERS_FINAL_CLASS { + private: + int32_t spindle_; + int32_t padding0__; + double speed_; + + public: + SpindleConstant() + : spindle_(0), + padding0__(0), + speed_(0) { + (void)padding0__; + } + SpindleConstant(int32_t _spindle, double _speed) + : spindle_(flatbuffers::EndianScalar(_spindle)), + padding0__(0), + speed_(flatbuffers::EndianScalar(_speed)) { + } + int32_t spindle() const { + return flatbuffers::EndianScalar(spindle_); + } + double speed() const { + return flatbuffers::EndianScalar(speed_); + } +}; +FLATBUFFERS_STRUCT_END(SpindleConstant, 16); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) SpindleBrakeRelease FLATBUFFERS_FINAL_CLASS { + private: + int32_t spindle_; + + public: + SpindleBrakeRelease() + : spindle_(0) { + } + SpindleBrakeRelease(int32_t _spindle) + : spindle_(flatbuffers::EndianScalar(_spindle)) { + } + int32_t spindle() const { + return flatbuffers::EndianScalar(spindle_); + } +}; +FLATBUFFERS_STRUCT_END(SpindleBrakeRelease, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) SpindleBrakeEngage FLATBUFFERS_FINAL_CLASS { + private: + int32_t spindle_; + + public: + SpindleBrakeEngage() + : spindle_(0) { + } + SpindleBrakeEngage(int32_t _spindle) + : spindle_(flatbuffers::EndianScalar(_spindle)) { + } + int32_t spindle() const { + return flatbuffers::EndianScalar(spindle_); + } +}; +FLATBUFFERS_STRUCT_END(SpindleBrakeEngage, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) CoolandMistOn FLATBUFFERS_FINAL_CLASS { + private: + int32_t dummy_; + + public: + CoolandMistOn() + : dummy_(0) { + } + CoolandMistOn(int32_t _dummy) + : dummy_(flatbuffers::EndianScalar(_dummy)) { + } + int32_t dummy() const { + return flatbuffers::EndianScalar(dummy_); + } +}; +FLATBUFFERS_STRUCT_END(CoolandMistOn, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) CoolandMistOff FLATBUFFERS_FINAL_CLASS { + private: + int32_t dummy_; + + public: + CoolandMistOff() + : dummy_(0) { + } + CoolandMistOff(int32_t _dummy) + : dummy_(flatbuffers::EndianScalar(_dummy)) { + } + int32_t dummy() const { + return flatbuffers::EndianScalar(dummy_); + } +}; +FLATBUFFERS_STRUCT_END(CoolandMistOff, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) CoolandFloodOn FLATBUFFERS_FINAL_CLASS { + private: + int32_t dummy_; + + public: + CoolandFloodOn() + : dummy_(0) { + } + CoolandFloodOn(int32_t _dummy) + : dummy_(flatbuffers::EndianScalar(_dummy)) { + } + int32_t dummy() const { + return flatbuffers::EndianScalar(dummy_); + } +}; +FLATBUFFERS_STRUCT_END(CoolandFloodOn, 4); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) CoolandFloodOff FLATBUFFERS_FINAL_CLASS { + private: + int32_t dummy_; + + public: + CoolandFloodOff() + : dummy_(0) { + } + CoolandFloodOff(int32_t _dummy) + : dummy_(flatbuffers::EndianScalar(_dummy)) { + } + int32_t dummy() const { + return flatbuffers::EndianScalar(dummy_); + } +}; +FLATBUFFERS_STRUCT_END(CoolandFloodOff, 4); + +struct JoinLoadCompT : public flatbuffers::NativeTable { + typedef JoinLoadComp TableType; + std::string file; + int32_t type; + JoinLoadCompT() + : type(0) { + } +}; + +struct JoinLoadComp FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef JoinLoadCompT NativeTableType; + typedef JoinLoadCompBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_FILE = 4, + VT_TYPE = 6 + }; + const flatbuffers::String *file() const { + return GetPointer(VT_FILE); + } + int32_t type() const { + return GetField(VT_TYPE, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_FILE) && + verifier.VerifyString(file()) && + VerifyField(verifier, VT_TYPE) && + verifier.EndTable(); + } + JoinLoadCompT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; + void UnPackTo(JoinLoadCompT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; + static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const JoinLoadCompT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); +}; + +struct JoinLoadCompBuilder { + typedef JoinLoadComp Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_file(flatbuffers::Offset file) { + fbb_.AddOffset(JoinLoadComp::VT_FILE, file); + } + void add_type(int32_t type) { + fbb_.AddElement(JoinLoadComp::VT_TYPE, type, 0); + } + explicit JoinLoadCompBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateJoinLoadComp( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset file = 0, + int32_t type = 0) { + JoinLoadCompBuilder builder_(_fbb); + builder_.add_type(type); + builder_.add_file(file); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateJoinLoadCompDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *file = nullptr, + int32_t type = 0) { + auto file__ = file ? _fbb.CreateString(file) : 0; + return EMC::CreateJoinLoadComp( + _fbb, + file__, + type); +} + +flatbuffers::Offset CreateJoinLoadComp(flatbuffers::FlatBufferBuilder &_fbb, const JoinLoadCompT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); + +struct TrajCircularMoveT : public flatbuffers::NativeTable { + typedef TrajCircularMove TableType; + std::unique_ptr end; + std::unique_ptr center; + std::unique_ptr normal; + int32_t turn; + int32_t type; + double vel; + double ini_maxvel; + double acc; + int32_t feed_mode; + TrajCircularMoveT() + : turn(0), + type(0), + vel(0.0), + ini_maxvel(0.0), + acc(0.0), + feed_mode(0) { + } +}; + +struct TrajCircularMove FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef TrajCircularMoveT NativeTableType; + typedef TrajCircularMoveBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_END = 4, + VT_CENTER = 6, + VT_NORMAL = 8, + VT_TURN = 10, + VT_TYPE = 12, + VT_VEL = 14, + VT_INI_MAXVEL = 16, + VT_ACC = 18, + VT_FEED_MODE = 20 + }; + const EMC::Pose *end() const { + return GetStruct(VT_END); + } + const EMC::Cartesian *center() const { + return GetStruct(VT_CENTER); + } + const EMC::Cartesian *normal() const { + return GetStruct(VT_NORMAL); + } + int32_t turn() const { + return GetField(VT_TURN, 0); + } + int32_t type() const { + return GetField(VT_TYPE, 0); + } + double vel() const { + return GetField(VT_VEL, 0.0); + } + double ini_maxvel() const { + return GetField(VT_INI_MAXVEL, 0.0); + } + double acc() const { + return GetField(VT_ACC, 0.0); + } + int32_t feed_mode() const { + return GetField(VT_FEED_MODE, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_END) && + VerifyField(verifier, VT_CENTER) && + VerifyField(verifier, VT_NORMAL) && + VerifyField(verifier, VT_TURN) && + VerifyField(verifier, VT_TYPE) && + VerifyField(verifier, VT_VEL) && + VerifyField(verifier, VT_INI_MAXVEL) && + VerifyField(verifier, VT_ACC) && + VerifyField(verifier, VT_FEED_MODE) && + verifier.EndTable(); + } + TrajCircularMoveT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; + void UnPackTo(TrajCircularMoveT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; + static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const TrajCircularMoveT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); +}; + +struct TrajCircularMoveBuilder { + typedef TrajCircularMove Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_end(const EMC::Pose *end) { + fbb_.AddStruct(TrajCircularMove::VT_END, end); + } + void add_center(const EMC::Cartesian *center) { + fbb_.AddStruct(TrajCircularMove::VT_CENTER, center); + } + void add_normal(const EMC::Cartesian *normal) { + fbb_.AddStruct(TrajCircularMove::VT_NORMAL, normal); + } + void add_turn(int32_t turn) { + fbb_.AddElement(TrajCircularMove::VT_TURN, turn, 0); + } + void add_type(int32_t type) { + fbb_.AddElement(TrajCircularMove::VT_TYPE, type, 0); + } + void add_vel(double vel) { + fbb_.AddElement(TrajCircularMove::VT_VEL, vel, 0.0); + } + void add_ini_maxvel(double ini_maxvel) { + fbb_.AddElement(TrajCircularMove::VT_INI_MAXVEL, ini_maxvel, 0.0); + } + void add_acc(double acc) { + fbb_.AddElement(TrajCircularMove::VT_ACC, acc, 0.0); + } + void add_feed_mode(int32_t feed_mode) { + fbb_.AddElement(TrajCircularMove::VT_FEED_MODE, feed_mode, 0); + } + explicit TrajCircularMoveBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateTrajCircularMove( + flatbuffers::FlatBufferBuilder &_fbb, + const EMC::Pose *end = 0, + const EMC::Cartesian *center = 0, + const EMC::Cartesian *normal = 0, + int32_t turn = 0, + int32_t type = 0, + double vel = 0.0, + double ini_maxvel = 0.0, + double acc = 0.0, + int32_t feed_mode = 0) { + TrajCircularMoveBuilder builder_(_fbb); + builder_.add_acc(acc); + builder_.add_ini_maxvel(ini_maxvel); + builder_.add_vel(vel); + builder_.add_feed_mode(feed_mode); + builder_.add_type(type); + builder_.add_turn(turn); + builder_.add_normal(normal); + builder_.add_center(center); + builder_.add_end(end); + return builder_.Finish(); +} + +flatbuffers::Offset CreateTrajCircularMove(flatbuffers::FlatBufferBuilder &_fbb, const TrajCircularMoveT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); + +struct TaskPlanOpenT : public flatbuffers::NativeTable { + typedef TaskPlanOpen TableType; + std::string file; + TaskPlanOpenT() { + } +}; + +struct TaskPlanOpen FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef TaskPlanOpenT NativeTableType; + typedef TaskPlanOpenBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_FILE = 4 + }; + const flatbuffers::String *file() const { + return GetPointer(VT_FILE); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_FILE) && + verifier.VerifyString(file()) && + verifier.EndTable(); + } + TaskPlanOpenT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; + void UnPackTo(TaskPlanOpenT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; + static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const TaskPlanOpenT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); +}; + +struct TaskPlanOpenBuilder { + typedef TaskPlanOpen Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_file(flatbuffers::Offset file) { + fbb_.AddOffset(TaskPlanOpen::VT_FILE, file); + } + explicit TaskPlanOpenBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateTaskPlanOpen( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset file = 0) { + TaskPlanOpenBuilder builder_(_fbb); + builder_.add_file(file); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateTaskPlanOpenDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *file = nullptr) { + auto file__ = file ? _fbb.CreateString(file) : 0; + return EMC::CreateTaskPlanOpen( + _fbb, + file__); +} + +flatbuffers::Offset CreateTaskPlanOpen(flatbuffers::FlatBufferBuilder &_fbb, const TaskPlanOpenT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); + +struct TaskPlanExecuteT : public flatbuffers::NativeTable { + typedef TaskPlanExecute TableType; + std::string command; + TaskPlanExecuteT() { + } +}; + +struct TaskPlanExecute FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef TaskPlanExecuteT NativeTableType; + typedef TaskPlanExecuteBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_COMMAND = 4 + }; + const flatbuffers::String *command() const { + return GetPointer(VT_COMMAND); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_COMMAND) && + verifier.VerifyString(command()) && + verifier.EndTable(); + } + TaskPlanExecuteT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; + void UnPackTo(TaskPlanExecuteT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; + static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const TaskPlanExecuteT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); +}; + +struct TaskPlanExecuteBuilder { + typedef TaskPlanExecute Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_command(flatbuffers::Offset command) { + fbb_.AddOffset(TaskPlanExecute::VT_COMMAND, command); + } + explicit TaskPlanExecuteBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateTaskPlanExecute( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset command = 0) { + TaskPlanExecuteBuilder builder_(_fbb); + builder_.add_command(command); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateTaskPlanExecuteDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *command = nullptr) { + auto command__ = command ? _fbb.CreateString(command) : 0; + return EMC::CreateTaskPlanExecute( + _fbb, + command__); +} + +flatbuffers::Offset CreateTaskPlanExecute(flatbuffers::FlatBufferBuilder &_fbb, const TaskPlanExecuteT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); + +struct ToolLoadToolTableT : public flatbuffers::NativeTable { + typedef ToolLoadToolTable TableType; + std::string file; + ToolLoadToolTableT() { + } +}; + +struct ToolLoadToolTable FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef ToolLoadToolTableT NativeTableType; + typedef ToolLoadToolTableBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_FILE = 4 + }; + const flatbuffers::String *file() const { + return GetPointer(VT_FILE); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_FILE) && + verifier.VerifyString(file()) && + verifier.EndTable(); + } + ToolLoadToolTableT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; + void UnPackTo(ToolLoadToolTableT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; + static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const ToolLoadToolTableT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); +}; + +struct ToolLoadToolTableBuilder { + typedef ToolLoadToolTable Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_file(flatbuffers::Offset file) { + fbb_.AddOffset(ToolLoadToolTable::VT_FILE, file); + } + explicit ToolLoadToolTableBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateToolLoadToolTable( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset file = 0) { + ToolLoadToolTableBuilder builder_(_fbb); + builder_.add_file(file); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateToolLoadToolTableDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *file = nullptr) { + auto file__ = file ? _fbb.CreateString(file) : 0; + return EMC::CreateToolLoadToolTable( + _fbb, + file__); +} + +flatbuffers::Offset CreateToolLoadToolTable(flatbuffers::FlatBufferBuilder &_fbb, const ToolLoadToolTableT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); + +struct CmdChannelMsgT : public flatbuffers::NativeTable { + typedef CmdChannelMsg TableType; + EMC::CommandUnion command; + CmdChannelMsgT() { + } +}; + +struct CmdChannelMsg FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef CmdChannelMsgT NativeTableType; + typedef CmdChannelMsgBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_COMMAND_TYPE = 4, + VT_COMMAND = 6 + }; + EMC::Command command_type() const { + return static_cast(GetField(VT_COMMAND_TYPE, 0)); + } + const void *command() const { + return GetPointer(VT_COMMAND); + } + template const T *command_as() const; + const EMC::SetDebug *command_as_set_debug() const { + return command_type() == EMC::Command_set_debug ? static_cast(command()) : nullptr; + } + const EMC::JogCmd *command_as_jog_cmd() const { + return command_type() == EMC::Command_jog_cmd ? static_cast(command()) : nullptr; + } + const EMC::JointSetBacklash *command_as_join_set_backlash() const { + return command_type() == EMC::Command_join_set_backlash ? static_cast(command()) : nullptr; + } + const EMC::JointSetMinPositionLimit *command_as_joint_set_min_position_limit() const { + return command_type() == EMC::Command_joint_set_min_position_limit ? static_cast(command()) : nullptr; + } + const EMC::JointSetMaxPositionLimit *command_as_joint_set_max_position_limit() const { + return command_type() == EMC::Command_joint_set_max_position_limit ? static_cast(command()) : nullptr; + } + const EMC::JointSetFerror *command_as_joint_set_ferror() const { + return command_type() == EMC::Command_joint_set_ferror ? static_cast(command()) : nullptr; + } + const EMC::JointSetMinFerror *command_as_joint_set_min_ferror() const { + return command_type() == EMC::Command_joint_set_min_ferror ? static_cast(command()) : nullptr; + } + const EMC::JointSetHomingParams *command_as_joint_set_homing_params() const { + return command_type() == EMC::Command_joint_set_homing_params ? static_cast(command()) : nullptr; + } + const EMC::JointHome *command_as_joint_home() const { + return command_type() == EMC::Command_joint_home ? static_cast(command()) : nullptr; + } + const EMC::JointUnhome *command_as_joint_unhome() const { + return command_type() == EMC::Command_joint_unhome ? static_cast(command()) : nullptr; + } + const EMC::JointHalt *command_as_joint_halt() const { + return command_type() == EMC::Command_joint_halt ? static_cast(command()) : nullptr; + } + const EMC::JogCont *command_as_jog_cont() const { + return command_type() == EMC::Command_jog_cont ? static_cast(command()) : nullptr; + } + const EMC::JogIncr *command_as_jog_incr() const { + return command_type() == EMC::Command_jog_incr ? static_cast(command()) : nullptr; + } + const EMC::JogAbs *command_as_jog_abs() const { + return command_type() == EMC::Command_jog_abs ? static_cast(command()) : nullptr; + } + const EMC::JogStop *command_as_jog_stop() const { + return command_type() == EMC::Command_jog_stop ? static_cast(command()) : nullptr; + } + const EMC::JoinOverrideLimits *command_as_join_override_limits() const { + return command_type() == EMC::Command_join_override_limits ? static_cast(command()) : nullptr; + } + const EMC::JoinLoadComp *command_as_join_load_comp() const { + return command_type() == EMC::Command_join_load_comp ? static_cast(command()) : nullptr; + } + const EMC::TrajSetMode *command_as_traj_set_mode() const { + return command_type() == EMC::Command_traj_set_mode ? static_cast(command()) : nullptr; + } + const EMC::TrajSetVelocity *command_as_traj_set_velocity() const { + return command_type() == EMC::Command_traj_set_velocity ? static_cast(command()) : nullptr; + } + const EMC::TrajSetAcceleration *command_as_tral_set_acceleration() const { + return command_type() == EMC::Command_tral_set_acceleration ? static_cast(command()) : nullptr; + } + const EMC::TrajSetMaxVelocity *command_as_traj_set_max_velocity() const { + return command_type() == EMC::Command_traj_set_max_velocity ? static_cast(command()) : nullptr; + } + const EMC::TrajSetScale *command_as_traj_set_scale() const { + return command_type() == EMC::Command_traj_set_scale ? static_cast(command()) : nullptr; + } + const EMC::TrajSetRapidScale *command_as_traj_set_rapid_scale() const { + return command_type() == EMC::Command_traj_set_rapid_scale ? static_cast(command()) : nullptr; + } + const EMC::TrajSetSpindleScale *command_as_traj_set_spindl_scale() const { + return command_type() == EMC::Command_traj_set_spindl_scale ? static_cast(command()) : nullptr; + } + const EMC::TrajSetFOEnable *command_as_traj_set_fo_enable() const { + return command_type() == EMC::Command_traj_set_fo_enable ? static_cast(command()) : nullptr; + } + const EMC::TrajSetSOEnable *command_as_traj_set_so_enable() const { + return command_type() == EMC::Command_traj_set_so_enable ? static_cast(command()) : nullptr; + } + const EMC::TrajSetFHEnable *command_as_traj_set_fh_enable() const { + return command_type() == EMC::Command_traj_set_fh_enable ? static_cast(command()) : nullptr; + } + const EMC::TrajAbort *command_as_traj_abort() const { + return command_type() == EMC::Command_traj_abort ? static_cast(command()) : nullptr; + } + const EMC::TrajPause *command_as_traj_pause() const { + return command_type() == EMC::Command_traj_pause ? static_cast(command()) : nullptr; + } + const EMC::TrajResume *command_as_traj_resume() const { + return command_type() == EMC::Command_traj_resume ? static_cast(command()) : nullptr; + } + const EMC::TrajDelay *command_as_traj_delay() const { + return command_type() == EMC::Command_traj_delay ? static_cast(command()) : nullptr; + } + const EMC::TrajLinearMove *command_as_traj_linear_move() const { + return command_type() == EMC::Command_traj_linear_move ? static_cast(command()) : nullptr; + } + const EMC::TrajCircularMove *command_as_traj_circular_move() const { + return command_type() == EMC::Command_traj_circular_move ? static_cast(command()) : nullptr; + } + const EMC::TrajSetTermCond *command_as_traj_set_term_cond() const { + return command_type() == EMC::Command_traj_set_term_cond ? static_cast(command()) : nullptr; + } + const EMC::TrajSetSpindleSync *command_as_traj_set_spindle_sync() const { + return command_type() == EMC::Command_traj_set_spindle_sync ? static_cast(command()) : nullptr; + } + const EMC::TrajSetOffset *command_as_traj_set_offset() const { + return command_type() == EMC::Command_traj_set_offset ? static_cast(command()) : nullptr; + } + const EMC::TrajSetG5x *command_as_traj_set_g5x() const { + return command_type() == EMC::Command_traj_set_g5x ? static_cast(command()) : nullptr; + } + const EMC::TrajSetG92 *command_as_traj_set_g92() const { + return command_type() == EMC::Command_traj_set_g92 ? static_cast(command()) : nullptr; + } + const EMC::TrajSetRotation *command_as_traj_set_rotation() const { + return command_type() == EMC::Command_traj_set_rotation ? static_cast(command()) : nullptr; + } + const EMC::TrajClearProbeTrippedFlag *command_as_traj_clear_probe_tripped_flag() const { + return command_type() == EMC::Command_traj_clear_probe_tripped_flag ? static_cast(command()) : nullptr; + } + const EMC::TrajSetTeleopEnable *command_as_traj_set_teleop_enable() const { + return command_type() == EMC::Command_traj_set_teleop_enable ? static_cast(command()) : nullptr; + } + const EMC::TrajProbe *command_as_traj_probe() const { + return command_type() == EMC::Command_traj_probe ? static_cast(command()) : nullptr; + } + const EMC::TrajRigidTap *command_as_traj_rigid_tap() const { + return command_type() == EMC::Command_traj_rigid_tap ? static_cast(command()) : nullptr; + } + const EMC::MotionSetAOut *command_as_motion_set_aout() const { + return command_type() == EMC::Command_motion_set_aout ? static_cast(command()) : nullptr; + } + const EMC::MotionSetDOut *command_as_motion_set_dout() const { + return command_type() == EMC::Command_motion_set_dout ? static_cast(command()) : nullptr; + } + const EMC::MotionAdaptive *command_as_motion_adaptive() const { + return command_type() == EMC::Command_motion_adaptive ? static_cast(command()) : nullptr; + } + const EMC::TaskAbort *command_as_task_abort() const { + return command_type() == EMC::Command_task_abort ? static_cast(command()) : nullptr; + } + const EMC::TaskSetMode *command_as_task_set_mode() const { + return command_type() == EMC::Command_task_set_mode ? static_cast(command()) : nullptr; + } + const EMC::TaskSetState *command_as_task_set_state() const { + return command_type() == EMC::Command_task_set_state ? static_cast(command()) : nullptr; + } + const EMC::TaskPlanOpen *command_as_task_plan_open() const { + return command_type() == EMC::Command_task_plan_open ? static_cast(command()) : nullptr; + } + const EMC::TaskPlanRun *command_as_task_plan_run() const { + return command_type() == EMC::Command_task_plan_run ? static_cast(command()) : nullptr; + } + const EMC::TaskPlanExecute *command_as_task_plan_execute() const { + return command_type() == EMC::Command_task_plan_execute ? static_cast(command()) : nullptr; + } + const EMC::TaskPlanReverse *command_as_task_plan_reverse() const { + return command_type() == EMC::Command_task_plan_reverse ? static_cast(command()) : nullptr; + } + const EMC::TaskPlanForward *command_as_task_plan_forward() const { + return command_type() == EMC::Command_task_plan_forward ? static_cast(command()) : nullptr; + } + const EMC::TaskPlanStep *command_as_task_plan_step() const { + return command_type() == EMC::Command_task_plan_step ? static_cast(command()) : nullptr; + } + const EMC::TaskPlanResume *command_as_task_plan_resume() const { + return command_type() == EMC::Command_task_plan_resume ? static_cast(command()) : nullptr; + } + const EMC::TaskPlanEnd *command_as_task_plan_end() const { + return command_type() == EMC::Command_task_plan_end ? static_cast(command()) : nullptr; + } + const EMC::TaskPlanClose *command_as_task_plan_close() const { + return command_type() == EMC::Command_task_plan_close ? static_cast(command()) : nullptr; + } + const EMC::TaskPlanInit *command_as_task_plan_init() const { + return command_type() == EMC::Command_task_plan_init ? static_cast(command()) : nullptr; + } + const EMC::TaskPlanSynch *command_as_task_plan_synch() const { + return command_type() == EMC::Command_task_plan_synch ? static_cast(command()) : nullptr; + } + const EMC::TaskPlanSetOptionalStop *command_as_task_plan_set_optional_stop() const { + return command_type() == EMC::Command_task_plan_set_optional_stop ? static_cast(command()) : nullptr; + } + const EMC::TaskPlanSetBlockDelete *command_as_task_plan_set_block_delete() const { + return command_type() == EMC::Command_task_plan_set_block_delete ? static_cast(command()) : nullptr; + } + const EMC::TaskPlanOptionalStop *command_as_task_plan_optional_stop() const { + return command_type() == EMC::Command_task_plan_optional_stop ? static_cast(command()) : nullptr; + } + const EMC::ToolCmd *command_as_tool_cmd() const { + return command_type() == EMC::Command_tool_cmd ? static_cast(command()) : nullptr; + } + const EMC::ToolHalt *command_as_tool_halt() const { + return command_type() == EMC::Command_tool_halt ? static_cast(command()) : nullptr; + } + const EMC::ToolAbort *command_as_tool_abort() const { + return command_type() == EMC::Command_tool_abort ? static_cast(command()) : nullptr; + } + const EMC::ToolPrepare *command_as_tool_prepare() const { + return command_type() == EMC::Command_tool_prepare ? static_cast(command()) : nullptr; + } + const EMC::ToolLoad *command_as_tool_load() const { + return command_type() == EMC::Command_tool_load ? static_cast(command()) : nullptr; + } + const EMC::ToolLoadToolTable *command_as_tool_load_tool_table() const { + return command_type() == EMC::Command_tool_load_tool_table ? static_cast(command()) : nullptr; + } + const EMC::ToolSetOffset *command_as_tool_set_offset() const { + return command_type() == EMC::Command_tool_set_offset ? static_cast(command()) : nullptr; + } + const EMC::ToolSetNumber *command_as_tool_set_number() const { + return command_type() == EMC::Command_tool_set_number ? static_cast(command()) : nullptr; + } + const EMC::AuxInputWait *command_as_aux_input_wait() const { + return command_type() == EMC::Command_aux_input_wait ? static_cast(command()) : nullptr; + } + const EMC::SpindleSpeed *command_as_spindle_speed() const { + return command_type() == EMC::Command_spindle_speed ? static_cast(command()) : nullptr; + } + const EMC::SpindleOrient *command_as_spindle_orient() const { + return command_type() == EMC::Command_spindle_orient ? static_cast(command()) : nullptr; + } + const EMC::SpindleWaitOrient *command_as_spindle_wait_orient() const { + return command_type() == EMC::Command_spindle_wait_orient ? static_cast(command()) : nullptr; + } + const EMC::SpindleOn *command_as_spindle_on() const { + return command_type() == EMC::Command_spindle_on ? static_cast(command()) : nullptr; + } + const EMC::SpindleOff *command_as_spindle_off() const { + return command_type() == EMC::Command_spindle_off ? static_cast(command()) : nullptr; + } + const EMC::SpindleIncrease *command_as_spindle_increase() const { + return command_type() == EMC::Command_spindle_increase ? static_cast(command()) : nullptr; + } + const EMC::SpindleDecrease *command_as_spindle_decrease() const { + return command_type() == EMC::Command_spindle_decrease ? static_cast(command()) : nullptr; + } + const EMC::SpindleConstant *command_as_spindle_constant() const { + return command_type() == EMC::Command_spindle_constant ? static_cast(command()) : nullptr; + } + const EMC::SpindleBrakeRelease *command_as_spindle_brake_release() const { + return command_type() == EMC::Command_spindle_brake_release ? static_cast(command()) : nullptr; + } + const EMC::SpindleBrakeEngage *command_as_spindle_brake_engage() const { + return command_type() == EMC::Command_spindle_brake_engage ? static_cast(command()) : nullptr; + } + const EMC::CoolandMistOn *command_as_coolant_mist_on() const { + return command_type() == EMC::Command_coolant_mist_on ? static_cast(command()) : nullptr; + } + const EMC::CoolandMistOff *command_as_coolant_mist_off() const { + return command_type() == EMC::Command_coolant_mist_off ? static_cast(command()) : nullptr; + } + const EMC::CoolandFloodOn *command_as_coolant_flood_on() const { + return command_type() == EMC::Command_coolant_flood_on ? static_cast(command()) : nullptr; + } + const EMC::CoolandFloodOff *command_as_cooland_flood_off() const { + return command_type() == EMC::Command_cooland_flood_off ? static_cast(command()) : nullptr; + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_COMMAND_TYPE) && + VerifyOffset(verifier, VT_COMMAND) && + VerifyCommand(verifier, command(), command_type()) && + verifier.EndTable(); + } + CmdChannelMsgT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; + void UnPackTo(CmdChannelMsgT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; + static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const CmdChannelMsgT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); +}; + +template<> inline const EMC::SetDebug *CmdChannelMsg::command_as() const { + return command_as_set_debug(); +} + +template<> inline const EMC::JogCmd *CmdChannelMsg::command_as() const { + return command_as_jog_cmd(); +} + +template<> inline const EMC::JointSetBacklash *CmdChannelMsg::command_as() const { + return command_as_join_set_backlash(); +} + +template<> inline const EMC::JointSetMinPositionLimit *CmdChannelMsg::command_as() const { + return command_as_joint_set_min_position_limit(); +} + +template<> inline const EMC::JointSetMaxPositionLimit *CmdChannelMsg::command_as() const { + return command_as_joint_set_max_position_limit(); +} + +template<> inline const EMC::JointSetFerror *CmdChannelMsg::command_as() const { + return command_as_joint_set_ferror(); +} + +template<> inline const EMC::JointSetMinFerror *CmdChannelMsg::command_as() const { + return command_as_joint_set_min_ferror(); +} + +template<> inline const EMC::JointSetHomingParams *CmdChannelMsg::command_as() const { + return command_as_joint_set_homing_params(); +} + +template<> inline const EMC::JointHome *CmdChannelMsg::command_as() const { + return command_as_joint_home(); +} + +template<> inline const EMC::JointUnhome *CmdChannelMsg::command_as() const { + return command_as_joint_unhome(); +} + +template<> inline const EMC::JointHalt *CmdChannelMsg::command_as() const { + return command_as_joint_halt(); +} + +template<> inline const EMC::JogCont *CmdChannelMsg::command_as() const { + return command_as_jog_cont(); +} + +template<> inline const EMC::JogIncr *CmdChannelMsg::command_as() const { + return command_as_jog_incr(); +} + +template<> inline const EMC::JogAbs *CmdChannelMsg::command_as() const { + return command_as_jog_abs(); +} + +template<> inline const EMC::JogStop *CmdChannelMsg::command_as() const { + return command_as_jog_stop(); +} + +template<> inline const EMC::JoinOverrideLimits *CmdChannelMsg::command_as() const { + return command_as_join_override_limits(); +} + +template<> inline const EMC::JoinLoadComp *CmdChannelMsg::command_as() const { + return command_as_join_load_comp(); +} + +template<> inline const EMC::TrajSetMode *CmdChannelMsg::command_as() const { + return command_as_traj_set_mode(); +} + +template<> inline const EMC::TrajSetVelocity *CmdChannelMsg::command_as() const { + return command_as_traj_set_velocity(); +} + +template<> inline const EMC::TrajSetAcceleration *CmdChannelMsg::command_as() const { + return command_as_tral_set_acceleration(); +} + +template<> inline const EMC::TrajSetMaxVelocity *CmdChannelMsg::command_as() const { + return command_as_traj_set_max_velocity(); +} + +template<> inline const EMC::TrajSetScale *CmdChannelMsg::command_as() const { + return command_as_traj_set_scale(); +} + +template<> inline const EMC::TrajSetRapidScale *CmdChannelMsg::command_as() const { + return command_as_traj_set_rapid_scale(); +} + +template<> inline const EMC::TrajSetSpindleScale *CmdChannelMsg::command_as() const { + return command_as_traj_set_spindl_scale(); +} + +template<> inline const EMC::TrajSetFOEnable *CmdChannelMsg::command_as() const { + return command_as_traj_set_fo_enable(); +} + +template<> inline const EMC::TrajSetSOEnable *CmdChannelMsg::command_as() const { + return command_as_traj_set_so_enable(); +} + +template<> inline const EMC::TrajSetFHEnable *CmdChannelMsg::command_as() const { + return command_as_traj_set_fh_enable(); +} + +template<> inline const EMC::TrajAbort *CmdChannelMsg::command_as() const { + return command_as_traj_abort(); +} + +template<> inline const EMC::TrajPause *CmdChannelMsg::command_as() const { + return command_as_traj_pause(); +} + +template<> inline const EMC::TrajResume *CmdChannelMsg::command_as() const { + return command_as_traj_resume(); +} + +template<> inline const EMC::TrajDelay *CmdChannelMsg::command_as() const { + return command_as_traj_delay(); +} + +template<> inline const EMC::TrajLinearMove *CmdChannelMsg::command_as() const { + return command_as_traj_linear_move(); +} + +template<> inline const EMC::TrajCircularMove *CmdChannelMsg::command_as() const { + return command_as_traj_circular_move(); +} + +template<> inline const EMC::TrajSetTermCond *CmdChannelMsg::command_as() const { + return command_as_traj_set_term_cond(); +} + +template<> inline const EMC::TrajSetSpindleSync *CmdChannelMsg::command_as() const { + return command_as_traj_set_spindle_sync(); +} + +template<> inline const EMC::TrajSetOffset *CmdChannelMsg::command_as() const { + return command_as_traj_set_offset(); +} + +template<> inline const EMC::TrajSetG5x *CmdChannelMsg::command_as() const { + return command_as_traj_set_g5x(); +} + +template<> inline const EMC::TrajSetG92 *CmdChannelMsg::command_as() const { + return command_as_traj_set_g92(); +} + +template<> inline const EMC::TrajSetRotation *CmdChannelMsg::command_as() const { + return command_as_traj_set_rotation(); +} + +template<> inline const EMC::TrajClearProbeTrippedFlag *CmdChannelMsg::command_as() const { + return command_as_traj_clear_probe_tripped_flag(); +} + +template<> inline const EMC::TrajSetTeleopEnable *CmdChannelMsg::command_as() const { + return command_as_traj_set_teleop_enable(); +} + +template<> inline const EMC::TrajProbe *CmdChannelMsg::command_as() const { + return command_as_traj_probe(); +} + +template<> inline const EMC::TrajRigidTap *CmdChannelMsg::command_as() const { + return command_as_traj_rigid_tap(); +} + +template<> inline const EMC::MotionSetAOut *CmdChannelMsg::command_as() const { + return command_as_motion_set_aout(); +} + +template<> inline const EMC::MotionSetDOut *CmdChannelMsg::command_as() const { + return command_as_motion_set_dout(); +} + +template<> inline const EMC::MotionAdaptive *CmdChannelMsg::command_as() const { + return command_as_motion_adaptive(); +} + +template<> inline const EMC::TaskAbort *CmdChannelMsg::command_as() const { + return command_as_task_abort(); +} + +template<> inline const EMC::TaskSetMode *CmdChannelMsg::command_as() const { + return command_as_task_set_mode(); +} + +template<> inline const EMC::TaskSetState *CmdChannelMsg::command_as() const { + return command_as_task_set_state(); +} + +template<> inline const EMC::TaskPlanOpen *CmdChannelMsg::command_as() const { + return command_as_task_plan_open(); +} + +template<> inline const EMC::TaskPlanRun *CmdChannelMsg::command_as() const { + return command_as_task_plan_run(); +} + +template<> inline const EMC::TaskPlanExecute *CmdChannelMsg::command_as() const { + return command_as_task_plan_execute(); +} + +template<> inline const EMC::TaskPlanReverse *CmdChannelMsg::command_as() const { + return command_as_task_plan_reverse(); +} + +template<> inline const EMC::TaskPlanForward *CmdChannelMsg::command_as() const { + return command_as_task_plan_forward(); +} + +template<> inline const EMC::TaskPlanStep *CmdChannelMsg::command_as() const { + return command_as_task_plan_step(); +} + +template<> inline const EMC::TaskPlanResume *CmdChannelMsg::command_as() const { + return command_as_task_plan_resume(); +} + +template<> inline const EMC::TaskPlanEnd *CmdChannelMsg::command_as() const { + return command_as_task_plan_end(); +} + +template<> inline const EMC::TaskPlanClose *CmdChannelMsg::command_as() const { + return command_as_task_plan_close(); +} + +template<> inline const EMC::TaskPlanInit *CmdChannelMsg::command_as() const { + return command_as_task_plan_init(); +} + +template<> inline const EMC::TaskPlanSynch *CmdChannelMsg::command_as() const { + return command_as_task_plan_synch(); +} + +template<> inline const EMC::TaskPlanSetOptionalStop *CmdChannelMsg::command_as() const { + return command_as_task_plan_set_optional_stop(); +} + +template<> inline const EMC::TaskPlanSetBlockDelete *CmdChannelMsg::command_as() const { + return command_as_task_plan_set_block_delete(); +} + +template<> inline const EMC::TaskPlanOptionalStop *CmdChannelMsg::command_as() const { + return command_as_task_plan_optional_stop(); +} + +template<> inline const EMC::ToolCmd *CmdChannelMsg::command_as() const { + return command_as_tool_cmd(); +} + +template<> inline const EMC::ToolHalt *CmdChannelMsg::command_as() const { + return command_as_tool_halt(); +} + +template<> inline const EMC::ToolAbort *CmdChannelMsg::command_as() const { + return command_as_tool_abort(); +} + +template<> inline const EMC::ToolPrepare *CmdChannelMsg::command_as() const { + return command_as_tool_prepare(); +} + +template<> inline const EMC::ToolLoad *CmdChannelMsg::command_as() const { + return command_as_tool_load(); +} + +template<> inline const EMC::ToolLoadToolTable *CmdChannelMsg::command_as() const { + return command_as_tool_load_tool_table(); +} + +template<> inline const EMC::ToolSetOffset *CmdChannelMsg::command_as() const { + return command_as_tool_set_offset(); +} + +template<> inline const EMC::ToolSetNumber *CmdChannelMsg::command_as() const { + return command_as_tool_set_number(); +} + +template<> inline const EMC::AuxInputWait *CmdChannelMsg::command_as() const { + return command_as_aux_input_wait(); +} + +template<> inline const EMC::SpindleSpeed *CmdChannelMsg::command_as() const { + return command_as_spindle_speed(); +} + +template<> inline const EMC::SpindleOrient *CmdChannelMsg::command_as() const { + return command_as_spindle_orient(); +} + +template<> inline const EMC::SpindleWaitOrient *CmdChannelMsg::command_as() const { + return command_as_spindle_wait_orient(); +} + +template<> inline const EMC::SpindleOn *CmdChannelMsg::command_as() const { + return command_as_spindle_on(); +} + +template<> inline const EMC::SpindleOff *CmdChannelMsg::command_as() const { + return command_as_spindle_off(); +} + +template<> inline const EMC::SpindleIncrease *CmdChannelMsg::command_as() const { + return command_as_spindle_increase(); +} + +template<> inline const EMC::SpindleDecrease *CmdChannelMsg::command_as() const { + return command_as_spindle_decrease(); +} + +template<> inline const EMC::SpindleConstant *CmdChannelMsg::command_as() const { + return command_as_spindle_constant(); +} + +template<> inline const EMC::SpindleBrakeRelease *CmdChannelMsg::command_as() const { + return command_as_spindle_brake_release(); +} + +template<> inline const EMC::SpindleBrakeEngage *CmdChannelMsg::command_as() const { + return command_as_spindle_brake_engage(); +} + +template<> inline const EMC::CoolandMistOn *CmdChannelMsg::command_as() const { + return command_as_coolant_mist_on(); +} + +template<> inline const EMC::CoolandMistOff *CmdChannelMsg::command_as() const { + return command_as_coolant_mist_off(); +} + +template<> inline const EMC::CoolandFloodOn *CmdChannelMsg::command_as() const { + return command_as_coolant_flood_on(); +} + +template<> inline const EMC::CoolandFloodOff *CmdChannelMsg::command_as() const { + return command_as_cooland_flood_off(); +} + +struct CmdChannelMsgBuilder { + typedef CmdChannelMsg Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_command_type(EMC::Command command_type) { + fbb_.AddElement(CmdChannelMsg::VT_COMMAND_TYPE, static_cast(command_type), 0); + } + void add_command(flatbuffers::Offset command) { + fbb_.AddOffset(CmdChannelMsg::VT_COMMAND, command); + } + explicit CmdChannelMsgBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateCmdChannelMsg( + flatbuffers::FlatBufferBuilder &_fbb, + EMC::Command command_type = EMC::Command_NONE, + flatbuffers::Offset command = 0) { + CmdChannelMsgBuilder builder_(_fbb); + builder_.add_command(command); + builder_.add_command_type(command_type); + return builder_.Finish(); +} + +flatbuffers::Offset CreateCmdChannelMsg(flatbuffers::FlatBufferBuilder &_fbb, const CmdChannelMsgT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); + +struct DebugLevelT : public flatbuffers::NativeTable { + typedef DebugLevel TableType; + int32_t debug_level; + DebugLevelT() + : debug_level(0) { + } +}; + +struct DebugLevel FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef DebugLevelT NativeTableType; + typedef DebugLevelBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_DEBUG_LEVEL = 4 + }; + int32_t debug_level() const { + return GetField(VT_DEBUG_LEVEL, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_DEBUG_LEVEL) && + verifier.EndTable(); + } + DebugLevelT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; + void UnPackTo(DebugLevelT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; + static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const DebugLevelT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); +}; + +struct DebugLevelBuilder { + typedef DebugLevel Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_debug_level(int32_t debug_level) { + fbb_.AddElement(DebugLevel::VT_DEBUG_LEVEL, debug_level, 0); + } + explicit DebugLevelBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateDebugLevel( + flatbuffers::FlatBufferBuilder &_fbb, + int32_t debug_level = 0) { + DebugLevelBuilder builder_(_fbb); + builder_.add_debug_level(debug_level); + return builder_.Finish(); +} + +flatbuffers::Offset CreateDebugLevel(flatbuffers::FlatBufferBuilder &_fbb, const DebugLevelT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); + +struct ResultT : public flatbuffers::NativeTable { + typedef Result TableType; + int32_t result; + ResultT() + : result(0) { + } +}; + +struct Result FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef ResultT NativeTableType; + typedef ResultBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_RESULT = 4 + }; + int32_t result() const { + return GetField(VT_RESULT, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_RESULT) && + verifier.EndTable(); + } + ResultT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; + void UnPackTo(ResultT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; + static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const ResultT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); +}; + +struct ResultBuilder { + typedef Result Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_result(int32_t result) { + fbb_.AddElement(Result::VT_RESULT, result, 0); + } + explicit ResultBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateResult( + flatbuffers::FlatBufferBuilder &_fbb, + int32_t result = 0) { + ResultBuilder builder_(_fbb); + builder_.add_result(result); + return builder_.Finish(); +} + +flatbuffers::Offset CreateResult(flatbuffers::FlatBufferBuilder &_fbb, const ResultT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); + +inline JoinLoadCompT *JoinLoadComp::UnPack(const flatbuffers::resolver_function_t *_resolver) const { + std::unique_ptr _o = std::unique_ptr(new JoinLoadCompT()); + UnPackTo(_o.get(), _resolver); + return _o.release(); +} + +inline void JoinLoadComp::UnPackTo(JoinLoadCompT *_o, const flatbuffers::resolver_function_t *_resolver) const { + (void)_o; + (void)_resolver; + { auto _e = file(); if (_e) _o->file = _e->str(); } + { auto _e = type(); _o->type = _e; } +} + +inline flatbuffers::Offset JoinLoadComp::Pack(flatbuffers::FlatBufferBuilder &_fbb, const JoinLoadCompT* _o, const flatbuffers::rehasher_function_t *_rehasher) { + return CreateJoinLoadComp(_fbb, _o, _rehasher); +} + +inline flatbuffers::Offset CreateJoinLoadComp(flatbuffers::FlatBufferBuilder &_fbb, const JoinLoadCompT *_o, const flatbuffers::rehasher_function_t *_rehasher) { + (void)_rehasher; + (void)_o; + struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const JoinLoadCompT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; + auto _file = _o->file.empty() ? 0 : _fbb.CreateString(_o->file); + auto _type = _o->type; + return EMC::CreateJoinLoadComp( + _fbb, + _file, + _type); +} + +inline TrajCircularMoveT *TrajCircularMove::UnPack(const flatbuffers::resolver_function_t *_resolver) const { + std::unique_ptr _o = std::unique_ptr(new TrajCircularMoveT()); + UnPackTo(_o.get(), _resolver); + return _o.release(); +} + +inline void TrajCircularMove::UnPackTo(TrajCircularMoveT *_o, const flatbuffers::resolver_function_t *_resolver) const { + (void)_o; + (void)_resolver; + { auto _e = end(); if (_e) _o->end = std::unique_ptr(new EMC::Pose(*_e)); } + { auto _e = center(); if (_e) _o->center = std::unique_ptr(new EMC::Cartesian(*_e)); } + { auto _e = normal(); if (_e) _o->normal = std::unique_ptr(new EMC::Cartesian(*_e)); } + { auto _e = turn(); _o->turn = _e; } + { auto _e = type(); _o->type = _e; } + { auto _e = vel(); _o->vel = _e; } + { auto _e = ini_maxvel(); _o->ini_maxvel = _e; } + { auto _e = acc(); _o->acc = _e; } + { auto _e = feed_mode(); _o->feed_mode = _e; } +} + +inline flatbuffers::Offset TrajCircularMove::Pack(flatbuffers::FlatBufferBuilder &_fbb, const TrajCircularMoveT* _o, const flatbuffers::rehasher_function_t *_rehasher) { + return CreateTrajCircularMove(_fbb, _o, _rehasher); +} + +inline flatbuffers::Offset CreateTrajCircularMove(flatbuffers::FlatBufferBuilder &_fbb, const TrajCircularMoveT *_o, const flatbuffers::rehasher_function_t *_rehasher) { + (void)_rehasher; + (void)_o; + struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const TrajCircularMoveT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; + auto _end = _o->end ? _o->end.get() : 0; + auto _center = _o->center ? _o->center.get() : 0; + auto _normal = _o->normal ? _o->normal.get() : 0; + auto _turn = _o->turn; + auto _type = _o->type; + auto _vel = _o->vel; + auto _ini_maxvel = _o->ini_maxvel; + auto _acc = _o->acc; + auto _feed_mode = _o->feed_mode; + return EMC::CreateTrajCircularMove( + _fbb, + _end, + _center, + _normal, + _turn, + _type, + _vel, + _ini_maxvel, + _acc, + _feed_mode); +} + +inline TaskPlanOpenT *TaskPlanOpen::UnPack(const flatbuffers::resolver_function_t *_resolver) const { + std::unique_ptr _o = std::unique_ptr(new TaskPlanOpenT()); + UnPackTo(_o.get(), _resolver); + return _o.release(); +} + +inline void TaskPlanOpen::UnPackTo(TaskPlanOpenT *_o, const flatbuffers::resolver_function_t *_resolver) const { + (void)_o; + (void)_resolver; + { auto _e = file(); if (_e) _o->file = _e->str(); } +} + +inline flatbuffers::Offset TaskPlanOpen::Pack(flatbuffers::FlatBufferBuilder &_fbb, const TaskPlanOpenT* _o, const flatbuffers::rehasher_function_t *_rehasher) { + return CreateTaskPlanOpen(_fbb, _o, _rehasher); +} + +inline flatbuffers::Offset CreateTaskPlanOpen(flatbuffers::FlatBufferBuilder &_fbb, const TaskPlanOpenT *_o, const flatbuffers::rehasher_function_t *_rehasher) { + (void)_rehasher; + (void)_o; + struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const TaskPlanOpenT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; + auto _file = _o->file.empty() ? 0 : _fbb.CreateString(_o->file); + return EMC::CreateTaskPlanOpen( + _fbb, + _file); +} + +inline TaskPlanExecuteT *TaskPlanExecute::UnPack(const flatbuffers::resolver_function_t *_resolver) const { + std::unique_ptr _o = std::unique_ptr(new TaskPlanExecuteT()); + UnPackTo(_o.get(), _resolver); + return _o.release(); +} + +inline void TaskPlanExecute::UnPackTo(TaskPlanExecuteT *_o, const flatbuffers::resolver_function_t *_resolver) const { + (void)_o; + (void)_resolver; + { auto _e = command(); if (_e) _o->command = _e->str(); } +} + +inline flatbuffers::Offset TaskPlanExecute::Pack(flatbuffers::FlatBufferBuilder &_fbb, const TaskPlanExecuteT* _o, const flatbuffers::rehasher_function_t *_rehasher) { + return CreateTaskPlanExecute(_fbb, _o, _rehasher); +} + +inline flatbuffers::Offset CreateTaskPlanExecute(flatbuffers::FlatBufferBuilder &_fbb, const TaskPlanExecuteT *_o, const flatbuffers::rehasher_function_t *_rehasher) { + (void)_rehasher; + (void)_o; + struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const TaskPlanExecuteT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; + auto _command = _o->command.empty() ? 0 : _fbb.CreateString(_o->command); + return EMC::CreateTaskPlanExecute( + _fbb, + _command); +} + +inline ToolLoadToolTableT *ToolLoadToolTable::UnPack(const flatbuffers::resolver_function_t *_resolver) const { + std::unique_ptr _o = std::unique_ptr(new ToolLoadToolTableT()); + UnPackTo(_o.get(), _resolver); + return _o.release(); +} + +inline void ToolLoadToolTable::UnPackTo(ToolLoadToolTableT *_o, const flatbuffers::resolver_function_t *_resolver) const { + (void)_o; + (void)_resolver; + { auto _e = file(); if (_e) _o->file = _e->str(); } +} + +inline flatbuffers::Offset ToolLoadToolTable::Pack(flatbuffers::FlatBufferBuilder &_fbb, const ToolLoadToolTableT* _o, const flatbuffers::rehasher_function_t *_rehasher) { + return CreateToolLoadToolTable(_fbb, _o, _rehasher); +} + +inline flatbuffers::Offset CreateToolLoadToolTable(flatbuffers::FlatBufferBuilder &_fbb, const ToolLoadToolTableT *_o, const flatbuffers::rehasher_function_t *_rehasher) { + (void)_rehasher; + (void)_o; + struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const ToolLoadToolTableT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; + auto _file = _o->file.empty() ? 0 : _fbb.CreateString(_o->file); + return EMC::CreateToolLoadToolTable( + _fbb, + _file); +} + +inline CmdChannelMsgT *CmdChannelMsg::UnPack(const flatbuffers::resolver_function_t *_resolver) const { + std::unique_ptr _o = std::unique_ptr(new CmdChannelMsgT()); + UnPackTo(_o.get(), _resolver); + return _o.release(); +} + +inline void CmdChannelMsg::UnPackTo(CmdChannelMsgT *_o, const flatbuffers::resolver_function_t *_resolver) const { + (void)_o; + (void)_resolver; + { auto _e = command_type(); _o->command.type = _e; } + { auto _e = command(); if (_e) _o->command.value = EMC::CommandUnion::UnPack(_e, command_type(), _resolver); } +} + +inline flatbuffers::Offset CmdChannelMsg::Pack(flatbuffers::FlatBufferBuilder &_fbb, const CmdChannelMsgT* _o, const flatbuffers::rehasher_function_t *_rehasher) { + return CreateCmdChannelMsg(_fbb, _o, _rehasher); +} + +inline flatbuffers::Offset CreateCmdChannelMsg(flatbuffers::FlatBufferBuilder &_fbb, const CmdChannelMsgT *_o, const flatbuffers::rehasher_function_t *_rehasher) { + (void)_rehasher; + (void)_o; + struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const CmdChannelMsgT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; + auto _command_type = _o->command.type; + auto _command = _o->command.Pack(_fbb); + return EMC::CreateCmdChannelMsg( + _fbb, + _command_type, + _command); +} + +inline DebugLevelT *DebugLevel::UnPack(const flatbuffers::resolver_function_t *_resolver) const { + std::unique_ptr _o = std::unique_ptr(new DebugLevelT()); + UnPackTo(_o.get(), _resolver); + return _o.release(); +} + +inline void DebugLevel::UnPackTo(DebugLevelT *_o, const flatbuffers::resolver_function_t *_resolver) const { + (void)_o; + (void)_resolver; + { auto _e = debug_level(); _o->debug_level = _e; } +} + +inline flatbuffers::Offset DebugLevel::Pack(flatbuffers::FlatBufferBuilder &_fbb, const DebugLevelT* _o, const flatbuffers::rehasher_function_t *_rehasher) { + return CreateDebugLevel(_fbb, _o, _rehasher); +} + +inline flatbuffers::Offset CreateDebugLevel(flatbuffers::FlatBufferBuilder &_fbb, const DebugLevelT *_o, const flatbuffers::rehasher_function_t *_rehasher) { + (void)_rehasher; + (void)_o; + struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const DebugLevelT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; + auto _debug_level = _o->debug_level; + return EMC::CreateDebugLevel( + _fbb, + _debug_level); +} + +inline ResultT *Result::UnPack(const flatbuffers::resolver_function_t *_resolver) const { + std::unique_ptr _o = std::unique_ptr(new ResultT()); + UnPackTo(_o.get(), _resolver); + return _o.release(); +} + +inline void Result::UnPackTo(ResultT *_o, const flatbuffers::resolver_function_t *_resolver) const { + (void)_o; + (void)_resolver; + { auto _e = result(); _o->result = _e; } +} + +inline flatbuffers::Offset Result::Pack(flatbuffers::FlatBufferBuilder &_fbb, const ResultT* _o, const flatbuffers::rehasher_function_t *_rehasher) { + return CreateResult(_fbb, _o, _rehasher); +} + +inline flatbuffers::Offset CreateResult(flatbuffers::FlatBufferBuilder &_fbb, const ResultT *_o, const flatbuffers::rehasher_function_t *_rehasher) { + (void)_rehasher; + (void)_o; + struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const ResultT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; + auto _result = _o->result; + return EMC::CreateResult( + _fbb, + _result); +} + +inline bool VerifyCommand(flatbuffers::Verifier &verifier, const void *obj, Command type) { + switch (type) { + case Command_NONE: { + return true; + } + case Command_set_debug: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_jog_cmd: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_join_set_backlash: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_joint_set_min_position_limit: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_joint_set_max_position_limit: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_joint_set_ferror: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_joint_set_min_ferror: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_joint_set_homing_params: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_joint_home: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_joint_unhome: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_joint_halt: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_jog_cont: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_jog_incr: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_jog_abs: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_jog_stop: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_join_override_limits: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_join_load_comp: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case Command_traj_set_mode: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_traj_set_velocity: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_tral_set_acceleration: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_traj_set_max_velocity: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_traj_set_scale: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_traj_set_rapid_scale: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_traj_set_spindl_scale: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_traj_set_fo_enable: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_traj_set_so_enable: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_traj_set_fh_enable: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_traj_abort: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_traj_pause: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_traj_resume: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_traj_delay: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_traj_linear_move: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_traj_circular_move: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case Command_traj_set_term_cond: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_traj_set_spindle_sync: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_traj_set_offset: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_traj_set_g5x: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_traj_set_g92: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_traj_set_rotation: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_traj_clear_probe_tripped_flag: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_traj_set_teleop_enable: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_traj_probe: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_traj_rigid_tap: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_motion_set_aout: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_motion_set_dout: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_motion_adaptive: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_task_abort: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_task_set_mode: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_task_set_state: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_task_plan_open: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case Command_task_plan_run: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_task_plan_execute: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case Command_task_plan_reverse: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_task_plan_forward: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_task_plan_step: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_task_plan_resume: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_task_plan_end: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_task_plan_close: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_task_plan_init: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_task_plan_synch: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_task_plan_set_optional_stop: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_task_plan_set_block_delete: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_task_plan_optional_stop: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_tool_cmd: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_tool_halt: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_tool_abort: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_tool_prepare: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_tool_load: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_tool_load_tool_table: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case Command_tool_set_offset: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_tool_set_number: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_aux_input_wait: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_spindle_speed: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_spindle_orient: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_spindle_wait_orient: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_spindle_on: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_spindle_off: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_spindle_increase: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_spindle_decrease: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_spindle_constant: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_spindle_brake_release: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_spindle_brake_engage: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_coolant_mist_on: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_coolant_mist_off: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_coolant_flood_on: { + return verifier.Verify(static_cast(obj), 0); + } + case Command_cooland_flood_off: { + return verifier.Verify(static_cast(obj), 0); + } + default: return true; + } +} + +inline bool VerifyCommandVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifyCommand( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + +inline void *CommandUnion::UnPack(const void *obj, Command type, const flatbuffers::resolver_function_t *resolver) { + switch (type) { + case Command_set_debug: { + auto ptr = reinterpret_cast(obj); + return new EMC::SetDebug(*ptr); + } + case Command_jog_cmd: { + auto ptr = reinterpret_cast(obj); + return new EMC::JogCmd(*ptr); + } + case Command_join_set_backlash: { + auto ptr = reinterpret_cast(obj); + return new EMC::JointSetBacklash(*ptr); + } + case Command_joint_set_min_position_limit: { + auto ptr = reinterpret_cast(obj); + return new EMC::JointSetMinPositionLimit(*ptr); + } + case Command_joint_set_max_position_limit: { + auto ptr = reinterpret_cast(obj); + return new EMC::JointSetMaxPositionLimit(*ptr); + } + case Command_joint_set_ferror: { + auto ptr = reinterpret_cast(obj); + return new EMC::JointSetFerror(*ptr); + } + case Command_joint_set_min_ferror: { + auto ptr = reinterpret_cast(obj); + return new EMC::JointSetMinFerror(*ptr); + } + case Command_joint_set_homing_params: { + auto ptr = reinterpret_cast(obj); + return new EMC::JointSetHomingParams(*ptr); + } + case Command_joint_home: { + auto ptr = reinterpret_cast(obj); + return new EMC::JointHome(*ptr); + } + case Command_joint_unhome: { + auto ptr = reinterpret_cast(obj); + return new EMC::JointUnhome(*ptr); + } + case Command_joint_halt: { + auto ptr = reinterpret_cast(obj); + return new EMC::JointHalt(*ptr); + } + case Command_jog_cont: { + auto ptr = reinterpret_cast(obj); + return new EMC::JogCont(*ptr); + } + case Command_jog_incr: { + auto ptr = reinterpret_cast(obj); + return new EMC::JogIncr(*ptr); + } + case Command_jog_abs: { + auto ptr = reinterpret_cast(obj); + return new EMC::JogAbs(*ptr); + } + case Command_jog_stop: { + auto ptr = reinterpret_cast(obj); + return new EMC::JogStop(*ptr); + } + case Command_join_override_limits: { + auto ptr = reinterpret_cast(obj); + return new EMC::JoinOverrideLimits(*ptr); + } + case Command_join_load_comp: { + auto ptr = reinterpret_cast(obj); + return ptr->UnPack(resolver); + } + case Command_traj_set_mode: { + auto ptr = reinterpret_cast(obj); + return new EMC::TrajSetMode(*ptr); + } + case Command_traj_set_velocity: { + auto ptr = reinterpret_cast(obj); + return new EMC::TrajSetVelocity(*ptr); + } + case Command_tral_set_acceleration: { + auto ptr = reinterpret_cast(obj); + return new EMC::TrajSetAcceleration(*ptr); + } + case Command_traj_set_max_velocity: { + auto ptr = reinterpret_cast(obj); + return new EMC::TrajSetMaxVelocity(*ptr); + } + case Command_traj_set_scale: { + auto ptr = reinterpret_cast(obj); + return new EMC::TrajSetScale(*ptr); + } + case Command_traj_set_rapid_scale: { + auto ptr = reinterpret_cast(obj); + return new EMC::TrajSetRapidScale(*ptr); + } + case Command_traj_set_spindl_scale: { + auto ptr = reinterpret_cast(obj); + return new EMC::TrajSetSpindleScale(*ptr); + } + case Command_traj_set_fo_enable: { + auto ptr = reinterpret_cast(obj); + return new EMC::TrajSetFOEnable(*ptr); + } + case Command_traj_set_so_enable: { + auto ptr = reinterpret_cast(obj); + return new EMC::TrajSetSOEnable(*ptr); + } + case Command_traj_set_fh_enable: { + auto ptr = reinterpret_cast(obj); + return new EMC::TrajSetFHEnable(*ptr); + } + case Command_traj_abort: { + auto ptr = reinterpret_cast(obj); + return new EMC::TrajAbort(*ptr); + } + case Command_traj_pause: { + auto ptr = reinterpret_cast(obj); + return new EMC::TrajPause(*ptr); + } + case Command_traj_resume: { + auto ptr = reinterpret_cast(obj); + return new EMC::TrajResume(*ptr); + } + case Command_traj_delay: { + auto ptr = reinterpret_cast(obj); + return new EMC::TrajDelay(*ptr); + } + case Command_traj_linear_move: { + auto ptr = reinterpret_cast(obj); + return new EMC::TrajLinearMove(*ptr); + } + case Command_traj_circular_move: { + auto ptr = reinterpret_cast(obj); + return ptr->UnPack(resolver); + } + case Command_traj_set_term_cond: { + auto ptr = reinterpret_cast(obj); + return new EMC::TrajSetTermCond(*ptr); + } + case Command_traj_set_spindle_sync: { + auto ptr = reinterpret_cast(obj); + return new EMC::TrajSetSpindleSync(*ptr); + } + case Command_traj_set_offset: { + auto ptr = reinterpret_cast(obj); + return new EMC::TrajSetOffset(*ptr); + } + case Command_traj_set_g5x: { + auto ptr = reinterpret_cast(obj); + return new EMC::TrajSetG5x(*ptr); + } + case Command_traj_set_g92: { + auto ptr = reinterpret_cast(obj); + return new EMC::TrajSetG92(*ptr); + } + case Command_traj_set_rotation: { + auto ptr = reinterpret_cast(obj); + return new EMC::TrajSetRotation(*ptr); + } + case Command_traj_clear_probe_tripped_flag: { + auto ptr = reinterpret_cast(obj); + return new EMC::TrajClearProbeTrippedFlag(*ptr); + } + case Command_traj_set_teleop_enable: { + auto ptr = reinterpret_cast(obj); + return new EMC::TrajSetTeleopEnable(*ptr); + } + case Command_traj_probe: { + auto ptr = reinterpret_cast(obj); + return new EMC::TrajProbe(*ptr); + } + case Command_traj_rigid_tap: { + auto ptr = reinterpret_cast(obj); + return new EMC::TrajRigidTap(*ptr); + } + case Command_motion_set_aout: { + auto ptr = reinterpret_cast(obj); + return new EMC::MotionSetAOut(*ptr); + } + case Command_motion_set_dout: { + auto ptr = reinterpret_cast(obj); + return new EMC::MotionSetDOut(*ptr); + } + case Command_motion_adaptive: { + auto ptr = reinterpret_cast(obj); + return new EMC::MotionAdaptive(*ptr); + } + case Command_task_abort: { + auto ptr = reinterpret_cast(obj); + return new EMC::TaskAbort(*ptr); + } + case Command_task_set_mode: { + auto ptr = reinterpret_cast(obj); + return new EMC::TaskSetMode(*ptr); + } + case Command_task_set_state: { + auto ptr = reinterpret_cast(obj); + return new EMC::TaskSetState(*ptr); + } + case Command_task_plan_open: { + auto ptr = reinterpret_cast(obj); + return ptr->UnPack(resolver); + } + case Command_task_plan_run: { + auto ptr = reinterpret_cast(obj); + return new EMC::TaskPlanRun(*ptr); + } + case Command_task_plan_execute: { + auto ptr = reinterpret_cast(obj); + return ptr->UnPack(resolver); + } + case Command_task_plan_reverse: { + auto ptr = reinterpret_cast(obj); + return new EMC::TaskPlanReverse(*ptr); + } + case Command_task_plan_forward: { + auto ptr = reinterpret_cast(obj); + return new EMC::TaskPlanForward(*ptr); + } + case Command_task_plan_step: { + auto ptr = reinterpret_cast(obj); + return new EMC::TaskPlanStep(*ptr); + } + case Command_task_plan_resume: { + auto ptr = reinterpret_cast(obj); + return new EMC::TaskPlanResume(*ptr); + } + case Command_task_plan_end: { + auto ptr = reinterpret_cast(obj); + return new EMC::TaskPlanEnd(*ptr); + } + case Command_task_plan_close: { + auto ptr = reinterpret_cast(obj); + return new EMC::TaskPlanClose(*ptr); + } + case Command_task_plan_init: { + auto ptr = reinterpret_cast(obj); + return new EMC::TaskPlanInit(*ptr); + } + case Command_task_plan_synch: { + auto ptr = reinterpret_cast(obj); + return new EMC::TaskPlanSynch(*ptr); + } + case Command_task_plan_set_optional_stop: { + auto ptr = reinterpret_cast(obj); + return new EMC::TaskPlanSetOptionalStop(*ptr); + } + case Command_task_plan_set_block_delete: { + auto ptr = reinterpret_cast(obj); + return new EMC::TaskPlanSetBlockDelete(*ptr); + } + case Command_task_plan_optional_stop: { + auto ptr = reinterpret_cast(obj); + return new EMC::TaskPlanOptionalStop(*ptr); + } + case Command_tool_cmd: { + auto ptr = reinterpret_cast(obj); + return new EMC::ToolCmd(*ptr); + } + case Command_tool_halt: { + auto ptr = reinterpret_cast(obj); + return new EMC::ToolHalt(*ptr); + } + case Command_tool_abort: { + auto ptr = reinterpret_cast(obj); + return new EMC::ToolAbort(*ptr); + } + case Command_tool_prepare: { + auto ptr = reinterpret_cast(obj); + return new EMC::ToolPrepare(*ptr); + } + case Command_tool_load: { + auto ptr = reinterpret_cast(obj); + return new EMC::ToolLoad(*ptr); + } + case Command_tool_load_tool_table: { + auto ptr = reinterpret_cast(obj); + return ptr->UnPack(resolver); + } + case Command_tool_set_offset: { + auto ptr = reinterpret_cast(obj); + return new EMC::ToolSetOffset(*ptr); + } + case Command_tool_set_number: { + auto ptr = reinterpret_cast(obj); + return new EMC::ToolSetNumber(*ptr); + } + case Command_aux_input_wait: { + auto ptr = reinterpret_cast(obj); + return new EMC::AuxInputWait(*ptr); + } + case Command_spindle_speed: { + auto ptr = reinterpret_cast(obj); + return new EMC::SpindleSpeed(*ptr); + } + case Command_spindle_orient: { + auto ptr = reinterpret_cast(obj); + return new EMC::SpindleOrient(*ptr); + } + case Command_spindle_wait_orient: { + auto ptr = reinterpret_cast(obj); + return new EMC::SpindleWaitOrient(*ptr); + } + case Command_spindle_on: { + auto ptr = reinterpret_cast(obj); + return new EMC::SpindleOn(*ptr); + } + case Command_spindle_off: { + auto ptr = reinterpret_cast(obj); + return new EMC::SpindleOff(*ptr); + } + case Command_spindle_increase: { + auto ptr = reinterpret_cast(obj); + return new EMC::SpindleIncrease(*ptr); + } + case Command_spindle_decrease: { + auto ptr = reinterpret_cast(obj); + return new EMC::SpindleDecrease(*ptr); + } + case Command_spindle_constant: { + auto ptr = reinterpret_cast(obj); + return new EMC::SpindleConstant(*ptr); + } + case Command_spindle_brake_release: { + auto ptr = reinterpret_cast(obj); + return new EMC::SpindleBrakeRelease(*ptr); + } + case Command_spindle_brake_engage: { + auto ptr = reinterpret_cast(obj); + return new EMC::SpindleBrakeEngage(*ptr); + } + case Command_coolant_mist_on: { + auto ptr = reinterpret_cast(obj); + return new EMC::CoolandMistOn(*ptr); + } + case Command_coolant_mist_off: { + auto ptr = reinterpret_cast(obj); + return new EMC::CoolandMistOff(*ptr); + } + case Command_coolant_flood_on: { + auto ptr = reinterpret_cast(obj); + return new EMC::CoolandFloodOn(*ptr); + } + case Command_cooland_flood_off: { + auto ptr = reinterpret_cast(obj); + return new EMC::CoolandFloodOff(*ptr); + } + default: return nullptr; + } +} + +inline flatbuffers::Offset CommandUnion::Pack(flatbuffers::FlatBufferBuilder &_fbb, const flatbuffers::rehasher_function_t *_rehasher) const { + switch (type) { + case Command_set_debug: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_jog_cmd: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_join_set_backlash: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_joint_set_min_position_limit: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_joint_set_max_position_limit: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_joint_set_ferror: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_joint_set_min_ferror: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_joint_set_homing_params: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_joint_home: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_joint_unhome: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_joint_halt: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_jog_cont: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_jog_incr: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_jog_abs: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_jog_stop: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_join_override_limits: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_join_load_comp: { + auto ptr = reinterpret_cast(value); + return CreateJoinLoadComp(_fbb, ptr, _rehasher).Union(); + } + case Command_traj_set_mode: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_traj_set_velocity: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_tral_set_acceleration: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_traj_set_max_velocity: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_traj_set_scale: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_traj_set_rapid_scale: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_traj_set_spindl_scale: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_traj_set_fo_enable: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_traj_set_so_enable: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_traj_set_fh_enable: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_traj_abort: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_traj_pause: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_traj_resume: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_traj_delay: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_traj_linear_move: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_traj_circular_move: { + auto ptr = reinterpret_cast(value); + return CreateTrajCircularMove(_fbb, ptr, _rehasher).Union(); + } + case Command_traj_set_term_cond: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_traj_set_spindle_sync: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_traj_set_offset: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_traj_set_g5x: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_traj_set_g92: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_traj_set_rotation: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_traj_clear_probe_tripped_flag: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_traj_set_teleop_enable: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_traj_probe: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_traj_rigid_tap: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_motion_set_aout: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_motion_set_dout: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_motion_adaptive: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_task_abort: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_task_set_mode: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_task_set_state: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_task_plan_open: { + auto ptr = reinterpret_cast(value); + return CreateTaskPlanOpen(_fbb, ptr, _rehasher).Union(); + } + case Command_task_plan_run: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_task_plan_execute: { + auto ptr = reinterpret_cast(value); + return CreateTaskPlanExecute(_fbb, ptr, _rehasher).Union(); + } + case Command_task_plan_reverse: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_task_plan_forward: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_task_plan_step: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_task_plan_resume: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_task_plan_end: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_task_plan_close: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_task_plan_init: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_task_plan_synch: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_task_plan_set_optional_stop: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_task_plan_set_block_delete: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_task_plan_optional_stop: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_tool_cmd: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_tool_halt: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_tool_abort: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_tool_prepare: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_tool_load: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_tool_load_tool_table: { + auto ptr = reinterpret_cast(value); + return CreateToolLoadToolTable(_fbb, ptr, _rehasher).Union(); + } + case Command_tool_set_offset: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_tool_set_number: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_aux_input_wait: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_spindle_speed: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_spindle_orient: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_spindle_wait_orient: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_spindle_on: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_spindle_off: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_spindle_increase: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_spindle_decrease: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_spindle_constant: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_spindle_brake_release: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_spindle_brake_engage: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_coolant_mist_on: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_coolant_mist_off: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_coolant_flood_on: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + case Command_cooland_flood_off: { + auto ptr = reinterpret_cast(value); + return _fbb.CreateStruct(*ptr).Union(); + } + default: return 0; + } +} + +inline CommandUnion::CommandUnion(const CommandUnion &u) : type(u.type), value(nullptr) { + switch (type) { + case Command_set_debug: { + value = new EMC::SetDebug(*reinterpret_cast(u.value)); + break; + } + case Command_jog_cmd: { + value = new EMC::JogCmd(*reinterpret_cast(u.value)); + break; + } + case Command_join_set_backlash: { + value = new EMC::JointSetBacklash(*reinterpret_cast(u.value)); + break; + } + case Command_joint_set_min_position_limit: { + value = new EMC::JointSetMinPositionLimit(*reinterpret_cast(u.value)); + break; + } + case Command_joint_set_max_position_limit: { + value = new EMC::JointSetMaxPositionLimit(*reinterpret_cast(u.value)); + break; + } + case Command_joint_set_ferror: { + value = new EMC::JointSetFerror(*reinterpret_cast(u.value)); + break; + } + case Command_joint_set_min_ferror: { + value = new EMC::JointSetMinFerror(*reinterpret_cast(u.value)); + break; + } + case Command_joint_set_homing_params: { + value = new EMC::JointSetHomingParams(*reinterpret_cast(u.value)); + break; + } + case Command_joint_home: { + value = new EMC::JointHome(*reinterpret_cast(u.value)); + break; + } + case Command_joint_unhome: { + value = new EMC::JointUnhome(*reinterpret_cast(u.value)); + break; + } + case Command_joint_halt: { + value = new EMC::JointHalt(*reinterpret_cast(u.value)); + break; + } + case Command_jog_cont: { + value = new EMC::JogCont(*reinterpret_cast(u.value)); + break; + } + case Command_jog_incr: { + value = new EMC::JogIncr(*reinterpret_cast(u.value)); + break; + } + case Command_jog_abs: { + value = new EMC::JogAbs(*reinterpret_cast(u.value)); + break; + } + case Command_jog_stop: { + value = new EMC::JogStop(*reinterpret_cast(u.value)); + break; + } + case Command_join_override_limits: { + value = new EMC::JoinOverrideLimits(*reinterpret_cast(u.value)); + break; + } + case Command_join_load_comp: { + value = new EMC::JoinLoadCompT(*reinterpret_cast(u.value)); + break; + } + case Command_traj_set_mode: { + value = new EMC::TrajSetMode(*reinterpret_cast(u.value)); + break; + } + case Command_traj_set_velocity: { + value = new EMC::TrajSetVelocity(*reinterpret_cast(u.value)); + break; + } + case Command_tral_set_acceleration: { + value = new EMC::TrajSetAcceleration(*reinterpret_cast(u.value)); + break; + } + case Command_traj_set_max_velocity: { + value = new EMC::TrajSetMaxVelocity(*reinterpret_cast(u.value)); + break; + } + case Command_traj_set_scale: { + value = new EMC::TrajSetScale(*reinterpret_cast(u.value)); + break; + } + case Command_traj_set_rapid_scale: { + value = new EMC::TrajSetRapidScale(*reinterpret_cast(u.value)); + break; + } + case Command_traj_set_spindl_scale: { + value = new EMC::TrajSetSpindleScale(*reinterpret_cast(u.value)); + break; + } + case Command_traj_set_fo_enable: { + value = new EMC::TrajSetFOEnable(*reinterpret_cast(u.value)); + break; + } + case Command_traj_set_so_enable: { + value = new EMC::TrajSetSOEnable(*reinterpret_cast(u.value)); + break; + } + case Command_traj_set_fh_enable: { + value = new EMC::TrajSetFHEnable(*reinterpret_cast(u.value)); + break; + } + case Command_traj_abort: { + value = new EMC::TrajAbort(*reinterpret_cast(u.value)); + break; + } + case Command_traj_pause: { + value = new EMC::TrajPause(*reinterpret_cast(u.value)); + break; + } + case Command_traj_resume: { + value = new EMC::TrajResume(*reinterpret_cast(u.value)); + break; + } + case Command_traj_delay: { + value = new EMC::TrajDelay(*reinterpret_cast(u.value)); + break; + } + case Command_traj_linear_move: { + FLATBUFFERS_ASSERT(false); // EMC::TrajLinearMove not copyable. + break; + } + case Command_traj_circular_move: { + FLATBUFFERS_ASSERT(false); // EMC::TrajCircularMoveT not copyable. + break; + } + case Command_traj_set_term_cond: { + value = new EMC::TrajSetTermCond(*reinterpret_cast(u.value)); + break; + } + case Command_traj_set_spindle_sync: { + value = new EMC::TrajSetSpindleSync(*reinterpret_cast(u.value)); + break; + } + case Command_traj_set_offset: { + FLATBUFFERS_ASSERT(false); // EMC::TrajSetOffset not copyable. + break; + } + case Command_traj_set_g5x: { + FLATBUFFERS_ASSERT(false); // EMC::TrajSetG5x not copyable. + break; + } + case Command_traj_set_g92: { + FLATBUFFERS_ASSERT(false); // EMC::TrajSetG92 not copyable. + break; + } + case Command_traj_set_rotation: { + value = new EMC::TrajSetRotation(*reinterpret_cast(u.value)); + break; + } + case Command_traj_clear_probe_tripped_flag: { + value = new EMC::TrajClearProbeTrippedFlag(*reinterpret_cast(u.value)); + break; + } + case Command_traj_set_teleop_enable: { + value = new EMC::TrajSetTeleopEnable(*reinterpret_cast(u.value)); + break; + } + case Command_traj_probe: { + FLATBUFFERS_ASSERT(false); // EMC::TrajProbe not copyable. + break; + } + case Command_traj_rigid_tap: { + FLATBUFFERS_ASSERT(false); // EMC::TrajRigidTap not copyable. + break; + } + case Command_motion_set_aout: { + value = new EMC::MotionSetAOut(*reinterpret_cast(u.value)); + break; + } + case Command_motion_set_dout: { + value = new EMC::MotionSetDOut(*reinterpret_cast(u.value)); + break; + } + case Command_motion_adaptive: { + value = new EMC::MotionAdaptive(*reinterpret_cast(u.value)); + break; + } + case Command_task_abort: { + value = new EMC::TaskAbort(*reinterpret_cast(u.value)); + break; + } + case Command_task_set_mode: { + value = new EMC::TaskSetMode(*reinterpret_cast(u.value)); + break; + } + case Command_task_set_state: { + value = new EMC::TaskSetState(*reinterpret_cast(u.value)); + break; + } + case Command_task_plan_open: { + value = new EMC::TaskPlanOpenT(*reinterpret_cast(u.value)); + break; + } + case Command_task_plan_run: { + value = new EMC::TaskPlanRun(*reinterpret_cast(u.value)); + break; + } + case Command_task_plan_execute: { + value = new EMC::TaskPlanExecuteT(*reinterpret_cast(u.value)); + break; + } + case Command_task_plan_reverse: { + value = new EMC::TaskPlanReverse(*reinterpret_cast(u.value)); + break; + } + case Command_task_plan_forward: { + value = new EMC::TaskPlanForward(*reinterpret_cast(u.value)); + break; + } + case Command_task_plan_step: { + value = new EMC::TaskPlanStep(*reinterpret_cast(u.value)); + break; + } + case Command_task_plan_resume: { + value = new EMC::TaskPlanResume(*reinterpret_cast(u.value)); + break; + } + case Command_task_plan_end: { + value = new EMC::TaskPlanEnd(*reinterpret_cast(u.value)); + break; + } + case Command_task_plan_close: { + value = new EMC::TaskPlanClose(*reinterpret_cast(u.value)); + break; + } + case Command_task_plan_init: { + value = new EMC::TaskPlanInit(*reinterpret_cast(u.value)); + break; + } + case Command_task_plan_synch: { + value = new EMC::TaskPlanSynch(*reinterpret_cast(u.value)); + break; + } + case Command_task_plan_set_optional_stop: { + value = new EMC::TaskPlanSetOptionalStop(*reinterpret_cast(u.value)); + break; + } + case Command_task_plan_set_block_delete: { + value = new EMC::TaskPlanSetBlockDelete(*reinterpret_cast(u.value)); + break; + } + case Command_task_plan_optional_stop: { + value = new EMC::TaskPlanOptionalStop(*reinterpret_cast(u.value)); + break; + } + case Command_tool_cmd: { + value = new EMC::ToolCmd(*reinterpret_cast(u.value)); + break; + } + case Command_tool_halt: { + value = new EMC::ToolHalt(*reinterpret_cast(u.value)); + break; + } + case Command_tool_abort: { + value = new EMC::ToolAbort(*reinterpret_cast(u.value)); + break; + } + case Command_tool_prepare: { + value = new EMC::ToolPrepare(*reinterpret_cast(u.value)); + break; + } + case Command_tool_load: { + value = new EMC::ToolLoad(*reinterpret_cast(u.value)); + break; + } + case Command_tool_load_tool_table: { + value = new EMC::ToolLoadToolTableT(*reinterpret_cast(u.value)); + break; + } + case Command_tool_set_offset: { + FLATBUFFERS_ASSERT(false); // EMC::ToolSetOffset not copyable. + break; + } + case Command_tool_set_number: { + value = new EMC::ToolSetNumber(*reinterpret_cast(u.value)); + break; + } + case Command_aux_input_wait: { + value = new EMC::AuxInputWait(*reinterpret_cast(u.value)); + break; + } + case Command_spindle_speed: { + value = new EMC::SpindleSpeed(*reinterpret_cast(u.value)); + break; + } + case Command_spindle_orient: { + value = new EMC::SpindleOrient(*reinterpret_cast(u.value)); + break; + } + case Command_spindle_wait_orient: { + value = new EMC::SpindleWaitOrient(*reinterpret_cast(u.value)); + break; + } + case Command_spindle_on: { + value = new EMC::SpindleOn(*reinterpret_cast(u.value)); + break; + } + case Command_spindle_off: { + value = new EMC::SpindleOff(*reinterpret_cast(u.value)); + break; + } + case Command_spindle_increase: { + value = new EMC::SpindleIncrease(*reinterpret_cast(u.value)); + break; + } + case Command_spindle_decrease: { + value = new EMC::SpindleDecrease(*reinterpret_cast(u.value)); + break; + } + case Command_spindle_constant: { + value = new EMC::SpindleConstant(*reinterpret_cast(u.value)); + break; + } + case Command_spindle_brake_release: { + value = new EMC::SpindleBrakeRelease(*reinterpret_cast(u.value)); + break; + } + case Command_spindle_brake_engage: { + value = new EMC::SpindleBrakeEngage(*reinterpret_cast(u.value)); + break; + } + case Command_coolant_mist_on: { + value = new EMC::CoolandMistOn(*reinterpret_cast(u.value)); + break; + } + case Command_coolant_mist_off: { + value = new EMC::CoolandMistOff(*reinterpret_cast(u.value)); + break; + } + case Command_coolant_flood_on: { + value = new EMC::CoolandFloodOn(*reinterpret_cast(u.value)); + break; + } + case Command_cooland_flood_off: { + value = new EMC::CoolandFloodOff(*reinterpret_cast(u.value)); + break; + } + default: + break; + } +} + +inline void CommandUnion::Reset() { + switch (type) { + case Command_set_debug: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_jog_cmd: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_join_set_backlash: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_joint_set_min_position_limit: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_joint_set_max_position_limit: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_joint_set_ferror: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_joint_set_min_ferror: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_joint_set_homing_params: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_joint_home: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_joint_unhome: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_joint_halt: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_jog_cont: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_jog_incr: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_jog_abs: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_jog_stop: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_join_override_limits: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_join_load_comp: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_traj_set_mode: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_traj_set_velocity: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; } - case Command_set_debug: { - return verifier.Verify(static_cast(obj), 0); + case Command_tral_set_acceleration: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; } - case Command_jog_cmd: { - return verifier.Verify(static_cast(obj), 0); + case Command_traj_set_max_velocity: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; } - case Command_join_set_backlash: { - return verifier.Verify(static_cast(obj), 0); + case Command_traj_set_scale: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; } - case Command_joint_set_min_position_limit: { - return verifier.Verify(static_cast(obj), 0); + case Command_traj_set_rapid_scale: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; } - case Command_joint_set_max_position_limit: { - return verifier.Verify(static_cast(obj), 0); + case Command_traj_set_spindl_scale: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; } - default: return true; - } -} - -inline bool VerifyCommandVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyCommand( - verifier, values->Get(i), types->GetEnum(i))) { - return false; + case Command_traj_set_fo_enable: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; } - } - return true; -} - -inline void *CommandUnion::UnPack(const void *obj, Command type, const flatbuffers::resolver_function_t *resolver) { - switch (type) { - case Command_set_debug: { - auto ptr = reinterpret_cast(obj); - return new EMC::SetDebug(*ptr); + case Command_traj_set_so_enable: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; } - case Command_jog_cmd: { - auto ptr = reinterpret_cast(obj); - return new EMC::JogCmd(*ptr); + case Command_traj_set_fh_enable: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; } - case Command_join_set_backlash: { - auto ptr = reinterpret_cast(obj); - return new EMC::JointSetBacklash(*ptr); + case Command_traj_abort: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; } - case Command_joint_set_min_position_limit: { - auto ptr = reinterpret_cast(obj); - return new EMC::JointSetMinPositionLimit(*ptr); + case Command_traj_pause: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; } - case Command_joint_set_max_position_limit: { - auto ptr = reinterpret_cast(obj); - return new EMC::JointSetMaxPositionLimit(*ptr); + case Command_traj_resume: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; } - default: return nullptr; - } -} - -inline flatbuffers::Offset CommandUnion::Pack(flatbuffers::FlatBufferBuilder &_fbb, const flatbuffers::rehasher_function_t *_rehasher) const { - switch (type) { - case Command_set_debug: { - auto ptr = reinterpret_cast(value); - return _fbb.CreateStruct(*ptr).Union(); + case Command_traj_delay: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; } - case Command_jog_cmd: { - auto ptr = reinterpret_cast(value); - return _fbb.CreateStruct(*ptr).Union(); + case Command_traj_linear_move: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; } - case Command_join_set_backlash: { - auto ptr = reinterpret_cast(value); - return _fbb.CreateStruct(*ptr).Union(); + case Command_traj_circular_move: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; } - case Command_joint_set_min_position_limit: { - auto ptr = reinterpret_cast(value); - return _fbb.CreateStruct(*ptr).Union(); + case Command_traj_set_term_cond: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; } - case Command_joint_set_max_position_limit: { - auto ptr = reinterpret_cast(value); - return _fbb.CreateStruct(*ptr).Union(); + case Command_traj_set_spindle_sync: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; } - default: return 0; - } -} - -inline CommandUnion::CommandUnion(const CommandUnion &u) : type(u.type), value(nullptr) { - switch (type) { - case Command_set_debug: { - value = new EMC::SetDebug(*reinterpret_cast(u.value)); + case Command_traj_set_offset: { + auto ptr = reinterpret_cast(value); + delete ptr; break; } - case Command_jog_cmd: { - value = new EMC::JogCmd(*reinterpret_cast(u.value)); + case Command_traj_set_g5x: { + auto ptr = reinterpret_cast(value); + delete ptr; break; } - case Command_join_set_backlash: { - value = new EMC::JointSetBacklash(*reinterpret_cast(u.value)); + case Command_traj_set_g92: { + auto ptr = reinterpret_cast(value); + delete ptr; break; } - case Command_joint_set_min_position_limit: { - value = new EMC::JointSetMinPositionLimit(*reinterpret_cast(u.value)); + case Command_traj_set_rotation: { + auto ptr = reinterpret_cast(value); + delete ptr; break; } - case Command_joint_set_max_position_limit: { - value = new EMC::JointSetMaxPositionLimit(*reinterpret_cast(u.value)); + case Command_traj_clear_probe_tripped_flag: { + auto ptr = reinterpret_cast(value); + delete ptr; break; } - default: + case Command_traj_set_teleop_enable: { + auto ptr = reinterpret_cast(value); + delete ptr; break; - } -} - -inline void CommandUnion::Reset() { - switch (type) { - case Command_set_debug: { - auto ptr = reinterpret_cast(value); + } + case Command_traj_probe: { + auto ptr = reinterpret_cast(value); delete ptr; break; } - case Command_jog_cmd: { - auto ptr = reinterpret_cast(value); + case Command_traj_rigid_tap: { + auto ptr = reinterpret_cast(value); delete ptr; break; } - case Command_join_set_backlash: { - auto ptr = reinterpret_cast(value); + case Command_motion_set_aout: { + auto ptr = reinterpret_cast(value); delete ptr; break; } - case Command_joint_set_min_position_limit: { - auto ptr = reinterpret_cast(value); + case Command_motion_set_dout: { + auto ptr = reinterpret_cast(value); delete ptr; break; } - case Command_joint_set_max_position_limit: { - auto ptr = reinterpret_cast(value); + case Command_motion_adaptive: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_task_abort: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_task_set_mode: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_task_set_state: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_task_plan_open: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_task_plan_run: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_task_plan_execute: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_task_plan_reverse: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_task_plan_forward: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_task_plan_step: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_task_plan_resume: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_task_plan_end: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_task_plan_close: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_task_plan_init: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_task_plan_synch: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_task_plan_set_optional_stop: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_task_plan_set_block_delete: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_task_plan_optional_stop: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_tool_cmd: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_tool_halt: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_tool_abort: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_tool_prepare: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_tool_load: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_tool_load_tool_table: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_tool_set_offset: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_tool_set_number: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_aux_input_wait: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_spindle_speed: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_spindle_orient: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_spindle_wait_orient: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_spindle_on: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_spindle_off: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_spindle_increase: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_spindle_decrease: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_spindle_constant: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_spindle_brake_release: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_spindle_brake_engage: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_coolant_mist_on: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_coolant_mist_off: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_coolant_flood_on: { + auto ptr = reinterpret_cast(value); + delete ptr; + break; + } + case Command_cooland_flood_off: { + auto ptr = reinterpret_cast(value); delete ptr; break; } diff --git a/src/emc/flatbuf/emc_common.fbs b/src/emc/flatbuf/emc_common.fbs index 5fa9b56bf75..5ba67e7e153 100644 --- a/src/emc/flatbuf/emc_common.fbs +++ b/src/emc/flatbuf/emc_common.fbs @@ -11,3 +11,9 @@ struct Pose { v: double; w: double; } + +struct Cartesian { + x: double; + y: double; + z: double; +} \ No newline at end of file diff --git a/src/emc/flatbuf/emc_common_generated.h b/src/emc/flatbuf/emc_common_generated.h index b89e01d5ffc..6182f771979 100644 --- a/src/emc/flatbuf/emc_common_generated.h +++ b/src/emc/flatbuf/emc_common_generated.h @@ -10,6 +10,8 @@ namespace EMC { struct Pose; +struct Cartesian; + FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Pose FLATBUFFERS_FINAL_CLASS { private: double x_; @@ -75,6 +77,35 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Pose FLATBUFFERS_FINAL_CLASS { }; FLATBUFFERS_STRUCT_END(Pose, 72); +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Cartesian FLATBUFFERS_FINAL_CLASS { + private: + double x_; + double y_; + double z_; + + public: + Cartesian() + : x_(0), + y_(0), + z_(0) { + } + Cartesian(double _x, double _y, double _z) + : x_(flatbuffers::EndianScalar(_x)), + y_(flatbuffers::EndianScalar(_y)), + z_(flatbuffers::EndianScalar(_z)) { + } + double x() const { + return flatbuffers::EndianScalar(x_); + } + double y() const { + return flatbuffers::EndianScalar(y_); + } + double z() const { + return flatbuffers::EndianScalar(z_); + } +}; +FLATBUFFERS_STRUCT_END(Cartesian, 24); + } // namespace EMC #endif // FLATBUFFERS_GENERATED_EMCCOMMON_EMC_H_ diff --git a/src/emc/task/emctaskmain.cc b/src/emc/task/emctaskmain.cc index 7c29944a330..1e9f636fc91 100644 --- a/src/emc/task/emctaskmain.cc +++ b/src/emc/task/emctaskmain.cc @@ -70,6 +70,7 @@ fpu_control_t __fpu_control = _FPU_IEEE & ~(_FPU_MASK_IM | _FPU_MASK_ZM | _FPU_M #endif #include +#include #include "canon.hh" // CANON_TOOL_TABLE stuff #include "config.h" @@ -91,6 +92,7 @@ fpu_control_t __fpu_control = _FPU_IEEE & ~(_FPU_MASK_IM | _FPU_MASK_ZM | _FPU_M #include "../flatbuf/emc_error_generated.h" #include "../flatbuf/emc_stat_generated.h" +#include "../flatbuf/emc_cmd_generated.h" static emcmot_config_t emcmotConfig; @@ -110,7 +112,9 @@ static std::unique_ptr error_socket; static std::unique_ptr status_socket; // NML command channel data pointer -static RCS_CMD_MSG* emcCommand = 0; +//static RCS_CMD_MSG* emcCommand = 0; +using emcCommand_t = std::unique_ptr; +static emcCommand_t emcCommand{0, [](RCS_CMD_MSG*){}}; // global EMC status EMC_STAT* emcStatus = 0; @@ -739,6 +743,77 @@ static bool allow_while_idle_type() return 0; } +template +std::unique_ptr make_msg() +{ + return {new T, [](RCS_CMD_MSG* t){delete t;}}; +} +static emcCommand_t check_0mq() +{ + zmqpp::message zmsg; + bool rc = command_socket->receive(zmsg, true); + if (rc) { + std::string s(static_cast(zmsg.raw_data()), zmsg.size(0)); + std::cerr << "msg received size: " << zmsg.size(0); + auto cmd = EMC::GetCmdChannelMsg(zmsg.raw_data()); + std::cerr << cmd->command_type() << std::endl; + switch (cmd->command_type()) { + + case EMC::Command_set_debug: { + auto msg = make_msg(); + msg->debug = cmd->command_as_set_debug()->debug_level(); + return msg; + } + + case EMC::Command_task_abort: + return make_msg(); + + case EMC::Command_task_set_mode: { + auto msg = make_msg(); + msg->mode = static_cast(cmd->command_as_task_set_mode()->mode()); + return msg; + } + case EMC::Command_task_set_state: { + auto msg = make_msg(); + msg->state = static_cast(cmd->command_as_task_set_state()->state()); + return msg; + } + case EMC::Command_task_plan_open: { + auto msg = make_msg(); + rtapi_strlcpy(msg->file, cmd->command_as_task_plan_open()->file()->c_str(), sizeof(msg->file)); + } + case EMC::Command_task_plan_run: + return make_msg(); + case EMC::Command_task_plan_execute: { + auto msg = make_msg(); + rtapi_strlcpy(msg->command, cmd->command_as_task_plan_execute()->command()->c_str(), sizeof(msg->command)); + return msg; + } + case EMC::Command_task_plan_reverse: + return make_msg(); + case EMC::Command_task_plan_forward: + return make_msg(); + case EMC::Command_task_plan_step: + return make_msg(); + case EMC::Command_task_plan_resume: + return make_msg(); + case EMC::Command_task_plan_end: + return make_msg(); + case EMC::Command_task_plan_close: + return make_msg(); + case EMC::Command_task_plan_init: + return make_msg(); + case EMC::Command_task_plan_synch: + return make_msg(); + case EMC::Command_NONE: + default: + break; + + } + } + return {nullptr, [](RCS_CMD_MSG*){}}; +} + /* emcTaskPlan() @@ -750,7 +825,8 @@ static int emcTaskPlan(void) int retval = 0; // check for new command - if (emcCommand->serial_number != emcStatus->echo_serial_number) { + if ((emcCommand->serial_number != emcStatus->echo_serial_number) || + emcCommand.get() != emcCommandBuffer->get_address()) { // flag it here locally as a new command type = emcCommand->type; } else { @@ -762,7 +838,7 @@ static int emcTaskPlan(void) switch (type) { case EMC_OPERATOR_ERROR_TYPE: case EMC_OPERATOR_TEXT_TYPE: - case EMC_OPERATOR_DISPLAY_TYPE: retval = emcTaskIssueCommand(emcCommand); return retval; + case EMC_OPERATOR_DISPLAY_TYPE: retval = emcTaskIssueCommand(emcCommand.get()); return retval; } // handle any new command @@ -817,20 +893,20 @@ static int emcTaskPlan(void) case EMC_MOTION_SET_AOUT_TYPE: case EMC_TRAJ_RIGID_TAP_TYPE: case EMC_TRAJ_SET_TELEOP_ENABLE_TYPE: - case EMC_SET_DEBUG_TYPE: retval = emcTaskIssueCommand(emcCommand); break; + case EMC_SET_DEBUG_TYPE: retval = emcTaskIssueCommand(emcCommand.get()); break; // one case where we need to be in manual mode case EMC_JOINT_OVERRIDE_LIMITS_TYPE: retval = 0; if (emcStatus->task.mode == EMC_TASK_MODE::MANUAL) { - retval = emcTaskIssueCommand(emcCommand); + retval = emcTaskIssueCommand(emcCommand.get()); } break; case EMC_TOOL_LOAD_TOOL_TABLE_TYPE: { // send to IO emcTaskQueueCommand(std::make_unique( - *static_cast(emcCommand))); + *static_cast(emcCommand.get()))); // signify no more reading emcTaskPlanSetWait(); // then resynch interpreter @@ -840,7 +916,7 @@ static int emcTaskPlan(void) case EMC_TOOL_SET_OFFSET_TYPE: { // send to IO emcTaskQueueCommand(std::make_unique( - *static_cast(emcCommand))); + *static_cast(emcCommand.get()))); // signify no more reading emcTaskPlanSetWait(); // then resynch interpreter @@ -851,7 +927,7 @@ static int emcTaskPlan(void) case EMC_TOOL_SET_NUMBER_TYPE: { // send to IO emcTaskQueueCommand(std::make_unique( - *static_cast(emcCommand))); + *static_cast(emcCommand.get()))); // signify no more reading emcTaskPlanSetWait(); // then resynch interpreter @@ -948,7 +1024,7 @@ static int emcTaskPlan(void) case EMC_TRAJ_RIGID_TAP_TYPE: case EMC_TRAJ_SET_TELEOP_ENABLE_TYPE: case EMC_SET_DEBUG_TYPE: - retval = emcTaskIssueCommand(emcCommand); + retval = emcTaskIssueCommand(emcCommand.get()); break; // queued commands @@ -958,13 +1034,13 @@ static int emcTaskPlan(void) // externally emcTaskQueueTaskPlanSynchCmd(); // and now call for interpreter execute - retval = emcTaskIssueCommand(emcCommand); + retval = emcTaskIssueCommand(emcCommand.get()); break; case EMC_TOOL_LOAD_TOOL_TABLE_TYPE: { // send to IO emcTaskQueueCommand(std::make_unique( - *static_cast(emcCommand))); + *static_cast(emcCommand.get()))); // signify no more reading emcTaskPlanSetWait(); // then resynch interpreter @@ -974,7 +1050,7 @@ static int emcTaskPlan(void) case EMC_TOOL_SET_OFFSET_TYPE: { // send to IO emcTaskQueueCommand(std::make_unique( - *static_cast(emcCommand))); + *static_cast(emcCommand.get()))); // signify no more reading emcTaskPlanSetWait(); // then resynch interpreter @@ -985,7 +1061,7 @@ static int emcTaskPlan(void) case EMC_TOOL_SET_NUMBER_TYPE: { // send to IO emcTaskQueueCommand(std::make_unique( - *static_cast(emcCommand))); + *static_cast(emcCommand.get()))); // signify no more reading emcTaskPlanSetWait(); // then resynch interpreter @@ -1071,7 +1147,7 @@ static int emcTaskPlan(void) case EMC_TRAJ_PROBE_TYPE: case EMC_AUX_INPUT_WAIT_TYPE: case EMC_TRAJ_RIGID_TAP_TYPE: - case EMC_SET_DEBUG_TYPE: retval = emcTaskIssueCommand(emcCommand); break; + case EMC_SET_DEBUG_TYPE: retval = emcTaskIssueCommand(emcCommand.get()); break; case EMC_TASK_PLAN_STEP_TYPE: // handles case where first action is to step the program @@ -1092,7 +1168,7 @@ static int emcTaskPlan(void) case EMC_TOOL_LOAD_TOOL_TABLE_TYPE: { // send to IO emcTaskQueueCommand(std::make_unique( - *static_cast(emcCommand))); + *static_cast(emcCommand.get()))); // signify no more reading emcTaskPlanSetWait(); // then resynch interpreter @@ -1102,7 +1178,7 @@ static int emcTaskPlan(void) case EMC_TOOL_SET_OFFSET_TYPE: { // send to IO emcTaskQueueCommand(std::make_unique( - *static_cast(emcCommand))); + *static_cast(emcCommand.get()))); // signify no more reading emcTaskPlanSetWait(); // then resynch interpreter @@ -1114,7 +1190,7 @@ static int emcTaskPlan(void) default: // EMC_TASK_MODE::AUTO(2) && EMC_TASK_INTERP::IDLE(1) if (allow_while_idle_type()) { - retval = emcTaskIssueCommand(emcCommand); + retval = emcTaskIssueCommand(emcCommand.get()); break; } emcOperatorError(_("can't do that (%s) in auto mode with the interpreter idle"), @@ -1172,7 +1248,7 @@ static int emcTaskPlan(void) case EMC_COOLANT_MIST_OFF_TYPE: case EMC_COOLANT_FLOOD_ON_TYPE: case EMC_COOLANT_FLOOD_OFF_TYPE: - retval = emcTaskIssueCommand(emcCommand); + retval = emcTaskIssueCommand(emcCommand.get()); return retval; break; @@ -1249,7 +1325,7 @@ static int emcTaskPlan(void) case EMC_TRAJ_PROBE_TYPE: case EMC_AUX_INPUT_WAIT_TYPE: case EMC_TRAJ_RIGID_TAP_TYPE: - case EMC_SET_DEBUG_TYPE: retval = emcTaskIssueCommand(emcCommand); break; + case EMC_SET_DEBUG_TYPE: retval = emcTaskIssueCommand(emcCommand.get()); break; case EMC_TASK_PLAN_STEP_TYPE: stepping = 1; @@ -1323,7 +1399,7 @@ static int emcTaskPlan(void) case EMC_COOLANT_MIST_ON_TYPE: case EMC_COOLANT_MIST_OFF_TYPE: case EMC_COOLANT_FLOOD_ON_TYPE: - case EMC_COOLANT_FLOOD_OFF_TYPE: retval = emcTaskIssueCommand(emcCommand); break; + case EMC_COOLANT_FLOOD_OFF_TYPE: retval = emcTaskIssueCommand(emcCommand.get()); break; case EMC_TASK_PLAN_STEP_TYPE: stepping = 1; // set stepping mode in case it's not @@ -1411,7 +1487,7 @@ static int emcTaskPlan(void) case EMC_MOTION_SET_AOUT_TYPE: case EMC_MOTION_ADAPTIVE_TYPE: case EMC_TRAJ_RIGID_TAP_TYPE: - case EMC_SET_DEBUG_TYPE: retval = emcTaskIssueCommand(emcCommand); break; + case EMC_SET_DEBUG_TYPE: retval = emcTaskIssueCommand(emcCommand.get()); break; case EMC_TASK_PLAN_EXECUTE_TYPE: // If there are no queued MDI commands, no commands in @@ -1421,11 +1497,11 @@ static int emcTaskPlan(void) // later. if ((mdi_execute_queue.len() == 0) && (interp_list.len() == 0) && (emcTaskCommand == NULL) && (emcTaskPlanIsWait() == 0)) { - retval = emcTaskIssueCommand(emcCommand); + retval = emcTaskIssueCommand(emcCommand.get()); } else { auto cmd = std::make_unique(); rtapi_strlcpy(cmd->command, - static_cast(emcCommand)->command, + static_cast(emcCommand.get())->command, sizeof(cmd->command)); mdi_execute_queue.append(std::move(cmd)); emcStatus->task.queuedMDIcommands = mdi_execute_queue.len(); @@ -1436,7 +1512,7 @@ static int emcTaskPlan(void) case EMC_TOOL_LOAD_TOOL_TABLE_TYPE: { // send to IO emcTaskQueueCommand(std::make_unique( - *static_cast(emcCommand))); + *static_cast(emcCommand.get()))); // signify no more reading emcTaskPlanSetWait(); // then resynch interpreter @@ -1446,7 +1522,7 @@ static int emcTaskPlan(void) case EMC_TOOL_SET_OFFSET_TYPE: { // send to IO emcTaskQueueCommand(std::make_unique( - *static_cast(emcCommand))); + *static_cast(emcCommand.get()))); // signify no more reading emcTaskPlanSetWait(); // then resynch interpreter @@ -1458,7 +1534,7 @@ static int emcTaskPlan(void) default: // EMC_TASK_MODE::MDI(3) && EMC_TASK_INTERP::IDLE(1) if (allow_while_idle_type()) { - retval = emcTaskIssueCommand(emcCommand); + retval = emcTaskIssueCommand(emcCommand.get()); break; } emcOperatorError(_("can't do that (%s:%d) in MDI mode"), @@ -1613,9 +1689,10 @@ static int emcTaskIssueCommand(NMLmsg* cmd) if (emc_debug & EMC_DEBUG_TASK_ISSUE) { rcs_print("emcTaskIssueCommand() null command\n"); } return 0; } - if (emc_debug & EMC_DEBUG_TASK_ISSUE) { - rcs_print("Issuing %s -- \t (%s)\n", + if (true || emc_debug & EMC_DEBUG_TASK_ISSUE) { + rcs_print("Issuing %s %d -- \t (%s)\n", emcSymbolLookup(cmd->type), + static_cast(cmd)->serial_number, emcCommandBuffer->msg2str(cmd)); } switch (cmd->type) { @@ -2797,7 +2874,7 @@ static int emctask_startup() return -1; } // get our command data structure - emcCommand = emcCommandBuffer->get_address(); + emcCommand = emcCommand_t{emcCommandBuffer->get_address(), [](RCS_CMD_MSG*){}}; // get the NML status buffer if (!(emc_debug & EMC_DEBUG_NML)) { @@ -3176,7 +3253,7 @@ int main(int argc, char* argv[]) status_socket->bind("tcp://*:5028"); // only keep last status update // att, conflate is not compatible with subscription filters - status_socket->set(zmqpp::socket_option::conflate, 1); + //status_socket->set(zmqpp::socket_option::conflate, 1); error_socket->bind("inproc://linuxcnc-error"); error_socket->bind("ipc://linuxcnc-error"); error_socket->bind("tcp://*:5029"); @@ -3238,7 +3315,16 @@ int main(int argc, char* argv[]) // got a new command, so clear out errors taskPlanError = 0; taskExecuteError = 0; + emcCommand = emcCommand_t{emcCommandBuffer->get_address(), [](RCS_CMD_MSG*){}}; + std::cerr << emcCommandBuffer->cms->header.write_id << " " << emcCommandBuffer->cms->queuing_header.write_id << std::endl; + } + else if (auto msg = check_0mq()) { + // got a new command, so clear out errors + taskPlanError = 0; + taskExecuteError = 0; + emcCommand = std::move(msg); } + // run control cycle if (0 != emcTaskPlan()) taskPlanError = 1; if (0 != emcTaskExecute()) taskExecuteError = 1;