|
|
|
@ -4,12 +4,19 @@ using DataBlockHelper.Entity.DB2106Entity;
|
|
|
|
|
using DataBlockHelper.Entity.DB2107Entity;
|
|
|
|
|
|
|
|
|
|
using DevExpress.Utils.Extensions;
|
|
|
|
|
using DevExpress.XtraPrinting;
|
|
|
|
|
|
|
|
|
|
using HslCommunication.Enthernet;
|
|
|
|
|
|
|
|
|
|
using ICSharpCode.Core;
|
|
|
|
|
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.Alarm.PmtAlarm;
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.Entity;
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.FreeDb;
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.FreeDb.DBEntity;
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.FreeDb.DBEntity.Report;
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.ManualControl;
|
|
|
|
|
using Mesnac.Basic;
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
@ -22,6 +29,67 @@ namespace Mesnac.Action.ChemicalWeighing.Report
|
|
|
|
|
{
|
|
|
|
|
public class ReportReadDb
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 干混料插入日志
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static void ReadFeededDry()
|
|
|
|
|
{
|
|
|
|
|
LoggingService<ReportReadDb>.Debug("读取加料信息"+DateTime.Now.ToString());
|
|
|
|
|
|
|
|
|
|
DB2105Helper dB2105Helper = new DB2105Helper();
|
|
|
|
|
List<bool> list=dB2105Helper.FeededDryList();
|
|
|
|
|
for (int i = 0; i < list.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
if (list[i])
|
|
|
|
|
{
|
|
|
|
|
var feedValue= new DB2107Helper().Weter[i].FeedValue.ToString("0.#");
|
|
|
|
|
LoggingService<ReportReadDb>.Debug($"{i+1}:{feedValue}");
|
|
|
|
|
var deviceno = (i + 3) / 2;
|
|
|
|
|
// 螺旋1启动向湿混机1
|
|
|
|
|
string logName = $"螺旋{deviceno}启动向湿混机{i + 1}";
|
|
|
|
|
LoggingService<ReportReadDb>.Info(logName);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var value = Convert.ToInt32(Convert.ToDouble(feedValue));
|
|
|
|
|
|
|
|
|
|
ManualLogControl(logName, value, 5, i + 1);
|
|
|
|
|
|
|
|
|
|
DB2105WriteHelper.WriteFalseFeededDry(i + 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 日志插入
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="logName">日志内容</param>
|
|
|
|
|
/// <param name="value">值</param>
|
|
|
|
|
/// <param name="valuekind">值类型 0无 1水称设定值 2水称称量值 3螺旋设定值 4螺旋称量值</param>
|
|
|
|
|
/// <param name="deviceno">设备编号</param>
|
|
|
|
|
/// <param name="devicekind">设备类型 0无 1水称 2螺旋</param>
|
|
|
|
|
private static void ManualLogControl(string logName, int value, int valuekind, int deviceno)
|
|
|
|
|
{
|
|
|
|
|
var Log = new ManualLogEntity()
|
|
|
|
|
{
|
|
|
|
|
logtext = logName,
|
|
|
|
|
logtime = DateTime.Now,
|
|
|
|
|
userid = string.IsNullOrWhiteSpace(UserInfo.Instance.UserName) ? "Edit" : UserInfo.Instance.UserName,
|
|
|
|
|
value = value,
|
|
|
|
|
deviceno = deviceno,
|
|
|
|
|
devicekind = 2,
|
|
|
|
|
valuekind = valuekind,
|
|
|
|
|
createdate = DateTime.Now.ToString("yyyyMMdd")
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
FreeSqlUnit.Instance.Insert(Log).ExecuteIdentity();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void Read()
|
|
|
|
|
{
|
|
|
|
|
LoggingService<ReportReadDb>.InfoFormatted("开始读取报表");
|
|
|
|
|