diff --git a/CapMachine.Model/MeterConfig/MeterPTCEntTemp.cs b/CapMachine.Model/MeterConfig/MeterPTCEntTemp.cs
index 257c952..cc2ba6c 100644
--- a/CapMachine.Model/MeterConfig/MeterPTCEntTemp.cs
+++ b/CapMachine.Model/MeterConfig/MeterPTCEntTemp.cs
@@ -9,6 +9,7 @@ namespace CapMachine.Model
{
///
/// PTC入口温度(℃) 表设置
+ /// 给冷水机组
///
[Table(Name = "MeterPTCEntTemp")]
public class MeterPTCEntTemp
diff --git a/CapMachine.Model/MeterConfig/MeterPTCFlow.cs b/CapMachine.Model/MeterConfig/MeterPTCFlow.cs
index f02f312..f76537b 100644
--- a/CapMachine.Model/MeterConfig/MeterPTCFlow.cs
+++ b/CapMachine.Model/MeterConfig/MeterPTCFlow.cs
@@ -9,6 +9,7 @@ namespace CapMachine.Model
{
///
/// PTC流量 表设置
+ /// 给冷水机组
///
[Table(Name = "MeterPTCFlow")]
public class MeterPTCFlow
diff --git a/CapMachine.Model/MeterConfig/MeterPTCPw.cs b/CapMachine.Model/MeterConfig/MeterPTCPw.cs
index 6c908b5..4ae4963 100644
--- a/CapMachine.Model/MeterConfig/MeterPTCPw.cs
+++ b/CapMachine.Model/MeterConfig/MeterPTCPw.cs
@@ -3,7 +3,8 @@
namespace CapMachine.Model
{
///
- /// PTC功率 表设置
+ /// PTC功率 表设置 给压缩机的PTC使用
+ /// PTC SV1 PTC功率给定
///
[Table(Name = "MeterPTCPw")]
public class MeterPTCPw
diff --git a/CapMachine.Model/MeterConfig/MeterPTCPw2.cs b/CapMachine.Model/MeterConfig/MeterPTCPw2.cs
index d7c31c8..164d4c1 100644
--- a/CapMachine.Model/MeterConfig/MeterPTCPw2.cs
+++ b/CapMachine.Model/MeterConfig/MeterPTCPw2.cs
@@ -3,7 +3,8 @@
namespace CapMachine.Model.MeterConfig
{
///
- /// PTC功率 表设置
+ /// PTC功率2 表设置 给压缩机的PTC使用
+ /// PTC SV2 PTC功率给定
///
[Table(Name = "MeterPTCPw2")]
public class MeterPTCPw2
diff --git a/CapMachine.Model/MeterConfig/MeterPTCWaterFlow.cs b/CapMachine.Model/MeterConfig/MeterPTCWaterFlow.cs
new file mode 100644
index 0000000..acd09eb
--- /dev/null
+++ b/CapMachine.Model/MeterConfig/MeterPTCWaterFlow.cs
@@ -0,0 +1,85 @@
+using FreeSql.DataAnnotations;
+
+namespace CapMachine.Model
+{
+ ///
+ /// PTC水流量 表设置 给压缩机的PTC使用
+ /// PTC水流量
+ ///
+ [Table(Name = "MeterPTCWaterFlow")]
+ public class MeterPTCWaterFlow
+ {
+ ///
+ /// 主键
+ ///
+ [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 int KeepTime { get; set; }
+
+ ///
+ /// 配置值类型
+ ///
+ [Column(MapType = typeof(int))]
+ public ConfigValueType ValueType { get; set; }
+
+ ///
+ /// 常值
+ /// 在ValueType为常值时会使用
+ ///
+ [Column(Name = "Constant")]
+ public double Constant { get; set; }
+
+
+ ///
+ /// PID No
+ ///
+ [Column(Name = "PIDNo")]
+ public int PIDNo { get; set; }
+
+ ///
+ /// 限幅 No
+ ///
+ [Column(Name = "LimitNo")]
+ public int LimitNo { get; set; }
+
+ ///
+ /// 报警 No
+ ///
+ [Column(Name = "AlarmNo")]
+ public int AlarmNo { 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/MeterPTCWaterTemp.cs b/CapMachine.Model/MeterConfig/MeterPTCWaterTemp.cs
new file mode 100644
index 0000000..27debad
--- /dev/null
+++ b/CapMachine.Model/MeterConfig/MeterPTCWaterTemp.cs
@@ -0,0 +1,85 @@
+using FreeSql.DataAnnotations;
+
+namespace CapMachine.Model
+{
+ ///
+ /// PTC目标水温 表设置 给压缩机的PTC使用
+ /// PTC目标水温
+ ///
+ [Table(Name = "MeterPTCWaterTemp")]
+ public class MeterPTCWaterTemp
+ {
+ ///
+ /// 主键
+ ///
+ [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 int KeepTime { get; set; }
+
+ ///
+ /// 配置值类型
+ ///
+ [Column(MapType = typeof(int))]
+ public ConfigValueType ValueType { get; set; }
+
+ ///
+ /// 常值
+ /// 在ValueType为常值时会使用
+ ///
+ [Column(Name = "Constant")]
+ public double Constant { get; set; }
+
+
+ ///
+ /// PID No
+ ///
+ [Column(Name = "PIDNo")]
+ public int PIDNo { get; set; }
+
+ ///
+ /// 限幅 No
+ ///
+ [Column(Name = "LimitNo")]
+ public int LimitNo { get; set; }
+
+ ///
+ /// 报警 No
+ ///
+ [Column(Name = "AlarmNo")]
+ public int AlarmNo { 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/MeterSpeed.cs b/CapMachine.Model/MeterConfig/MeterSpeed.cs
index c9bfce0..96cb77d 100644
--- a/CapMachine.Model/MeterConfig/MeterSpeed.cs
+++ b/CapMachine.Model/MeterConfig/MeterSpeed.cs
@@ -106,33 +106,33 @@ namespace CapMachine.Model
[Column(Name = "PTCEnable")]
public bool PTCEnable { get; set; }
- ///
- /// 加热器 PTC功率1
- /// 跟随速度步骤的常值数据
- ///
- [Column(Name = "PTCPw1")]
- public double PTCPw1 { get; set; }
+ /////
+ ///// 加热器 PTC功率1
+ ///// 跟随速度步骤的常值数据
+ /////
+ //[Column(Name = "PTCPw1")]
+ //public double PTCPw1 { get; set; }
- ///
- /// 加热器 PTC功率2
- /// 跟随速度步骤的常值数据
- ///
- [Column(Name = "PTCPw2")]
- public double PTCPw2 { get; set; }
+ /////
+ ///// 加热器 PTC功率2
+ ///// 跟随速度步骤的常值数据
+ /////
+ //[Column(Name = "PTCPw2")]
+ //public double PTCPw2 { get; set; }
- ///
- /// 加热器 PTC水流量
- /// 跟随速度步骤的常值数据
- ///
- [Column(Name = "PTCWaterFlow")]
- public double PTCWaterFlow { get; set; }
+ /////
+ ///// 加热器 PTC水流量
+ ///// 跟随速度步骤的常值数据
+ /////
+ //[Column(Name = "PTCWaterFlow")]
+ //public double PTCWaterFlow { get; set; }
- ///
- /// 加热器 PTC水温
- /// 跟随速度步骤的常值数据
- ///
- [Column(Name = "PTCWaterTemp")]
- public double PTCWaterTemp { get; set; }
+ /////
+ ///// 加热器 PTC水温
+ ///// 跟随速度步骤的常值数据
+ /////
+ //[Column(Name = "PTCWaterTemp")]
+ //public double PTCWaterTemp { get; set; }
/////
diff --git a/CapMachine.Model/ProStep.cs b/CapMachine.Model/ProStep.cs
index 0c4a386..8eda52d 100644
--- a/CapMachine.Model/ProStep.cs
+++ b/CapMachine.Model/ProStep.cs
@@ -1,4 +1,5 @@
-using FreeSql.DataAnnotations;
+using CapMachine.Model.MeterConfig;
+using FreeSql.DataAnnotations;
using System;
using System.Collections.Generic;
using System.Diagnostics.Metrics;
@@ -117,22 +118,47 @@ namespace CapMachine.Model
/// OS2温度/吸气混合器温度
///
public List? MeterOS2Temps { get; set; } = new List();
+
///
/// PTC入口水温
+ /// 给冷水机组
///
public List? MeterPTCEntTemps { get; set; } = new List();
///
/// PTC流量
+ /// 给冷水机组
///
public List? MeterPTCFlows { get; set; } = new List();
+
///
- /// PTC功率
+ /// PTC功率SV1
+ /// 给压缩机PTC使用
///
public List? MeterPTCPws { get; set; } = new List();
+
+ ///
+ /// PTC功率SV2
+ /// 给压缩机PTC使用
+ ///
+ public List? MeterPTCPw2s { get; set; } = new List();
+
+ ///
+ /// PTC目标水温
+ /// 给压缩机PTC使用
+ ///
+ public List? MeterPTCWaterTemps { get; set; } = new List();
+
+ ///
+ /// PTC水流量
+ /// 给压缩机PTC使用
+ ///
+ public List? MeterPTCWaterFlows { get; set; } = new List();
+
///
/// 试验箱湿度
///
public List? MeterEnvRHs { get; set; } = new List();
+
///
/// 试验箱温度
///
diff --git a/CapMachine.Wpf/ChannelModel/ProRunChannelData.cs b/CapMachine.Wpf/ChannelModel/ProRunChannelData.cs
index 8f4086b..7a15847 100644
--- a/CapMachine.Wpf/ChannelModel/ProRunChannelData.cs
+++ b/CapMachine.Wpf/ChannelModel/ProRunChannelData.cs
@@ -59,6 +59,12 @@ namespace CapMachine.Wpf.ChannelModel
///
public bool IsSpeed { get; set; } = false;
+ ///
+ /// 执行标记信息
+ /// 特殊的参数控制
+ ///
+ public ProExFlag ProExFlag { get; set; }
+
///
/// 拓展参数集合
/// 比如:速度参数拓展的输出锁定、吸排气阀,压缩机使能等这些拓展参数
diff --git a/CapMachine.Wpf/Dtos/ProStepDto.cs b/CapMachine.Wpf/Dtos/ProStepDto.cs
index 2f5dc5a..4541d8f 100644
--- a/CapMachine.Wpf/Dtos/ProStepDto.cs
+++ b/CapMachine.Wpf/Dtos/ProStepDto.cs
@@ -29,7 +29,7 @@ namespace CapMachine.Model
/////
//public int StepRepeat { get; set; }
- private CycleInfoDto? _SpeedCycle=new CycleInfoDto();
+ private CycleInfoDto? _SpeedCycle = new CycleInfoDto();
///
/// 速度循环信息
///
@@ -209,6 +209,40 @@ namespace CapMachine.Model
set { _MeterPTCPwInfo = value; RaisePropertyChanged(); }
}
+
+ private string? _MeterPTCPw2Info;
+ ///
+ /// MeterPTCPw 2 信息
+ ///
+ public string? MeterPTCPw2Info
+ {
+ get { return _MeterPTCPw2Info; }
+ set { _MeterPTCPw2Info = value; RaisePropertyChanged(); }
+ }
+
+
+
+ private string? _MeterPTCWaterTempInfo;
+ ///
+ /// MeterPTCWaterTemp 信息
+ ///
+ public string? MeterPTCWaterTempInfo
+ {
+ get { return _MeterPTCWaterTempInfo; }
+ set { _MeterPTCWaterTempInfo = value; RaisePropertyChanged(); }
+ }
+
+
+ private string? _MeterPTCWaterFlowInfo;
+ ///
+ /// MeterPTCWaterFlow 信息
+ ///
+ public string? MeterPTCWaterFlowInfo
+ {
+ get { return _MeterPTCWaterFlowInfo; }
+ set { _MeterPTCWaterFlowInfo = value; RaisePropertyChanged(); }
+ }
+
private string? _MeterEnvRHInfo;
///
/// MeterTestBoxRH 信息
diff --git a/CapMachine.Wpf/Models/ProModelPars/ProExFlag.cs b/CapMachine.Wpf/Models/ProModelPars/ProExFlag.cs
new file mode 100644
index 0000000..6ee64d9
--- /dev/null
+++ b/CapMachine.Wpf/Models/ProModelPars/ProExFlag.cs
@@ -0,0 +1,50 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CapMachine.Wpf.Models.ProModelPars
+{
+ ///
+ /// 程序执行的标志信息
+ ///
+ public enum ProExFlag
+ {
+ ///
+ /// 没有特殊的标记
+ ///
+ None = 0,
+
+ ///
+ /// 压缩机 转速
+ ///
+ CapSpeed = 100,
+
+ ///
+ /// 压缩机PTC 功率SV1
+ /// 像速度一样,这个执行不需要写入到PLC发给仪表控制,直接发送给压缩机,PTC控制
+ ///
+ CapPTCPw = 1,
+
+ ///
+ /// 压缩机PTC 功率SV2
+ /// 像速度一样,这个执行不需要写入到PLC发给仪表控制,直接发送给压缩机,PTC控制
+ ///
+ CapPTCPw2 = 2,
+
+
+ ///
+ /// 压缩机PTC 目标水温
+ /// 像速度一样,这个执行不需要写入到PLC发给仪表控制,直接发送给压缩机,PTC控制
+ ///
+ CapPTCWaterTemp = 3,
+
+ ///
+ /// 压缩机PTC 水流量
+ /// 像速度一样,这个执行不需要写入到PLC发给仪表控制,直接发送给压缩机,PTC控制
+ ///
+ CapPTCWaterFlow = 4,
+
+ }
+}
diff --git a/CapMachine.Wpf/Models/ProModelPars/ProExModel.cs b/CapMachine.Wpf/Models/ProModelPars/ProExModel.cs
index 37f1541..f59d99a 100644
--- a/CapMachine.Wpf/Models/ProModelPars/ProExModel.cs
+++ b/CapMachine.Wpf/Models/ProModelPars/ProExModel.cs
@@ -44,6 +44,12 @@ namespace CapMachine.Wpf.Models.ProModelPars
///
public bool IsSpeed { get; set; } = false;
+ ///
+ /// 执行标记信息
+ /// 特殊的参数控制
+ ///
+ public ProExFlag ProExFlag { get; set; }
+
///
/// 程序执行管道
///
@@ -248,6 +254,7 @@ namespace CapMachine.Wpf.Models.ProModelPars
CurLoadPID = PidResult == true ? new PID() { P = (short)NextProStepExe.CurConfigPIDDto.P, I = (short)NextProStepExe.CurConfigPIDDto.I, D = (short)NextProStepExe.CurConfigPIDDto.D } : new PID(),
RunStepType = GetRunStepType(PidResult, LimitResult, false),
IsSpeed = IsSpeed,
+ ProExFlag= ProExFlag,
ListStepExd = GetStepExds(NextProStepExe),//拓展参数
@@ -305,6 +312,7 @@ namespace CapMachine.Wpf.Models.ProModelPars
CurLoadPID = PidResult == true ? new PID() { P = (short)NextProStepExe.CurConfigPIDDto.P, I = (short)NextProStepExe.CurConfigPIDDto.I, D = (short)NextProStepExe.CurConfigPIDDto.D } : new PID(),
RunStepType = GetRunStepType(PidResult, LimitResult, true),
IsSpeed = IsSpeed,
+ ProExFlag = ProExFlag,
ListStepExd = GetStepExds(NextProStepExe),//拓展参数
});
@@ -490,6 +498,7 @@ namespace CapMachine.Wpf.Models.ProModelPars
MeterName = MeterName,
SV = NoExData.First().SV,
IsSpeed = IsSpeed,
+ ProExFlag = ProExFlag,
ProSegName = CurProStepExe.ProSegName,
MeterStep = CurProStepExe.MeterStep,
diff --git a/CapMachine.Wpf/Services/MachineRtDataService.cs b/CapMachine.Wpf/Services/MachineRtDataService.cs
index 3808636..693d4ee 100644
--- a/CapMachine.Wpf/Services/MachineRtDataService.cs
+++ b/CapMachine.Wpf/Services/MachineRtDataService.cs
@@ -797,7 +797,7 @@ namespace CapMachine.Wpf.Services
EnName = "PTCPw",
Group = "程序",
MinValue = 0,
- MaxValue = 150,
+ MaxValue = 5000,
IsMeter = true,
DecimalPoint = 1,
Precision = 1,
@@ -819,36 +819,100 @@ namespace CapMachine.Wpf.Services
RWInfo = RWInfo.Control,
});
- //PTC功率2 控制但非仪表控制 -北厂未启用此功能,南厂有此功能
- //TagManger.AddTag(new ShortControlTag()
- //{
- // Id = 201,
- // Name = "PTC功率2[W]",
- // NameNoUnit = "PTC功率2",
- // EnName = "PTCPw2",
- // Group = "程序",
- // MinValue = 0,
- // MaxValue = 10000,
- // IsMeter = true,
- // DecimalPoint = 1,
- // Precision = 1,
- // Unit = "W",
- // DataType = TagDataType.Short,
- // PVModel = new MeterValueAttrCell() { Address = "VW434", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 334},
- // SVModel = new MeterValueAttrCell() { Address = "VW434", EngValue = 0, EngValueStr = "", Block = "SV", BlockIndex = 34 },
- // MVModel = new MeterValueAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Block = "MV", BlockIndex = 1, Enable = false },
- // MVAutoHandModel = new MvAmAttrCell() { Address = "", EngValueStr = "", Block = "MVAM", BlockIndex = 1, Enable = false },
+ //PTC功率2 控制但非仪表控制
+ TagManger.AddTag(new ShortControlTag()
+ {
+ Id = 201,
+ Name = "PTC功率2[W]",
+ NameNoUnit = "PTC功率2",
+ EnName = "PTCPw2",
+ Group = "程序",
+ MinValue = 0,
+ MaxValue = 10000,
+ IsMeter = true,
+ DecimalPoint = 1,
+ Precision = 1,
+ Unit = "W",
+ DataType = TagDataType.Short,
+ PVModel = new MeterValueAttrCell() { Address = "VW14022", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 334 },
+ SVModel = new MeterValueAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Block = "SV", BlockIndex = 34 },
+ MVModel = new MeterValueAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Block = "MV", BlockIndex = 1, Enable = false },
+ MVAutoHandModel = new MvAmAttrCell() { Address = "", EngValueStr = "", Block = "MVAM", BlockIndex = 1, Enable = false },
- // Pid_PModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
- // Pid_IModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
- // Pid_DModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
- // Limit_UpModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
- // Limit_DownModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
- // AlarmModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
- // AutoHandState = false,
+ Pid_PModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
+ Pid_IModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
+ Pid_DModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
+ Limit_UpModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
+ Limit_DownModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
+ AlarmModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
+ AutoHandState = false,
+
+ RWInfo = RWInfo.Control,
+ });
+
+
+ //PTC目标水温 控制但非仪表控制
+ TagManger.AddTag(new ShortControlTag()
+ {
+ Id = 202,
+ Name = "PTC目标水温[℃]",
+ NameNoUnit = "PTC目标水温",
+ EnName = "PTCWaterTemp",
+ Group = "程序",
+ MinValue = 0,
+ MaxValue = 150,
+ IsMeter = true,
+ DecimalPoint = 1,
+ Precision = 1,
+ Unit = "W",
+ DataType = TagDataType.Short,
+ PVModel = new MeterValueAttrCell() { Address = "VW14026", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 334 },
+ SVModel = new MeterValueAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Block = "SV", BlockIndex = 34 },
+ MVModel = new MeterValueAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Block = "MV", BlockIndex = 1, Enable = false },
+ MVAutoHandModel = new MvAmAttrCell() { Address = "", EngValueStr = "", Block = "MVAM", BlockIndex = 1, Enable = false },
+
+ Pid_PModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
+ Pid_IModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
+ Pid_DModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
+ Limit_UpModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
+ Limit_DownModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
+ AlarmModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
+ AutoHandState = false,
+
+ RWInfo = RWInfo.Control,
+ });
+
+ //PTC水流量 控制但非仪表控制
+ TagManger.AddTag(new ShortControlTag()
+ {
+ Id = 203,
+ Name = "PTC水流量[L/Min]",
+ NameNoUnit = "PTC水流量",
+ EnName = "PTCWaterFlow",
+ Group = "程序",
+ MinValue = 0,
+ MaxValue = 500,
+ IsMeter = true,
+ DecimalPoint = 2,
+ Precision = 1,
+ Unit = "W",
+ DataType = TagDataType.Short,
+ PVModel = new MeterValueAttrCell() { Address = "VW14024", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 334 },
+ SVModel = new MeterValueAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Block = "SV", BlockIndex = 34 },
+ MVModel = new MeterValueAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Block = "MV", BlockIndex = 1, Enable = false },
+ MVAutoHandModel = new MvAmAttrCell() { Address = "", EngValueStr = "", Block = "MVAM", BlockIndex = 1, Enable = false },
+
+ Pid_PModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
+ Pid_IModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
+ Pid_DModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
+ Limit_UpModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
+ Limit_DownModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
+ AlarmModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
+ AutoHandState = false,
+
+ RWInfo = RWInfo.Control,
+ });
- // RWInfo = RWInfo.Control,
- //});
//PTC流量 控制但非仪表控制
@@ -2939,6 +3003,31 @@ namespace CapMachine.Wpf.Services
{
while (ProRunChannel.Reader.TryRead(out var ProRunChannelData))
{
+ if (ProRunChannelData.ProExFlag != ProExFlag.None)
+ {
+ switch (ProRunChannelData.ProExFlag)
+ {
+ case ProExFlag.CapSpeed:
+ SendSpeedSvToCap(ProRunChannelData.SV);
+ break;
+ case ProExFlag.CapPTCPw:
+ SendPTCPwSvToCap(ProRunChannelData.SV);
+ break;
+ case ProExFlag.CapPTCPw2:
+ SendPTCPwSv2ToCap(ProRunChannelData.SV);
+ break;
+ case ProExFlag.CapPTCWaterTemp:
+ SendPTCWaterTempToCap(ProRunChannelData.SV);
+ break;
+ case ProExFlag.CapPTCWaterFlow:
+ SendPTCWaterFlowToCap(ProRunChannelData.SV);
+ break;
+ default:
+ break;
+ }
+ continue;
+ }
+
////第一次计时
//stopwatch.Start(); //启动Stopwatch
switch (ProRunChannelData.RunStepType)
@@ -3149,89 +3238,89 @@ namespace CapMachine.Wpf.Services
continue;
}
- //压缩机PTC功率1的参数直接给压缩机触发
- if (itemStepExd.Name!.Contains("PTC功率1"))
- {
- switch (ConfigService.CanLinRunStateModel.CurSysSelectedCanLin)
- {
- case CanLinEnum.Can:
- CanDriveService.UpdateCapPTCPwCmdData((double)itemStepExd.Value!);
- break;
- case CanLinEnum.CANFD:
- CanFdDriveService.UpdateCapPTCPwCmdData((double)itemStepExd.Value!);
- break;
- case CanLinEnum.Lin:
- LinDriveService.UpdateCapEnableCmdData((bool)itemStepExd.Value!);
- break;
- default:
- break;
- }
- continue;
- }
+ ////压缩机PTC功率1的参数直接给压缩机触发
+ //if (itemStepExd.Name!.Contains("PTC功率1"))
+ //{
+ // switch (ConfigService.CanLinRunStateModel.CurSysSelectedCanLin)
+ // {
+ // case CanLinEnum.Can:
+ // CanDriveService.UpdateCapPTCPwCmdData((double)itemStepExd.Value!);
+ // break;
+ // case CanLinEnum.CANFD:
+ // CanFdDriveService.UpdateCapPTCPwCmdData((double)itemStepExd.Value!);
+ // break;
+ // case CanLinEnum.Lin:
+ // LinDriveService.UpdateCapEnableCmdData((bool)itemStepExd.Value!);
+ // break;
+ // default:
+ // break;
+ // }
+ // continue;
+ //}
- //压缩机PTC功率2的参数直接给压缩机触发
- if (itemStepExd.Name!.Contains("PTC功率2"))
- {
- switch (ConfigService.CanLinRunStateModel.CurSysSelectedCanLin)
- {
- case CanLinEnum.Can:
- CanDriveService.UpdateCapPTCPwCmdData((double)itemStepExd.Value!);
- break;
- case CanLinEnum.CANFD:
- CanFdDriveService.UpdateCapPTCPwCmdData((double)itemStepExd.Value!);
- break;
- case CanLinEnum.Lin:
- //LinDriveService.UpdateCapEnableCmdData((bool)itemStepExd.Value!);
- break;
- default:
- break;
- }
- continue;
- }
+ ////压缩机PTC功率2的参数直接给压缩机触发
+ //if (itemStepExd.Name!.Contains("PTC功率2"))
+ //{
+ // switch (ConfigService.CanLinRunStateModel.CurSysSelectedCanLin)
+ // {
+ // case CanLinEnum.Can:
+ // CanDriveService.UpdateCapPTCPwCmdData((double)itemStepExd.Value!);
+ // break;
+ // case CanLinEnum.CANFD:
+ // CanFdDriveService.UpdateCapPTCPwCmdData((double)itemStepExd.Value!);
+ // break;
+ // case CanLinEnum.Lin:
+ // //LinDriveService.UpdateCapEnableCmdData((bool)itemStepExd.Value!);
+ // break;
+ // default:
+ // break;
+ // }
+ // continue;
+ //}
- //压缩机PTC水流量的参数直接给压缩机触发
- if (itemStepExd.Name!.Contains("PTC水流量"))
- {
- switch (ConfigService.CanLinRunStateModel.CurSysSelectedCanLin)
- {
- case CanLinEnum.Can:
- CanDriveService.UpdateCapPTCFlowCmdData((double)itemStepExd.Value!);
- break;
- case CanLinEnum.CANFD:
- CanFdDriveService.UpdateCapPTCFlowCmdData((double)itemStepExd.Value!);
- break;
- case CanLinEnum.Lin:
- //LinDriveService.UpdateCapEnableCmdData((bool)itemStepExd.Value!);
- break;
- default:
- break;
- }
- continue;
- }
+ ////压缩机PTC水流量的参数直接给压缩机触发
+ //if (itemStepExd.Name!.Contains("PTC水流量"))
+ //{
+ // switch (ConfigService.CanLinRunStateModel.CurSysSelectedCanLin)
+ // {
+ // case CanLinEnum.Can:
+ // CanDriveService.UpdateCapPTCFlowCmdData((double)itemStepExd.Value!);
+ // break;
+ // case CanLinEnum.CANFD:
+ // CanFdDriveService.UpdateCapPTCFlowCmdData((double)itemStepExd.Value!);
+ // break;
+ // case CanLinEnum.Lin:
+ // //LinDriveService.UpdateCapEnableCmdData((bool)itemStepExd.Value!);
+ // break;
+ // default:
+ // break;
+ // }
+ // continue;
+ //}
- //压缩机PTC水温的参数直接给压缩机触发
- if (itemStepExd.Name!.Contains("PTC水温"))
- {
- switch (ConfigService.CanLinRunStateModel.CurSysSelectedCanLin)
- {
- case CanLinEnum.Can:
- CanDriveService.UpdateCapPTCWaterTempCmdData((double)itemStepExd.Value!);
- break;
- case CanLinEnum.CANFD:
- CanFdDriveService.UpdateCapPTCWaterTempCmdData((double)itemStepExd.Value!);
- break;
- case CanLinEnum.Lin:
- //LinDriveService.UpdateCapEnableCmdData((bool)itemStepExd.Value!);
- break;
- default:
- break;
- }
- continue;
+ ////压缩机PTC水温的参数直接给压缩机触发
+ //if (itemStepExd.Name!.Contains("PTC水温"))
+ //{
+ // switch (ConfigService.CanLinRunStateModel.CurSysSelectedCanLin)
+ // {
+ // case CanLinEnum.Can:
+ // CanDriveService.UpdateCapPTCWaterTempCmdData((double)itemStepExd.Value!);
+ // break;
+ // case CanLinEnum.CANFD:
+ // CanFdDriveService.UpdateCapPTCWaterTempCmdData((double)itemStepExd.Value!);
+ // break;
+ // case CanLinEnum.Lin:
+ // //LinDriveService.UpdateCapEnableCmdData((bool)itemStepExd.Value!);
+ // break;
+ // default:
+ // break;
+ // }
+ // continue;
- //Console.WriteLine($"{ProRunChannelData.MeterName}拓展参数------------:{itemStepExd.Name}:{itemStepExd.Value}");
- //continue;
- }
+ // //Console.WriteLine($"{ProRunChannelData.MeterName}拓展参数------------:{itemStepExd.Name}:{itemStepExd.Value}");
+ // //continue;
+ //}
var DataAdrees = ListPlcExdConfigCell.FirstOrDefault(a => a.Name == itemStepExd.Name);
if (DataAdrees != null)
@@ -3292,6 +3381,7 @@ namespace CapMachine.Wpf.Services
}
}
+
///
/// 发送速度SV到压缩机
/// 自动步骤数据发送
@@ -3329,6 +3419,98 @@ namespace CapMachine.Wpf.Services
}
}
+ ///
+ /// 发送PTCPw SV到压缩机
+ /// 自动步骤数据发送
+ ///
+ private void SendPTCPwSvToCap(double Valuve)
+ {
+ switch (ConfigService.CanLinRunStateModel.CurSysSelectedCanLin)
+ {
+ case CanLinEnum.Can:
+ CanDriveService.UpdateCapPTCPwCmdData(Valuve!);
+ break;
+ case CanLinEnum.CANFD:
+ CanFdDriveService.UpdateCapPTCPwCmdData(Valuve!);
+ break;
+ case CanLinEnum.Lin:
+ //LinDriveService.UpdateCapPTCPwCmdData((bool)ProRunChannelData.SV!);
+ break;
+ default:
+ break;
+ }
+ }
+
+
+ ///
+ /// 发送PTCPw2 SV到压缩机
+ /// 自动步骤数据发送
+ ///
+ private void SendPTCPwSv2ToCap(double Valuve)
+ {
+ switch (ConfigService.CanLinRunStateModel.CurSysSelectedCanLin)
+ {
+ case CanLinEnum.Can:
+ CanDriveService.UpdateCapPTCPwCmdData(Valuve!);
+ break;
+ case CanLinEnum.CANFD:
+ CanFdDriveService.UpdateCapPTCPwCmdData(Valuve!);
+ break;
+ case CanLinEnum.Lin:
+ //LinDriveService.UpdateCapPTCPwCmdData((bool)ProRunChannelData.SV!);
+ break;
+ default:
+ break;
+ }
+ }
+
+
+ ///
+ /// 发送PTCPw2 SV到压缩机
+ /// 自动步骤数据发送
+ ///
+ private void SendPTCWaterTempToCap(double Valuve)
+ {
+ switch (ConfigService.CanLinRunStateModel.CurSysSelectedCanLin)
+ {
+ case CanLinEnum.Can:
+ CanDriveService.UpdateCapPTCWaterTempCmdData(Valuve!);
+ break;
+ case CanLinEnum.CANFD:
+ CanFdDriveService.UpdateCapPTCWaterTempCmdData(Valuve!);
+ break;
+ case CanLinEnum.Lin:
+ //LinDriveService.UpdateCapPTCPwCmdData((bool)ProRunChannelData.SV!);
+ break;
+ default:
+ break;
+ }
+ }
+
+
+ ///
+ /// 发送PTCPw2 SV到压缩机
+ /// 自动步骤数据发送
+ ///
+ private void SendPTCWaterFlowToCap(double Valuve)
+ {
+ switch (ConfigService.CanLinRunStateModel.CurSysSelectedCanLin)
+ {
+ case CanLinEnum.Can:
+ CanDriveService.UpdateCapPTCFlowCmdData(Valuve!);
+ break;
+ case CanLinEnum.CANFD:
+ CanFdDriveService.UpdateCapPTCFlowCmdData(Valuve!);
+ break;
+ case CanLinEnum.Lin:
+ //LinDriveService.UpdateCapPTCPwCmdData((bool)ProRunChannelData.SV!);
+ break;
+ default:
+ break;
+ }
+ }
+
+
#endregion
}
}
diff --git a/CapMachine.Wpf/Services/ProRuntimeService.cs b/CapMachine.Wpf/Services/ProRuntimeService.cs
index 2e39c28..7a91420 100644
--- a/CapMachine.Wpf/Services/ProRuntimeService.cs
+++ b/CapMachine.Wpf/Services/ProRuntimeService.cs
@@ -82,6 +82,7 @@ namespace CapMachine.Wpf.Services
MeterName = itemKeyValue.Value.NameNoUnit,
ListProStepExe = new List(),
IsSpeed = itemKeyValue.Value.Name.Contains("转速") == true ? true : false,
+ ProExFlag = GetProExFlagByName(itemKeyValue.Value.NameNoUnit),
CurShortControlTag = MachineRtDataService.TagManger.GetShortControlTagByName(itemKeyValue.Key)!,
});
}
@@ -166,6 +167,32 @@ namespace CapMachine.Wpf.Services
return $"{hours}:{minutes:D2}:{seconds:D2}";
}
+ ///
+ /// 根据名称获取具体的标记信息
+ ///
+ ///
+ private ProExFlag GetProExFlagByName(string Name)
+ {
+ //转速的话,直接获取
+ if (Name.Contains("转速")) return ProExFlag.CapSpeed;
+
+ switch (Name)
+ {
+ case "PTC功率":
+ return ProExFlag.CapPTCPw;
+ case "PTC功率2":
+ return ProExFlag.CapPTCPw2;
+ case "PTC目标水温":
+ return ProExFlag.CapPTCWaterTemp;
+ case "PTC水流量":
+ return ProExFlag.CapPTCWaterFlow;
+ default:
+ return ProExFlag.None;
+ }
+ }
+
+
+
///
/// 是否在下载中
///
@@ -231,6 +258,9 @@ namespace CapMachine.Wpf.Services
.IncludeMany(b => b.MeterPTCPws)
.IncludeMany(b => b.MeterEnvRHs)
.IncludeMany(b => b.MeterEnvTemps)
+ .IncludeMany(b => b.MeterPTCPw2s)
+ .IncludeMany(b => b.MeterPTCWaterFlows)
+ .IncludeMany(b => b.MeterPTCWaterTemps)
).ToList().FirstOrDefault();
//获取当前的程序
@@ -294,7 +324,7 @@ namespace CapMachine.Wpf.Services
MeterStepIsExeing = false,//配置阶段默认不执行 false
MeterStepIsOK = false,//配置阶段默认不完成 false
ExistSlop = false,//常值没有斜率 //开始和结束不一样则存在斜率
-
+
MeterStep = ListProExModel.FindFirst(a => a.MeterName == CurMeterName).ListProStepExe.Count + 1,
MeterName = CurMeterName,
@@ -314,10 +344,10 @@ namespace CapMachine.Wpf.Services
new StepExd(){ Name="压缩机使能",Value=itemMeterValueCell.CapEnable,ValueType=ExdValueType.Bool},
new StepExd(){ Name="PTC使能",Value=itemMeterValueCell.PTCEnable,ValueType=ExdValueType.Bool},
- new StepExd(){ Name="PTC功率1",Value=itemMeterValueCell.PTCPw1,ValueType=ExdValueType.Double},
- new StepExd(){ Name="PTC功率2",Value=itemMeterValueCell.PTCPw2,ValueType=ExdValueType.Double},
- new StepExd(){ Name="PTC水流量",Value=itemMeterValueCell.PTCWaterFlow,ValueType=ExdValueType.Double},
- new StepExd(){ Name="PTC水温",Value=itemMeterValueCell.PTCWaterTemp,ValueType=ExdValueType.Double},
+ //new StepExd(){ Name="PTC功率1",Value=itemMeterValueCell.PTCPw1,ValueType=ExdValueType.Double},
+ //new StepExd(){ Name="PTC功率2",Value=itemMeterValueCell.PTCPw2,ValueType=ExdValueType.Double},
+ //new StepExd(){ Name="PTC水流量",Value=itemMeterValueCell.PTCWaterFlow,ValueType=ExdValueType.Double},
+ //new StepExd(){ Name="PTC水温",Value=itemMeterValueCell.PTCWaterTemp,ValueType=ExdValueType.Double},
},
ProStepInfo = $"{itemStep.StepNo}",
@@ -387,10 +417,10 @@ namespace CapMachine.Wpf.Services
new StepExd(){ Name="压缩机使能",Value=itemMeterValueCell.CapEnable,ValueType=ExdValueType.Bool},
new StepExd(){ Name="PTC使能",Value=itemMeterValueCell.PTCEnable,ValueType=ExdValueType.Bool},
- new StepExd(){ Name="PTC功率1",Value=itemMeterValueCell.PTCPw1,ValueType=ExdValueType.Double},
- new StepExd(){ Name="PTC功率2",Value=itemMeterValueCell.PTCPw2,ValueType=ExdValueType.Double},
- new StepExd(){ Name="PTC水流量",Value=itemMeterValueCell.PTCWaterFlow,ValueType=ExdValueType.Double},
- new StepExd(){ Name="PTC水温",Value=itemMeterValueCell.PTCWaterTemp,ValueType=ExdValueType.Double},
+ //new StepExd(){ Name="PTC功率1",Value=itemMeterValueCell.PTCPw1,ValueType=ExdValueType.Double},
+ //new StepExd(){ Name="PTC功率2",Value=itemMeterValueCell.PTCPw2,ValueType=ExdValueType.Double},
+ //new StepExd(){ Name="PTC水流量",Value=itemMeterValueCell.PTCWaterFlow,ValueType=ExdValueType.Double},
+ //new StepExd(){ Name="PTC水温",Value=itemMeterValueCell.PTCWaterTemp,ValueType=ExdValueType.Double},
},
ProStepInfo = $"{itemStep.StepNo}-{itemMeterValueCell.StepNo}",
@@ -3167,6 +3197,466 @@ namespace CapMachine.Wpf.Services
}
+ //********* 单个【PTC功率2】步骤信息的解析 *********
+ {
+ var CurMeterName = "PTC功率2";
+ if (itemStep.MeterPTCPw2s != null && itemStep.MeterPTCPw2s.Any())
+ {
+ switch (itemStep.MeterPTCPw2s.FirstOrDefault()!.ValueType)
+ {
+ case ConfigValueType.Constant: //常值
+ //常值的话就一个数据,循环执行一次
+ foreach (var itemMeterValueCell in itemStep.MeterPTCPw2s)
+ {
+ var Pid = new ConfigPID();
+ if (FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.PIDNo).Any())
+ {
+ Pid = FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.PIDNo).First();
+ }
+ var Limit = new ConfigLimit();
+ if (FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.LimitNo).Any())
+ {
+ Limit = FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.LimitNo).First();
+ }
+ var Alarm = new ConfigAlarm();
+ if (FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.AlarmNo).Any())
+ {
+ Alarm = FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.AlarmNo).First();
+ }
+
+ ListProExModel.FindFirst(a => a.MeterName == CurMeterName).ListProStepExe.Add(new ProStepExe()
+ {
+ //程序块
+ ProSegName = CurProgramSeg.Name,
+ ProSegStep = SegIndex,
+ ProSegRepeat = CurProgramSeg.ProRepeat,
+ ProSegIsExeing = false,//配置阶段默认不执行 false
+
+ //程序步骤数据
+ StartSV = GetSVByProcess(itemMeterValueCell.Constant, CurMeterName),
+ EndSV = GetSVByProcess(itemMeterValueCell.Constant, CurMeterName),
+ KeepTime = itemMeterValueCell.KeepTime,
+ MeterStepIsExeing = false,//配置阶段默认不执行 false
+ MeterStepIsOK = false,//配置阶段默认不完成 false
+ ExistSlop = false,//常值没有斜率 //开始和结束不一样则存在斜率
+
+ MeterStep = ListProExModel.FindFirst(a => a.MeterName == CurMeterName).ListProStepExe.Count + 1,
+ MeterName = CurMeterName,
+
+ LimitNo = itemMeterValueCell.LimitNo,
+ AlarmNo = itemMeterValueCell.AlarmNo,
+ PIDNo = itemMeterValueCell.PIDNo,
+
+ CurConfigPIDDto = Mapper.Map(Pid),
+ CurConfigLimitDto = Mapper.Map(Limit),
+ CurConfigAlarmDto = Mapper.Map(Alarm),
+
+ ProStepInfo = $"{itemStep.StepNo}",
+ ProStep = $"{itemStep.StepNo}/{SpeedMaxStep}",
+ StepExeInfo = $"{itemStep.StepNo}{Environment.NewLine}{itemMeterValueCell.Constant}->{itemMeterValueCell.Constant}{Environment.NewLine}[{ConvertSecToTimeStr(itemMeterValueCell.KeepTime)}]",
+ });
+ }
+ break;
+ case ConfigValueType.Slope:
+ //带斜率
+ //根据循环次数确定
+ var Cycle = GetCycleBySpeed(itemStep.MeterSpeeds, itemStep.SpeedCycle, itemStep.MeterPTCPw2s.Select(p => new MeterCom { Constant = p.Constant, KeepTime = p.KeepTime, StepNo = p.StepNo, ValueType = p.ValueType }).ToList());
+ for (int StepCycleIndex = 1; StepCycleIndex <= Cycle; StepCycleIndex++)
+ {
+ //根据循环次数执行
+ foreach (var itemMeterValueCell in itemStep.MeterPTCPw2s)
+ {
+ var Pid = new ConfigPID();
+ if (FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.PIDNo).Any())
+ {
+ Pid = FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.PIDNo).First();
+ }
+ var Limit = new ConfigLimit();
+ if (FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.LimitNo).Any())
+ {
+ Limit = FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.LimitNo).First();
+ }
+ var Alarm = new ConfigAlarm();
+ if (FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.AlarmNo).Any())
+ {
+ Alarm = FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.AlarmNo).First();
+ }
+
+ ListProExModel.FindFirst(a => a.MeterName == CurMeterName).ListProStepExe.Add(new ProStepExe()
+ {
+ //程序块
+ ProSegName = CurProgramSeg.Name,
+ ProSegStep = SegIndex,
+ ProSegRepeat = CurProgramSeg.ProRepeat,
+ ProSegIsExeing = false,//配置阶段默认不执行 false
+
+ //程序步骤数据
+ //SV = CALCHelper.GetQuickSV(itemMeterValueCell.Constant, 1),
+ StartSV = GetSVByProcess(itemMeterValueCell.StartValue, CurMeterName),
+ EndSV = GetSVByProcess(itemMeterValueCell.EndValue, CurMeterName),
+ KeepTime = itemMeterValueCell.KeepTime,
+ MeterStepIsExeing = false,//配置阶段默认不执行 false
+ MeterStepIsOK = false,//配置阶段默认不完成 false
+ ExistSlop = itemMeterValueCell.StartValue == itemMeterValueCell.EndValue ? false : true,//开始和结束不一样则存在斜率
+
+ MeterStep = ListProExModel.FindFirst(a => a.MeterName == CurMeterName).ListProStepExe.Count + 1,
+
+ LimitNo = itemMeterValueCell.LimitNo,
+ AlarmNo = itemMeterValueCell.AlarmNo,
+ PIDNo = itemMeterValueCell.PIDNo,
+
+ CurConfigPIDDto = Mapper.Map(Pid),
+ CurConfigLimitDto = Mapper.Map(Limit),
+ CurConfigAlarmDto = Mapper.Map(Alarm),
+
+ ProStepInfo = $"{itemStep.StepNo}-{itemMeterValueCell.StepNo}",
+ ProStep = $"{itemStep.StepNo}/{SpeedMaxStep}",
+ StepExeInfo = $"{itemStep.StepNo}-{itemMeterValueCell.StepNo}{Environment.NewLine}{itemMeterValueCell.StartValue}->{itemMeterValueCell.EndValue}{Environment.NewLine}[{ConvertSecToTimeStr(itemMeterValueCell.KeepTime)}]",
+ MeterName = CurMeterName,
+ });
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ else
+ {
+ //判断当前的参数是全部都没有设置还是这一步没有设置,如果这个步骤没有设置,则沿用上一个步骤数据
+ var CurMeterListStepExe = ListProExModel.FindFirst(a => a.MeterName == CurMeterName).ListProStepExe;
+ if (CurMeterListStepExe.Any())
+ {
+ //之前有步骤数据的话,则直接使用上一步的数据
+
+ //Copy这个步骤的数据
+ var LastStepData = CurMeterListStepExe.OrderByDescending(a => a.MeterStep).FirstOrDefault().DeepClone();
+ //处理这个步骤的数据-处理按照常值的恒定的模式运行,就是维持结束的常值数据
+ LastStepData!.MeterStep = LastStepData.MeterStep + 1;//步骤+1
+ LastStepData.KeepTime = SpeedStepTotaolTime;//时间是整个时间
+ LastStepData.ExistSlop = false;
+ LastStepData.StartSV = LastStepData.EndSV;
+ LastStepData.ProStepInfo = $"{itemStep.StepNo}-{1}";
+ //添加
+ CurMeterListStepExe.Add(LastStepData);
+ //SpeedStepTotaolTime
+ }
+ else
+ {
+ //之前步骤没有数据的话,则放弃,不做任何处理
+ }
+ LogService.Warn($"【名称】: {CurMeterName} - 未找到步骤信息。步骤为空");
+ }
+
+ }
+
+ //********* 单个【PTC目标水温】步骤信息的解析 *********
+ {
+ var CurMeterName = "PTC目标水温";
+ if (itemStep.MeterPTCWaterTemps != null && itemStep.MeterPTCWaterTemps.Any())
+ {
+ switch (itemStep.MeterPTCWaterTemps.FirstOrDefault()!.ValueType)
+ {
+ case ConfigValueType.Constant: //常值
+ //常值的话就一个数据,循环执行一次
+ foreach (var itemMeterValueCell in itemStep.MeterPTCWaterTemps)
+ {
+ var Pid = new ConfigPID();
+ if (FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.PIDNo).Any())
+ {
+ Pid = FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.PIDNo).First();
+ }
+ var Limit = new ConfigLimit();
+ if (FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.LimitNo).Any())
+ {
+ Limit = FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.LimitNo).First();
+ }
+ var Alarm = new ConfigAlarm();
+ if (FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.AlarmNo).Any())
+ {
+ Alarm = FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.AlarmNo).First();
+ }
+
+ ListProExModel.FindFirst(a => a.MeterName == CurMeterName).ListProStepExe.Add(new ProStepExe()
+ {
+ //程序块
+ ProSegName = CurProgramSeg.Name,
+ ProSegStep = SegIndex,
+ ProSegRepeat = CurProgramSeg.ProRepeat,
+ ProSegIsExeing = false,//配置阶段默认不执行 false
+
+ //程序步骤数据
+ StartSV = GetSVByProcess(itemMeterValueCell.Constant, CurMeterName),
+ EndSV = GetSVByProcess(itemMeterValueCell.Constant, CurMeterName),
+ KeepTime = itemMeterValueCell.KeepTime,
+ MeterStepIsExeing = false,//配置阶段默认不执行 false
+ MeterStepIsOK = false,//配置阶段默认不完成 false
+ ExistSlop = false,//常值没有斜率 //开始和结束不一样则存在斜率
+
+ MeterStep = ListProExModel.FindFirst(a => a.MeterName == CurMeterName).ListProStepExe.Count + 1,
+ MeterName = CurMeterName,
+
+ LimitNo = itemMeterValueCell.LimitNo,
+ AlarmNo = itemMeterValueCell.AlarmNo,
+ PIDNo = itemMeterValueCell.PIDNo,
+
+ CurConfigPIDDto = Mapper.Map(Pid),
+ CurConfigLimitDto = Mapper.Map(Limit),
+ CurConfigAlarmDto = Mapper.Map(Alarm),
+
+ ProStepInfo = $"{itemStep.StepNo}",
+ ProStep = $"{itemStep.StepNo}/{SpeedMaxStep}",
+ StepExeInfo = $"{itemStep.StepNo}{Environment.NewLine}{itemMeterValueCell.Constant}->{itemMeterValueCell.Constant}{Environment.NewLine}[{ConvertSecToTimeStr(itemMeterValueCell.KeepTime)}]",
+ });
+ }
+ break;
+ case ConfigValueType.Slope:
+ //带斜率
+ //根据循环次数确定
+ var Cycle = GetCycleBySpeed(itemStep.MeterSpeeds, itemStep.SpeedCycle, itemStep.MeterPTCWaterTemps.Select(p => new MeterCom { Constant = p.Constant, KeepTime = p.KeepTime, StepNo = p.StepNo, ValueType = p.ValueType }).ToList());
+ for (int StepCycleIndex = 1; StepCycleIndex <= Cycle; StepCycleIndex++)
+ {
+ //根据循环次数执行
+ foreach (var itemMeterValueCell in itemStep.MeterPTCWaterTemps)
+ {
+ var Pid = new ConfigPID();
+ if (FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.PIDNo).Any())
+ {
+ Pid = FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.PIDNo).First();
+ }
+ var Limit = new ConfigLimit();
+ if (FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.LimitNo).Any())
+ {
+ Limit = FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.LimitNo).First();
+ }
+ var Alarm = new ConfigAlarm();
+ if (FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.AlarmNo).Any())
+ {
+ Alarm = FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.AlarmNo).First();
+ }
+
+ ListProExModel.FindFirst(a => a.MeterName == CurMeterName).ListProStepExe.Add(new ProStepExe()
+ {
+ //程序块
+ ProSegName = CurProgramSeg.Name,
+ ProSegStep = SegIndex,
+ ProSegRepeat = CurProgramSeg.ProRepeat,
+ ProSegIsExeing = false,//配置阶段默认不执行 false
+
+ //程序步骤数据
+ //SV = CALCHelper.GetQuickSV(itemMeterValueCell.Constant, 1),
+ StartSV = GetSVByProcess(itemMeterValueCell.StartValue, CurMeterName),
+ EndSV = GetSVByProcess(itemMeterValueCell.EndValue, CurMeterName),
+ KeepTime = itemMeterValueCell.KeepTime,
+ MeterStepIsExeing = false,//配置阶段默认不执行 false
+ MeterStepIsOK = false,//配置阶段默认不完成 false
+ ExistSlop = itemMeterValueCell.StartValue == itemMeterValueCell.EndValue ? false : true,//开始和结束不一样则存在斜率
+
+ MeterStep = ListProExModel.FindFirst(a => a.MeterName == CurMeterName).ListProStepExe.Count + 1,
+
+ LimitNo = itemMeterValueCell.LimitNo,
+ AlarmNo = itemMeterValueCell.AlarmNo,
+ PIDNo = itemMeterValueCell.PIDNo,
+
+ CurConfigPIDDto = Mapper.Map(Pid),
+ CurConfigLimitDto = Mapper.Map(Limit),
+ CurConfigAlarmDto = Mapper.Map(Alarm),
+
+ ProStepInfo = $"{itemStep.StepNo}-{itemMeterValueCell.StepNo}",
+ ProStep = $"{itemStep.StepNo}/{SpeedMaxStep}",
+ StepExeInfo = $"{itemStep.StepNo}-{itemMeterValueCell.StepNo}{Environment.NewLine}{itemMeterValueCell.StartValue}->{itemMeterValueCell.EndValue}{Environment.NewLine}[{ConvertSecToTimeStr(itemMeterValueCell.KeepTime)}]",
+ MeterName = CurMeterName,
+ });
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ else
+ {
+ //判断当前的参数是全部都没有设置还是这一步没有设置,如果这个步骤没有设置,则沿用上一个步骤数据
+ var CurMeterListStepExe = ListProExModel.FindFirst(a => a.MeterName == CurMeterName).ListProStepExe;
+ if (CurMeterListStepExe.Any())
+ {
+ //之前有步骤数据的话,则直接使用上一步的数据
+
+ //Copy这个步骤的数据
+ var LastStepData = CurMeterListStepExe.OrderByDescending(a => a.MeterStep).FirstOrDefault().DeepClone();
+ //处理这个步骤的数据-处理按照常值的恒定的模式运行,就是维持结束的常值数据
+ LastStepData!.MeterStep = LastStepData.MeterStep + 1;//步骤+1
+ LastStepData.KeepTime = SpeedStepTotaolTime;//时间是整个时间
+ LastStepData.ExistSlop = false;
+ LastStepData.StartSV = LastStepData.EndSV;
+ LastStepData.ProStepInfo = $"{itemStep.StepNo}-{1}";
+ //添加
+ CurMeterListStepExe.Add(LastStepData);
+ //SpeedStepTotaolTime
+ }
+ else
+ {
+ //之前步骤没有数据的话,则放弃,不做任何处理
+ }
+ LogService.Warn($"【名称】: {CurMeterName} - 未找到步骤信息。步骤为空");
+ }
+
+ }
+
+ //********* 单个【PTC水流量】步骤信息的解析 *********
+ {
+ var CurMeterName = "PTC水流量";
+ if (itemStep.MeterPTCWaterFlows != null && itemStep.MeterPTCWaterFlows.Any())
+ {
+ switch (itemStep.MeterPTCWaterFlows.FirstOrDefault()!.ValueType)
+ {
+ case ConfigValueType.Constant: //常值
+ //常值的话就一个数据,循环执行一次
+ foreach (var itemMeterValueCell in itemStep.MeterPTCWaterFlows)
+ {
+ var Pid = new ConfigPID();
+ if (FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.PIDNo).Any())
+ {
+ Pid = FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.PIDNo).First();
+ }
+ var Limit = new ConfigLimit();
+ if (FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.LimitNo).Any())
+ {
+ Limit = FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.LimitNo).First();
+ }
+ var Alarm = new ConfigAlarm();
+ if (FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.AlarmNo).Any())
+ {
+ Alarm = FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.AlarmNo).First();
+ }
+
+ ListProExModel.FindFirst(a => a.MeterName == CurMeterName).ListProStepExe.Add(new ProStepExe()
+ {
+ //程序块
+ ProSegName = CurProgramSeg.Name,
+ ProSegStep = SegIndex,
+ ProSegRepeat = CurProgramSeg.ProRepeat,
+ ProSegIsExeing = false,//配置阶段默认不执行 false
+
+ //程序步骤数据
+ StartSV = GetSVByProcess(itemMeterValueCell.Constant, CurMeterName),
+ EndSV = GetSVByProcess(itemMeterValueCell.Constant, CurMeterName),
+ KeepTime = itemMeterValueCell.KeepTime,
+ MeterStepIsExeing = false,//配置阶段默认不执行 false
+ MeterStepIsOK = false,//配置阶段默认不完成 false
+ ExistSlop = false,//常值没有斜率 //开始和结束不一样则存在斜率
+
+ MeterStep = ListProExModel.FindFirst(a => a.MeterName == CurMeterName).ListProStepExe.Count + 1,
+ MeterName = CurMeterName,
+
+ LimitNo = itemMeterValueCell.LimitNo,
+ AlarmNo = itemMeterValueCell.AlarmNo,
+ PIDNo = itemMeterValueCell.PIDNo,
+
+ CurConfigPIDDto = Mapper.Map(Pid),
+ CurConfigLimitDto = Mapper.Map(Limit),
+ CurConfigAlarmDto = Mapper.Map(Alarm),
+
+ ProStepInfo = $"{itemStep.StepNo}",
+ ProStep = $"{itemStep.StepNo}/{SpeedMaxStep}",
+ StepExeInfo = $"{itemStep.StepNo}{Environment.NewLine}{itemMeterValueCell.Constant}->{itemMeterValueCell.Constant}{Environment.NewLine}[{ConvertSecToTimeStr(itemMeterValueCell.KeepTime)}]",
+ });
+ }
+ break;
+ case ConfigValueType.Slope:
+ //带斜率
+ //根据循环次数确定
+ var Cycle = GetCycleBySpeed(itemStep.MeterSpeeds, itemStep.SpeedCycle, itemStep.MeterPTCWaterFlows.Select(p => new MeterCom { Constant = p.Constant, KeepTime = p.KeepTime, StepNo = p.StepNo, ValueType = p.ValueType }).ToList());
+ for (int StepCycleIndex = 1; StepCycleIndex <= Cycle; StepCycleIndex++)
+ {
+ //根据循环次数执行
+ foreach (var itemMeterValueCell in itemStep.MeterPTCWaterFlows)
+ {
+ var Pid = new ConfigPID();
+ if (FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.PIDNo).Any())
+ {
+ Pid = FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.PIDNo).First();
+ }
+ var Limit = new ConfigLimit();
+ if (FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.LimitNo).Any())
+ {
+ Limit = FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.LimitNo).First();
+ }
+ var Alarm = new ConfigAlarm();
+ if (FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.AlarmNo).Any())
+ {
+ Alarm = FreeSql.Select().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.AlarmNo).First();
+ }
+
+ ListProExModel.FindFirst(a => a.MeterName == CurMeterName).ListProStepExe.Add(new ProStepExe()
+ {
+ //程序块
+ ProSegName = CurProgramSeg.Name,
+ ProSegStep = SegIndex,
+ ProSegRepeat = CurProgramSeg.ProRepeat,
+ ProSegIsExeing = false,//配置阶段默认不执行 false
+
+ //程序步骤数据
+ //SV = CALCHelper.GetQuickSV(itemMeterValueCell.Constant, 1),
+ StartSV = GetSVByProcess(itemMeterValueCell.StartValue, CurMeterName),
+ EndSV = GetSVByProcess(itemMeterValueCell.EndValue, CurMeterName),
+ KeepTime = itemMeterValueCell.KeepTime,
+ MeterStepIsExeing = false,//配置阶段默认不执行 false
+ MeterStepIsOK = false,//配置阶段默认不完成 false
+ ExistSlop = itemMeterValueCell.StartValue == itemMeterValueCell.EndValue ? false : true,//开始和结束不一样则存在斜率
+
+ MeterStep = ListProExModel.FindFirst(a => a.MeterName == CurMeterName).ListProStepExe.Count + 1,
+
+ LimitNo = itemMeterValueCell.LimitNo,
+ AlarmNo = itemMeterValueCell.AlarmNo,
+ PIDNo = itemMeterValueCell.PIDNo,
+
+ CurConfigPIDDto = Mapper.Map(Pid),
+ CurConfigLimitDto = Mapper.Map(Limit),
+ CurConfigAlarmDto = Mapper.Map(Alarm),
+
+ ProStepInfo = $"{itemStep.StepNo}-{itemMeterValueCell.StepNo}",
+ ProStep = $"{itemStep.StepNo}/{SpeedMaxStep}",
+ StepExeInfo = $"{itemStep.StepNo}-{itemMeterValueCell.StepNo}{Environment.NewLine}{itemMeterValueCell.StartValue}->{itemMeterValueCell.EndValue}{Environment.NewLine}[{ConvertSecToTimeStr(itemMeterValueCell.KeepTime)}]",
+ MeterName = CurMeterName,
+ });
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ else
+ {
+ //判断当前的参数是全部都没有设置还是这一步没有设置,如果这个步骤没有设置,则沿用上一个步骤数据
+ var CurMeterListStepExe = ListProExModel.FindFirst(a => a.MeterName == CurMeterName).ListProStepExe;
+ if (CurMeterListStepExe.Any())
+ {
+ //之前有步骤数据的话,则直接使用上一步的数据
+
+ //Copy这个步骤的数据
+ var LastStepData = CurMeterListStepExe.OrderByDescending(a => a.MeterStep).FirstOrDefault().DeepClone();
+ //处理这个步骤的数据-处理按照常值的恒定的模式运行,就是维持结束的常值数据
+ LastStepData!.MeterStep = LastStepData.MeterStep + 1;//步骤+1
+ LastStepData.KeepTime = SpeedStepTotaolTime;//时间是整个时间
+ LastStepData.ExistSlop = false;
+ LastStepData.StartSV = LastStepData.EndSV;
+ LastStepData.ProStepInfo = $"{itemStep.StepNo}-{1}";
+ //添加
+ CurMeterListStepExe.Add(LastStepData);
+ //SpeedStepTotaolTime
+ }
+ else
+ {
+ //之前步骤没有数据的话,则放弃,不做任何处理
+ }
+ LogService.Warn($"【名称】: {CurMeterName} - 未找到步骤信息。步骤为空");
+ }
+
+ }
+
+
}
}
diff --git a/CapMachine.Wpf/ViewModels/ProConfigViewModel.cs b/CapMachine.Wpf/ViewModels/ProConfigViewModel.cs
index 99c13c3..36772a7 100644
--- a/CapMachine.Wpf/ViewModels/ProConfigViewModel.cs
+++ b/CapMachine.Wpf/ViewModels/ProConfigViewModel.cs
@@ -60,6 +60,9 @@ namespace CapMachine.Wpf.ViewModels
PTCPwInit();
EnvRHInit();
EnvTempInit();
+ PTCPw2Init();
+ PTCWaterTempInit();
+ PTCWaterFlowInit();
ListProStepDtoItems = new ObservableCollection();
ListProStep = new List();
@@ -174,6 +177,9 @@ namespace CapMachine.Wpf.ViewModels
MeterPTCPwInfo = MeterPTCPwToString(item.MeterPTCPws!.ToList()),
MeterEnvRHInfo = MeterEnvRHToString(item.MeterEnvRHs!.ToList()),
MeterEnvTempInfo = MeterEnvTempToString(item.MeterEnvTemps!.ToList()),
+ MeterPTCPw2Info = MeterPTCPw2ToString(item.MeterPTCPw2s!.ToList()),
+ MeterPTCWaterFlowInfo = MeterPTCWaterFlowToString(item.MeterPTCWaterFlows!.ToList()),
+ MeterPTCWaterTempInfo = MeterPTCWaterTempToString(item.MeterPTCWaterTemps!.ToList()),
//xxx = MeterSpeedToString(item.xxxs!.ToList()),
});
@@ -255,6 +261,9 @@ namespace CapMachine.Wpf.ViewModels
.IncludeMany(b => b.MeterPTCPws)
.IncludeMany(b => b.MeterEnvRHs)
.IncludeMany(b => b.MeterEnvTemps)
+ .IncludeMany(b => b.MeterPTCPw2s)
+ .IncludeMany(b => b.MeterPTCWaterFlows)
+ .IncludeMany(b => b.MeterPTCWaterTemps)
//.IncludeMany(b => b.MeterPds)
).ToList();
@@ -296,6 +305,9 @@ namespace CapMachine.Wpf.ViewModels
.IncludeMany(b => b.MeterPTCPws)
.IncludeMany(b => b.MeterEnvRHs)
.IncludeMany(b => b.MeterEnvTemps)
+ .IncludeMany(b => b.MeterPTCPw2s)
+ .IncludeMany(b => b.MeterPTCWaterFlows)
+ .IncludeMany(b => b.MeterPTCWaterTemps)
//.IncludeMany(b => b.MeterPds)
).ToList();
@@ -515,7 +527,10 @@ namespace CapMachine.Wpf.ViewModels
.IncludeMany(b => b.MeterPTCFlows)
.IncludeMany(b => b.MeterPTCPws)
.IncludeMany(b => b.MeterEnvRHs)
- .IncludeMany(b => b.MeterEnvTemps))
+ .IncludeMany(b => b.MeterEnvTemps)
+ .IncludeMany(b => b.MeterPTCPw2s)
+ .IncludeMany(b => b.MeterPTCWaterFlows)
+ .IncludeMany(b => b.MeterPTCWaterTemps))
//.IncludeMany(b => b.MeterPds))
//.IncludeMany(a => a.QuickClutchStepCells)
//.IncludeMany(a => a.QuickVoltageStepCells)
@@ -1622,6 +1637,159 @@ namespace CapMachine.Wpf.ViewModels
ListProStepDtoItems.FindFirst(a => a.Id == SelectedProStepDto!.Id)!.MeterPTCPwInfo = MeterPTCPwToString(ListSlopMeterPTCPw);
}
+ //////////////////////////PTCPw2//////////////////////////////////////
+ var TempListMeterPTCPw2 = ListProStep.Where(a => a.Id == SelectedProStepDto.Id).FirstOrDefault()!.MeterPTCPw2s!.ToList();
+ //判断是斜率还是常值
+ if (TempListMeterPTCPw2 != null && TempListMeterPTCPw2.Count > 0)
+ {
+ if (TempListMeterPTCPw2.Any(a => a.ValueType == ConfigValueType.Constant))
+ {
+ //清空之前的步骤的斜率集合状态信息
+ ListSlopMeterPTCPw2 = new List();
+ ListSlopMeterPTCPw2Items = new ObservableCollection(ListSlopMeterPTCPw2);
+
+ //常值信息
+ ProStepPTCPw2SwitchConstSlopIndex = 0;
+ //常值只有一个
+ SelectedConstPTCPw2 = TempListMeterPTCPw2.FirstOrDefault()!;
+ SelectedConstPTCPw2Value = SelectedConstPTCPw2.Constant;
+
+ //更新ProStep的字符串的集合数据
+ ListProStepDtoItems.FindFirst(a => a.Id == SelectedProStepDto!.Id)!.MeterPTCPw2Info = MeterPTCPw2ToString(new List() { SelectedConstPTCPw2 });
+
+ }
+ else//斜率
+ {
+ //清空之前的步骤的常值集合状态信息
+ SelectedConstPTCPw2Value = 0;
+
+ ProStepPTCPw2SwitchConstSlopIndex = 1;
+
+ ListSlopMeterPTCPw2 = TempListMeterPTCPw2.Where(a => a.ValueType == ConfigValueType.Slope).ToList();
+ ListSlopMeterPTCPw2Items = new ObservableCollection(ListSlopMeterPTCPw2);
+
+ //更新ProStep的字符串的集合数据
+ ListProStepDtoItems.FindFirst(a => a.Id == SelectedProStepDto!.Id)!.MeterPTCPw2Info = MeterPTCPw2ToString(ListSlopMeterPTCPw2);
+
+ //更新后检测时间是否匹配并界面提示
+ CheckPTCPw2SlopListTime();
+ }
+ }
+ else
+ {
+ //为空,一次也没有设置数据
+ //清空之前的步骤的斜率/常值集合状态信息
+ ProStepPTCPw2SwitchConstSlopIndex = 1;
+ ListSlopMeterPTCPw2 = new List();
+ ListSlopMeterPTCPw2Items = new ObservableCollection(ListSlopMeterPTCPw2);
+ SelectedConstPTCPw2Value = 0;
+
+ //更新ProStep的字符串的集合数据
+ ListProStepDtoItems.FindFirst(a => a.Id == SelectedProStepDto!.Id)!.MeterPTCPw2Info = MeterPTCPw2ToString(ListSlopMeterPTCPw2);
+ }
+
+ //////////////////////////PTCWaterFlow//////////////////////////////////////
+ var TempListMeterPTCWaterFlow = ListProStep.Where(a => a.Id == SelectedProStepDto.Id).FirstOrDefault()!.MeterPTCWaterFlows!.ToList();
+ //判断是斜率还是常值
+ if (TempListMeterPTCWaterFlow != null && TempListMeterPTCWaterFlow.Count > 0)
+ {
+ if (TempListMeterPTCWaterFlow.Any(a => a.ValueType == ConfigValueType.Constant))
+ {
+ //清空之前的步骤的斜率集合状态信息
+ ListSlopMeterPTCWaterFlow = new List();
+ ListSlopMeterPTCWaterFlowItems = new ObservableCollection(ListSlopMeterPTCWaterFlow);
+
+ //常值信息
+ ProStepPTCWaterFlowSwitchConstSlopIndex = 0;
+ //常值只有一个
+ SelectedConstPTCWaterFlow = TempListMeterPTCWaterFlow.FirstOrDefault()!;
+ SelectedConstPTCWaterFlowValue = SelectedConstPTCWaterFlow.Constant;
+
+ //更新ProStep的字符串的集合数据
+ ListProStepDtoItems.FindFirst(a => a.Id == SelectedProStepDto!.Id)!.MeterPTCWaterFlowInfo = MeterPTCWaterFlowToString(new List() { SelectedConstPTCWaterFlow });
+
+ }
+ else//斜率
+ {
+ //清空之前的步骤的常值集合状态信息
+ SelectedConstPTCWaterFlowValue = 0;
+
+ ProStepPTCWaterFlowSwitchConstSlopIndex = 1;
+
+ ListSlopMeterPTCWaterFlow = TempListMeterPTCWaterFlow.Where(a => a.ValueType == ConfigValueType.Slope).ToList();
+ ListSlopMeterPTCWaterFlowItems = new ObservableCollection(ListSlopMeterPTCWaterFlow);
+
+ //更新ProStep的字符串的集合数据
+ ListProStepDtoItems.FindFirst(a => a.Id == SelectedProStepDto!.Id)!.MeterPTCWaterFlowInfo = MeterPTCWaterFlowToString(ListSlopMeterPTCWaterFlow);
+
+ //更新后检测时间是否匹配并界面提示
+ CheckPTCWaterFlowSlopListTime();
+ }
+ }
+ else
+ {
+ //为空,一次也没有设置数据
+ //清空之前的步骤的斜率/常值集合状态信息
+ ProStepPTCWaterFlowSwitchConstSlopIndex = 1;
+ ListSlopMeterPTCWaterFlow = new List();
+ ListSlopMeterPTCWaterFlowItems = new ObservableCollection(ListSlopMeterPTCWaterFlow);
+ SelectedConstPTCWaterFlowValue = 0;
+
+ //更新ProStep的字符串的集合数据
+ ListProStepDtoItems.FindFirst(a => a.Id == SelectedProStepDto!.Id)!.MeterPTCWaterFlowInfo = MeterPTCWaterFlowToString(ListSlopMeterPTCWaterFlow);
+ }
+
+
+ //////////////////////////PTCWaterTemp//////////////////////////////////////
+ var TempListMeterPTCWaterTemp = ListProStep.Where(a => a.Id == SelectedProStepDto.Id).FirstOrDefault()!.MeterPTCWaterTemps!.ToList();
+ //判断是斜率还是常值
+ if (TempListMeterPTCWaterTemp != null && TempListMeterPTCWaterTemp.Count > 0)
+ {
+ if (TempListMeterPTCWaterTemp.Any(a => a.ValueType == ConfigValueType.Constant))
+ {
+ //清空之前的步骤的斜率集合状态信息
+ ListSlopMeterPTCWaterTemp = new List();
+ ListSlopMeterPTCWaterTempItems = new ObservableCollection(ListSlopMeterPTCWaterTemp);
+
+ //常值信息
+ ProStepPTCWaterTempSwitchConstSlopIndex = 0;
+ //常值只有一个
+ SelectedConstPTCWaterTemp = TempListMeterPTCWaterTemp.FirstOrDefault()!;
+ SelectedConstPTCWaterTempValue = SelectedConstPTCWaterTemp.Constant;
+
+ //更新ProStep的字符串的集合数据
+ ListProStepDtoItems.FindFirst(a => a.Id == SelectedProStepDto!.Id)!.MeterPTCWaterTempInfo = MeterPTCWaterTempToString(new List() { SelectedConstPTCWaterTemp });
+
+ }
+ else//斜率
+ {
+ //清空之前的步骤的常值集合状态信息
+ SelectedConstPTCWaterTempValue = 0;
+
+ ProStepPTCWaterTempSwitchConstSlopIndex = 1;
+
+ ListSlopMeterPTCWaterTemp = TempListMeterPTCWaterTemp.Where(a => a.ValueType == ConfigValueType.Slope).ToList();
+ ListSlopMeterPTCWaterTempItems = new ObservableCollection(ListSlopMeterPTCWaterTemp);
+
+ //更新ProStep的字符串的集合数据
+ ListProStepDtoItems.FindFirst(a => a.Id == SelectedProStepDto!.Id)!.MeterPTCWaterTempInfo = MeterPTCWaterTempToString(ListSlopMeterPTCWaterTemp);
+
+ //更新后检测时间是否匹配并界面提示
+ CheckPTCWaterTempSlopListTime();
+ }
+ }
+ else
+ {
+ //为空,一次也没有设置数据
+ //清空之前的步骤的斜率/常值集合状态信息
+ ProStepPTCWaterTempSwitchConstSlopIndex = 1;
+ ListSlopMeterPTCWaterTemp = new List();
+ ListSlopMeterPTCWaterTempItems = new ObservableCollection(ListSlopMeterPTCWaterTemp);
+ SelectedConstPTCWaterTempValue = 0;
+
+ //更新ProStep的字符串的集合数据
+ ListProStepDtoItems.FindFirst(a => a.Id == SelectedProStepDto!.Id)!.MeterPTCWaterTempInfo = MeterPTCWaterTempToString(ListSlopMeterPTCWaterTemp);
+ }
//////////////////////////EnvRH//////////////////////////////////////
@@ -2051,6 +2219,9 @@ namespace CapMachine.Wpf.ViewModels
.IncludeMany(b => b.MeterPTCPws)
.IncludeMany(b => b.MeterEnvRHs)
.IncludeMany(b => b.MeterEnvTemps)
+ .IncludeMany(b => b.MeterPTCPw2s)
+ .IncludeMany(b => b.MeterPTCWaterFlows)
+ .IncludeMany(b => b.MeterPTCWaterTemps)
//.IncludeMany(a => a.QuickClutchStepCells)
//.IncludeMany(a => a.QuickVoltageStepCells)
.ToList();
@@ -2114,6 +2285,9 @@ namespace CapMachine.Wpf.ViewModels
.IncludeMany(b => b.MeterPTCPws)
.IncludeMany(b => b.MeterEnvRHs)
.IncludeMany(b => b.MeterEnvTemps)
+ .IncludeMany(b => b.MeterPTCPw2s)
+ .IncludeMany(b => b.MeterPTCWaterFlows)
+ .IncludeMany(b => b.MeterPTCWaterTemps)
.ToList();
//【+++】
@@ -2162,6 +2336,10 @@ namespace CapMachine.Wpf.ViewModels
MeterPTCPwInfo = MeterPTCPwToString(proStep.MeterPTCPws!.ToList()),
MeterEnvRHInfo = MeterEnvRHToString(proStep.MeterEnvRHs!.ToList()),
MeterEnvTempInfo = MeterEnvTempToString(proStep.MeterEnvTemps!.ToList()),
+ MeterPTCPw2Info = MeterPTCPw2ToString(proStep.MeterPTCPw2s!.ToList()),
+ MeterPTCWaterFlowInfo = MeterPTCWaterFlowToString(proStep.MeterPTCWaterFlows!.ToList()),
+ MeterPTCWaterTempInfo = MeterPTCWaterTempToString(proStep.MeterPTCWaterTemps!.ToList()),
+
};
//【+++】
@@ -2754,10 +2932,10 @@ namespace CapMachine.Wpf.ViewModels
//AlarmNo = SelectedSlopMeterSpeed.AlarmNo,
//LimitNo = SelectedSlopMeterSpeed.LimitNo,
- PTCPw1 = SelectedSlopMeterSpeed.PTCPw1,
- PTCPw2 = SelectedSlopMeterSpeed.PTCPw2,
- PTCWaterFlow = SelectedSlopMeterSpeed.PTCWaterFlow,
- PTCWaterTemp = SelectedSlopMeterSpeed.PTCWaterTemp,
+ //PTCPw1 = SelectedSlopMeterSpeed.PTCPw1,
+ //PTCPw2 = SelectedSlopMeterSpeed.PTCPw2,
+ //PTCWaterFlow = SelectedSlopMeterSpeed.PTCWaterFlow,
+ //PTCWaterTemp = SelectedSlopMeterSpeed.PTCWaterTemp,
//StepNo = AutoGetMeterSpeedStepNo(),
};
@@ -2792,10 +2970,10 @@ namespace CapMachine.Wpf.ViewModels
.Set(a => a.CapEnable, SelectedSlopMeterSpeed.CapEnable)
.Set(a => a.Ev, SelectedSlopMeterSpeed.Ev)
.Set(a => a.PTCEnable, SelectedSlopMeterSpeed.PTCEnable)
- .Set(a => a.PTCPw1, SelectedSlopMeterSpeed.PTCPw1)
- .Set(a => a.PTCPw2, SelectedSlopMeterSpeed.PTCPw2)
- .Set(a => a.PTCWaterFlow, SelectedSlopMeterSpeed.PTCWaterFlow)
- .Set(a => a.PTCWaterTemp, SelectedSlopMeterSpeed.PTCWaterTemp)
+ //.Set(a => a.PTCPw1, SelectedSlopMeterSpeed.PTCPw1)
+ //.Set(a => a.PTCPw2, SelectedSlopMeterSpeed.PTCPw2)
+ //.Set(a => a.PTCWaterFlow, SelectedSlopMeterSpeed.PTCWaterFlow)
+ //.Set(a => a.PTCWaterTemp, SelectedSlopMeterSpeed.PTCWaterTemp)
.Set(a => a.InhExhValve, SelectedSlopMeterSpeed.InhExhValve)
.Where(a => a.Id == ConstantData!.Id)
.ExecuteAffrows();
@@ -2866,10 +3044,10 @@ namespace CapMachine.Wpf.ViewModels
//AlarmNo = SelectedData.AlarmNo,
//LimitNo = SelectedData.LimitNo,
//PIDNo = SelectedData.PIDNo,
- PTCPw1 = SelectedData.PTCPw1,
- PTCPw2 = SelectedData.PTCPw2,
- PTCWaterFlow = SelectedData.PTCWaterFlow,
- PTCWaterTemp = SelectedData.PTCWaterTemp,
+ //PTCPw1 = SelectedData.PTCPw1,
+ //PTCPw2 = SelectedData.PTCPw2,
+ //PTCWaterFlow = SelectedData.PTCWaterFlow,
+ //PTCWaterTemp = SelectedData.PTCWaterTemp,
ProStep = SelectedData.ProStep,
ProStepId = SelectedData.ProStepId,
StartValue = SelectedData.StartValue,
@@ -2958,10 +3136,10 @@ namespace CapMachine.Wpf.ViewModels
//AlarmNo = SelectedSlopMeterSpeed.AlarmNo,
//LimitNo = SelectedSlopMeterSpeed.LimitNo,
//PIDNo = SelectedSlopMeterSpeed.PIDNo,
- PTCPw1 = SelectedSlopMeterSpeed.PTCPw1,
- PTCPw2 = SelectedSlopMeterSpeed.PTCPw2,
- PTCWaterFlow = SelectedSlopMeterSpeed.PTCWaterFlow,
- PTCWaterTemp = SelectedSlopMeterSpeed.PTCWaterTemp,
+ //PTCPw1 = SelectedSlopMeterSpeed.PTCPw1,
+ //PTCPw2 = SelectedSlopMeterSpeed.PTCPw2,
+ //PTCWaterFlow = SelectedSlopMeterSpeed.PTCWaterFlow,
+ //PTCWaterTemp = SelectedSlopMeterSpeed.PTCWaterTemp,
ValueType = ConfigValueType.Slope,
StepNo = AutoGetMeterSpeedStepNo(),
};
@@ -3050,15 +3228,14 @@ namespace CapMachine.Wpf.ViewModels
.Set(a => a.CapEnable, SelectedSlopMeterSpeed.CapEnable)
.Set(a => a.Ev, SelectedSlopMeterSpeed.Ev)
.Set(a => a.PTCEnable, SelectedSlopMeterSpeed.PTCEnable)
- .Set(a => a.PTCPw1, SelectedSlopMeterSpeed.PTCPw1)
- .Set(a => a.PTCPw2, SelectedSlopMeterSpeed.PTCPw2)
- .Set(a => a.PTCWaterFlow, SelectedSlopMeterSpeed.PTCWaterFlow)
- .Set(a => a.PTCWaterTemp, SelectedSlopMeterSpeed.PTCWaterTemp)
+ //.Set(a => a.PTCPw1, SelectedSlopMeterSpeed.PTCPw1)
+ //.Set(a => a.PTCPw2, SelectedSlopMeterSpeed.PTCPw2)
+ //.Set(a => a.PTCWaterFlow, SelectedSlopMeterSpeed.PTCWaterFlow)
+ //.Set(a => a.PTCWaterTemp, SelectedSlopMeterSpeed.PTCWaterTemp)
.Set(a => a.InhExhValve, SelectedSlopMeterSpeed.InhExhValve)
.Where(a => a.Id == SelectedSlopMeterSpeed.Id)
.ExecuteAffrows();
-
//重新查询获取的数据包括子集
var GetUpdateData = RefreshSpeedById(SelectedSlopMeterSpeed.Id);
var CurIndex = ListSlopMeterSpeed.FindIndex(a => a.Id == SelectedSlopMeterSpeed.Id);
@@ -14670,698 +14847,2086 @@ namespace CapMachine.Wpf.ViewModels
- //#region PTCPw2表-北厂未启用此功能,南厂有此功能
-
-
-
- /////
- ///// PTCPw2 初始化函数
- /////
- //private void PTCPw2Init()
- //{
- // ListSlopMeterPTCPw2Items = new ObservableCollection();
- // SelectedSlopPTCPw2 = new MeterPTCPw2();
- // SelectedConstPTCPw2 = new MeterPTCPw2();
- //}
-
-
- //private ObservableCollection _ListSlopMeterPTCPw2Items;
- /////
- ///// Meter PTCPw2数据集合 斜率的
- /////
- //public ObservableCollection ListSlopMeterPTCPw2Items
- //{
- // get { return _ListSlopMeterPTCPw2Items; }
- // set { _ListSlopMeterPTCPw2Items = value; RaisePropertyChanged(); }
- //}
-
- /////
- ///// MeterPTCPw2集合数据 斜率
- /////
- //public List ListSlopMeterPTCPw2 { get; set; }
-
-
- //private MeterPTCPw2 _SelectedSlopPTCPw2;
- /////
- ///// 当前选中的程序 PTCPw2 斜率
- /////
- //public MeterPTCPw2 SelectedSlopPTCPw2
- //{
- // get { return _SelectedSlopPTCPw2; }
- // set { _SelectedSlopPTCPw2 = value; RaisePropertyChanged(); }
- //}
-
- //private MeterExInfoDto _MeterPTCPw2ExDto = new MeterExInfoDto();
- /////
- ///// 当前的拓展模型 PTCPw2
- ///// 用作统计,计算等
- /////
- //public MeterExInfoDto MeterPTCPw2ExDto
- //{
- // get { return _MeterPTCPw2ExDto; }
- // set { _MeterPTCPw2ExDto = value; RaisePropertyChanged(); }
- //}
-
-
-
- //private MeterPTCPw2 _SelectedConstPTCPw2;
- /////
- ///// 当前选中的程序 PTCPw2 常值
- /////
- //public MeterPTCPw2 SelectedConstPTCPw2
- //{
- // get { return _SelectedConstPTCPw2; }
- // set { _SelectedConstPTCPw2 = value; RaisePropertyChanged(); }
- //}
-
-
- //private double _SelectedConstPTCPw2Value;
- /////
- ///// 常值模式设置的数据
- /////
- //public double SelectedConstPTCPw2Value
- //{
- // get { return _SelectedConstPTCPw2Value; }
- // set { _SelectedConstPTCPw2Value = value; RaisePropertyChanged(); }
- //}
-
-
-
- //private DelegateCommand