增加PTC功能

This commit is contained in:
2025-08-06 14:28:03 +08:00
parent 035a16fe60
commit c4be5e0929
9 changed files with 450 additions and 147 deletions

View File

@@ -97,6 +97,8 @@ namespace CapMachine.Model
[Column(Name = "InhExhValve")]
public bool InhExhValve { get; set; }
/// <summary>
/// 加热器使能0/1PTC使能
/// 跟随速度步骤的常值数据
@@ -105,25 +107,54 @@ namespace CapMachine.Model
public bool PTCEnable { get; set; }
/// <summary>
/// PID No
/// 加热器 PTC功率1
/// 跟随速度步骤的常值数据
/// </summary>
[Column(Name = "PIDNo")]
public int PIDNo { get; set; }
[Column(Name = "PTCPw1")]
public double PTCPw1 { get; set; }
/// <summary>
/// 限幅 No
/// 加热器 PTC功率2
/// 跟随速度步骤的常值数据
/// </summary>
[Column(Name = "LimitNo")]
public int LimitNo { get; set; }
[Column(Name = "PTCPw2")]
public double PTCPw2 { get; set; }
/// <summary>
/// 报警 No
/// 加热器 PTC水流量
/// 跟随速度步骤的常值数据
/// </summary>
[Column(Name = "AlarmNo")]
public int AlarmNo { get; set; }
[Column(Name = "PTCWaterFlow")]
public double PTCWaterFlow { get; set; }
/// <summary>
/// 加热器 PTC水温
/// 跟随速度步骤的常值数据
/// </summary>
[Column(Name = "PTCWaterTemp")]
public double PTCWaterTemp { get; set; }
///// <summary>
///// PID No
///// 跟随速度步骤的常值数据
///// </summary>
//[Column(Name = "PIDNo")]
//public int PIDNo { get; set; }
///// <summary>
///// 限幅 No
///// 跟随速度步骤的常值数据
///// </summary>
//[Column(Name = "LimitNo")]
//public int LimitNo { get; set; }
///// <summary>
///// 报警 No
///// 跟随速度步骤的常值数据
///// </summary>
//[Column(Name = "AlarmNo")]
//public int AlarmNo { get; set; }
[Column(ServerTime = DateTimeKind.Local, CanUpdate = false)]
public DateTime CreateTime { get; set; }

View File

