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

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

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

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

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

@ -7,7 +7,7 @@ using log4net;
using System.Diagnostics;
using System.Threading;
using Admin.Core.Common;
using Aucma.Core.PLc;
using Aucma.Core.HwPLc;
using Aucma.Core.Scanner;
using System.Linq;
using System.Threading.Tasks;
@ -51,7 +51,7 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
{
RefreshMesDb();
RefreshPlc();
RefreshScanner();
//RefreshScanner();
}
/// <summary>
@ -72,7 +72,7 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
/// <param name="e"></param>
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.plc.IsConnected)

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

@ -79,12 +79,12 @@
</Border.Background>
</Border>
<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>
<ImageBrush x:Name="Scanner1Status" ImageSource="{Binding Scanner1UIIcon}"/>
</Border.Background>
</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>
</Grid>

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

Loading…
Cancel
Save