输送改进

dep_deliver
我叫锄头 1 year ago
parent d3faa811b5
commit d0dc861f1b

@ -0,0 +1,126 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mesnac.Action.ChemicalWeighing.LjDeliver
{
public class DaCangFactory
{
public static IDictionary<String,DaCangValue> GetDefault()
{
IDictionary<String, DaCangValue> keyValuePairs=new
Dictionary<String, DaCangValue>();
keyValuePairs.Add("小料1", new DaCangValue()
{
volume = 150,
Density = 0.69f
});
keyValuePairs.Add("小料2", new DaCangValue()
{
volume = 150,
Density = 0.87f
});
keyValuePairs.Add("木粉", new DaCangValue()
{
volume = 300,
Density = 0.4f
});
keyValuePairs.Add("碳酸钙", new DaCangValue()
{
volume = 300,
Density = 1.7f
});
keyValuePairs.Add("木薯粉", new DaCangValue()
{
volume = 300,
Density = 0.71f
});
keyValuePairs.Add("玉米粉", new DaCangValue()
{
volume = 300,
Density = 0.69f
});
keyValuePairs.Add("碳粉1", new DaCangValue()
{
volume = 700,
Density = 0.64f
});
keyValuePairs.Add("碳粉2", new DaCangValue()
{
volume = 700,
Density = 0.65f
});
keyValuePairs.Add("碳粉3", new DaCangValue()
{
volume = 700,
Density = 0.69f
});
keyValuePairs.Add("碳粉4", new DaCangValue()
{
volume = 700,
Density = 0.77f
});
keyValuePairs.Add("碳粉5", new DaCangValue()
{
volume = 700,
Density = 0.64f
});
keyValuePairs.Add("碳粉6", new DaCangValue()
{
volume = 700,
Density = 0.65f
});
keyValuePairs.Add("碳粉7", new DaCangValue()
{
volume = 700,
Density = 0.69f
});
keyValuePairs.Add("碳粉8", new DaCangValue()
{
volume = 700,
Density = 0.77f
});
keyValuePairs.Add("回收罐", new DaCangValue()
{
volume = 50,
Density = 0.69f
});
return keyValuePairs;
}
}
public class DaCangValue
{
/// <summary>
/// 体积
/// </summary>
public int volume { get; set; }
/// <summary>
/// 密度
/// </summary>
public float Density { get; set; }
}
}

@ -2,6 +2,9 @@
using DataBlockHelper.DBHelpers;
using DevExpress.Data.Filtering.Helpers;
using DevExpress.Utils.FormShadow;
using HslCommunication.LogNet;
using Mesnac.Action.Base;
using Mesnac.Action.ChemicalWeighing.LjDeliver.Entity;
using Mesnac.Action.ChemicalWeighing.LjMaterial;
@ -865,23 +868,42 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver
ControlsHelper.SetHslBottle(bottleE.Bottle14, PlcTemp.Bottle14_Set);
ControlsHelper.SetHslBottle(bottleE.Bottle15, PlcTemp.Bottle15_Set);
ControlsImprot.SetMCLabel(LabelE.HslBottleValue1, Math.Round(PlcTemp.Bottle1_Set, 1) + " %");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue2, Math.Round(PlcTemp.Bottle2_Set, 1) + " %");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue3, Math.Round(PlcTemp.Bottle3_Set, 1) + " %");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue4, Math.Round(PlcTemp.Bottle4_Set, 1) + " %");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue5, Math.Round(PlcTemp.Bottle5_Set, 1) + " %");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue6, Math.Round(PlcTemp.Bottle6_Set, 1) + " %");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue7, Math.Round(PlcTemp.Bottle7_Set, 1) + " %");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue8, Math.Round(PlcTemp.Bottle8_Set, 1) + " %");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue9, Math.Round(PlcTemp.Bottle9_Set, 1) + " %");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue10, Math.Round(PlcTemp.Bottle10_Set, 1) + " %");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue11, Math.Round(PlcTemp.Bottle11_Set, 1) + " %");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue12, Math.Round(PlcTemp.Bottle12_Set, 1) + " %");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue13, Math.Round(PlcTemp.Bottle13_Set, 1) + " %");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue14, Math.Round(PlcTemp.Bottle14_Set, 1) + " %");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue15, Math.Round(PlcTemp.Bottle15_Set, 1) + " %");
var dic = DaCangFactory.GetDefault();
ControlsImprot.SetMCLabel(LabelE.HslBottleValue1, JiSuan(PlcTemp.Bottle1_Set, dic["小料1"]) + "t");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue2, JiSuan(PlcTemp.Bottle2_Set, dic["小料2"]) + "t");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue3, JiSuan(PlcTemp.Bottle3_Set, dic["木粉"]) + "t");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue4, JiSuan(PlcTemp.Bottle4_Set, dic["碳酸钙"]) + "t");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue5, JiSuan(PlcTemp.Bottle5_Set, dic["木薯粉"]) + "t");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue6, JiSuan(PlcTemp.Bottle6_Set, dic["玉米粉"]) + "t");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue7, JiSuan(PlcTemp.Bottle7_Set, dic["碳粉1"]) + "t");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue8, JiSuan(PlcTemp.Bottle8_Set, dic["碳粉2"]) + "t");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue9, JiSuan(PlcTemp.Bottle9_Set, dic["碳粉3"]) + "t");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue10, JiSuan(PlcTemp.Bottle10_Set, dic["碳粉4"]) + "t");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue11, JiSuan(PlcTemp.Bottle11_Set, dic["碳粉5"]) + "t");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue12, JiSuan(PlcTemp.Bottle12_Set, dic["碳粉6"]) + "t");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue13, JiSuan(PlcTemp.Bottle13_Set, dic["碳粉7"]) + "t");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue14, JiSuan(PlcTemp.Bottle14_Set, dic["碳粉8"]) + "t");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue15, JiSuan(PlcTemp.Bottle15_Set, dic["小料1"]) + "t");
}
public string JiSuan(double x, DaCangValue daCangValue)
{
var bottleValue3 = Math.Round(x * daCangValue.volume * daCangValue.Density, 2)/100;
var entity= bottleValue3.ToString("f1");
if (entity == "0.0")
{
return "0";
}
return entity;
}
#endregion
#region 报警管理

@ -311,6 +311,7 @@
<Compile Include="LjDeliverPressureSetting\PlcDownload.cs" />
<Compile Include="LjDeliverPressureSetting\PressureSettingButtonAction.cs" />
<Compile Include="LjDeliver\ControlsHelper.cs" />
<Compile Include="LjDeliver\DaCangFactory.cs" />
<Compile Include="LjDeliver\DeliverInitAction.cs" />
<Compile Include="LjDeliver\Entity\DeliverEntity.cs" />
<Compile Include="LjDeliver\Entity\PlcTempEntity.cs" />

@ -44,8 +44,8 @@ namespace DataBlockHelper
return s7;
}
}
}
}

Loading…
Cancel
Save