|
@@ -112,6 +112,7 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
|
|
|
private async void Schedual_DateTimeChanged(object sender, SCADA.CommonLib.DateTimeChangedArgs e)
|
|
|
{
|
|
|
+ #region 90s后读回绑定队列产品数据
|
|
|
if (e.ChangeType == DateTimeChangeType.SecondChanged && e.TimeFlag.Second % 5 == 0)
|
|
|
{
|
|
|
if (CustomerEnv.RFIDBindingList.Count > 0 && CustomerEnv.RFIDBindingList[0]?.CreateTime != null && !isReadInfoDone)
|
|
@@ -125,6 +126,9 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region PingMes服务器网络,校验接口token
|
|
|
if (e.ChangeType == DateTimeChangeType.SecondChanged && e.TimeFlag.Second % 1 == 0 && CustomerEnv.CustomerConfig.SetPower.MESUpload)
|
|
|
{
|
|
|
var ip = CustomerEnv.CustomerConfig.MESInfo.MesDataUrl?.Split('/', ':').ToList()[3];
|
|
@@ -136,8 +140,11 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
CustomerEnv.MESGetAPIToken();
|
|
|
}
|
|
|
}
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region //定时上传未上传的产品数据
|
|
|
if (e.ChangeType == DateTimeChangeType.MinuteChanged && e.TimeFlag.Minute % 30 == 0 &&
|
|
|
- CustomerEnv.MESServerConnectStatus && CustomerEnv.MESAPIToken != null && CustomerEnv.CustomerConfig.SetPower.MESUpload) //定时上传未上传的产品数据
|
|
|
+ CustomerEnv.MESServerConnectStatus && CustomerEnv.MESAPIToken != null && CustomerEnv.CustomerConfig.SetPower.MESUpload)
|
|
|
{
|
|
|
var notSyncedList = Env.DAL.App_Microwave_TestResult.GetData<ProductModel>(t => t.IsSynced == false && t.Barcode != null && t.Barcode != "");
|
|
|
var synecdList = new List<ProductModel>();
|
|
@@ -184,6 +191,7 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
t => new { t.IsSynced });
|
|
|
}
|
|
|
}
|
|
|
+ #endregion
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -600,23 +608,34 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
{
|
|
|
var points = new List<ProcessData>();
|
|
|
data = data.Skip(6).Take(data.Count - 8).ToList();
|
|
|
- for (int i = 0; i < data.Count; i += 6)
|
|
|
+ if (data.Count >= 90 && !CustomerEnv.CustomerConfig.SetPower.IsSimulationDta)
|
|
|
+ {
|
|
|
+ for (int i = 0; i < data.Count; i += 6)
|
|
|
+ {
|
|
|
+ var model = new ProcessData();
|
|
|
+ model.DataDecode(data.ToArray(), i);
|
|
|
+ points.Add(model);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- var model = new ProcessData();
|
|
|
- model.DataDecode(data.ToArray(), i);
|
|
|
- points.Add(model);
|
|
|
+ points = ProcessData.SimulationData();
|
|
|
}
|
|
|
|
|
|
- var ngNumber = points.Where(point => (point.Power < CustomerEnv.CustomerConfig.SetPower.MinPower
|
|
|
- || point.Power > CustomerEnv.CustomerConfig.SetPower.MaxPower) && point.Power != 0).ToList().Count();
|
|
|
+ #region 测试结果判断
|
|
|
+ var MinNGNumber = points.Where(point => point.Power < CustomerEnv.CustomerConfig.SetPower.MinPower
|
|
|
+ && point.Power != 0).ToList().Count();
|
|
|
+ var MaxNGNumber = points.Where(point => point.Power > CustomerEnv.CustomerConfig.SetPower.MaxPower
|
|
|
+ && point.Power != 0).ToList().Count();
|
|
|
var okNumber = points.Where(point => point.Power >= CustomerEnv.CustomerConfig.SetPower.MinPower
|
|
|
&& point.Power <= CustomerEnv.CustomerConfig.SetPower.MaxPower).ToList().Count();
|
|
|
var testResult = TestResult.NG;
|
|
|
- if (ngNumber < CustomerEnv.CustomerConfig.SetPower.NGNo &&
|
|
|
+ if (MinNGNumber < CustomerEnv.CustomerConfig.SetPower.MinNGNo && MaxNGNumber < CustomerEnv.CustomerConfig.SetPower.MaxNGNo &&
|
|
|
okNumber >= CustomerEnv.CustomerConfig.SetPower.OKNo && rfidInfo.Barcode?.Length == 22)
|
|
|
{
|
|
|
testResult = TestResult.OK;
|
|
|
}
|
|
|
+ #endregion
|
|
|
|
|
|
var product = new ProductModel()
|
|
|
{
|