@@ -319,20 +319,20 @@ namespace CapMachine.Wpf.ProPars
//ParNoData.Value = Convert.ToDouble(item.ParNo);
//FindParNo.Steps.Add(ParNoData);
var FindPidNo = ListPlcParsData.Find(a => a.Name.Equals("PID编号"));
var PidNoData = plcMeterStepCell.DeepClone();
PidNoData.Value = Convert.ToDouble(item.PIDNo);
FindPidNo.Steps.Add(PidNoData);
//var FindPidNo = ListPlcParsData.Find(a => a.Name.Equals("PID编号"));
//var PidNoData = plcMeterStepCell.DeepClone();
//PidNoData.Value = Convert.ToDouble(item.PIDNo);
//FindPidNo.Steps.Add(PidNoData);
var FindLimitNo = ListPlcParsData.Find(a => a.Name.Equals("限幅编号"));
var LimitNoData = plcMeterStepCell.DeepClone();
LimitNoData.Value = Convert.ToDouble(item.LimitNo);
FindLimitNo.Steps.Add(LimitNoData);
//var FindLimitNo = ListPlcParsData.Find(a => a.Name.Equals("限幅编号"));
//var LimitNoData = plcMeterStepCell.DeepClone();
//LimitNoData.Value = Convert.ToDouble(item.LimitNo);
//FindLimitNo.Steps.Add(LimitNoData);
var FindAlarmNo = ListPlcParsData.Find(a => a.Name.Equals("报警编号"));
var AlarmNoData = plcMeterStepCell.DeepClone();
AlarmNoData.Value = Convert.ToDouble(item.AlarmNo);
FindAlarmNo.Steps.Add(AlarmNoData);
//var FindAlarmNo = ListPlcParsData.Find(a => a.Name.Equals("报警编号"));
//var AlarmNoData = plcMeterStepCell.DeepClone();
//AlarmNoData.Value = Convert.ToDouble(item.AlarmNo);
//FindAlarmNo.Steps.Add(AlarmNoData);
var FindEV = ListPlcParsData.Find(a => a.Name.Equals("EV"));
var EVData = plcMeterStepCell.DeepClone();
@@ -387,20 +387,20 @@ namespace CapMachine.Wpf.ProPars
//ParNoData.Value = Convert.ToDouble(Data.ParNo);
//FindParNo.Steps.Add(ParNoData);
var FindPidNo = ListPlcParsData.Find(a => a.Name.Equals("PID编号"));
var PidNoData = plcMeterStepCell.DeepClone();
PidNoData.Value = Convert.ToDouble(Data.PIDNo);
FindPidNo.Steps.Add(PidNoData);
//var FindPidNo = ListPlcParsData.Find(a => a.Name.Equals("PID编号"));
//var PidNoData = plcMeterStepCell.DeepClone();
//PidNoData.Value = Convert.ToDouble(Data.PIDNo);
//FindPidNo.Steps.Add(PidNoData);
var FindLimitNo = ListPlcParsData.Find(a => a.Name.Equals("限幅编号"));
var LimitNoData = plcMeterStepCell.DeepClone();
LimitNoData.Value = Convert.ToDouble(Data.LimitNo);
FindLimitNo.Steps.Add(LimitNoData);
//var FindLimitNo = ListPlcParsData.Find(a => a.Name.Equals("限幅编号"));
//var LimitNoData = plcMeterStepCell.DeepClone();
//LimitNoData.Value = Convert.ToDouble(Data.LimitNo);
//FindLimitNo.Steps.Add(LimitNoData);
var FindAlarmNo = ListPlcParsData.Find(a => a.Name.Equals("报警编号"));
var AlarmNoData = plcMeterStepCell.DeepClone();
AlarmNoData.Value = Convert.ToDouble(Data.AlarmNo);
FindAlarmNo.Steps.Add(AlarmNoData);
//var FindAlarmNo = ListPlcParsData.Find(a => a.Name.Equals("报警编号"));
//var AlarmNoData = plcMeterStepCell.DeepClone();
//AlarmNoData.Value = Convert.ToDouble(Data.AlarmNo);
//FindAlarmNo.Steps.Add(AlarmNoData);
var FindEV = ListPlcParsData.Find(a => a.Name.Equals("EV"));
var EVData = plcMeterStepCell.DeepClone();

View File

