You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
haoliang-net/Device/DeviceState.cs

42 lines
1.7 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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;
}
}