添加手动维护功能

main
xiaoguo 7 months ago
parent 714f4a06b9
commit 38bb0d61aa

@ -237,8 +237,11 @@ namespace CVDEMCS.Devices.Impl
{
var state = EquipmentState.Stop;
//如果运行状态比警告状态高这里先判断运行状态如果运行状态为false在判断警告状态
//故障>运行>停止
if (maintain.GetValue<bool>())
//维护>运行>停止
if (maintain.GetValue<bool>()
||
//如果为手动模式且为维护状态,则当前状态为维护状态
(startStop.Model == EquipmentAlarmModel.Manual && startStop.IsMaintain))
{
state = EquipmentState.Maintain;
}
@ -250,14 +253,6 @@ namespace CVDEMCS.Devices.Impl
{
state = EquipmentState.Alarm;
}
//如果为报警状态,则判断是否设为手动,且为不报警,则屏蔽报警信号,不做记录
//if (state == EquipmentState.Alarm &&
// startStop.Model == EquipmentAlarmModel.Manual &&
// !startStop.IsAlarm)
//{
// continue;
//}
//equipmentRecordService.AddUpdateEquipmentRecord(id, state, DateTime.Now);
models.Add(new EquipmentRecordUpdateModel
{

@ -91,7 +91,10 @@ namespace CVDEMCS.Services.Impl
var state = EquipmentState.Stop;
//如果运行状态比警告状态高这里先判断运行状态如果运行状态为false在判断警告状态
//维护>运行>停止
if (maintain.GetValue<bool>())
if (maintain.GetValue<bool>()
||
//如果为手动模式且为维护状态,则当前状态为维护状态
(startStop.Model == EquipmentAlarmModel.Manual && startStop.IsMaintain))
{
state = EquipmentState.Maintain;
}

@ -50,7 +50,7 @@ public partial class DevicePoint
public string EquipmentType { get; set; }
/// <summary>
/// 点位所属动作,启动停止:start_stop故障fault
/// 点位所属动作,启动停止:StartStop报警Alarm; 维护: Maintain
/// </summary>
public string ActionType { get; set; }
@ -86,9 +86,9 @@ public partial class DevicePoint
public String Model { get; set; }
/// <summary>
/// 是否报警true 报警false 不报警(为Auto)
/// 是否维护true 维护false 不维护model为Auto)
/// </summary>
public bool IsAlarm { get; set; }
public bool IsMaintain { get; set; }
/// <summary>
/// 备注

@ -49,9 +49,9 @@ public partial class EquipmentInfo
public String Model { get; set; }
/// <summary>
/// 是否报警true 报警false 不报警model为Auto)
/// 是否维护true 维护false 不维护model为Auto)
/// </summary>
public bool IsAlarm { get; set; }
public bool IsMaintain { get; set; }
/// <summary>
/// 备注

@ -65,7 +65,7 @@ public partial class DevicePointEntity : CUDBaseEntity
public string DataType { get; set; }
/// <summary>
/// 点位所属动作,启动停止:start_stop故障fault
/// 点位所属动作,启动停止:StartStop报警Alarm; 维护: Maintain
/// </summary>
[Required]
[Column("action_type")]

@ -115,7 +115,7 @@ public partial class EFContext : DbContext
entity.Property(e => e.EquipmentName).HasComment("设备名称");
entity.Property(e => e.EquipmentType).HasComment("设备类型IonbondBalzersCemecon");
entity.Property(e => e.Model).HasComment("模式Auto 自动Manual手动");
entity.Property(e => e.IsAlarm).HasComment("是否报警1 报警0 不报警model为Auto");
entity.Property(e => e.IsMaintain).HasComment("是否报警1 报警0 不报警model为Auto");
entity.Property(e => e.OrdrNo).HasComment("排序号");
entity.Property(e => e.IsDelete)
.HasDefaultValueSql("b'0'")

@ -51,10 +51,10 @@ public partial class EquipmentInfoEntity : CUDBaseEntity
public String Model { get; set; }
/// <summary>
/// 是否报警true 报警false 不报警model为Auto)
/// 是否维护true 维护false 不维护model为Auto)
/// </summary>
[Column("isAlarm", TypeName = "bit(1)")]
public bool IsAlarm { get; set; }
[Column("isMaintain", TypeName = "bit(1)")]
public bool IsMaintain { get; set; }
/// <summary>
/// 排序号

@ -281,14 +281,14 @@ namespace CVDEMCS.Services.Repositories.Impl
EquipmentName = equipment.EquipmentName,
EquipmentType = equipment.EquipmentType,
Model = equipment.Model,
IsAlarm = equipment.IsAlarm,
IsMaintain = equipment.IsMaintain,
Activated = point.Activated,
PointCode = point.PointCode,
PointName = point.PointName,
Address = point.Address,
DataType = point.DataType,
ActionType = point.ActionType,
Remark = point.Remark,
};
if (!deviceId.IsNullOrEmpty())

@ -91,7 +91,7 @@ namespace CVDEMCS.Services.Repositories
Activated = f.Activated,
OrdrNo = f.OrdrNo,
Model = f.Model,
IsAlarm = f.IsAlarm,
IsMaintain = f.IsMaintain,
Remark = f.Remark
});
@ -182,7 +182,7 @@ namespace CVDEMCS.Services.Repositories
update.OrdrNo = entity.OrdrNo;
update.Remark = entity.Remark;
update.Model = entity.Model;
update.IsAlarm = entity.IsAlarm;
update.IsMaintain = entity.IsMaintain;
update.Update();
context.SaveChanges();

Loading…
Cancel
Save