@@ -370,20 +370,20 @@ namespace CapMachine.Wpf.ProPars
//ParNoData.Value = Convert.ToDouble(item.ParNo);
//FindParNo.Steps.Add(ParNoData);
var FindPidNo = ListPlcParsData.Find(a => a.Name.Equals("PID编号"));
var PidNoData = plcMeterStepCell.DeepClone();
PidNoData.Value = Convert.ToDouble(item.PIDNo);
FindPidNo.Steps.Add(PidNoData);
//var FindPidNo = ListPlcParsData.Find(a => a.Name.Equals("PID编号"));
//var PidNoData = plcMeterStepCell.DeepClone();
//PidNoData.Value = Convert.ToDouble(item.PIDNo);
//FindPidNo.Steps.Add(PidNoData);
var FindLimitNo = ListPlcParsData.Find(a => a.Name.Equals("限幅编号"));
var LimitNoData = plcMeterStepCell.DeepClone();
LimitNoData.Value = Convert.ToDouble(item.LimitNo);
FindLimitNo.Steps.Add(LimitNoData);
//var FindLimitNo = ListPlcParsData.Find(a => a.Name.Equals("限幅编号"));
//var LimitNoData = plcMeterStepCell.DeepClone();
//LimitNoData.Value = Convert.ToDouble(item.LimitNo);
//FindLimitNo.Steps.Add(LimitNoData);
var FindAlarmNo = ListPlcParsData.Find(a => a.Name.Equals("报警编号"));
var AlarmNoData = plcMeterStepCell.DeepClone();
AlarmNoData.Value = Convert.ToDouble(item.AlarmNo);
FindAlarmNo.Steps.Add(AlarmNoData);
//var FindAlarmNo = ListPlcParsData.Find(a => a.Name.Equals("报警编号"));
//var AlarmNoData = plcMeterStepCell.DeepClone();
//AlarmNoData.Value = Convert.ToDouble(item.AlarmNo);
//FindAlarmNo.Steps.Add(AlarmNoData);
var FindEV = ListPlcParsData.Find(a => a.Name.Equals("EV"));
var EVData = plcMeterStepCell.DeepClone();
@@ -438,20 +438,20 @@ namespace CapMachine.Wpf.ProPars
//ParNoData.Value = Convert.ToDouble(Data.ParNo);
//FindParNo.Steps.Add(ParNoData);
var FindPidNo = ListPlcParsData.Find(a => a.Name.Equals("PID编号"));
var PidNoData = plcMeterStepCell.DeepClone();
PidNoData.Value = Convert.ToDouble(Data.PIDNo);
FindPidNo.Steps.Add(PidNoData);
//var FindPidNo = ListPlcParsData.Find(a => a.Name.Equals("PID编号"));
//var PidNoData = plcMeterStepCell.DeepClone();
//PidNoData.Value = Convert.ToDouble(Data.PIDNo);
//FindPidNo.Steps.Add(PidNoData);
var FindLimitNo = ListPlcParsData.Find(a => a.Name.Equals("限幅编号"));
var LimitNoData = plcMeterStepCell.DeepClone();
LimitNoData.Value = Convert.ToDouble(Data.LimitNo);
FindLimitNo.Steps.Add(LimitNoData);
//var FindLimitNo = ListPlcParsData.Find(a => a.Name.Equals("限幅编号"));
//var LimitNoData = plcMeterStepCell.DeepClone();
//LimitNoData.Value = Convert.ToDouble(Data.LimitNo);
//FindLimitNo.Steps.Add(LimitNoData);
var FindAlarmNo = ListPlcParsData.Find(a => a.Name.Equals("报警编号"));
var AlarmNoData = plcMeterStepCell.DeepClone();
AlarmNoData.Value = Convert.ToDouble(Data.AlarmNo);
FindAlarmNo.Steps.Add(AlarmNoData);
//var FindAlarmNo = ListPlcParsData.Find(a => a.Name.Equals("报警编号"));
//var AlarmNoData = plcMeterStepCell.DeepClone();
//AlarmNoData.Value = Convert.ToDouble(Data.AlarmNo);
//FindAlarmNo.Steps.Add(AlarmNoData);
var FindEV = ListPlcParsData.Find(a => a.Name.Equals("EV"));
var EVData = plcMeterStepCell.DeepClone();

View File

@@ -159,6 +159,26 @@ namespace CapMachine.Wpf.Services
/// </summary>
private CanCmdData EnableCanCmdData { get; set; }
/// <summary>
/// PTC使能 指令数据 实例
/// </summary>
private CanCmdData PTCEnableCanCmdData { get; set; }
/// <summary>
/// PTC功率 指令数据 实例
/// </summary>
private CanCmdData PTCPwCanCmdData { get; set; }
/// <summary>
/// PTC水流量 指令数据 实例
/// </summary>
private CanCmdData PTCFlowCanCmdData { get; set; }
/// <summary>
/// PTC水温 指令数据 实例
/// </summary>
private CanCmdData PTCWaterTempCanCmdData { get; set; }
/// <summary>
/// 要发送的CAN指令数据
/// 在程序配置好后就确定要发送哪些数据
@@ -186,6 +206,18 @@ namespace CapMachine.Wpf.Services
case "Anti_Sleep":
//SpeedCanCmdData = SendCanCmdData;
break;
case "PTC使能":
PTCEnableCanCmdData = SendCanCmdData;
break;
case "PTC功率":
PTCPwCanCmdData = SendCanCmdData;
break;
case "PTC水流量":
PTCFlowCanCmdData = SendCanCmdData;
break;
case "PTC水温":
PTCWaterTempCanCmdData = SendCanCmdData;
break;
default:
break;
}
@@ -240,6 +272,56 @@ namespace CapMachine.Wpf.Services
}
}
/// <summary>
/// 更新 PTC使能信号
/// </summary>
/// <param name="IsEnable"></param>
public void UpdateCapPTCEnableCmdData(bool IsEnable)
{
if (PTCEnableCanCmdData != null)
{
PTCEnableCanCmdData.SignalCmdValue = IsEnable ? 1 : 0;
}
}
/// <summary>
/// 更新 PTC功率 信号
/// </summary>
/// <param name="IsEnable"></param>
public void UpdateCapPTCPwCmdData(double PTCPw)
{
if (PTCPwCanCmdData != null)
{
PTCPwCanCmdData.SignalCmdValue = PTCPw;
}
}
/// <summary>
/// 更新 PTC水流量 信号
/// </summary>
/// <param name="IsEnable"></param>
public void UpdateCapPTCFlowCmdData(double Flow)
{
if (PTCFlowCanCmdData != null)
{
PTCFlowCanCmdData.SignalCmdValue = Flow;
}
}
/// <summary>
/// 更新 PTC水温 信号
/// </summary>
/// <param name="IsEnable"></param>
public void UpdateCapPTCWaterTempCmdData(double WaterTemp)
{
if (PTCWaterTempCanCmdData != null)
{
PTCWaterTempCanCmdData.SignalCmdValue = WaterTemp;
}
}
/// <summary>
/// 更新压缩机使能数据 手动时的赋值数据
/// </summary>

