liulb@mesnac.com 1 year ago
parent 23f3ad66c7
commit 50d8905ad6

@ -326,6 +326,11 @@
物料名称 物料名称
</summary> </summary>
</member> </member>
<member name="P:Admin.Core.Model.BaseMaterialInfo.MaterialSubclass">
<summary>
物料小类
</summary>
</member>
<member name="P:Admin.Core.Model.BaseMaterialInfo.InboundDirection"> <member name="P:Admin.Core.Model.BaseMaterialInfo.InboundDirection">
<summary> <summary>
入库方向-A/B 入库方向-A/B

@ -56,7 +56,7 @@ namespace Admin.Core.Tasks
public async Task Execute(IJobExecutionContext context) public async Task Execute(IJobExecutionContext context)
{ {
await ExecuteJob(context, async () => await OldBoxFoamDataRun(context));//发泡线 await ExecuteJob(context, async () => await OldBoxFoamDataRun(context));//发泡线
//await ExecuteJob(context, async () => await OldBoxFoamStoreDataRun(context)); await ExecuteJob(context, async () => await OldBoxFoamStoreDataRun(context));
} }
/// <summary> /// <summary>
/// 发泡线 /// 发泡线
@ -415,15 +415,22 @@ namespace Admin.Core.Tasks
{ {
item.Fixturestatus = "停止"; item.Fixturestatus = "停止";
} }
item.Production = obj.plc.ReadInt16("D181");
item.CuringTimeSettingValue = obj.plc.ReadInt16("D910").ToString(); item.CuringTimeSettingValue = obj.plc.ReadInt16("D910").ToString();
item.ActualValue = obj.plc.ReadInt16("T3").ToString(); item.ActualValue = obj.plc.ReadInt16("T3").ToString();
item.UpdatedTime = DateTime.Now; item.UpdatedTime = DateTime.Now;
} }
var objProduction = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc2"));
if (objProduction == null) {
item.Production = 0;
}
else
{
item.Production = obj.plc.ReadInt16("D181");
}
} }
if (item.ObjId == 2) if (item.ObjId == 2)
{ {
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc2")); var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc1"));
if (obj == null) { return; } if (obj == null) { return; }
if (obj.plc.IsConnected) if (obj.plc.IsConnected)
{ {
@ -441,15 +448,23 @@ namespace Admin.Core.Tasks
{ {
item.Fixturestatus = "停止"; item.Fixturestatus = "停止";
} }
item.Production = obj.plc.ReadInt16("D183");
item.CuringTimeSettingValue = obj.plc.ReadInt16("D912").ToString(); item.CuringTimeSettingValue = obj.plc.ReadInt16("D912").ToString();
item.ActualValue = obj.plc.ReadInt16("T13").ToString(); item.ActualValue = obj.plc.ReadInt16("T13").ToString();
item.UpdatedTime = DateTime.Now; item.UpdatedTime = DateTime.Now;
} }
var objProduction = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc2"));
if (objProduction == null)
{
item.Production = 0;
}
else
{
item.Production = obj.plc.ReadInt16("D183");
}
} }
if (item.ObjId == 3) if (item.ObjId == 3)
{ {
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc3")); var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc1"));
if (obj == null) { return; } if (obj == null) { return; }
if (obj.plc.IsConnected) if (obj.plc.IsConnected)
{ {
@ -467,20 +482,34 @@ namespace Admin.Core.Tasks
{ {
item.Fixturestatus = "停止"; item.Fixturestatus = "停止";
} }
item.Production = obj.plc.ReadInt16("D184");
item.CuringTimeSettingValue = obj.plc.ReadInt16("D912").ToString(); item.CuringTimeSettingValue = obj.plc.ReadInt16("D912").ToString();
item.ActualValue = obj.plc.ReadInt16("T23").ToString(); item.ActualValue = obj.plc.ReadInt16("T23").ToString();
item.UpdatedTime = DateTime.Now; item.UpdatedTime = DateTime.Now;
} }
var objProduction = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc2"));
if (objProduction == null)
{
item.Production = 0;
}
else
{
item.Production = obj.plc.ReadInt16("D184");
}
} }
if (item.ObjId == 4) if (item.ObjId == 4)
{ {
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc4")); var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc1"));
if (obj == null) { return; } if (obj == null) { return; }
if (obj.plc.IsConnected) if (obj.plc.IsConnected)
{ {
string type = $"{obj.plc.ReadInt16("D3144")}{obj.plc.ReadInt16("D3145")}"; string type = $"{obj.plc.ReadInt16("D3144")}{obj.plc.ReadInt16("D3145")}";
item.Fixtureboxtype = type; item.Fixtureboxtype = type;
item.CuringTimeSettingValue = obj.plc.ReadInt16("D913").ToString();
item.ActualValue = obj.plc.ReadInt16("T33").ToString();
item.UpdatedTime = DateTime.Now;
}
var objStatus = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc2"));
if (objStatus != null) {
if (obj.plc.ReadBool("Y100")) if (obj.plc.ReadBool("Y100"))
{ {
item.Fixturestatus = "手动"; item.Fixturestatus = "手动";
@ -494,54 +523,66 @@ namespace Admin.Core.Tasks
item.Fixturestatus = "停止"; item.Fixturestatus = "停止";
} }
item.Production = obj.plc.ReadInt16("D185"); item.Production = obj.plc.ReadInt16("D185");
item.CuringTimeSettingValue = obj.plc.ReadInt16("D913").ToString();
item.ActualValue = obj.plc.ReadInt16("T33").ToString();
item.UpdatedTime = DateTime.Now;
} }
} }
if (item.ObjId == 5) if (item.ObjId == 5)
{ {
//var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc5")); var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc1"));
//if (obj == null) { return; } if (obj == null) { return; }
//if (obj.plc.IsConnected) if (obj.plc.IsConnected)
//{ {
// string type = $"{obj.plc.ReadInt16("D3150")}{obj.plc.ReadInt16("D3151")}"; string type = $"{obj.plc.ReadInt16("D3150")}{obj.plc.ReadInt16("D3151")}";
// item.Fixtureboxtype = type; item.Fixtureboxtype = type;
// if (obj.plc.ReadBool("Y105")) item.CuringTimeSettingValue = obj.plc.ReadInt16("D913").ToString();
// { item.ActualValue = obj.plc.ReadInt16("T43").ToString();
// item.Fixtureboxtype = "手动"; item.UpdatedTime = DateTime.Now;
// } }
// if (obj.plc.ReadBool("Y106")) var objStatus = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc2"));
// { if (objStatus != null)
// item.Fixtureboxtype = "手动"; {
// } if (obj.plc.ReadBool("Y105"))
// if (obj.plc.ReadBool("Y114")) {
// { item.Fixturestatus = "手动";
// item.Fixtureboxtype = "停止"; }
// } if (obj.plc.ReadBool("Y106"))
//} {
item.Fixturestatus = "手动";
}
if (obj.plc.ReadBool("Y114"))
{
item.Fixturestatus = "停止";
}
item.Production = obj.plc.ReadInt16("D186");
}
} }
if (item.ObjId == 6) if (item.ObjId == 6)
{ {
//var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc5")); var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc1"));
//if (obj == null) { return; } if (obj == null) { return; }
//if (obj.plc.IsConnected) if (obj.plc.IsConnected)
//{ {
// string type = $"{obj.plc.ReadInt16("D3152")}{obj.plc.ReadInt16("D3143")}"; string type = $"{obj.plc.ReadInt16("D3152")}{obj.plc.ReadInt16("D3143")}";
// item.Fixtureboxtype = type; item.Fixtureboxtype = type;
// if (obj.plc.ReadBool("Y10A")) item.ActualValue = obj.plc.ReadInt16("T53").ToString();
// { item.UpdatedTime = DateTime.Now;
// item.Fixtureboxtype = "手动"; }
// } var objStatus = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc2"));
// if (obj.plc.ReadBool("Y10B")) if (objStatus != null)
// { {
// item.Fixtureboxtype = "手动"; if (obj.plc.ReadBool("Y10A"))
// } {
// if (obj.plc.ReadBool("Y115")) item.Fixturestatus = "手动";
// { }
// item.Fixtureboxtype = "停止"; if (obj.plc.ReadBool("Y10B"))
// } {
//} item.Fixturestatus = "手动";
}
if (obj.plc.ReadBool("Y115"))
{
item.Fixturestatus = "停止";
}
item.Production = obj.plc.ReadInt16("D187");
}
} }
bool result = await _oldBoxFoamDataServices.UpdateAsync(item); bool result = await _oldBoxFoamDataServices.UpdateAsync(item);

