时序配置校验
This commit is contained in:
parent
96d9f2e261
commit
e9fad702d5
@ -15,6 +15,13 @@ namespace InSituLaboratory.IService
|
||||
/// <returns></returns>
|
||||
IEnumerable<SysDevice> GetDevices();
|
||||
|
||||
/// <summary>
|
||||
/// 根据设备名称获取设备ID
|
||||
/// </summary>
|
||||
/// <param name="DeviceName"></param>
|
||||
/// <returns></returns>
|
||||
string GetDeviceByDeviceName(string DeviceName);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,5 +33,17 @@ namespace InSituLaboratory.IService
|
||||
/// <returns></returns>
|
||||
|
||||
IEnumerable<SysSequentialDetails> GetSequentialDetailList(int key);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据序组、时序号查询循环时间
|
||||
/// </summary>
|
||||
/// <param name="SequenceGroup"></param>
|
||||
/// <param name="Sequential"></param>
|
||||
/// <param name="kind"></param>
|
||||
/// <returns></returns>
|
||||
SysSequentialDetails GetSequentialSequenceGroup(string SequenceGroup,string Sequential);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,5 +43,27 @@ namespace InSituLaboratory.Service
|
||||
{
|
||||
return this.Set<SysSequentialDetails>().Where(m => m.Number == key && m.IsDelete == 0);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据序组、时序号查询循环时间
|
||||
/// </summary>
|
||||
/// <param name="SequenceGroup"></param>
|
||||
/// <param name="Sequential"></param>
|
||||
/// <param name="kind"></param>
|
||||
/// <returns></returns>
|
||||
public SysSequentialDetails GetSequentialSequenceGroup(string SequenceGroup, string Sequential)
|
||||
{
|
||||
var list = this.Query<SysSequentialDetails>(m => m.SequenceGroup == SequenceGroup && m.Sequential == Sequential && m.IsDelete == 0).ToList();
|
||||
if (list.Count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
return list.FirstOrDefault();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,6 +25,9 @@ namespace InSituLaboratory.ViewModels.Pages.Dialogs
|
||||
/// </summary>
|
||||
public List<SysDevice> DeviceNodes { get; set; } = new List<SysDevice>();
|
||||
|
||||
public SysSequentialDetails SysSequentialdata { get; set; }
|
||||
|
||||
|
||||
public string? workTime { get; set; }
|
||||
|
||||
public long? workInt { get; set; }
|
||||
@ -43,7 +46,26 @@ namespace InSituLaboratory.ViewModels.Pages.Dialogs
|
||||
/// <summary>
|
||||
/// 配置
|
||||
/// </summary>
|
||||
public string SequenceGroup { get; set; }
|
||||
private string _sequenceGroup;
|
||||
|
||||
public string SequenceGroup
|
||||
{
|
||||
get { return _sequenceGroup; }
|
||||
set
|
||||
{
|
||||
_sequenceGroup = value;
|
||||
SysSequentialdata = _sequentialService.GetSequentialSequenceGroup(SequenceGroup, kind);
|
||||
if (SysSequentialdata != null)
|
||||
{
|
||||
ErrorList.Add("DurationTime", new List<string> { "当前配置存在循环时长:" + SysSequentialdata.DurationTime +"s"});
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorList.Remove("DurationTime");
|
||||
}
|
||||
this.RaiseErrorsChanged("DurationTime");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 序号
|
||||
@ -57,7 +79,7 @@ namespace InSituLaboratory.ViewModels.Pages.Dialogs
|
||||
|
||||
public string SensorID
|
||||
{
|
||||
get { return _sensorID;}
|
||||
get { return _sensorID; }
|
||||
set
|
||||
{
|
||||
_sensorID = value;
|
||||
@ -71,12 +93,10 @@ namespace InSituLaboratory.ViewModels.Pages.Dialogs
|
||||
if (Convert.ToInt64(WorkTime) > workInt)
|
||||
{
|
||||
ErrorList.Add("WorkTime", new List<string> { "质谱仪已超出最大工作时长" });
|
||||
this.RaiseErrorsChanged("WorkTime");
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorList.Remove("WorkTime");
|
||||
this.RaiseErrorsChanged("WorkTime");
|
||||
}
|
||||
}
|
||||
else if (_sensorID == "二氧化碳同位素分析仪")
|
||||
@ -85,12 +105,10 @@ namespace InSituLaboratory.ViewModels.Pages.Dialogs
|
||||
if (Convert.ToInt64(WorkTime) > workInt)
|
||||
{
|
||||
ErrorList.Add("WorkTime", new List<string> { "二氧化碳同位素分析仪已超出最大工作时长" });
|
||||
this.RaiseErrorsChanged("WorkTime");
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorList.Remove("WorkTime");
|
||||
this.RaiseErrorsChanged("WorkTime");
|
||||
}
|
||||
}
|
||||
else if (_sensorID == "甲烷同位素分析仪")
|
||||
@ -99,7 +117,10 @@ namespace InSituLaboratory.ViewModels.Pages.Dialogs
|
||||
if (Convert.ToInt64(WorkTime) > workInt)
|
||||
{
|
||||
ErrorList.Add("WorkTime", new List<string> { "甲烷同位素分析仪已超出最大工作时长" });
|
||||
this.RaiseErrorsChanged("WorkTime");
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorList.Remove("WorkTime");
|
||||
}
|
||||
}
|
||||
else if (_sensorID == "气相色谱仪")
|
||||
@ -108,7 +129,10 @@ namespace InSituLaboratory.ViewModels.Pages.Dialogs
|
||||
if (Convert.ToInt64(WorkTime) > workInt)
|
||||
{
|
||||
ErrorList.Add("WorkTime", new List<string> { "气相色谱仪已超出最大工作时长" });
|
||||
this.RaiseErrorsChanged("WorkTime");
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorList.Remove("WorkTime");
|
||||
}
|
||||
}
|
||||
else if (_sensorID == "基因测序仪")
|
||||
@ -117,23 +141,50 @@ namespace InSituLaboratory.ViewModels.Pages.Dialogs
|
||||
if (Convert.ToInt64(WorkTime) > workInt)
|
||||
{
|
||||
ErrorList.Add("WorkTime", new List<string> { "基因测序仪已超出最大工作时长" });
|
||||
this.RaiseErrorsChanged("WorkTime");
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorList.Remove("WorkTime");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorList.Remove("WorkTime");
|
||||
}
|
||||
this.RaiseErrorsChanged("WorkTime");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 循环时长
|
||||
/// </summary>
|
||||
public string DurationTime { get; set; }
|
||||
private string _durationTime;
|
||||
|
||||
public string DurationTime
|
||||
{
|
||||
get { return _durationTime; }
|
||||
set
|
||||
{
|
||||
_durationTime = value;
|
||||
ErrorList.Remove("DurationTime");
|
||||
if (SequenceGroup != null)
|
||||
{
|
||||
if (SysSequentialdata != null)
|
||||
{
|
||||
if (_durationTime != SysSequentialdata.DurationTime)
|
||||
{
|
||||
ErrorList.Add("DurationTime", new List<string> { "当前配置已存在循环时长:" + SysSequentialdata.DurationTime +"s"+",无法修改" });
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorList.Remove("DurationTime");
|
||||
}
|
||||
this.RaiseErrorsChanged("DurationTime");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 时序类别
|
||||
@ -155,7 +206,6 @@ namespace InSituLaboratory.ViewModels.Pages.Dialogs
|
||||
if (string.IsNullOrEmpty(value))
|
||||
{
|
||||
ErrorList.Add("WorkTime", new List<string> { "工作时长不能为空" });
|
||||
this.RaiseErrorsChanged();
|
||||
}
|
||||
else if (_sensorID == "质谱仪")
|
||||
{
|
||||
@ -163,7 +213,10 @@ namespace InSituLaboratory.ViewModels.Pages.Dialogs
|
||||
if (Convert.ToInt64(value) > workInt)
|
||||
{
|
||||
ErrorList.Add("WorkTime", new List<string> { "质谱仪已超出最大工作时长" });
|
||||
this.RaiseErrorsChanged("WorkTime");
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorList.Remove("WorkTime");
|
||||
}
|
||||
}
|
||||
else if (_sensorID == "二氧化碳同位素分析仪")
|
||||
@ -172,7 +225,10 @@ namespace InSituLaboratory.ViewModels.Pages.Dialogs
|
||||
if (Convert.ToInt64(value) > workInt)
|
||||
{
|
||||
ErrorList.Add("WorkTime", new List<string> { "二氧化碳同位素分析仪已超出最大工作时长" });
|
||||
this.RaiseErrorsChanged("WorkTime");
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorList.Remove("WorkTime");
|
||||
}
|
||||
}
|
||||
else if (_sensorID == "甲烷同位素分析仪")
|
||||
@ -181,7 +237,10 @@ namespace InSituLaboratory.ViewModels.Pages.Dialogs
|
||||
if (Convert.ToInt64(value) > workInt)
|
||||
{
|
||||
ErrorList.Add("WorkTime", new List<string> { "甲烷同位素分析仪已超出最大工作时长" });
|
||||
this.RaiseErrorsChanged("WorkTime");
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorList.Remove("WorkTime");
|
||||
}
|
||||
}
|
||||
else if (_sensorID == "气相色谱仪")
|
||||
@ -190,7 +249,10 @@ namespace InSituLaboratory.ViewModels.Pages.Dialogs
|
||||
if (Convert.ToInt64(value) > workInt)
|
||||
{
|
||||
ErrorList.Add("WorkTime", new List<string> { "气相色谱仪已超出最大工作时长" });
|
||||
this.RaiseErrorsChanged("WorkTime");
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorList.Remove("WorkTime");
|
||||
}
|
||||
}
|
||||
else if (_sensorID == "基因测序仪")
|
||||
@ -199,14 +261,18 @@ namespace InSituLaboratory.ViewModels.Pages.Dialogs
|
||||
if (Convert.ToInt64(value) > workInt)
|
||||
{
|
||||
ErrorList.Add("WorkTime", new List<string> { "基因测序仪已超出最大工作时长" });
|
||||
this.RaiseErrorsChanged("WorkTime");
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorList.Remove("WorkTime");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorList.Remove("WorkTime");
|
||||
this.RaiseErrorsChanged("WorkTime");
|
||||
}
|
||||
this.RaiseErrorsChanged("WorkTime");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -240,6 +306,8 @@ namespace InSituLaboratory.ViewModels.Pages.Dialogs
|
||||
var su = _sequentialService.Find<SysSequentialDetails>(SequentialDetail.Number);
|
||||
Number = su.Number;
|
||||
SensorID = su.SensorID;
|
||||
WorkTime = su.WorkTime;
|
||||
SequenceGroup = su.SequenceGroup;
|
||||
DurationTime = su.DurationTime;
|
||||
}
|
||||
|
||||
@ -250,6 +318,15 @@ namespace InSituLaboratory.ViewModels.Pages.Dialogs
|
||||
{
|
||||
try
|
||||
{
|
||||
if (SysSequentialdata != null)
|
||||
{
|
||||
if (SysSequentialdata.DurationTime == DurationTime)
|
||||
{
|
||||
ErrorList.Remove("DurationTime");
|
||||
this.RaiseErrorsChanged("DurationTime");
|
||||
}
|
||||
}
|
||||
|
||||
if (this.HasErrors) return;
|
||||
|
||||
var data = _sequentialService.GetSequentials(kind).ToList();
|
||||
@ -270,6 +347,8 @@ namespace InSituLaboratory.ViewModels.Pages.Dialogs
|
||||
SysSquentialID = Squential.Number,
|
||||
SensorID = SensorID,
|
||||
DurationTime = DurationTime,
|
||||
WorkTime = WorkTime,
|
||||
SequenceGroup = SequenceGroup,
|
||||
CreateTime = DateTime.Now,
|
||||
Sequential = kind,
|
||||
IsDelete = 0
|
||||
@ -302,6 +381,8 @@ namespace InSituLaboratory.ViewModels.Pages.Dialogs
|
||||
var ssd = _sequentialService.Find<SysSequentialDetails>(Number);
|
||||
ssd.SensorID = SensorID;
|
||||
ssd.DurationTime = DurationTime;
|
||||
ssd.WorkTime = WorkTime;
|
||||
ssd.SequenceGroup = SequenceGroup;
|
||||
_sequentialService.Update(ssd);
|
||||
}
|
||||
}
|
||||
@ -322,6 +403,8 @@ namespace InSituLaboratory.ViewModels.Pages.Dialogs
|
||||
SysSquentialID = Squential.Number,
|
||||
SensorID = SensorID,
|
||||
DurationTime = DurationTime,
|
||||
WorkTime = WorkTime,
|
||||
SequenceGroup = SequenceGroup,
|
||||
CreateTime = DateTime.Now,
|
||||
Sequential = kind,
|
||||
IsDelete = 0
|
||||
|
||||
@ -154,6 +154,8 @@
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding num}" FontWeight="Normal" Grid.Column="0" FontSize="12" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding SequenceGroup}" FontSize="12" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user