能耗定时上传
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using JY.Model;
|
||||
using JY.Inspection.Mes;
|
||||
using JY.Model;
|
||||
using JY.Model.Common;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using System;
|
||||
@@ -21,8 +22,53 @@ namespace JY.Inspection
|
||||
}
|
||||
|
||||
scheduler.AddTask(state => {
|
||||
Debug.WriteLine("Hello");
|
||||
}, interval: 1000 * 60);
|
||||
//Debug.WriteLine("Hello");
|
||||
List<string> data = this.Invoke(new Func<List<string>>(() => {
|
||||
List<string> list = new List<string>();
|
||||
|
||||
#region 添加电表数据
|
||||
//相电压UA
|
||||
list.Add(txtPhaseVolUA.Text);
|
||||
//相电压UB
|
||||
list.Add(txtPhaseVolUB.Text);
|
||||
//相电压UC
|
||||
list.Add(txtPhaseVolUC.Text);
|
||||
//线电压UAB
|
||||
list.Add(txtLineVolUAB.Text);
|
||||
//线电压UBC
|
||||
list.Add(txtLineVolUBC.Text);
|
||||
//线电压UAC
|
||||
list.Add(txtLineVolUAC.Text);
|
||||
|
||||
//电流IA
|
||||
list.Add(txtIA.Text);
|
||||
//电流IB
|
||||
list.Add(txtIB.Text);
|
||||
//电流IC
|
||||
list.Add(txtIC.Text);
|
||||
|
||||
//A相有功功率
|
||||
list.Add(txtPowerA.Text);
|
||||
//B相有功功率
|
||||
list.Add(txtPowerB.Text);
|
||||
//C相有功功率
|
||||
list.Add(txtPowerC.Text);
|
||||
//总有功功率
|
||||
list.Add(txtTotalPower.Text);
|
||||
#endregion
|
||||
|
||||
return list;
|
||||
})) as List<string>;
|
||||
|
||||
if (data == null || data.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.WriteLine($"定时任务执行中, 时间: {DateTime.Now}");
|
||||
|
||||
new MESDataCombin().UpEnergyDataMqtt(data);
|
||||
}, interval: 1000 * 60 * Global.systemConfig.TaskInterval);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user