@ -21,7 +21,7 @@ namespace Aucma.Core.BoxFoam.ViewModels
public FoamMachinesPageViewModel() public FoamMachinesPageViewModel()
{ {
_boxLastShotRecordServices = App.ServiceProvider.GetService<IBoxLastShotRecordServices>(); _boxLastShotRecordServices = App.ServiceProvider.GetService<IBoxLastShotRecordServices>();
Task.WaitAll(LoadData()); //Task.WaitAll(LoadData());
} }
#region 加载DataGrid数据 #region 加载DataGrid数据
private async Task LoadData() private async Task LoadData()

@ -62,9 +62,6 @@ namespace Aucma.Core.OldBoxFoam
//注册业务服务 //注册业务服务
AddServices(services); AddServices(services);
//扫码器
services.AddScannerSetup();
//任务调度 //任务调度
services.AddJobSetup(); services.AddJobSetup();
//PLC //PLC

@ -7,7 +7,7 @@ using log4net;
using System.Diagnostics; using System.Diagnostics;
using System.Threading; using System.Threading;
using Admin.Core.Common; using Admin.Core.Common;
using Aucma.Core.PLc; using Aucma.Core.HwPLc;
using Aucma.Core.Scanner; using Aucma.Core.Scanner;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -51,7 +51,7 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
{ {
RefreshMesDb(); RefreshMesDb();
RefreshPlc(); RefreshPlc();
RefreshScanner(); //RefreshScanner();
} }
/// <summary> /// <summary>
@ -72,7 +72,7 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
/// <param name="e"></param> /// <param name="e"></param>
public void RefreshPlc() public void RefreshPlc()
{ {
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("泡前库Plc")); var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc1"));
if (obj != null) if (obj != null)
{ {
if (obj.plc.IsConnected) if (obj.plc.IsConnected)

@ -29,8 +29,7 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
Job_OldBoxFoam_Quartz.RefreshOldBoxFoamTypeDataDelegateEvent += OldBoxFoamTypeOnLoad3; Job_OldBoxFoam_Quartz.RefreshOldBoxFoamTypeDataDelegateEvent += OldBoxFoamTypeOnLoad3;
Job_OldBoxFoam_Quartz.RefreshOldBoxFoamDataDelegateEvent += OldBoxFoamOnLoad3; Job_OldBoxFoam_Quartz.RefreshOldBoxFoamDataDelegateEvent += OldBoxFoamOnLoad3;
OldBoxFoamOnLoad(); Task.WaitAll(OldBoxFoamOnLoad(), OldBoxFoamTypeOnLoad());
OldBoxFoamTypeOnLoad();
} }
#region 初始化加载数据 #region 初始化加载数据

@ -79,12 +79,12 @@
</Border.Background> </Border.Background>
</Border> </Border>
<TextBlock x:Name="PLCState" Text="{Binding PlcUIStatusWb}" VerticalAlignment="Center" Foreground="{Binding PlcUIColor}" FontSize="18" Margin="10,0"/> <TextBlock x:Name="PLCState" Text="{Binding PlcUIStatusWb}" VerticalAlignment="Center" Foreground="{Binding PlcUIColor}" FontSize="18" Margin="10,0"/>
<Border Width="30" Height="30" CornerRadius="15"> <!--<Border Width="30" Height="30" CornerRadius="15">
<Border.Background> <Border.Background>
<ImageBrush x:Name="Scanner1Status" ImageSource="{Binding Scanner1UIIcon}"/> <ImageBrush x:Name="Scanner1Status" ImageSource="{Binding Scanner1UIIcon}"/>
</Border.Background> </Border.Background>
</Border> </Border>
<TextBlock x:Name="Scanner1" Text="{Binding Scanner1UIStatusWb}" VerticalAlignment="Center" Foreground="{Binding Scanner1UIColor}" FontSize="18" Margin="10,0"/> <TextBlock x:Name="Scanner1" Text="{Binding Scanner1UIStatusWb}" VerticalAlignment="Center" Foreground="{Binding Scanner1UIColor}" FontSize="18" Margin="10,0"/>-->
</StackPanel> </StackPanel>
</Grid> </Grid>

@ -95,8 +95,8 @@
<DataGridTextColumn Binding="{Binding Fixtureboxtype}" Header="夹具箱型" Width="*" /> <DataGridTextColumn Binding="{Binding Fixtureboxtype}" Header="夹具箱型" Width="*" />
<DataGridTextColumn Binding="{Binding Fixturestatus}" Header="夹具状态" Width="*" /> <DataGridTextColumn Binding="{Binding Fixturestatus}" Header="夹具状态" Width="*" />
<DataGridTextColumn Binding="{Binding Production}" Header="产量" Width="*" /> <DataGridTextColumn Binding="{Binding Production}" Header="产量" Width="*" />
<DataGridTextColumn Binding="{Binding CuringTimeSettingValue}" Header="设定时间" Width="*" /> <DataGridTextColumn Binding="{Binding CuringTimeSettingValue}" Header="设定时间(s)" Width="*" />
<DataGridTextColumn Binding="{Binding ActualValue}" Header="固化时间实际值" Width="*"/> <DataGridTextColumn Binding="{Binding ActualValue}" Header="固化时间实际值(s)" Width="*"/>
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
</Border> </Border>

Loading…
Cancel
Save