进站测试
This commit is contained in:
parent
b403a5f450
commit
1657e8e453
@ -62,6 +62,13 @@ namespace MDM.Model.Process
|
||||
[SugarColumn(ColumnName = "standard_time")]
|
||||
public int? StandardTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最大重复过站次数
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "max_station_count")]
|
||||
public int? MaxStationCount { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 控制策略(枚举[1,2,3,4])
|
||||
/// </summary>
|
||||
|
||||
@ -171,6 +171,31 @@ namespace RIZO.Service.PLCBackground.Stations
|
||||
}
|
||||
//6时间超出规定无法生产
|
||||
|
||||
|
||||
//7固化时间未到规定时间
|
||||
|
||||
int LastOperationStandardTime = processOperations.Where(operation => operation.OperationCode == LastOperation.OperationCode)
|
||||
.Select(operation => operation.StandardTime??0).First();
|
||||
|
||||
|
||||
|
||||
if (LastOperationStandardTime > 0)
|
||||
{
|
||||
// 上一站的入站时间 和本站的请求时间差值
|
||||
DateTime LastInStationTime= await Context.Queryable<ProductPassStationRecord>()
|
||||
.Where(it => it.ProductSN == productSN)
|
||||
.Where(it => it.OperationCode == LastOperation.OperationCode)
|
||||
.Where(it => it.PasstationType == 1)
|
||||
.MaxAsync(it => it.InStationTime??DateTime.MinValue);
|
||||
TimeSpan timeDiff = DateTime.Now - LastInStationTime;
|
||||
double totalSeconds = timeDiff.TotalSeconds;
|
||||
if(totalSeconds < LastOperationStandardTime)
|
||||
{
|
||||
result = EntryPermissionResult.CuringTimeNotReached;
|
||||
goto InsertPassrecord;
|
||||
}
|
||||
|
||||
}
|
||||
//OK 准许进站
|
||||
result = EntryPermissionResult.AllowIntoStation;
|
||||
goto InsertPassrecord;
|
||||
|
||||
@ -94,7 +94,7 @@ namespace RIZO.Service.PLCBackground.Stations
|
||||
//上传工艺参数
|
||||
bool CheckOutstationResult = await UploadProcessParameters(productSN, processOperations.First().FkRoutingCode, WorkstationCode);
|
||||
|
||||
//判断该产品是否允许进站
|
||||
//判断该产品是否允许出站
|
||||
|
||||
OutPermissionResult result = await checkOutPermission(productModel, productSN, WorkstationCode, processOperations, CheckOutstationResult);
|
||||
await _plcService.WriteAsync("DB1010.DBW2000", (int)result);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user