|
|
@@ -156,6 +156,17 @@ namespace TeamAAS_VP.Core
|
|
|
get { return _CTtime; }
|
|
|
set { SetProperty(ref _CTtime, value); }
|
|
|
}
|
|
|
+
|
|
|
+ private double _CTtime2;
|
|
|
+ /// <summary>
|
|
|
+ /// ct2
|
|
|
+ /// </summary>
|
|
|
+ public double CTtime2
|
|
|
+ {
|
|
|
+ get { return _CTtime2; }
|
|
|
+ set { SetProperty(ref _CTtime2, value); }
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 显示界面
|
|
|
/// </summary>
|
|
|
@@ -220,25 +231,6 @@ namespace TeamAAS_VP.Core
|
|
|
get { return _CurrentUPH; }
|
|
|
set { SetProperty(ref _CurrentUPH, value); }
|
|
|
}
|
|
|
-
|
|
|
- private Int64 _NgNumber;
|
|
|
- /// <summary>
|
|
|
- /// 当前的NG数量
|
|
|
- /// </summary>
|
|
|
- public Int64 NgNumber
|
|
|
- {
|
|
|
- get { return _NgNumber; }
|
|
|
- set { SetProperty(ref _NgNumber, value); }
|
|
|
- }
|
|
|
- private double _Yield;
|
|
|
- /// <summary>
|
|
|
- /// 当前的NG数量
|
|
|
- /// </summary>
|
|
|
- public double Yield
|
|
|
- {
|
|
|
- get { return _Yield; }
|
|
|
- set { SetProperty(ref _Yield, value); }
|
|
|
- }
|
|
|
private XYD_ScrewDriver _ScrewDriver;
|
|
|
public XYD_ScrewDriver ScrewDriver
|
|
|
{
|
|
|
@@ -1376,6 +1368,7 @@ namespace TeamAAS_VP.Core
|
|
|
addressConfig.AutoRunning.Address,
|
|
|
addressConfig.ManualMode.Address,
|
|
|
addressConfig.ClearMode.Address,
|
|
|
+ addressConfig.WorkCt.Address,
|
|
|
};
|
|
|
for (int i = 0; i < 10; i++)
|
|
|
{
|
|
|
@@ -1487,6 +1480,7 @@ namespace TeamAAS_VP.Core
|
|
|
public bool _LastManualMode = false;
|
|
|
bool _LastFzCameracheckExe = false;
|
|
|
bool _LastClearMode = false;
|
|
|
+ bool _Lastworkct = false;
|
|
|
Int16 _LastWorkStart = 0;
|
|
|
Int16 _LastWorkDone = 0;
|
|
|
Int16 _LastRequestPosition = 0;
|
|
|
@@ -2679,6 +2673,28 @@ namespace TeamAAS_VP.Core
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ //读取PLC生产CT
|
|
|
+ else if (addressConfig.WorkCt.Address.Contains(tuple.nodeId))
|
|
|
+ {
|
|
|
+ if (tuple.value is bool state)
|
|
|
+ {
|
|
|
+ if (_Lastworkct != state)
|
|
|
+ {
|
|
|
+ _Lastworkct = state;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (state)
|
|
|
+ {
|
|
|
+ Int32 cttime = plc.ReadNode<Int32>(addressConfig.In_CycleTimeBefor.Address);
|
|
|
+ SendTaskMessage($"读取PLC记录CT:{cttime}", MessageLevel.Info);
|
|
|
+ CTtime2 = Convert.ToDouble(cttime);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 过站检查
|
|
|
else
|
|
|
{
|
|
|
@@ -3175,9 +3191,9 @@ namespace TeamAAS_VP.Core
|
|
|
ERROR_MESSAGE = item.PhotoPassed == "OK" ? "" : $"{item.PhotoName} OOS",
|
|
|
PD_ATTR_01 = ProductMainSN,//
|
|
|
PD_ATTR_02 = item.MidLimit,
|
|
|
- PD_ATTR_03 = "",
|
|
|
+ PD_ATTR_03 = CTtime.ToString(),
|
|
|
PD_ATTR_04 = code,
|
|
|
- PD_ATTR_05 = CTtime.ToString(),
|
|
|
+ PD_ATTR_05 = CTtime2.ToString(),
|
|
|
});
|
|
|
}
|
|
|
if (stationConfig.SaveCsvkeyData)
|
|
|
@@ -3209,9 +3225,9 @@ namespace TeamAAS_VP.Core
|
|
|
ERROR_MESSAGE = ok ? "" : $"{diffvalue}",
|
|
|
PD_ATTR_01 = ProductMainSN,//
|
|
|
PD_ATTR_02 = "",
|
|
|
- PD_ATTR_03 = "",
|
|
|
+ PD_ATTR_03 = CTtime.ToString(),
|
|
|
PD_ATTR_04 = code,
|
|
|
- PD_ATTR_05 = CTtime.ToString(),
|
|
|
+ PD_ATTR_05 = CTtime2.ToString(),
|
|
|
});
|
|
|
}
|
|
|
foreach (var items in keyData1)
|
|
|
@@ -3240,9 +3256,9 @@ namespace TeamAAS_VP.Core
|
|
|
ERROR_MESSAGE = ok ? "" : $"{diffvalue1}",
|
|
|
PD_ATTR_01 = ProductMainSN,//
|
|
|
PD_ATTR_02 = "0.15",
|
|
|
- PD_ATTR_03 = "",
|
|
|
+ PD_ATTR_03 = CTtime.ToString(),
|
|
|
PD_ATTR_04 = code,
|
|
|
- PD_ATTR_05 = CTtime.ToString(),
|
|
|
+ PD_ATTR_05 = CTtime2.ToString(),
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
@@ -5232,29 +5248,22 @@ namespace TeamAAS_VP.Core
|
|
|
try
|
|
|
{
|
|
|
//获取当前产品
|
|
|
- CurrentProduct = _productService.GetCurrentProduct();
|
|
|
var currentproduct = _productService.GetCurrentProduct();
|
|
|
if (currentproduct == null) return;
|
|
|
TotalQuantity = await _systemDatabaseService.GetOverallProductionAsync(currentproduct.Name);
|
|
|
- //TotalQuantityToday = await _systemDatabaseService.GetTodayProductionAsync(currentproduct.Name);
|
|
|
- //CurrentUPH = await _systemDatabaseService.GetLastHourProductionAsync(currentproduct.Name);
|
|
|
- ////
|
|
|
- //NgNumber = await _systemDatabaseService.GetNGProductionAsync(currentproduct.Name);
|
|
|
- //Yield = ((double)TotalQuantityToday - (double)NgNumber) / (double)TotalQuantityToday * 100;
|
|
|
|
|
|
TotalQuantityToday = 0;
|
|
|
CurrentUPH = 0;
|
|
|
- NgNumber = 0;
|
|
|
- Yield = 0;
|
|
|
+ //NgNumber = 0;
|
|
|
+ //Yield = 0;
|
|
|
ObservableCollection<ProductModel> ProductList = new ObservableCollection<ProductModel>(_productService.GetAllProducts());
|
|
|
foreach (var product in ProductList)
|
|
|
{
|
|
|
//TotalQuantity += await _systemDatabaseService.GetOverallProductionAsync(product.Name);
|
|
|
TotalQuantityToday += await _systemDatabaseService.GetTodayProductionAsync(product.Name);
|
|
|
CurrentUPH += await _systemDatabaseService.GetLastHourProductionAsync(product.Name);
|
|
|
- NgNumber += await _systemDatabaseService.GetNGProductionAsync(product.Name);
|
|
|
+ //NgNumber += await _systemDatabaseService.GetNGProductionAsync(product.Name);
|
|
|
}
|
|
|
- Yield += ((double)TotalQuantityToday - (double)NgNumber) / (double)TotalQuantityToday * 100;
|
|
|
}
|
|
|
catch (Exception)
|
|
|
{
|
|
|
@@ -5262,6 +5271,7 @@ namespace TeamAAS_VP.Core
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
#region vm启动检测
|
|
|
|
|
|
/// <summary>
|