module SampleModule { // 定义枚举类型,用于表示命令的状态 enum CommandState { STOP, // 停止 START // 启动 }; // 一次性采样配置数据 struct SampleConfig { uint16 unifiedDepth; // 统一深度(全段面采样时使用) uint8 sampleOrder; // 大车行进顺序(1: 原点往外,2: 往原点采) }; // 采样命令结构体 struct SampleCommand { uint32 maskBits; // 32位掩码,表示哪些字段被修改 uint8 controlType; // 控制类型(1: 就地,2: 远程) CommandState startSample; // 启动采样命令 CommandState stopSample; // 停止采样命令 CommandState reset; // 系统复位命令 CommandState positionCheck; // 位置确认命令 CommandState emergencyUp; // 紧急提升命令 CommandState emergencyStop; // 系统急停命令 CommandState controlBelt1; // 启停皮带1 CommandState controlBelt2; // 启停皮带2 CommandState controlCrush1; // 启停破碎机1 CommandState controlCrush2; // 启停破碎机2 CommandState controlDivider; // 启停缩分器 CommandState controlCoalDistributor; // 打开布煤器 uint16 reductionRatio; // 缩分比 uint8 version; // 结构体版本号(可选) }; // 定义枚举类型,用于表示设备状态 enum DeviceState { OFF, // 关闭 ON, // 启动 ERROR // 错误状态 }; // 采样机状态信息 struct SampleMachineInfo { uint32 maskBits; // 32位掩码,表示哪些字段被修改 uint16 bigPoint; // 大车位置 uint16 smallPoint; // 小车位置 uint16 depthPoint; // 深度位置 uint8 hasToXY; // 到达坐标点(0: 未到达,1: 已到达) uint8 hasSamplePoints; // 已采样点数 uint8 gameOver; // 采样完成(0: 未完成,1: 完成) uint16 backState; // 采样状态返回 DeviceState sampleState; // 采样机状态 DeviceState belt1State; // 皮带1状态 DeviceState belt2State; // 皮带2状态 DeviceState crush1State; // 破碎机1状态 DeviceState crush2State; // 破碎机2状态 DeviceState dividerState; // 缩分器状态 uint8 bigLimit; // 大车限位(0: 未限位,1: 已限位) uint8 bigZeroLimit; // 大车零点限位(0: 未限位,1: 已限位) uint8 smallLimit; // 小车限位(0: 未限位,1: 已限位) uint8 smallZeroLimit; // 小车零点限位(0: 未限位,1: 已限位) uint8 upLimit; // 升高限位(0: 未限位,1: 已限位) uint8 downLimit; // 降低限位(0: 未限位,1: 已限位) uint8 version; // 结构体版本号(可选) }; // 定义枚举类型,用于表示落料选择 enum DropChoice { BYPASS, // 旁路 CRUSHER // 破碎机 }; // 采样点信息 struct SamplePoints { uint8 totalPoints; // 采样点数量 uint16 x1; // 采样点1 X 坐标 uint16 y1; // 采样点1 Y 坐标 uint16 z1; // 采样点1 Z 坐标 DropChoice o1; // 采样点1 落料选择 uint16 x2; // 采样点2 X 坐标 uint16 y2; // 采样点2 Y 坐标 uint16 z2; // 采样点2 Z 坐标 DropChoice o2; // 采样点2 落料选择 uint16 x3; // 采样点3 X 坐标 uint16 y3; // 采样点3 Y 坐标 uint16 z3; // 采样点3 Z 坐标 DropChoice o3; // 采样点3 落料选择 uint16 x4; // 采样点4 X 坐标 uint16 y4; // 采样点4 Y 坐标 uint16 z4; // 采样点4 Z 坐标 DropChoice o4; // 采样点4 落料选择 uint16 x5; // 采样点5 X 坐标 uint16 y5; // 采样点5 Y 坐标 uint16 z5; // 采样点5 Z 坐标 DropChoice o5; // 采样点5 落料选择 uint16 x6; // 采样点6 X 坐标 uint16 y6; // 采样点6 Y 坐标 uint16 z6; // 采样点6 Z 坐标 DropChoice o6; // 采样点6 落料选择 }; };