View File

@@ -2364,8 +2364,8 @@ namespace CapMachine.Wpf.Services
//return true;
//取消XXX
var Result = SiemensDrive.Write("M0.4", true);
var Result1 = SiemensDrive.Write("V99.0", true);
var Result = SiemensDrive.Write("M0.4", true);
var Result1 = SiemensDrive.Write("V99.0", true);
if (Result.IsSuccess)
{
return true;
@@ -3126,6 +3126,109 @@ namespace CapMachine.Wpf.Services
default:
break;
}
continue;
}
//压缩机PTC使能的参数直接给压缩机触发
if (itemStepExd.Name!.Contains("PTC使能"))
{
switch (ConfigService.CanLinRunStateModel.CurSysSelectedCanLin)
{
case CanLinEnum.Can:
CanDriveService.UpdateCapEnableCmdData((bool)itemStepExd.Value!);
break;
case CanLinEnum.CANFD:
CanFdDriveService.UpdateCapEnableCmdData((bool)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水流量的参数直接给压缩机触发
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;
//Console.WriteLine($"{ProRunChannelData.MeterName}拓展参数------------:{itemStepExd.Name}:{itemStepExd.Value}");
//continue;
}
@@ -3153,41 +3256,42 @@ namespace CapMachine.Wpf.Services
}
}
}
//if (ProRunChannelData.RunStepType == RunStepType.SlopCell)
//{
// //SiemensDrive.Write("D1", (short)ProRunChannelData.SV);
// //Console.WriteLine($"【时间】{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff")} " +
// // $"【参数名称】:{ProRunChannelData.MeterName} " +
// // $"【程序Seg】{ProRunChannelData.ProSegName} " +
// // $"【程序步骤】{ProRunChannelData.MeterStep} " +
// // $"【斜坡打点步骤】{ProRunChannelData.SlopStepNo} " +
// // $"【斜坡打点值SV】{ProRunChannelData.SV} " +
// // $"【Msg】接受到仿真写入PLC OK ");
//}
//else
//{
// //SiemensDrive.Write("D1", (short)ProRunChannelData.SV);
// //Console.WriteLine($"【时间】{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff")} " +
// // $"【参数名称】:{ProRunChannelData.MeterName} " +
// // $"【程序Seg】{ProRunChannelData.ProSegName} " +
// // $"【程序步骤】{ProRunChannelData.MeterStep} " +
// // $"【步骤SV】{ProRunChannelData.SV} " +
// // $"【Msg】接受到步骤仿真写入PLC OK ");
//}
//Thread.Sleep(50);
//DownLoadPID();
//stopwatch.Stop(); //停止Stopwatch
//Console.WriteLine("保存数据耗时::{0}", stopwatch.Elapsed.TotalSeconds.ToString());
//stopwatch.Reset();
}
//if (ProRunChannelData.RunStepType == RunStepType.SlopCell)
//{
// //SiemensDrive.Write("D1", (short)ProRunChannelData.SV);
// //Console.WriteLine($"【时间】{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff")} " +
// // $"【参数名称】:{ProRunChannelData.MeterName} " +
// // $"【程序Seg】{ProRunChannelData.ProSegName} " +
// // $"【程序步骤】{ProRunChannelData.MeterStep} " +
// // $"【斜坡打点步骤】{ProRunChannelData.SlopStepNo} " +
// // $"【斜坡打点值SV】{ProRunChannelData.SV} " +
// // $"【Msg】接受到仿真写入PLC OK ");
//}
//else
//{
// //SiemensDrive.Write("D1", (short)ProRunChannelData.SV);
// //Console.WriteLine($"【时间】{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff")} " +
// // $"【参数名称】:{ProRunChannelData.MeterName} " +
// // $"【程序Seg】{ProRunChannelData.ProSegName} " +
// // $"【程序步骤】{ProRunChannelData.MeterStep} " +
// // $"【步骤SV】{ProRunChannelData.SV} " +
// // $"【Msg】接受到步骤仿真写入PLC OK ");
//}
//Thread.Sleep(50);
//DownLoadPID();
//stopwatch.Stop(); //停止Stopwatch
//Console.WriteLine("保存数据耗时::{0}", stopwatch.Elapsed.TotalSeconds.ToString());
//stopwatch.Reset();
}
}
/// <summary>
/// 发送速度SV到压缩机
/// 自动步骤数据发送

