|
|
namespace CncSimulator.Device
|
|
|
{
|
|
|
/// <summary>单台模拟设备的完整状态</summary>
|
|
|
public class DeviceState
|
|
|
{
|
|
|
// 固定信息
|
|
|
public string DeviceCode { get; set; }
|
|
|
public string Desc { get; set; }
|
|
|
|
|
|
// 动态状态
|
|
|
public string CurrentScenario { get; set; } = "idle";
|
|
|
public bool IsOnline { get; set; } = true;
|
|
|
public string ProgramName { get; set; } = "O0001";
|
|
|
public int PartCount { get; set; } = 0;
|
|
|
public int DeviceStatus { get; set; } = 1; // _io_status
|
|
|
public int RunStatus { get; set; } = 0; // 0=待机 1=运行 3=加工中
|
|
|
public int OperateMode { get; set; } = 1; // 1=MEM 10=JOG
|
|
|
public decimal SpindleSpeedSet { get; set; } = 450;
|
|
|
public decimal FeedSpeedSet { get; set; } = 60;
|
|
|
public decimal SpindleSpeedActual { get; set; } = 0;
|
|
|
public decimal FeedSpeedActual { get; set; } = 0;
|
|
|
public decimal SpindleLoad { get; set; } = 0;
|
|
|
public decimal SpindleOverride { get; set; } = 100;
|
|
|
public decimal PowerOnTime { get; set; } = 0;
|
|
|
public decimal RunTime { get; set; } = 0;
|
|
|
public decimal CuttingTime { get; set; } = 0;
|
|
|
public decimal CycleTime { get; set; } = 0;
|
|
|
public string MachiningStatus { get; set; } = "";
|
|
|
public string ProgramContent { get; set; } = "";
|
|
|
|
|
|
// 剧本控制
|
|
|
public int ScenarioTick { get; set; } = 0;
|
|
|
public int ScenarioDuration { get; set; } = 10;
|
|
|
|
|
|
// 上一次的part_count(用于检测手动清零)
|
|
|
public int LastPartCount { get; set; } = 0;
|
|
|
|
|
|
// 累计数据变化间隔(用于递增时间字段)
|
|
|
public int DataChangeInterval { get; set; } = 10;
|
|
|
}
|
|
|
}
|