|
|
|
@ -2,6 +2,7 @@
|
|
|
|
|
using DataBlockHelper.DBHelpers;
|
|
|
|
|
using DataBlockHelper.Entity.DB2106Entity;
|
|
|
|
|
using DataBlockHelper.Entity.DB2107Entity;
|
|
|
|
|
using DataBlockHelper.Entity.DB2111Entity;
|
|
|
|
|
|
|
|
|
|
using DevExpress.Utils.Extensions;
|
|
|
|
|
using DevExpress.XtraPrinting;
|
|
|
|
@ -35,25 +36,107 @@ namespace Mesnac.Action.ChemicalWeighing.Report
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static void ReadFeededDry()
|
|
|
|
|
{
|
|
|
|
|
DB2107Helper dB2107Helper = new DB2107Helper();
|
|
|
|
|
var nornalStatus = dB2107Helper.NormalStatus;
|
|
|
|
|
DB2111Helper dB2111Helper = new DB2111Helper();
|
|
|
|
|
//黑粉准备好信号
|
|
|
|
|
if (nornalStatus.spare1)
|
|
|
|
|
{
|
|
|
|
|
FeededDry(1, dB2111Helper.DryDosing_A);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (nornalStatus.spare2)
|
|
|
|
|
{
|
|
|
|
|
FeededDry(2, dB2111Helper.DryDosing_B);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (nornalStatus.spare3)
|
|
|
|
|
{
|
|
|
|
|
FeededDry(3, dB2111Helper.DryDosing_C);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (nornalStatus.spare4)
|
|
|
|
|
{
|
|
|
|
|
FeededDry(4, dB2111Helper.DryDosing_D);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DB2105Helper dB2105Helper = new DB2105Helper();
|
|
|
|
|
List<bool> list = dB2105Helper.FeededDryList();
|
|
|
|
|
for (int i = 0; i < list.Count; i++)
|
|
|
|
|
//水
|
|
|
|
|
if (nornalStatus.RdyRpt_W1)
|
|
|
|
|
{
|
|
|
|
|
if (list[i])
|
|
|
|
|
FeededWaterHA(dB2111Helper.hwReport_A);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (nornalStatus.RdyRpt_W2)
|
|
|
|
|
{
|
|
|
|
|
FeededWaterCA(dB2111Helper.cwReport_A);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//热水B
|
|
|
|
|
if (nornalStatus.RdyRpt_W3)
|
|
|
|
|
{
|
|
|
|
|
FeededWaterHB(dB2111Helper.hwReport_B);
|
|
|
|
|
}
|
|
|
|
|
if (nornalStatus.RdyRpt_W4)
|
|
|
|
|
{
|
|
|
|
|
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}";
|
|
|
|
|
FeededWaterCB(dB2111Helper.cwReport_B);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//热水A
|
|
|
|
|
private static void FeededWaterHA(ReportDosEntity entity)
|
|
|
|
|
{
|
|
|
|
|
var actValue = Convert.ToInt32(entity.actValue);
|
|
|
|
|
string logName = $"热水秤A向 [{entity.eqNo}] 加水 {actValue}";
|
|
|
|
|
LoggingService<ReportReadDb>.Info(logName);
|
|
|
|
|
LjLogControl.ManualLogControl(logName, actValue, 2, entity.eqNo, 1);
|
|
|
|
|
DB2107WriteHelper.CleanWater(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void FeededWaterCA(ReportDosEntity entity)
|
|
|
|
|
{
|
|
|
|
|
var actValue = Convert.ToInt32(entity.actValue);
|
|
|
|
|
string logName = $"冷水秤A向 [{entity.eqNo}] 加水 {actValue}";
|
|
|
|
|
LoggingService<ReportReadDb>.Info(logName);
|
|
|
|
|
var value = Convert.ToInt32(Convert.ToDouble(feedValue));
|
|
|
|
|
LjLogControl.ManualLogControl(logName, value, 4, i + 1, 2);
|
|
|
|
|
DB2105WriteHelper.WriteFalseFeededDry(i + 1);
|
|
|
|
|
LjLogControl.ManualLogControl(logName, actValue, 2, entity.eqNo, 1);
|
|
|
|
|
DB2107WriteHelper.CleanWater(2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static void FeededWaterHB(ReportDosEntity entity)
|
|
|
|
|
{
|
|
|
|
|
var actValue = Convert.ToInt32(entity.actValue);
|
|
|
|
|
string logName = $"热水秤B向 [{entity.eqNo+4}] 加水 {actValue}";
|
|
|
|
|
LoggingService<ReportReadDb>.Info(logName);
|
|
|
|
|
LjLogControl.ManualLogControl(logName, actValue, 2, entity.eqNo+4, 1);
|
|
|
|
|
DB2107WriteHelper.CleanWater(3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void FeededWaterCB(ReportDosEntity entity)
|
|
|
|
|
{
|
|
|
|
|
var actValue = Convert.ToInt32(entity.actValue);
|
|
|
|
|
string logName = $"冷水秤B向 [{entity.eqNo + 4}] 加水 {actValue}";
|
|
|
|
|
LoggingService<ReportReadDb>.Info(logName);
|
|
|
|
|
LjLogControl.ManualLogControl(logName, actValue, 2, entity.eqNo + 4, 1);
|
|
|
|
|
DB2107WriteHelper.CleanWater(4);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static void FeededDry(int deviceno, ReportDosEntity entity)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
int no = deviceno * 2;
|
|
|
|
|
if (entity.eqNo == 1)
|
|
|
|
|
{
|
|
|
|
|
no = deviceno-1;
|
|
|
|
|
}
|
|
|
|
|
var actValue = Convert.ToInt32(entity.actValue);
|
|
|
|
|
string logName = $"螺旋{deviceno}向湿混机 [{no}] 投料 {actValue}";
|
|
|
|
|
LoggingService<ReportReadDb>.Info(logName);
|
|
|
|
|
LjLogControl.ManualLogControl(logName, actValue, 4, no, 2);
|
|
|
|
|
DB2107WriteHelper.CleanSpare(deviceno);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void ReadReport()
|
|
|
|
@ -483,8 +566,12 @@ namespace Mesnac.Action.ChemicalWeighing.Report
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(lde.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
FreeSqlUnit.Instance.Insert(report).ExecuteAffrows();
|
|
|
|
|
FreeSqlUnit.Instance.Insert(lde).ExecuteAffrows();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|