View File

@@ -263,21 +263,21 @@ namespace CapMachine.Wpf.Services
//常值的话就一个数据,循环执行一次
foreach (var itemMeterValueCell in itemStep.MeterSpeeds)
{
var Pid = new ConfigPID();
if (FreeSql.Select<ConfigPID>().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.PIDNo).Any())
{
Pid = FreeSql.Select<ConfigPID>().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.PIDNo).First();
}
var Limit = new ConfigLimit();
if (FreeSql.Select<ConfigLimit>().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.LimitNo).Any())
{
Limit = FreeSql.Select<ConfigLimit>().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.LimitNo).First();
}
var Alarm = new ConfigAlarm();
if (FreeSql.Select<ConfigAlarm>().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.AlarmNo).Any())
{
Alarm = FreeSql.Select<ConfigAlarm>().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.AlarmNo).First();
}
//var Pid = new ConfigPID();
//if (FreeSql.Select<ConfigPID>().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.PIDNo).Any())
//{
// Pid = FreeSql.Select<ConfigPID>().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.PIDNo).First();
//}
//var Limit = new ConfigLimit();
//if (FreeSql.Select<ConfigLimit>().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.LimitNo).Any())
//{
// Limit = FreeSql.Select<ConfigLimit>().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.LimitNo).First();
//}
//var Alarm = new ConfigAlarm();
//if (FreeSql.Select<ConfigAlarm>().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.AlarmNo).Any())
//{
// Alarm = FreeSql.Select<ConfigAlarm>().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.AlarmNo).First();
//}
ListProExModel.FindFirst(a => a.MeterName == CurMeterName).ListProStepExe.Add(new ProStepExe()
{
@@ -298,13 +298,13 @@ namespace CapMachine.Wpf.Services
MeterStep = ListProExModel.FindFirst(a => a.MeterName == CurMeterName).ListProStepExe.Count + 1,
MeterName = CurMeterName,
LimitNo = itemMeterValueCell.LimitNo,
AlarmNo = itemMeterValueCell.AlarmNo,
PIDNo = itemMeterValueCell.PIDNo,
//LimitNo = itemMeterValueCell.LimitNo,
//AlarmNo = itemMeterValueCell.AlarmNo,
//PIDNo = itemMeterValueCell.PIDNo,
CurConfigPIDDto = Mapper.Map<ConfigPIDDto>(Pid),
CurConfigLimitDto = Mapper.Map<ConfigLimitDto>(Limit),
CurConfigAlarmDto = Mapper.Map<ConfigAlarmDto>(Alarm),
//CurConfigPIDDto = Mapper.Map<ConfigPIDDto>(Pid),
//CurConfigLimitDto = Mapper.Map<ConfigLimitDto>(Limit),
//CurConfigAlarmDto = Mapper.Map<ConfigAlarmDto>(Alarm),
ListStepExd = new List<StepExd>()
{
@@ -312,6 +312,12 @@ namespace CapMachine.Wpf.Services
new StepExd(){ Name="吸排气阀",Value=itemMeterValueCell.InhExhValve,ValueType=ExdValueType.Bool},
new StepExd(){ Name="EV",Value=(short)itemMeterValueCell.Ev,ValueType=ExdValueType.Short},
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},
},
ProStepInfo = $"{itemStep.StepNo}",
@@ -330,21 +336,21 @@ namespace CapMachine.Wpf.Services
//根据循环次数执行
foreach (var itemMeterValueCell in itemStep.MeterSpeeds)
{
var Pid = new ConfigPID();
if (FreeSql.Select<ConfigPID>().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.PIDNo).Any())
{
Pid = FreeSql.Select<ConfigPID>().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.PIDNo).First();
}
var Limit = new ConfigLimit();
if (FreeSql.Select<ConfigLimit>().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.LimitNo).Any())
{
Limit = FreeSql.Select<ConfigLimit>().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.LimitNo).First();
}
var Alarm = new ConfigAlarm();
if (FreeSql.Select<ConfigAlarm>().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.AlarmNo).Any())
{
Alarm = FreeSql.Select<ConfigAlarm>().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.AlarmNo).First();
}
//var Pid = new ConfigPID();
//if (FreeSql.Select<ConfigPID>().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.PIDNo).Any())
//{
// Pid = FreeSql.Select<ConfigPID>().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.PIDNo).First();
//}
//var Limit = new ConfigLimit();
//if (FreeSql.Select<ConfigLimit>().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.LimitNo).Any())
//{
// Limit = FreeSql.Select<ConfigLimit>().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.LimitNo).First();
//}
//var Alarm = new ConfigAlarm();
//if (FreeSql.Select<ConfigAlarm>().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.AlarmNo).Any())
//{
// Alarm = FreeSql.Select<ConfigAlarm>().Where(a => a.MeterName == CurMeterName && a.IndexNo == itemMeterValueCell.AlarmNo).First();
//}
ListProExModel.FindFirst(a => a.MeterName == CurMeterName).ListProStepExe.Add(new ProStepExe()
{
@@ -365,13 +371,13 @@ namespace CapMachine.Wpf.Services
MeterStep = ListProExModel.FindFirst(a => a.MeterName == CurMeterName).ListProStepExe.Count + 1,
LimitNo = itemMeterValueCell.LimitNo,
AlarmNo = itemMeterValueCell.AlarmNo,
PIDNo = itemMeterValueCell.PIDNo,
//LimitNo = itemMeterValueCell.LimitNo,
//AlarmNo = itemMeterValueCell.AlarmNo,
//PIDNo = itemMeterValueCell.PIDNo,
CurConfigPIDDto = Mapper.Map<ConfigPIDDto>(Pid),
CurConfigLimitDto = Mapper.Map<ConfigLimitDto>(Limit),
CurConfigAlarmDto = Mapper.Map<ConfigAlarmDto>(Alarm),
//CurConfigPIDDto = Mapper.Map<ConfigPIDDto>(Pid),
//CurConfigLimitDto = Mapper.Map<ConfigLimitDto>(Limit),
//CurConfigAlarmDto = Mapper.Map<ConfigAlarmDto>(Alarm),
ListStepExd = new List<StepExd>()
{
@@ -379,6 +385,12 @@ namespace CapMachine.Wpf.Services
new StepExd(){ Name="吸排气阀",Value=itemMeterValueCell.InhExhValve,ValueType=ExdValueType.Bool},
new StepExd(){ Name="EV",Value=(short)itemMeterValueCell.Ev,ValueType=ExdValueType.Short},
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},
},
ProStepInfo = $"{itemStep.StepNo}-{itemMeterValueCell.StepNo}",

View File

@@ -66,6 +66,11 @@ namespace CapMachine.Wpf.ViewModels
new CbxItems(){ Key="功率限制",Text="功率限制"},
new CbxItems(){ Key="使能",Text="使能"},
new CbxItems(){ Key="Anti_Sleep",Text="Anti_Sleep"},
new CbxItems(){ Key="PTC使能",Text="PTC使能"},
new CbxItems(){ Key="PTC功率",Text="PTC功率"},
new CbxItems(){ Key="PTC水流量",Text="PTC水流量"},
new CbxItems(){ Key="PTC水温",Text="PTC水温"},
};
@@ -77,6 +82,13 @@ namespace CapMachine.Wpf.ViewModels
new CbxItems(){ Key="通讯相电流",Text="通讯相电流"},
new CbxItems(){ Key="通讯功率",Text="通讯功率"},
new CbxItems(){ Key="通讯芯片温度",Text="通讯芯片温度"},
new CbxItems(){ Key="通讯PTC入水温度",Text="通讯PTC入水温度"},
new CbxItems(){ Key="通讯PTC出水温度",Text="通讯PTC出水温度"},
new CbxItems(){ Key="通讯PTC峰值电流",Text="通讯PTC峰值电流"},
new CbxItems(){ Key="通讯PTC母线电流",Text="通讯PTC母线电流"},
new CbxItems(){ Key="通讯PTC膜温",Text="通讯PTC膜温"},
new CbxItems(){ Key="通讯PTC模块温度",Text="通讯PTC模块温度"},
};
InitLoadCanConfigPro();

