diff --git a/CapMachine.Model/ActionLog.cs b/CapMachine.Model/ActionLog.cs new file mode 100644 index 0000000..01d96a2 --- /dev/null +++ b/CapMachine.Model/ActionLog.cs @@ -0,0 +1,47 @@ +using FreeSql.DataAnnotations; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Model +{ + /// + /// ActionLog + /// 动作日志 + /// + [Table(Name = "ActionLog")] + public class ActionLog + { + /// + /// 主键 + /// + [Column(IsPrimary = true, IsIdentity = true)] + public long Id { get; set; } + + /// + /// 等级 + /// + [Column(Name = "Level")] + public int Level { get; set; } + + /// + /// 分类 + /// + [Column(Name = "Category", IsNullable = true, StringLength = 30)] + public string? Category { get; set; } + + /// + /// 内容 + /// + [Column(Name = "Content", IsNullable = true, StringLength = 300)] + public string? Content { get; set; } + + /// + /// 创建时间 + /// + [Column(ServerTime = DateTimeKind.Local, CanUpdate = false)] + public DateTime CreateTime { get; set; } + } +} diff --git a/CapMachine.Model/MeterConfig/MeterCond1Temp.cs b/CapMachine.Model/MeterConfig/MeterCond1Temp.cs new file mode 100644 index 0000000..27d1e18 --- /dev/null +++ b/CapMachine.Model/MeterConfig/MeterCond1Temp.cs @@ -0,0 +1,70 @@ +using FreeSql.DataAnnotations; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Model +{ + /// + /// COND1温度 表设置 + /// + [Table(Name = "MeterCond1Temp")] + public class MeterCond1Temp + { + /// + /// 主键 + /// + [Column(IsPrimary = true, IsIdentity = true)] + public long Id { get; set; } + + /// + /// 程序步骤序号 + /// + [Column(Name = "StepNo")] + public int StepNo { get; set; } + + /// + /// 开始值 + /// + [Column(Name = "StartValue")] + public double StartValue { get; set; } + + /// + /// 结束值 + /// + [Column(Name = "EndValue")] + public double EndValue { get; set; } + + /// + /// 维持时间 + /// + [Column(Name = "KeepTime")] + public double KeepTime { get; set; } + + /// + /// 配置值类型 + /// + [Column(MapType = typeof(int))] + public ConfigValueType ValueType { get; set; } + + /// + /// 常值 + /// 在ValueType为常值时会使用 + /// + [Column(Name = "Constant")] + public double Constant { get; set; } + + + [Column(ServerTime = DateTimeKind.Local, CanUpdate = false)] + public DateTime CreateTime { get; set; } + + /// + /// ///////////////////////////////////////////导航属性/////////////////////////////////////////////////////// + /// + + public long ProStepId { get; set; } + public ProStep? ProStep { get; set; } + } +} diff --git a/CapMachine.Model/MeterConfig/MeterCond2Temp.cs b/CapMachine.Model/MeterConfig/MeterCond2Temp.cs new file mode 100644 index 0000000..869d470 --- /dev/null +++ b/CapMachine.Model/MeterConfig/MeterCond2Temp.cs @@ -0,0 +1,70 @@ +using FreeSql.DataAnnotations; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Model +{ + /// + /// COND2温度 表设置 + /// + [Table(Name = "MeterCond2Temp")] + public class MeterCond2Temp + { + /// + /// 主键 + /// + [Column(IsPrimary = true, IsIdentity = true)] + public long Id { get; set; } + + /// + /// 程序步骤序号 + /// + [Column(Name = "StepNo")] + public int StepNo { get; set; } + + /// + /// 开始值 + /// + [Column(Name = "StartValue")] + public double StartValue { get; set; } + + /// + /// 结束值 + /// + [Column(Name = "EndValue")] + public double EndValue { get; set; } + + /// + /// 维持时间 + /// + [Column(Name = "KeepTime")] + public double KeepTime { get; set; } + + /// + /// 配置值类型 + /// + [Column(MapType = typeof(int))] + public ConfigValueType ValueType { get; set; } + + /// + /// 常值 + /// 在ValueType为常值时会使用 + /// + [Column(Name = "Constant")] + public double Constant { get; set; } + + + [Column(ServerTime = DateTimeKind.Local, CanUpdate = false)] + public DateTime CreateTime { get; set; } + + /// + /// ///////////////////////////////////////////导航属性/////////////////////////////////////////////////////// + /// + + public long ProStepId { get; set; } + public ProStep? ProStep { get; set; } + } +} diff --git a/CapMachine.Model/MeterConfig/MeterCondPress.cs b/CapMachine.Model/MeterConfig/MeterCondPress.cs new file mode 100644 index 0000000..0248e1f --- /dev/null +++ b/CapMachine.Model/MeterConfig/MeterCondPress.cs @@ -0,0 +1,70 @@ +using FreeSql.DataAnnotations; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Model +{ + /// + /// COND2压力 表设置 + /// + [Table(Name = "MeterCondPress")] + public class MeterCondPress + { + /// + /// 主键 + /// + [Column(IsPrimary = true, IsIdentity = true)] + public long Id { get; set; } + + /// + /// 程序步骤序号 + /// + [Column(Name = "StepNo")] + public int StepNo { get; set; } + + /// + /// 开始值 + /// + [Column(Name = "StartValue")] + public double StartValue { get; set; } + + /// + /// 结束值 + /// + [Column(Name = "EndValue")] + public double EndValue { get; set; } + + /// + /// 维持时间 + /// + [Column(Name = "KeepTime")] + public double KeepTime { get; set; } + + /// + /// 配置值类型 + /// + [Column(MapType = typeof(int))] + public ConfigValueType ValueType { get; set; } + + /// + /// 常值 + /// 在ValueType为常值时会使用 + /// + [Column(Name = "Constant")] + public double Constant { get; set; } + + + [Column(ServerTime = DateTimeKind.Local, CanUpdate = false)] + public DateTime CreateTime { get; set; } + + /// + /// ///////////////////////////////////////////导航属性/////////////////////////////////////////////////////// + /// + + public long ProStepId { get; set; } + public ProStep? ProStep { get; set; } + } +} diff --git a/CapMachine.Model/MeterConfig/MeterEVAPExpTemp.cs b/CapMachine.Model/MeterConfig/MeterEVAPExpTemp.cs new file mode 100644 index 0000000..46383b0 --- /dev/null +++ b/CapMachine.Model/MeterConfig/MeterEVAPExpTemp.cs @@ -0,0 +1,70 @@ +using FreeSql.DataAnnotations; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Model +{ + /// + /// EVAP出口温度(℃) 表设置 + /// + [Table(Name = "MeterEVAPExpTemp")] + public class MeterEVAPExpTemp + { + /// + /// 主键 + /// + [Column(IsPrimary = true, IsIdentity = true)] + public long Id { get; set; } + + /// + /// 程序步骤序号 + /// + [Column(Name = "StepNo")] + public int StepNo { get; set; } + + /// + /// 开始值 + /// + [Column(Name = "StartValue")] + public double StartValue { get; set; } + + /// + /// 结束值 + /// + [Column(Name = "EndValue")] + public double EndValue { get; set; } + + /// + /// 维持时间 + /// + [Column(Name = "KeepTime")] + public double KeepTime { get; set; } + + /// + /// 配置值类型 + /// + [Column(MapType = typeof(int))] + public ConfigValueType ValueType { get; set; } + + /// + /// 常值 + /// 在ValueType为常值时会使用 + /// + [Column(Name = "Constant")] + public double Constant { get; set; } + + + [Column(ServerTime = DateTimeKind.Local, CanUpdate = false)] + public DateTime CreateTime { get; set; } + + /// + /// ///////////////////////////////////////////导航属性/////////////////////////////////////////////////////// + /// + + public long ProStepId { get; set; } + public ProStep? ProStep { get; set; } + } +} diff --git a/CapMachine.Model/MeterConfig/MeterExPress.cs b/CapMachine.Model/MeterConfig/MeterExPress.cs new file mode 100644 index 0000000..b278787 --- /dev/null +++ b/CapMachine.Model/MeterConfig/MeterExPress.cs @@ -0,0 +1,71 @@ +using FreeSql.DataAnnotations; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Model +{ + /// + /// 排气压力设置 + /// + [Table(Name = "MeterExPress")] + public class MeterExPress + { + /// + /// 主键 + /// + [Column(IsPrimary = true, IsIdentity = true)] + public long Id { get; set; } + + /// + /// 程序步骤序号 + /// + [Column(Name = "StepNo")] + public int StepNo { get; set; } + + /// + /// 开始值 + /// + [Column(Name = "StartValue")] + public double StartValue { get; set; } + + /// + /// 结束值 + /// + [Column(Name = "EndValue")] + public double EndValue { get; set; } + + /// + /// 维持时间 + /// + [Column(Name = "KeepTime")] + public double KeepTime { get; set; } + + /// + /// 配置值类型 + /// + [Column(MapType = typeof(int))] + public ConfigValueType ValueType { get; set; } + + /// + /// 常值 + /// 在ValueType为常值时会使用 + /// + [Column(Name = "Constant")] + public double Constant { get; set; } + + + [Column(ServerTime = DateTimeKind.Local, CanUpdate = false)] + public DateTime CreateTime { get; set; } + + /// + /// ///////////////////////////////////////////导航属性/////////////////////////////////////////////////////// + /// + + public long ProStepId { get; set; } + public ProStep? ProStep { get; set; } + + } +} diff --git a/CapMachine.Model/MeterConfig/MeterHVVol.cs b/CapMachine.Model/MeterConfig/MeterHVVol.cs new file mode 100644 index 0000000..b123d1e --- /dev/null +++ b/CapMachine.Model/MeterConfig/MeterHVVol.cs @@ -0,0 +1,70 @@ +using FreeSql.DataAnnotations; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Model +{ + /// + /// HV电压 表设置 + /// + [Table(Name = "MeterHVVol")] + public class MeterHVVol + { + /// + /// 主键 + /// + [Column(IsPrimary = true, IsIdentity = true)] + public long Id { get; set; } + + /// + /// 程序步骤序号 + /// + [Column(Name = "StepNo")] + public int StepNo { get; set; } + + /// + /// 开始值 + /// + [Column(Name = "StartValue")] + public double StartValue { get; set; } + + /// + /// 结束值 + /// + [Column(Name = "EndValue")] + public double EndValue { get; set; } + + /// + /// 维持时间 + /// + [Column(Name = "KeepTime")] + public double KeepTime { get; set; } + + /// + /// 配置值类型 + /// + [Column(MapType = typeof(int))] + public ConfigValueType ValueType { get; set; } + + /// + /// 常值 + /// 在ValueType为常值时会使用 + /// + [Column(Name = "Constant")] + public double Constant { get; set; } + + + [Column(ServerTime = DateTimeKind.Local, CanUpdate = false)] + public DateTime CreateTime { get; set; } + + /// + /// ///////////////////////////////////////////导航属性/////////////////////////////////////////////////////// + /// + + public long ProStepId { get; set; } + public ProStep? ProStep { get; set; } + } +} diff --git a/CapMachine.Model/MeterConfig/MeterInhPress.cs b/CapMachine.Model/MeterConfig/MeterInhPress.cs new file mode 100644 index 0000000..8d98cb2 --- /dev/null +++ b/CapMachine.Model/MeterConfig/MeterInhPress.cs @@ -0,0 +1,65 @@ +using FreeSql.DataAnnotations; + +namespace CapMachine.Model +{ + /// + /// 吸气压力 表设置 + /// + [Table(Name = "MeterInhPress")] + public class MeterInhPress + { + /// + /// 主键 + /// + [Column(IsPrimary = true, IsIdentity = true)] + public long Id { get; set; } + + /// + /// 程序步骤序号 + /// + [Column(Name = "StepNo")] + public int StepNo { get; set; } + + /// + /// 开始值 + /// + [Column(Name = "StartValue")] + public double StartValue { get; set; } + + /// + /// 结束值 + /// + [Column(Name = "EndValue")] + public double EndValue { get; set; } + + /// + /// 维持时间 + /// + [Column(Name = "KeepTime")] + public double KeepTime { get; set; } + + /// + /// 配置值类型 + /// + [Column(MapType = typeof(int))] + public ConfigValueType ValueType { get; set; } + + /// + /// 常值 + /// 在ValueType为常值时会使用 + /// + [Column(Name = "Constant")] + public double Constant { get; set; } + + + [Column(ServerTime = DateTimeKind.Local, CanUpdate = false)] + public DateTime CreateTime { get; set; } + + /// + /// ///////////////////////////////////////////导航属性/////////////////////////////////////////////////////// + /// + + public long ProStepId { get; set; } + public ProStep? ProStep { get; set; } + } +} diff --git a/CapMachine.Model/MeterConfig/MeterInhTemp.cs b/CapMachine.Model/MeterConfig/MeterInhTemp.cs new file mode 100644 index 0000000..316a9d3 --- /dev/null +++ b/CapMachine.Model/MeterConfig/MeterInhTemp.cs @@ -0,0 +1,66 @@ +using FreeSql.DataAnnotations; + +namespace CapMachine.Model +{ + /// + /// 吸气温度 设置 + /// + [Table(Name = "MeterInhTemp")] + public class MeterInhTemp + { + /// + /// 主键 + /// + [Column(IsPrimary = true, IsIdentity = true)] + public long Id { get; set; } + + /// + /// 程序步骤序号 + /// + [Column(Name = "StepNo")] + public int StepNo { get; set; } + + /// + /// 开始值 + /// + [Column(Name = "StartValue")] + public double StartValue { get; set; } + + /// + /// 结束值 + /// + [Column(Name = "EndValue")] + public double EndValue { get; set; } + + /// + /// 维持时间 + /// + [Column(Name = "KeepTime")] + public double KeepTime { get; set; } + + /// + /// 配置值类型 + /// + [Column(MapType = typeof(int))] + public ConfigValueType ValueType { get; set; } + + /// + /// 常值 + /// 在ValueType为常值时会使用 + /// + [Column(Name = "Constant")] + public double Constant { get; set; } + + + [Column(ServerTime = DateTimeKind.Local, CanUpdate = false)] + public DateTime CreateTime { get; set; } + + /// + /// ///////////////////////////////////////////导航属性/////////////////////////////////////////////////////// + /// + + public long ProStepId { get; set; } + public ProStep? ProStep { get; set; } + + } +} diff --git a/CapMachine.Model/MeterConfig/MeterLVVol.cs b/CapMachine.Model/MeterConfig/MeterLVVol.cs new file mode 100644 index 0000000..19eb742 --- /dev/null +++ b/CapMachine.Model/MeterConfig/MeterLVVol.cs @@ -0,0 +1,70 @@ +using FreeSql.DataAnnotations; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Model +{ + /// + /// LV电压 表设置 + /// + [Table(Name = "MeterLVVol")] + public class MeterLVVol + { + /// + /// 主键 + /// + [Column(IsPrimary = true, IsIdentity = true)] + public long Id { get; set; } + + /// + /// 程序步骤序号 + /// + [Column(Name = "StepNo")] + public int StepNo { get; set; } + + /// + /// 开始值 + /// + [Column(Name = "StartValue")] + public double StartValue { get; set; } + + /// + /// 结束值 + /// + [Column(Name = "EndValue")] + public double EndValue { get; set; } + + /// + /// 维持时间 + /// + [Column(Name = "KeepTime")] + public double KeepTime { get; set; } + + /// + /// 配置值类型 + /// + [Column(MapType = typeof(int))] + public ConfigValueType ValueType { get; set; } + + /// + /// 常值 + /// 在ValueType为常值时会使用 + /// + [Column(Name = "Constant")] + public double Constant { get; set; } + + + [Column(ServerTime = DateTimeKind.Local, CanUpdate = false)] + public DateTime CreateTime { get; set; } + + /// + /// ///////////////////////////////////////////导航属性/////////////////////////////////////////////////////// + /// + + public long ProStepId { get; set; } + public ProStep? ProStep { get; set; } + } +} diff --git a/CapMachine.Model/MeterConfig/MeterLoPress.cs b/CapMachine.Model/MeterConfig/MeterLoPress.cs new file mode 100644 index 0000000..1f7eb3b --- /dev/null +++ b/CapMachine.Model/MeterConfig/MeterLoPress.cs @@ -0,0 +1,71 @@ +using FreeSql.DataAnnotations; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Model +{ + /// + /// 润滑油压力 设置 + /// + [Table(Name = "MeterLoPress")] + public class MeterLoPress + { + /// + /// 主键 + /// + [Column(IsPrimary = true, IsIdentity = true)] + public long Id { get; set; } + + /// + /// 程序步骤序号 + /// + [Column(Name = "StepNo")] + public int StepNo { get; set; } + + /// + /// 开始值 + /// + [Column(Name = "StartValue")] + public double StartValue { get; set; } + + /// + /// 结束值 + /// + [Column(Name = "EndValue")] + public double EndValue { get; set; } + + /// + /// 维持时间 + /// + [Column(Name = "KeepTime")] + public double KeepTime { get; set; } + + /// + /// 配置值类型 + /// + [Column(MapType = typeof(int))] + public ConfigValueType ValueType { get; set; } + + /// + /// 常值 + /// 在ValueType为常值时会使用 + /// + [Column(Name = "Constant")] + public double Constant { get; set; } + + + [Column(ServerTime = DateTimeKind.Local, CanUpdate = false)] + public DateTime CreateTime { get; set; } + + /// + /// ///////////////////////////////////////////导航属性/////////////////////////////////////////////////////// + /// + + public long ProStepId { get; set; } + public ProStep? ProStep { get; set; } + + } +} diff --git a/CapMachine.Model/MeterConfig/MeterOCR.cs b/CapMachine.Model/MeterConfig/MeterOCR.cs new file mode 100644 index 0000000..bf44daf --- /dev/null +++ b/CapMachine.Model/MeterConfig/MeterOCR.cs @@ -0,0 +1,70 @@ +using FreeSql.DataAnnotations; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Model +{ + /// + /// OCR 表设置 + /// + [Table(Name = "MeterOCR")] + public class MeterOCR + { + /// + /// 主键 + /// + [Column(IsPrimary = true, IsIdentity = true)] + public long Id { get; set; } + + /// + /// 程序步骤序号 + /// + [Column(Name = "StepNo")] + public int StepNo { get; set; } + + /// + /// 开始值 + /// + [Column(Name = "StartValue")] + public double StartValue { get; set; } + + /// + /// 结束值 + /// + [Column(Name = "EndValue")] + public double EndValue { get; set; } + + /// + /// 维持时间 + /// + [Column(Name = "KeepTime")] + public double KeepTime { get; set; } + + /// + /// 配置值类型 + /// + [Column(MapType = typeof(int))] + public ConfigValueType ValueType { get; set; } + + /// + /// 常值 + /// 在ValueType为常值时会使用 + /// + [Column(Name = "Constant")] + public double Constant { get; set; } + + + [Column(ServerTime = DateTimeKind.Local, CanUpdate = false)] + public DateTime CreateTime { get; set; } + + /// + /// ///////////////////////////////////////////导航属性/////////////////////////////////////////////////////// + /// + + public long ProStepId { get; set; } + public ProStep? ProStep { get; set; } + } +} diff --git a/CapMachine.Model/MeterConfig/MeterOS1Temp.cs b/CapMachine.Model/MeterConfig/MeterOS1Temp.cs new file mode 100644 index 0000000..b767e9a --- /dev/null +++ b/CapMachine.Model/MeterConfig/MeterOS1Temp.cs @@ -0,0 +1,70 @@ +using FreeSql.DataAnnotations; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Model +{ + /// + /// OS1温度 表设置 + /// + [Table(Name = "MeterOS1Temp")] + public class MeterOS1Temp + { + /// + /// 主键 + /// + [Column(IsPrimary = true, IsIdentity = true)] + public long Id { get; set; } + + /// + /// 程序步骤序号 + /// + [Column(Name = "StepNo")] + public int StepNo { get; set; } + + /// + /// 开始值 + /// + [Column(Name = "StartValue")] + public double StartValue { get; set; } + + /// + /// 结束值 + /// + [Column(Name = "EndValue")] + public double EndValue { get; set; } + + /// + /// 维持时间 + /// + [Column(Name = "KeepTime")] + public double KeepTime { get; set; } + + /// + /// 配置值类型 + /// + [Column(MapType = typeof(int))] + public ConfigValueType ValueType { get; set; } + + /// + /// 常值 + /// 在ValueType为常值时会使用 + /// + [Column(Name = "Constant")] + public double Constant { get; set; } + + + [Column(ServerTime = DateTimeKind.Local, CanUpdate = false)] + public DateTime CreateTime { get; set; } + + /// + /// ///////////////////////////////////////////导航属性/////////////////////////////////////////////////////// + /// + + public long ProStepId { get; set; } + public ProStep? ProStep { get; set; } + } +} diff --git a/CapMachine.Model/MeterConfig/MeterOS2Temp.cs b/CapMachine.Model/MeterConfig/MeterOS2Temp.cs new file mode 100644 index 0000000..e9f01b7 --- /dev/null +++ b/CapMachine.Model/MeterConfig/MeterOS2Temp.cs @@ -0,0 +1,70 @@ +using FreeSql.DataAnnotations; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Model +{ + /// + /// OS2温度 表设置 + /// + [Table(Name = "MeterOS2Temp")] + public class MeterOS2Temp + { + /// + /// 主键 + /// + [Column(IsPrimary = true, IsIdentity = true)] + public long Id { get; set; } + + /// + /// 程序步骤序号 + /// + [Column(Name = "StepNo")] + public int StepNo { get; set; } + + /// + /// 开始值 + /// + [Column(Name = "StartValue")] + public double StartValue { get; set; } + + /// + /// 结束值 + /// + [Column(Name = "EndValue")] + public double EndValue { get; set; } + + /// + /// 维持时间 + /// + [Column(Name = "KeepTime")] + public double KeepTime { get; set; } + + /// + /// 配置值类型 + /// + [Column(MapType = typeof(int))] + public ConfigValueType ValueType { get; set; } + + /// + /// 常值 + /// 在ValueType为常值时会使用 + /// + [Column(Name = "Constant")] + public double Constant { get; set; } + + + [Column(ServerTime = DateTimeKind.Local, CanUpdate = false)] + public DateTime CreateTime { get; set; } + + /// + /// ///////////////////////////////////////////导航属性/////////////////////////////////////////////////////// + /// + + public long ProStepId { get; set; } + public ProStep? ProStep { get; set; } + } +} diff --git a/CapMachine.Model/MeterConfig/MeterPTCEntTemp.cs b/CapMachine.Model/MeterConfig/MeterPTCEntTemp.cs new file mode 100644 index 0000000..242e871 --- /dev/null +++ b/CapMachine.Model/MeterConfig/MeterPTCEntTemp.cs @@ -0,0 +1,70 @@ +using FreeSql.DataAnnotations; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Model +{ + /// + /// PTC入口温度(℃) 表设置 + /// + [Table(Name = "MeterPTCEntTemp")] + public class MeterPTCEntTemp + { + /// + /// 主键 + /// + [Column(IsPrimary = true, IsIdentity = true)] + public long Id { get; set; } + + /// + /// 程序步骤序号 + /// + [Column(Name = "StepNo")] + public int StepNo { get; set; } + + /// + /// 开始值 + /// + [Column(Name = "StartValue")] + public double StartValue { get; set; } + + /// + /// 结束值 + /// + [Column(Name = "EndValue")] + public double EndValue { get; set; } + + /// + /// 维持时间 + /// + [Column(Name = "KeepTime")] + public double KeepTime { get; set; } + + /// + /// 配置值类型 + /// + [Column(MapType = typeof(int))] + public ConfigValueType ValueType { get; set; } + + /// + /// 常值 + /// 在ValueType为常值时会使用 + /// + [Column(Name = "Constant")] + public double Constant { get; set; } + + + [Column(ServerTime = DateTimeKind.Local, CanUpdate = false)] + public DateTime CreateTime { get; set; } + + /// + /// ///////////////////////////////////////////导航属性/////////////////////////////////////////////////////// + /// + + public long ProStepId { get; set; } + public ProStep? ProStep { get; set; } + } +} diff --git a/CapMachine.Model/MeterConfig/MeterPTCFlow.cs b/CapMachine.Model/MeterConfig/MeterPTCFlow.cs new file mode 100644 index 0000000..4f765fc --- /dev/null +++ b/CapMachine.Model/MeterConfig/MeterPTCFlow.cs @@ -0,0 +1,70 @@ +using FreeSql.DataAnnotations; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Model +{ + /// + /// PTC流量 表设置 + /// + [Table(Name = "MeterPTCFlow")] + public class MeterPTCFlow + { + /// + /// 主键 + /// + [Column(IsPrimary = true, IsIdentity = true)] + public long Id { get; set; } + + /// + /// 程序步骤序号 + /// + [Column(Name = "StepNo")] + public int StepNo { get; set; } + + /// + /// 开始值 + /// + [Column(Name = "StartValue")] + public double StartValue { get; set; } + + /// + /// 结束值 + /// + [Column(Name = "EndValue")] + public double EndValue { get; set; } + + /// + /// 维持时间 + /// + [Column(Name = "KeepTime")] + public double KeepTime { get; set; } + + /// + /// 配置值类型 + /// + [Column(MapType = typeof(int))] + public ConfigValueType ValueType { get; set; } + + /// + /// 常值 + /// 在ValueType为常值时会使用 + /// + [Column(Name = "Constant")] + public double Constant { get; set; } + + + [Column(ServerTime = DateTimeKind.Local, CanUpdate = false)] + public DateTime CreateTime { get; set; } + + /// + /// ///////////////////////////////////////////导航属性/////////////////////////////////////////////////////// + /// + + public long ProStepId { get; set; } + public ProStep? ProStep { get; set; } + } +} diff --git a/CapMachine.Model/MeterConfig/MeterPTCPw.cs b/CapMachine.Model/MeterConfig/MeterPTCPw.cs new file mode 100644 index 0000000..e215c8f --- /dev/null +++ b/CapMachine.Model/MeterConfig/MeterPTCPw.cs @@ -0,0 +1,70 @@ +using FreeSql.DataAnnotations; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Model +{ + /// + /// PTC功率 表设置 + /// + [Table(Name = "MeterPTCPw")] + public class MeterPTCPw + { + /// + /// 主键 + /// + [Column(IsPrimary = true, IsIdentity = true)] + public long Id { get; set; } + + /// + /// 程序步骤序号 + /// + [Column(Name = "StepNo")] + public int StepNo { get; set; } + + /// + /// 开始值 + /// + [Column(Name = "StartValue")] + public double StartValue { get; set; } + + /// + /// 结束值 + /// + [Column(Name = "EndValue")] + public double EndValue { get; set; } + + /// + /// 维持时间 + /// + [Column(Name = "KeepTime")] + public double KeepTime { get; set; } + + /// + /// 配置值类型 + /// + [Column(MapType = typeof(int))] + public ConfigValueType ValueType { get; set; } + + /// + /// 常值 + /// 在ValueType为常值时会使用 + /// + [Column(Name = "Constant")] + public double Constant { get; set; } + + + [Column(ServerTime = DateTimeKind.Local, CanUpdate = false)] + public DateTime CreateTime { get; set; } + + /// + /// ///////////////////////////////////////////导航属性/////////////////////////////////////////////////////// + /// + + public long ProStepId { get; set; } + public ProStep? ProStep { get; set; } + } +} diff --git a/CapMachine.Model/MeterPd.cs b/CapMachine.Model/MeterConfig/MeterPd.cs similarity index 100% rename from CapMachine.Model/MeterPd.cs rename to CapMachine.Model/MeterConfig/MeterPd.cs diff --git a/CapMachine.Model/MeterPs.cs b/CapMachine.Model/MeterConfig/MeterPs.cs similarity index 100% rename from CapMachine.Model/MeterPs.cs rename to CapMachine.Model/MeterConfig/MeterPs.cs diff --git a/CapMachine.Model/MeterSpeed.cs b/CapMachine.Model/MeterConfig/MeterSpeed.cs similarity index 100% rename from CapMachine.Model/MeterSpeed.cs rename to CapMachine.Model/MeterConfig/MeterSpeed.cs diff --git a/CapMachine.Model/MeterConfig/MeterTestBoxRH.cs b/CapMachine.Model/MeterConfig/MeterTestBoxRH.cs new file mode 100644 index 0000000..358f04f --- /dev/null +++ b/CapMachine.Model/MeterConfig/MeterTestBoxRH.cs @@ -0,0 +1,70 @@ +using FreeSql.DataAnnotations; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Model +{ + /// + /// 试验箱湿度 表设置 + /// + [Table(Name = "MeterTestBoxRH")] + public class MeterTestBoxRH + { + /// + /// 主键 + /// + [Column(IsPrimary = true, IsIdentity = true)] + public long Id { get; set; } + + /// + /// 程序步骤序号 + /// + [Column(Name = "StepNo")] + public int StepNo { get; set; } + + /// + /// 开始值 + /// + [Column(Name = "StartValue")] + public double StartValue { get; set; } + + /// + /// 结束值 + /// + [Column(Name = "EndValue")] + public double EndValue { get; set; } + + /// + /// 维持时间 + /// + [Column(Name = "KeepTime")] + public double KeepTime { get; set; } + + /// + /// 配置值类型 + /// + [Column(MapType = typeof(int))] + public ConfigValueType ValueType { get; set; } + + /// + /// 常值 + /// 在ValueType为常值时会使用 + /// + [Column(Name = "Constant")] + public double Constant { get; set; } + + + [Column(ServerTime = DateTimeKind.Local, CanUpdate = false)] + public DateTime CreateTime { get; set; } + + /// + /// ///////////////////////////////////////////导航属性/////////////////////////////////////////////////////// + /// + + public long ProStepId { get; set; } + public ProStep? ProStep { get; set; } + } +} diff --git a/CapMachine.Model/MeterConfig/MeterTestBoxTemp.cs b/CapMachine.Model/MeterConfig/MeterTestBoxTemp.cs new file mode 100644 index 0000000..4a15bcc --- /dev/null +++ b/CapMachine.Model/MeterConfig/MeterTestBoxTemp.cs @@ -0,0 +1,70 @@ +using FreeSql.DataAnnotations; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Model +{ + /// + /// 试验箱温度 表设置 + /// + [Table(Name = "MeterTestBoxTemp")] + public class MeterTestBoxTemp + { + /// + /// 主键 + /// + [Column(IsPrimary = true, IsIdentity = true)] + public long Id { get; set; } + + /// + /// 程序步骤序号 + /// + [Column(Name = "StepNo")] + public int StepNo { get; set; } + + /// + /// 开始值 + /// + [Column(Name = "StartValue")] + public double StartValue { get; set; } + + /// + /// 结束值 + /// + [Column(Name = "EndValue")] + public double EndValue { get; set; } + + /// + /// 维持时间 + /// + [Column(Name = "KeepTime")] + public double KeepTime { get; set; } + + /// + /// 配置值类型 + /// + [Column(MapType = typeof(int))] + public ConfigValueType ValueType { get; set; } + + /// + /// 常值 + /// 在ValueType为常值时会使用 + /// + [Column(Name = "Constant")] + public double Constant { get; set; } + + + [Column(ServerTime = DateTimeKind.Local, CanUpdate = false)] + public DateTime CreateTime { get; set; } + + /// + /// ///////////////////////////////////////////导航属性/////////////////////////////////////////////////////// + /// + + public long ProStepId { get; set; } + public ProStep? ProStep { get; set; } + } +} diff --git a/CapMachine.Model/ProStep.cs b/CapMachine.Model/ProStep.cs index f992cf8..9f67167 100644 --- a/CapMachine.Model/ProStep.cs +++ b/CapMachine.Model/ProStep.cs @@ -53,10 +53,27 @@ namespace CapMachine.Model /// public ICollection? MeterSpeeds { get; set; } - public ICollection? MeterPds { get; set; } - public ICollection? MeterPss { get; set; } - + public ICollection? MeterCond1Temps { get; set; } + public ICollection? MeterCond2Temps { get; set; } + public ICollection? MeterCondPresss { get; set; } + public ICollection? MeterEVAPExpTemps { get; set; } + public ICollection? MeterExPresss { get; set; } + public ICollection? MeterHVVols { get; set; } + public ICollection? MeterInhPresss { get; set; } + public ICollection? MeterInhTemps { get; set; } + public ICollection? MeterLoPresss { get; set; } + public ICollection? MeterLVVols { get; set; } + public ICollection? MeterOCRs { get; set; } + public ICollection? MeterOS1Temps { get; set; } + public ICollection? MeterOS2Temps { get; set; } + public ICollection? MeterPTCEntTemps { get; set; } + public ICollection? MeterPTCFlows { get; set; } + public ICollection? MeterPTCPws { get; set; } + public ICollection? MeterTestBoxRHs { get; set; } + public ICollection? MeterTestBoxTemps { get; set; } + //public ICollection? MeterPds { get; set; } + //public ICollection? MeterPss { get; set; } /// /// ///////////////////////////////////////////导航属性/////////////////////////////////////////////////////// diff --git a/CapMachine.Model/ProgramSeg.cs b/CapMachine.Model/ProgramSeg.cs index ebe4669..8d87e17 100644 --- a/CapMachine.Model/ProgramSeg.cs +++ b/CapMachine.Model/ProgramSeg.cs @@ -4,6 +4,9 @@ using System.Collections.Generic; namespace CapMachine.Model { + /// + /// 程序设置 + /// [Table(Name = "ProgramSeg")] public class ProgramSeg { @@ -18,7 +21,7 @@ namespace CapMachine.Model /// 工况名称 /// [Column(Name = "Name", IsNullable = false, StringLength = 50)] - public string Name { get; set; } + public string? Name { get; set; } /// /// 程序段反复 @@ -30,13 +33,13 @@ namespace CapMachine.Model /// 编辑者 /// [Column(Name = "UserName", IsNullable = false, StringLength = 20)] - public string UserName { get; set; } + public string? UserName { get; set; } /// /// 备注 /// [Column(Name = "Remark", IsNullable = false, StringLength = 100)] - public string Remark { get; set; } + public string? Remark { get; set; } [Column(ServerTime = DateTimeKind.Local, CanUpdate = false)] public DateTime CreateTime { get; set; } diff --git a/CapMachine.Shared/Controls/Meter.xaml.cs b/CapMachine.Shared/Controls/Meter.xaml.cs index 992f75e..6ac5ea3 100644 --- a/CapMachine.Shared/Controls/Meter.xaml.cs +++ b/CapMachine.Shared/Controls/Meter.xaml.cs @@ -32,14 +32,14 @@ namespace CapMachine.Shared.Controls { get { - return (string)base.GetValue(MeterConfig.MeterNameProperty); + return (string)base.GetValue(Meter.MeterNameProperty); } set { - base.SetValue(MeterConfig.MeterNameProperty, value); + base.SetValue(Meter.MeterNameProperty, value); } } - public static readonly DependencyProperty MeterNameProperty = DependencyProperty.Register("MeterName", typeof(string), typeof(MeterConfig), new PropertyMetadata("速度")); + public static readonly DependencyProperty MeterNameProperty = DependencyProperty.Register("MeterName", typeof(string), typeof(Meter), new PropertyMetadata("名称")); diff --git a/CapMachine.Wpf/App.xaml.cs b/CapMachine.Wpf/App.xaml.cs index 3bd39ed..d13b483 100644 --- a/CapMachine.Wpf/App.xaml.cs +++ b/CapMachine.Wpf/App.xaml.cs @@ -53,7 +53,9 @@ namespace CapMachine.Wpf protected override void RegisterTypes(IContainerRegistry containerRegistry) { ////注册日志服务 - //containerRegistry.RegisterSingleton(); + containerRegistry.RegisterSingleton(); + containerRegistry.RegisterSingleton(); + containerRegistry.RegisterSingleton(); ////注册设备服务 //containerRegistry.RegisterSingleton(); @@ -79,9 +81,12 @@ namespace CapMachine.Wpf containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); - //containerRegistry.RegisterForNavigation(); - //containerRegistry.RegisterForNavigation(); - + containerRegistry.RegisterForNavigation(); + containerRegistry.RegisterForNavigation(); + containerRegistry.RegisterForNavigation(); + containerRegistry.RegisterForNavigation(); + containerRegistry.RegisterForNavigation(); + //注册Dialog视图时绑定VM containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); @@ -120,6 +125,7 @@ namespace CapMachine.Wpf //从容器中获取MainView的实例对象 var container = ContainerLocator.Container; var shell = container.Resolve("MainView"); + if (shell is Window view) { //更新Prism注册区域信息 @@ -127,6 +133,10 @@ namespace CapMachine.Wpf RegionManager.SetRegionManager(view, regionManager); RegionManager.UpdateRegions(); + //给MainView的MainViewFooterContentRegion区域设置FooterView具体的信息 + regionManager.RequestNavigate("MainViewFooterContentRegion", nameof(FooterView)); + + //调用首页的INavigationAware 接口做一个初始化操作 if (view.DataContext is INavigationAware navigationAware) { @@ -134,6 +144,7 @@ namespace CapMachine.Wpf //呈现首页 App.Current.MainWindow = view; } + } //先加载服务,防止在ViewModel中使用时速度慢 @@ -141,8 +152,11 @@ namespace CapMachine.Wpf //var appVersionService1 = ContainerLocator.Container.Resolve(); //var appVersionService2 = ContainerLocator.Container.Resolve(); var appVersionService3 = ContainerLocator.Container.Resolve(); + var appVersionService4 = ContainerLocator.Container.Resolve(); base.OnInitialized(); + + } } diff --git a/CapMachine.Wpf/Assets/Images/favicon.ico b/CapMachine.Wpf/Assets/Images/favicon.ico new file mode 100644 index 0000000..f8e93e2 Binary files /dev/null and b/CapMachine.Wpf/Assets/Images/favicon.ico differ diff --git a/CapMachine.Wpf/CapMachine.Wpf.csproj b/CapMachine.Wpf/CapMachine.Wpf.csproj index 6bb4200..cf26f1c 100644 --- a/CapMachine.Wpf/CapMachine.Wpf.csproj +++ b/CapMachine.Wpf/CapMachine.Wpf.csproj @@ -9,6 +9,7 @@ + @@ -28,15 +29,15 @@ + + + - - - @@ -56,5 +57,13 @@ C:\Program Files (x86)\Arction\LightningChart .NET SDK v.10\LibNET4\Arction.Wpf.Charting.LightningChart.dll + + + + + + PreserveNewest + + diff --git a/CapMachine.Wpf/Dtos/ActionLogDto.cs b/CapMachine.Wpf/Dtos/ActionLogDto.cs new file mode 100644 index 0000000..e376cd4 --- /dev/null +++ b/CapMachine.Wpf/Dtos/ActionLogDto.cs @@ -0,0 +1,35 @@ +using Prism.Mvvm; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Wpf.Dtos +{ + /// + /// + /// + public class ActionLogDto : BindableBase + { + /// + /// 等级 + /// + public int Level { get; set; } + + /// + /// 分类 + /// + public string? Category { get; set; } + + /// + /// 内容 + /// + public string? Content { get; set; } + + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + } +} diff --git a/CapMachine.Wpf/MapperProfile/ActionLogProfile.cs b/CapMachine.Wpf/MapperProfile/ActionLogProfile.cs new file mode 100644 index 0000000..107f9f1 --- /dev/null +++ b/CapMachine.Wpf/MapperProfile/ActionLogProfile.cs @@ -0,0 +1,20 @@ +using AutoMapper; +using CapMachine.Model; +using CapMachine.Wpf.Dtos; +using CapMachine.Wpf.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Wpf.MapperProfile +{ + public class ActionLogProfile:Profile + { + public ActionLogProfile() + { + CreateMap().ReverseMap(); + } + } +} diff --git a/CapMachine.Wpf/Models/ComboBoxModel.cs b/CapMachine.Wpf/Models/ComboBoxModel.cs new file mode 100644 index 0000000..93f2c52 --- /dev/null +++ b/CapMachine.Wpf/Models/ComboBoxModel.cs @@ -0,0 +1,33 @@ +using Prism.Mvvm; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Wpf.Models +{ + public class ComboBoxModel:BindableBase + { + private string key; + /// + /// Key值 + /// + public string Key + { + get { return key; } + set { key = value; RaisePropertyChanged(); } + } + + + private string text; + /// + /// Text值 + /// + public string Text + { + get { return text; } + set { text = value; RaisePropertyChanged(); } + } + } +} diff --git a/CapMachine.Wpf/PrismEvent/ProStepDrawerEvent.cs b/CapMachine.Wpf/PrismEvent/ProStepDrawerEvent.cs new file mode 100644 index 0000000..58b4cfe --- /dev/null +++ b/CapMachine.Wpf/PrismEvent/ProStepDrawerEvent.cs @@ -0,0 +1,14 @@ +using Prism.Events; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Wpf.PrismEvent +{ + public class ProStepDrawerEvent : PubSubEvent + { + + } +} diff --git a/CapMachine.Wpf/Services/ConfigService.cs b/CapMachine.Wpf/Services/ConfigService.cs new file mode 100644 index 0000000..82e2f87 --- /dev/null +++ b/CapMachine.Wpf/Services/ConfigService.cs @@ -0,0 +1,20 @@ +using Prism.Mvvm; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Wpf.Services +{ + /// + /// 配置服务中心 + /// + public class ConfigService:BindableBase + { + public ConfigService() + { + + } + } +} diff --git a/CapMachine.Wpf/Services/ILogService.cs b/CapMachine.Wpf/Services/ILogService.cs new file mode 100644 index 0000000..6e06737 --- /dev/null +++ b/CapMachine.Wpf/Services/ILogService.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Wpf.Services +{ + /// + /// NLog服务 + /// + public interface ILogService + { + void Debug(string msg); + void Error(string msg); + void Fatal(string msg); + void Info(string msg); + void Warn(string msg); + } +} diff --git a/CapMachine.Wpf/Services/LogService.cs b/CapMachine.Wpf/Services/LogService.cs new file mode 100644 index 0000000..2a75f80 --- /dev/null +++ b/CapMachine.Wpf/Services/LogService.cs @@ -0,0 +1,83 @@ +using NLog; +using Prism.Services.Dialogs; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Wpf.Services +{ + /// + /// NLog 服务 + /// + public class LogService : ILogService + { + private static Logger logger = LogManager.GetCurrentClassLogger(); //初始化日志类 + + /// + /// 调试日志 + /// + /// 日志内容 + public void Debug(string msg) + { + logger.Debug(msg); + } + + /// + /// 信息日志 + /// + /// 日志内容 + /// + /// 适用大部分场景 + /// 1.记录日志文件 + /// + public void Info(string msg) + { + logger.Info(msg); + } + + /// + /// 错误日志 + /// + /// 日志内容 + /// + /// 适用异常,错误日志记录 + /// 1.记录日志文件 + /// + public void Error(string msg) + { + logger.Error(msg); + } + + /// + /// 严重致命错误日志 + /// + /// 日志内容 + /// + /// 1.记录日志文件 + /// 2.控制台输出 + /// + public void Fatal(string msg) + { + logger.Fatal(msg); + } + + /// + /// 警告日志 + /// + /// 日志内容 + /// + /// 1.记录日志文件 + /// 2.发送日志邮件 + /// + public void Warn(string msg) + { + try + { + logger.Warn(msg); + } + catch { } + } + } +} diff --git a/CapMachine.Wpf/Services/NavigationMenuService.cs b/CapMachine.Wpf/Services/NavigationMenuService.cs index 2b7c80f..e36c5cd 100644 --- a/CapMachine.Wpf/Services/NavigationMenuService.cs +++ b/CapMachine.Wpf/Services/NavigationMenuService.cs @@ -26,38 +26,36 @@ namespace CapMachine.Wpf.Services public void Initialize() { MenuItems.Clear(); - MenuItems.Add(new NavigationItem("", "全部", "", new ObservableCollection() + MenuItems.Add(new NavigationItem("", "系统", "", new ObservableCollection() { - new NavigationItem("","模板匹配","",new ObservableCollection() + new NavigationItem("","系统配置","",new ObservableCollection() { - new NavigationItem("ShapeCirclePlus","轮廓匹配",""), - new NavigationItem("ShapeOutline","形状匹配",""), - new NavigationItem("Clouds", "相似性匹配",""), - new NavigationItem("ShapeOvalPlus","形变匹配",""), + new NavigationItem("ShapeCirclePlus","日志文件",""), + new NavigationItem("ShapeOutline","工况预设",""), + new NavigationItem("Clouds", "高速记录",""), + new NavigationItem("ShapeOvalPlus","系统配置",""), }), - new NavigationItem("", "比较测量","",new ObservableCollection() + new NavigationItem("", "计算信息","",new ObservableCollection() { - new NavigationItem("Circle","卡尺找圆",""), - new NavigationItem("Palette","颜色检测",""), - new NavigationItem("Ruler", "几何测量",""), + new NavigationItem("Circle","过热度",""), + new NavigationItem("Palette","过冷度",""), }), - new NavigationItem("","字符识别","",new ObservableCollection() + new NavigationItem("", "PID设置","",new ObservableCollection() { - new NavigationItem("FormatColorText", "字符识别",""), - new NavigationItem("Barcode", "一维码识别",""), - new NavigationItem("Qrcode", "二维码识别",""), + new NavigationItem("Circle","转速PID",""), }), - new NavigationItem("","缺陷检测","",new ObservableCollection() + new NavigationItem("","版本信息","",new ObservableCollection() { - new NavigationItem("Crop", "差分模型",""), - new NavigationItem("CropRotate", "形变模型",""), - }) + new NavigationItem("FormatColorText", "操作手册",""), + new NavigationItem("Barcode", "版本更新信息",""), + }), + })); MenuItems.Add(new NavigationItem("", "工艺过程", "MonitorView")); MenuItems.Add(new NavigationItem("", "工艺参数", "ProConfigView")); MenuItems.Add(new NavigationItem("", "工艺曲线", "RealTimeChartView")); MenuItems.Add(new NavigationItem("", "动作日志", "ActionLogView")); - MenuItems.Add(new NavigationItem("", "用户管理", "UserView")); + MenuItems.Add(new NavigationItem("", "用户管理", "UserManageView")); } } } diff --git a/CapMachine.Wpf/Services/SysService.cs b/CapMachine.Wpf/Services/SysService.cs new file mode 100644 index 0000000..6e938ca --- /dev/null +++ b/CapMachine.Wpf/Services/SysService.cs @@ -0,0 +1,49 @@ +using Prism.Mvvm; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Wpf.Services +{ + /// + /// 系统资源 + /// + public class SysService : BindableBase + { + public SysService() + { + // 创建一个定时器,设置间隔时间为2000毫秒(即2秒) + CurTimer = new System.Timers.Timer(5000); + CurTimer.AutoReset = true; + // 设置Elapsed事件处理程序 + CurTimer.Elapsed += CurTimer_Elapsed; + // 启动定时器 + CurTimer.Start(); + + } + + private void CurTimer_Elapsed(object? sender, System.Timers.ElapsedEventArgs e) + { + CurDateTime=DateTime.Now; + + } + + /// + /// 定时器 + /// + private System.Timers.Timer CurTimer { get; set; } + + private DateTime _CurDateTime; + /// + /// 当前时间信息 + /// + public DateTime CurDateTime + { + get { return _CurDateTime; } + set { _CurDateTime = value; RaisePropertyChanged(); } + } + + } +} diff --git a/CapMachine.Wpf/ViewModels/ActionLogViewModel.cs b/CapMachine.Wpf/ViewModels/ActionLogViewModel.cs new file mode 100644 index 0000000..2cacaae --- /dev/null +++ b/CapMachine.Wpf/ViewModels/ActionLogViewModel.cs @@ -0,0 +1,387 @@ +using AutoMapper; +using CapMachine.Core; +using CapMachine.Model; +using CapMachine.Wpf.Dtos; +using CapMachine.Wpf.Models; +using CapMachine.Wpf.Services; +using Microsoft.Extensions.Logging; +using NPOI.HSSF.Util; +using NPOI.SS.UserModel; +using NPOI.XSSF.UserModel; +using Prism.Events; +using Prism.Services.Dialogs; +using Syncfusion.Windows.Shared; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; + +namespace CapMachine.Wpf.ViewModels +{ + public class ActionLogViewModel : NavigationViewModel + { + /// + /// 实例化 + /// + /// + /// + /// + public ActionLogViewModel(IDialogService dialogService, IFreeSql freeSql, IEventAggregator eventAggregator, IMapper mapper, ILogService logger) + { + DialogService = dialogService; + FreeSql = freeSql; + EventAggregator = eventAggregator; + Mapper = mapper; + Logger = logger; + + CategoryComboBoxList = new List() + { + new ComboBoxModel(){Key="0",Text="系统" }, + new ComboBoxModel(){Key="1",Text="程序步骤" }, + new ComboBoxModel(){Key="2",Text="报警" }, + }; + } + + private string CurrentName = "埋塞敲入螺旋钉安装"; + + private string CurrentTemplate = "BurPlugInstallTemplate.xlsx"; + + public IDialogService DialogService { get; } + public IFreeSql FreeSql { get; } + public IEventAggregator EventAggregator { get; } + public IMapper Mapper { get; } + public ILogService Logger { get; } + + //ActionLog + + private List _CategoryComboBoxList; + /// + /// 分类下拉框列表 + /// + public List CategoryComboBoxList + { + get { return _CategoryComboBoxList; } + set { _CategoryComboBoxList = value; RaisePropertyChanged(); } + } + + + private string _SearchCategory; + /// + /// 搜索条件-分类 + /// + public string SearchCategory + { + get + { + return _SearchCategory; + } + set + { + _SearchCategory = value; + RaisePropertyChanged(); + } + } + + /// + /// 列表集合 + /// + private ObservableCollection _ListModelDto=new ObservableCollection(); + /// + /// 列表集合 + /// + public ObservableCollection ListModelDto + { + get { return _ListModelDto; } + set { _ListModelDto = value; } + } + + #region 搜索条件属性 + + /// + /// 分类 + /// + private string _Category; + + public string Category + { + get + { + return _Category; + } + set + { + _Category = value; + RaisePropertyChanged(); + } + } + + + ///// + ///// 搜索条件-筒体编号 + ///// + //private string searchCylinderNo; + + //public string SearchCylinderNo + //{ + // get + // { + // return searchCylinderNo; + // } + // set + // { + // searchCylinderNo = value; + // RaisePropertyChanged(); + // } + //} + + + /// + /// 搜索条件-开始时间 + /// + private string _SearchStartDate; + + public string SearchStartDate + { + get + { + return _SearchStartDate; + } + set + { + _SearchStartDate = value; + RaisePropertyChanged(); + } + } + + /// + /// 搜索条件-结束时间 + /// + private string _SearchEndDate; + + public string SearchEndDate + { + get + { + return _SearchEndDate; + } + + set + { + _SearchEndDate = value; + RaisePropertyChanged(); + } + } + + #endregion + + #region 搜索命令 + + /// + /// 搜索命令 + /// + private DelegateCommand _SearchCmd; + public DelegateCommand SearchCmd + { + get + { + if (_SearchCmd == null) return new DelegateCommand((a) => Search()); + return _SearchCmd; + } + set + { + _SearchCmd = value; + } + } + + private void Search() + { + try + { + var MulConQueryable = FreeSql.Select(); + + //多条件查询 + if (!string.IsNullOrEmpty(SearchCategory)) + { + MulConQueryable = MulConQueryable.Where(t => t.Category == SearchCategory); + } + //多条件查询 + if (!string.IsNullOrEmpty(SearchStartDate)) + { + MulConQueryable = MulConQueryable.Where(t => t.CreateTime.Date >= Convert.ToDateTime(SearchStartDate)); + } + //多条件查询 + if (!string.IsNullOrEmpty(SearchEndDate)) + { + MulConQueryable = MulConQueryable.Where(t => t.CreateTime.Date < Convert.ToDateTime(SearchEndDate).AddDays(1)); + } + var ListDpI = MulConQueryable.OrderByDescending(a => a.CreateTime).ToList();//.Where(a => a.CreateTime >= DateTime.Now); + ListModelDto.Clear(); + + + foreach (var item in ListDpI) + { + ListModelDto.Add(Mapper.Map(item)); + + } + } + catch (Exception ex) + { + Logger.Error(String.Format("ErrSource : {0} ErrMsg : {1}", ex.StackTrace.ToString(), ex.Message.ToString())); + } + } + #endregion + + #region "导出数据" + + /// + /// 搜索命令 + /// + private DelegateCommand _OutputDataCmd; + public DelegateCommand OutputDataCmd + { + set + { + _OutputDataCmd = value; + } + get + { + if (_OutputDataCmd == null) + { + _OutputDataCmd = new DelegateCommand(a => OutputDataAction()); + } + return _OutputDataCmd; + } + } + + private void OutputDataAction() + { + return; + + try + { + if (ListModelDto != null && ListModelDto.Count > 0) + { + string FilePath = string.Empty; + //FolderBrowserDialog dialog = new FolderBrowserDialog(); + //dialog.Description = "请选择文件夹"; + //dialog.ShowNewFolderButton = true; // 显示 新建文件夹 按钮 + // //dialog.SelectedPath = Environment.CurrentDirectory; // 设置 选择的路径 为 当前项目路径 + //if (dialog.ShowDialog() == DialogResult.OK) + //{ + // // 判空 + // if (string.IsNullOrEmpty(dialog.SelectedPath)) { MessageBox.Show("文件夹路径不能为空", "温馨提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } + // FilePath = dialog.SelectedPath; // 获取 选择的 文件夹 路径 + //} + + + var ListData = ListModelDto.ToList(); + + /*********************** + 1.读取excel到workbook中 + ***********************/ + string TemplateFilePath = System.Environment.CurrentDirectory; + string tPath = TemplateFilePath + @"\ReportFile\" + CurrentTemplate; + //string tPath = @"D:\ReportTemplate\注油Template.xlsx"; + XSSFWorkbook wk = null; + using (FileStream fs = File.Open(tPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) + { + wk = new XSSFWorkbook(fs); + fs.Close(); //把excel里的内容保存到workbook中之后,就可以关闭了 + } + NPOI.SS.UserModel.ISheet sheet = wk.GetSheetAt(0); //获得wk中第一个sheet,保存到sheet中 + + /*********************** + 2.操作数据 + ***********************/ + //2行 5行 + IDataFormat dataformat = wk.CreateDataFormat(); + ICellStyle style0 = wk.CreateCellStyle(); + + ICellStyle styleBag = wk.CreateCellStyle(); + styleBag.FillForegroundColor = HSSFColor.Red.Index; + styleBag.FillPattern = FillPattern.SolidForeground; + + for (int i = 0; i < ListData.Count; i++)// (int i = 2; i < 6; i += 3) + { + IRow row; + row = sheet.CreateRow(i + 1); + + //row.CreateCell(0).SetCellValue(ListData[i].StaticDiskNo.ToString()); + //row.CreateCell(1).SetCellValue(ListData[i].OpNo.ToString()); + //row.CreateCell(2).SetCellValue(ListData[i].CreateTime.ToString("yyyy-MM-dd HH:mm")); + + + //row.GetCell(10).CellStyle = style0; + + style0.DataFormat = dataformat.GetFormat("yyyy-MM-dd HH:mm:ss"); + row.GetCell(2).CellStyle = style0; + //row.GetCell(26).CellStyle = style0; + //if (ListDat[i].UpperGroupStandDiffResult == "NG") + //{ + // row.GetCell(4).CellStyle = styleBag; + //} + //if (ListDat[i].LowerGroupStandDiffResult == "NG") + //{ + // row.GetCell(6).CellStyle = styleBag; + //} + //if (ListDat[i].GroupStandDiffResult == "NG") + //{ + // row.GetCell(8).CellStyle = styleBag; + //} + //if (ListDat[i].FillReal >= ListDat[i].BeforLow && ListDat[i].FillReal <= ListDat[i].BeforUp) + //{ + + //} + //else + //{ + // row.GetCell(7).CellStyle = styleBag; + //} + + } + + + //DayDailyParameterInfo = null; + //NightDailyParameterInfo = null; + + /*********************** + 3.修改完成,写入到客户端 + ***********************/ + using (System.IO.MemoryStream ms = new System.IO.MemoryStream()) + { + //tPath = @"D:\日立报表\"; + //判断文件夹是否存在,不存在就创建 + if (!Directory.Exists(FilePath)) + { + Directory.CreateDirectory(FilePath); + } + FilePath = FilePath + @"\" + Convert.ToDateTime(SearchStartDate).ToString("yyyy-MM-dd") + "-" + Convert.ToDateTime(SearchStartDate).ToString("yyyy-MM-dd") + "-" + CurrentName + ".xlsx"; + wk.Write(ms); + + using (FileStream fs = new FileStream(FilePath, FileMode.Create, FileAccess.Write)) + { + byte[] data = ms.ToArray(); + fs.Write(data, 0, data.Length); + fs.Flush(); + } + wk = null; + } + System.Windows.MessageBox.Show("生成成功"); + } + else + { + MessageBox.Show("请先搜索数据后再导出", "提示", MessageBoxButton.OK, MessageBoxImage.Information); + } + } + catch (Exception ex) + { + Logger.Error(String.Format("ErrSource : {0} ErrMsg : {1}", ex.StackTrace.ToString(), ex.Message.ToString())); + } + } + + #endregion + } +} diff --git a/CapMachine.Wpf/ViewModels/FooterViewModel.cs b/CapMachine.Wpf/ViewModels/FooterViewModel.cs new file mode 100644 index 0000000..83da003 --- /dev/null +++ b/CapMachine.Wpf/ViewModels/FooterViewModel.cs @@ -0,0 +1,17 @@ +using CapMachine.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Wpf.ViewModels +{ + public class FooterViewModel : NavigationViewModel + { + public FooterViewModel() + { + var dd = 1; + } + } +} diff --git a/CapMachine.Wpf/ViewModels/MainViewModel.cs b/CapMachine.Wpf/ViewModels/MainViewModel.cs index 020eb3a..9d0c182 100644 --- a/CapMachine.Wpf/ViewModels/MainViewModel.cs +++ b/CapMachine.Wpf/ViewModels/MainViewModel.cs @@ -1,6 +1,7 @@ using CapMachine.Core; using CapMachine.Core.IService; using CapMachine.Wpf.Models; +using CapMachine.Wpf.Services; using Prism.Commands; using Prism.Regions; @@ -8,15 +9,16 @@ namespace CapMachine.Wpf.ViewModels { public class MainViewModel : NavigationViewModel { - public MainViewModel(IRegionManager region, INavigationMenuService menuService) + public MainViewModel(IRegionManager region, INavigationMenuService menuService, SysService sysService) { this.region = region; MenuService = menuService; + SysService = sysService; NavigateCommand = new DelegateCommand(Navigate); } public INavigationMenuService MenuService { get; } - + public SysService SysService { get; } public DelegateCommand NavigateCommand { get; private set; } private int selectedIndex = -1; @@ -46,7 +48,7 @@ namespace CapMachine.Wpf.ViewModels { if (item == null) return; - if (item.Name.Equals("全部")) + if (item.Name.Equals("系统")) { IsTopDrawerOpen = true; return; diff --git a/CapMachine.Wpf/ViewModels/ProConfigViewModel.cs b/CapMachine.Wpf/ViewModels/ProConfigViewModel.cs index 10fd7c1..561406c 100644 --- a/CapMachine.Wpf/ViewModels/ProConfigViewModel.cs +++ b/CapMachine.Wpf/ViewModels/ProConfigViewModel.cs @@ -1,6 +1,11 @@ using CapMachine.Core; using CapMachine.Model; +using CapMachine.Wpf.PrismEvent; +using CapMachine.Wpf.Views; +using MaterialDesignThemes.Wpf; using Prism.Commands; +using Prism.Events; +using Prism.Regions; using Prism.Services.Dialogs; using System.Collections.ObjectModel; using System.Text; @@ -10,10 +15,13 @@ namespace CapMachine.Wpf.ViewModels { public class ProConfigViewModel : NavigationViewModel { - public ProConfigViewModel(IDialogService dialogService, IFreeSql freeSql) + public ProConfigViewModel(IDialogService dialogService, IFreeSql freeSql,IEventAggregator eventAggregator, IRegionManager regionManager) { //LogService = logService; FreeSql = freeSql; + EventAggregator = eventAggregator; + RegionManager = regionManager; + //MachineDataService = machineDataService; DialogService = dialogService; @@ -29,12 +37,16 @@ namespace CapMachine.Wpf.ViewModels //各个单独仪表的初始化 SelectedMeterSpeed = new MeterSpeed(); SelectedPs = new MeterPs(); + + } /// /// FreeSQL 实例函数 /// public IFreeSql FreeSql { get; } + public IEventAggregator EventAggregator { get; } + public IRegionManager RegionManager { get; } /// /// 弹窗服务 @@ -276,6 +288,37 @@ namespace CapMachine.Wpf.ViewModels #endregion + private DelegateCommand _ProStepPsCmd; + /// + /// 新增PS命令 + /// + public DelegateCommand ProStepPsCmd + { + set + { + _ProStepPsCmd = value; + } + get + { + if (_ProStepPsCmd == null) + { + _ProStepPsCmd = new DelegateCommand(() => ProStepPsCmdCmdMethod()); + } + return _ProStepPsCmd; + } + } + + private void ProStepPsCmdCmdMethod() + { + //var openDrawerCommand = MaterialDesignThemes.Wpf.DrawerHost.OpenDrawerCommand; + + RegionManager.RequestNavigate("ProStepDrawerContentRegion", nameof(ProStepConfigPsView)); + + //EventAggregator.GetEvent().Publish("Right"); + + + } + #region Ps表 private ObservableCollection _ListMeterPsItems; diff --git a/CapMachine.Wpf/ViewModels/ProStepConfigMainViewModel.cs b/CapMachine.Wpf/ViewModels/ProStepConfigMainViewModel.cs new file mode 100644 index 0000000..da6bf32 --- /dev/null +++ b/CapMachine.Wpf/ViewModels/ProStepConfigMainViewModel.cs @@ -0,0 +1,19 @@ +using CapMachine.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Wpf.ViewModels +{ + public class ProStepConfigMainViewModel : NavigationViewModel + { + public ProStepConfigMainViewModel() + { + + } + + + } +} diff --git a/CapMachine.Wpf/ViewModels/ProStepConfigViewModelGroup/ProStepConfigPsViewModel.cs b/CapMachine.Wpf/ViewModels/ProStepConfigViewModelGroup/ProStepConfigPsViewModel.cs new file mode 100644 index 0000000..21b650a --- /dev/null +++ b/CapMachine.Wpf/ViewModels/ProStepConfigViewModelGroup/ProStepConfigPsViewModel.cs @@ -0,0 +1,14 @@ +using CapMachine.Core; + +namespace CapMachine.Wpf.ViewModels +{ + public class ProStepConfigPsViewModel : NavigationViewModel + { + public ProStepConfigPsViewModel() + { + + } + + + } +} diff --git a/CapMachine.Wpf/ViewModels/UserManageViewModel.cs b/CapMachine.Wpf/ViewModels/UserManageViewModel.cs new file mode 100644 index 0000000..7423a58 --- /dev/null +++ b/CapMachine.Wpf/ViewModels/UserManageViewModel.cs @@ -0,0 +1,20 @@ +using CapMachine.Core; +using Prism.Events; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapMachine.Wpf.ViewModels +{ + public class UserManageViewModel : NavigationViewModel + { + public UserManageViewModel(IEventAggregator eventAggregator) + { + //事件服务 + _EventAggregator = eventAggregator; + } + private IEventAggregator _EventAggregator { get; set; } + } +} diff --git a/CapMachine.Wpf/Views/ActionLogView.xaml b/CapMachine.Wpf/Views/ActionLogView.xaml new file mode 100644 index 0000000..5b61114 --- /dev/null +++ b/CapMachine.Wpf/Views/ActionLogView.xaml @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - + + + + + + + + + + + + + + + - + diff --git a/CapMachine.Wpf/Views/ProConfigView.xaml.cs b/CapMachine.Wpf/Views/ProConfigView.xaml.cs index dbb7fe8..ee2e615 100644 --- a/CapMachine.Wpf/Views/ProConfigView.xaml.cs +++ b/CapMachine.Wpf/Views/ProConfigView.xaml.cs @@ -1,4 +1,7 @@ -using System.Windows; +using CapMachine.Wpf.PrismEvent; +using MaterialDesignThemes.Wpf; +using Prism.Events; +using System.Windows; using System.Windows.Controls; namespace CapMachine.Wpf.Views @@ -8,34 +11,45 @@ namespace CapMachine.Wpf.Views /// public partial class ProConfigView : UserControl { - public ProConfigView() + public ProConfigView(IEventAggregator eventAggregator) { InitializeComponent(); + + EventAggregator = eventAggregator; + EventAggregator.GetEvent().Subscribe(DrawerCmd); + } + + private void DrawerCmd(string obj) + { + ProDrawerHost.IsRightDrawerOpen = true; + //ProDrawerHost.IsLeftDrawerOpen = true; } public int TabSelectedIndex { get; set; } + public IEventAggregator EventAggregator { get; } + private void ProStepOtherTapLeft(object sender, RoutedEventArgs e) { - if (TabSelectedIndex > 0) - { - TabSelectedIndex--; - OtherTabControl.SelectedIndex = TabSelectedIndex; - // 将选定的 TabItem 滚动到可视范围内 - TabItem selectedItem = OtherTabControl.SelectedItem as TabItem; - selectedItem?.BringIntoView(); - } + //if (TabSelectedIndex > 0) + //{ + // TabSelectedIndex--; + // OtherTabControl.SelectedIndex = TabSelectedIndex; + // // 将选定的 TabItem 滚动到可视范围内 + // TabItem selectedItem = OtherTabControl.SelectedItem as TabItem; + // selectedItem?.BringIntoView(); + //} } private void ProStepOtherTapRight(object sender, RoutedEventArgs e) { - if (TabSelectedIndex < 12) - { - TabSelectedIndex++; - OtherTabControl.SelectedIndex = TabSelectedIndex; - // 将选定的 TabItem 滚动到可视范围内 - TabItem selectedItem = OtherTabControl.SelectedItem as TabItem; - selectedItem?.BringIntoView(); - } + //if (TabSelectedIndex < 12) + //{ + // TabSelectedIndex++; + // OtherTabControl.SelectedIndex = TabSelectedIndex; + // // 将选定的 TabItem 滚动到可视范围内 + // TabItem selectedItem = OtherTabControl.SelectedItem as TabItem; + // selectedItem?.BringIntoView(); + //} } } diff --git a/CapMachine.Wpf/Views/ProStepConfigMainView.xaml b/CapMachine.Wpf/Views/ProStepConfigMainView.xaml new file mode 100644 index 0000000..424ad7d --- /dev/null +++ b/CapMachine.Wpf/Views/ProStepConfigMainView.xaml @@ -0,0 +1,22 @@ + + + +