总风机不转

dep
杨威 5 months ago
parent 2a80af210c
commit d667fd02c3

@ -2,6 +2,8 @@
using DataBlockHelper.Entity.DB2104Entity;
using Mesnac.Action.ChemicalWeighing.AutoControl.DB;
using Mesnac.Action.ChemicalWeighing.AutoControl.Entity;
using Mesnac.Action.ChemicalWeighing.FreeDb;
using Mesnac.Action.ChemicalWeighing.FreeDb.DBEntity;
using Mesnac.Action.ChemicalWeighing.LjMixManager;
using Mesnac.Action.ChemicalWeighing.LjPlanning;
using Mesnac.Action.ChemicalWeighing.MinAn;
@ -539,10 +541,50 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
ColdA.stand = Convert.ToInt16(ComboE.CALeftOrRight.MCValue);
ColdB.stand = Convert.ToInt16(ComboE.CBLeftOrRight.MCValue);
WaterDownloadEntity entity = new WaterDownloadEntity();
//1 冷水a 2 冷水b 3 热水a 4 热水b
Db2104WriteHelper.WriteAHostWater(HotA);
entity.Id = 3;
entity.Tolerance=HotA.Tolerance;
entity.stand = HotA.stand;
entity.differ = HotA.differ;
entity.Set = HotA.Set;
entity.Bin=HotA.Bin;
FreeSqlUnit.Instance.Update<WaterDownloadEntity>().SetSource(entity).ExecuteUpdated();
Db2104WriteHelper.WriteBHostWater(HotB);
entity.Id = 4;
entity.Tolerance = HotB.Tolerance;
entity.stand = HotB.stand;
entity.differ = HotB.differ;
entity.Set = HotB.Set;
entity.Bin = HotB.Bin;
FreeSqlUnit.Instance.Update<WaterDownloadEntity>().SetSource(entity).ExecuteUpdated();
Db2104WriteHelper.WriteAColWater(ColdA);
entity.Id = 1;
entity.Tolerance = ColdA.Tolerance;
entity.stand = ColdA.stand;
entity.differ = ColdA.differ;
entity.Set = ColdA.Set;
entity.Bin = ColdA.Bin;
FreeSqlUnit.Instance.Update<WaterDownloadEntity>().SetSource(entity).ExecuteUpdated();
Db2104WriteHelper.WriteBColWater(ColdB);
entity.Id = 2;
entity.Tolerance = ColdB.Tolerance;
entity.stand = ColdB.stand;
entity.differ = ColdB.differ;
entity.Set = ColdB.Set;
entity.Bin = ColdB.Bin;
FreeSqlUnit.Instance.Update<WaterDownloadEntity>().SetSource(entity).ExecuteUpdated();
MesnacServiceManager.Instance.LoggingService.Info("水称数据下发成功!");
MessageBox.Show("水称数据下发成功");
}

@ -0,0 +1,32 @@
using FreeSql.DataAnnotations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mesnac.Action.ChemicalWeighing.FreeDb.DBEntity
{
[Table(Name = "WaterDownload")]
public class WaterDownloadEntity
{
/// <summary>
/// 主键
/// </summary>
[Column(IsPrimary = true, IsIdentity = false)]
public int Id { get; set; }
public int Bin { get; set; } = 0;
public float Set { get; set; } = 0;
public float Tolerance { get; set; } = 0;
public float differ { get; set; } = 0;
public int stand { get; set; } = 0;
}
}

@ -1508,6 +1508,9 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
PlcReadTemp.DM1DRY3_Running_Set = DB2103.DM1DRY3.Running;
PlcReadTemp.DM1DRY4_Running_Set = DB2103.DM1DRY4.Running;
PlcReadTemp.PM3ADF01_Set = DB2103.DMFILTER.Running;
PlcReadTemp.DMWETER1_Set = DB2103.DMWETER1.Running;
PlcReadTemp.DMWETER2_Set = DB2103.DMWETER2.Running;
PlcReadTemp.DMWETER3_Set = DB2103.DMWETER3.Running;

@ -283,6 +283,7 @@
<Compile Include="FreeDb\DBEntity\Report\Report_GelMixing_Detail.cs" />
<Compile Include="FreeDb\DBEntity\Report\Report_WetMixer.cs" />
<Compile Include="FreeDb\DBEntity\Report\Report_WetMixer_Detail.cs" />
<Compile Include="FreeDb\DBEntity\WaterDownloadEntity.cs" />
<Compile Include="FreeDb\FreeSqlUnit.cs" />
<Compile Include="InterfaceDocking\DockingEntity\JsonReturnEntity.cs" />
<Compile Include="InterfaceDocking\DockingEntity\MaterialPlanSyncEntity.cs" />

@ -13,25 +13,8 @@ namespace DataBlockHelper.DBHelpers
public static void WriteA()
{
var siemensS7Net = PlcConnect.Instance;
int start = 3384;
ushort a = 0;
siemensS7Net.Write($"{DbName}.{start}.0", a);
start += 2;
siemensS7Net.Write($"{DbName}.{start}.0", a);
start += 2;
siemensS7Net.Write($"{DbName}.{start}.0", a);
start += 2;
siemensS7Net.Write($"{DbName}.{start}.0", a);
start += 2;
siemensS7Net.Write($"{DbName}.{start}.0", a);
siemensS7Net.Write($"{DbName}.3412.0", a);
siemensS7Net.Write($"{DbName}.3416.0",true);
siemensS7Net.Write($"DB2107.11.1",true);
}
@ -40,37 +23,7 @@ namespace DataBlockHelper.DBHelpers
public static void WriteB()
{
var siemensS7Net = PlcConnect.Instance;
int start = 3394;
ushort a = 0;
siemensS7Net.Write($"{DbName}.{start}.0",a);
start += 2;
siemensS7Net.Write($"{DbName}.{start}.0", a);
start += 2;
siemensS7Net.Write($"{DbName}.{start}.0", a);
start += 2;
siemensS7Net.Write($"{DbName}.{start}.0", a);
start += 2;
siemensS7Net.Write($"{DbName}.{start}.0", a);
start += 2;
siemensS7Net.Write($"{DbName}.{start}.0", a);
start += 2;
siemensS7Net.Write($"{DbName}.{start}.0", a);
start += 2;
siemensS7Net.Write($"{DbName}.{start}.0", a);
start += 2;
siemensS7Net.Write($"{DbName}.{start}.0", a);
siemensS7Net.Write($"{DbName}.3414.0", a);
siemensS7Net.Write($"{DbName}.3416.1", true);
siemensS7Net.Write($"DB2107.11.2", true);
}
}
}

@ -68,15 +68,15 @@ namespace DataBlockHelper.DBHelpers
public string GetB()
{
List<string> list = new List<string>();
list.Add(GetAvalue(queB0));
list.Add(GetAvalue(queB1));
list.Add(GetAvalue(queB2));
list.Add(GetAvalue(queB3));
list.Add(GetAvalue(queB4));
list.Add(GetAvalue(queB5));
list.Add(GetAvalue(queB6));
list.Add(GetAvalue(queB7));
list.Add(GetAvalue(queB8));
list.Add(GetBvalue(queB0));
list.Add(GetBvalue(queB1));
list.Add(GetBvalue(queB2));
list.Add(GetBvalue(queB3));
list.Add(GetBvalue(queB4));
list.Add(GetBvalue(queB5));
list.Add(GetBvalue(queB6));
list.Add(GetBvalue(queB7));
list.Add(GetBvalue(queB8));
if (list.Count == list.Where(x => x == "0").Count())
{

Loading…
Cancel
Save