View File

@@ -2750,9 +2750,14 @@ namespace CapMachine.Wpf.ViewModels
CapEnable = SelectedSlopMeterSpeed.CapEnable,
OutLock = SelectedSlopMeterSpeed.OutLock,
//ParNo = SelectedSlopMeterSpeed.ParNo,
PIDNo = SelectedSlopMeterSpeed.PIDNo,
AlarmNo = SelectedSlopMeterSpeed.AlarmNo,
LimitNo = SelectedSlopMeterSpeed.LimitNo,
//PIDNo = SelectedSlopMeterSpeed.PIDNo,
//AlarmNo = SelectedSlopMeterSpeed.AlarmNo,
//LimitNo = SelectedSlopMeterSpeed.LimitNo,
PTCPw1 = SelectedSlopMeterSpeed.PTCPw1,
PTCPw2 = SelectedSlopMeterSpeed.PTCPw2,
PTCWaterFlow = SelectedSlopMeterSpeed.PTCWaterFlow,
PTCWaterTemp = SelectedSlopMeterSpeed.PTCWaterTemp,
//StepNo = AutoGetMeterSpeedStepNo(),
};
@@ -2780,13 +2785,17 @@ namespace CapMachine.Wpf.ViewModels
.Set(a => a.Constant, SelectedConstSpeedValue)
.Set(a => a.KeepTime, SelectedConstSpeedTimeValue)
//.Set(a => a.ParNo, SelectedSlopMeterSpeed.ParNo)
.Set(a => a.PIDNo, SelectedSlopMeterSpeed.PIDNo)
.Set(a => a.LimitNo, SelectedSlopMeterSpeed.LimitNo)
.Set(a => a.AlarmNo, SelectedSlopMeterSpeed.AlarmNo)
//.Set(a => a.PIDNo, SelectedSlopMeterSpeed.PIDNo)
//.Set(a => a.LimitNo, SelectedSlopMeterSpeed.LimitNo)
//.Set(a => a.AlarmNo, SelectedSlopMeterSpeed.AlarmNo)
.Set(a => a.OutLock, SelectedSlopMeterSpeed.OutLock)
.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.InhExhValve, SelectedSlopMeterSpeed.InhExhValve)
.Where(a => a.Id == ConstantData!.Id)
.ExecuteAffrows();
@@ -2854,9 +2863,13 @@ namespace CapMachine.Wpf.ViewModels
InhExhValve = SelectedData.InhExhValve,
OutLock = SelectedData.OutLock,
//ParNo = SelectedData.ParNo,
AlarmNo = SelectedData.AlarmNo,
LimitNo = SelectedData.LimitNo,
PIDNo = SelectedData.PIDNo,
//AlarmNo = SelectedData.AlarmNo,
//LimitNo = SelectedData.LimitNo,
//PIDNo = SelectedData.PIDNo,
PTCPw1 = SelectedData.PTCPw1,
PTCPw2 = SelectedData.PTCPw2,
PTCWaterFlow = SelectedData.PTCWaterFlow,
PTCWaterTemp = SelectedData.PTCWaterTemp,
ProStep = SelectedData.ProStep,
ProStepId = SelectedData.ProStepId,
StartValue = SelectedData.StartValue,
@@ -2942,9 +2955,13 @@ namespace CapMachine.Wpf.ViewModels
CapEnable = SelectedSlopMeterSpeed.CapEnable,
OutLock = SelectedSlopMeterSpeed.OutLock,
//ParNo = SelectedSlopMeterSpeed.ParNo,
AlarmNo = SelectedSlopMeterSpeed.AlarmNo,
LimitNo = SelectedSlopMeterSpeed.LimitNo,
PIDNo = SelectedSlopMeterSpeed.PIDNo,
//AlarmNo = SelectedSlopMeterSpeed.AlarmNo,
//LimitNo = SelectedSlopMeterSpeed.LimitNo,
//PIDNo = SelectedSlopMeterSpeed.PIDNo,
PTCPw1 = SelectedSlopMeterSpeed.PTCPw1,
PTCPw2 = SelectedSlopMeterSpeed.PTCPw2,
PTCWaterFlow = SelectedSlopMeterSpeed.PTCWaterFlow,
PTCWaterTemp = SelectedSlopMeterSpeed.PTCWaterTemp,
ValueType = ConfigValueType.Slope,
StepNo = AutoGetMeterSpeedStepNo(),
};
@@ -3025,13 +3042,18 @@ namespace CapMachine.Wpf.ViewModels
.Set(a => a.StepNo, SelectedSlopMeterSpeed.StepNo)
//.Set(a => a.ParNo, SelectedSlopMeterSpeed.ParNo)
.Set(a => a.PIDNo, SelectedSlopMeterSpeed.PIDNo)
.Set(a => a.LimitNo, SelectedSlopMeterSpeed.LimitNo)
.Set(a => a.AlarmNo, SelectedSlopMeterSpeed.AlarmNo)
//.Set(a => a.PIDNo, SelectedSlopMeterSpeed.PIDNo)
//.Set(a => a.LimitNo, SelectedSlopMeterSpeed.LimitNo)
//.Set(a => a.AlarmNo, SelectedSlopMeterSpeed.AlarmNo)
.Set(a => a.OutLock, SelectedSlopMeterSpeed.OutLock)
.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.InhExhValve, SelectedSlopMeterSpeed.InhExhValve)
.Where(a => a.Id == SelectedSlopMeterSpeed.Id)
.ExecuteAffrows();

View File

@@ -1407,6 +1407,7 @@
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
@@ -1453,7 +1454,46 @@
Style="{StaticResource MaterialDesignSwitchToggleButton}"
ToolTip="压缩机使能" />
</StackPanel>
<StackPanel
Grid.Row="1"
Grid.Column="0"
HorizontalAlignment="Center">
<TextBlock FontSize="12" Text="PTC使能(0/1)" />
<ToggleButton
Height="20"
Margin="5,2"
IsChecked="{Binding SelectedSlopMeterSpeed.PTCEnable}"
Style="{StaticResource MaterialDesignSwitchToggleButton}"
ToolTip="PTC使能" />
</StackPanel>
<StackPanel
Grid.Row="1"
Grid.Column="1"
HorizontalAlignment="Center">
<TextBlock FontSize="12" Text="PTC功率1(W)" />
<TextBox Style="{StaticResource txtboxStyle}" Text="{Binding SelectedSlopMeterSpeed.PTCPw1}" />
</StackPanel>
<StackPanel
Grid.Row="1"
Grid.Column="2"
HorizontalAlignment="Center">
<TextBlock FontSize="12" Text="PTC功率2(W)" />
<TextBox Style="{StaticResource txtboxStyle}" Text="{Binding SelectedSlopMeterSpeed.PTCPw2}" />
</StackPanel>
<StackPanel
Grid.Row="1"
Grid.Column="3"
HorizontalAlignment="Center">
<TextBlock FontSize="12" Text="PTC水流量" />
<TextBox Style="{StaticResource txtboxStyle}" Text="{Binding SelectedSlopMeterSpeed.PTCWaterFlow}" />
</StackPanel>
<StackPanel
Grid.Row="1"
Grid.Column="4"
HorizontalAlignment="Center">
<TextBlock FontSize="12" Text="PTC水温(℃)" />
<TextBox Style="{StaticResource txtboxStyle}" Text="{Binding SelectedSlopMeterSpeed.PTCWaterTemp}" />
</StackPanel>
<!--<StackPanel
Grid.Row="1"
Grid.Column="0"