修改打印

dev
liulb@mesnac.com 1 year ago
parent 8538964ef3
commit 09425abb94

@ -2481,6 +2481,16 @@
所属产线 所属产线
</summary> </summary>
</member> </member>
<member name="P:Admin.Core.Model.OffLineInfo.SaveRetuenInfo">
<summary>
上传条码系统保存接口返回信息
</summary>
</member>
<member name="P:Admin.Core.Model.OffLineInfo.LoginTeam">
<summary>
当前登录班组(一线白班,一线夜班,二线白班,二线夜班)
</summary>
</member>
<member name="T:Admin.Core.Model.Perfusion_Alarm"> <member name="T:Admin.Core.Model.Perfusion_Alarm">
<summary> <summary>
灌注告警 灌注告警

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Extensions")] [assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Extensions")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1fc9493a7ff9eb3e5bc2b6109e38a8c263e3b897")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8538964ef3a1a79e9a9bc655bb6d2f3d8a56c86a")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Extensions")] [assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Extensions")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Extensions")] [assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Extensions")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
d780f4c71d7f81730d6e88e43ff8d26d1f8e15b705f157a4bf086caa5e7da499 ccbbc17784cbf7858c929b248f106ffa29ff2844237989ec117203b05eeae991

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.IRepository")] [assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.IRepository")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1fc9493a7ff9eb3e5bc2b6109e38a8c263e3b897")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8538964ef3a1a79e9a9bc655bb6d2f3d8a56c86a")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.IRepository")] [assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.IRepository")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.IRepository")] [assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.IRepository")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
72f20f6cf98a472ebf4c20b336a615ec584766bd52e85cd9501f3b4e781988db 301a2f01eba9435b62a6ed87a5d4e047767724541eb68c6eb91a1acdd4792fa5

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.IService")] [assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.IService")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1fc9493a7ff9eb3e5bc2b6109e38a8c263e3b897")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8538964ef3a1a79e9a9bc655bb6d2f3d8a56c86a")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.IService")] [assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.IService")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.IService")] [assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.IService")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
58e5bcaec14d01e659427d2a8c0b1fbc2e0da050bb91443cceff81b9cb2a3e6c 65b4c6f711245279c3727e3a1c075776410fbd5f735a7f0e582ddf21a60e9c4e

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Model")] [assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Model")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1fc9493a7ff9eb3e5bc2b6109e38a8c263e3b897")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8538964ef3a1a79e9a9bc655bb6d2f3d8a56c86a")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Model")] [assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Model")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Model")] [assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Model")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
1ec56689cad54c12209e5fbd483faa339ac415e2614a8fd6b45ec357a392a616 a2595f6072e1077c968fa28c018b419ef63a5870e11dfa76af33a0fcc6553b79

@ -61,6 +61,7 @@ namespace Admin.Core.Repository
{ {
try try
{ {
var dd = _db.CopyNew().Ado.IsValidConnection();
if (_db.CopyNew().Ado.IsValidConnection()) if (_db.CopyNew().Ado.IsValidConnection())
{ {
@ -75,7 +76,8 @@ namespace Admin.Core.Repository
} }
catch (Exception ex) catch (Exception ex)
{ {
var dd = _db.CopyNew().Ado.IsValidConnection();
var ddd= _db.CopyNew().Ado.IsValidConnectionNoClose();
Console.WriteLine(ex.ToString()); Console.WriteLine(ex.ToString());
return false; return false;
} }

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Repository")] [assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Repository")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1fc9493a7ff9eb3e5bc2b6109e38a8c263e3b897")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8538964ef3a1a79e9a9bc655bb6d2f3d8a56c86a")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Repository")] [assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Repository")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Repository")] [assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Repository")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
4639e0ce1dff133705f35aae6cc343d3a434fc547d556f93e46bcf77a8fe9d80 f18bd845b76dc9a757f5750b92d530121079126688148320def4fbb662ad68d1

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Service")] [assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Service")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1fc9493a7ff9eb3e5bc2b6109e38a8c263e3b897")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8538964ef3a1a79e9a9bc655bb6d2f3d8a56c86a")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Service")] [assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Service")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Service")] [assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Service")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
f7af35947834bb2b8700b1aa87f9fe428cf89bd259aefe95cb2c632699945ffb f7901cea78b4fbd0cdbeedc32dc88893aba7e0db582da2fd10c194604f8fe159

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Tasks")] [assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Tasks")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1fc9493a7ff9eb3e5bc2b6109e38a8c263e3b897")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8538964ef3a1a79e9a9bc655bb6d2f3d8a56c86a")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Tasks")] [assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Tasks")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Tasks")] [assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Tasks")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
357d4cf1da9d0baaf00ea24891148cc7f0ef3028d39279eea9f552730b5fa818 ccee45fea5738afedac594e057e6913d00207ed71ccfc8815ac25e5f1785be4d

@ -62,7 +62,6 @@ namespace Aucam.Core.PerfusionService
//PLC //PLC
services.AddPlcSetup(); services.AddPlcSetup();
services.AddAucmaTaskSetup();
//支持编码大全 例如:支持 System.Text.Encoding.GetEncoding("GB2312") System.Text.Encoding.GetEncoding("GB18030") //支持编码大全 例如:支持 System.Text.Encoding.GetEncoding("GB2312") System.Text.Encoding.GetEncoding("GB18030")
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
} }
@ -84,8 +83,7 @@ namespace Aucam.Core.PerfusionService
/// <param name="app"></param> /// <param name="app"></param>
/// <param name="env"></param> /// <param name="env"></param>
public void Configure(IApplicationBuilder app, ISysTasksQzService tasksQzService, public void Configure(IApplicationBuilder app, ISysTasksQzService tasksQzService,
ISchedulerCenter schedulerCenter, IRunPlcService runPlcService, ISchedulerCenter schedulerCenter, IRunPlcService runPlcService)
IAucamTaskService aucamTaskService)
{ {
// 使用静态文件 // 使用静态文件
app.UseStaticFiles(); app.UseStaticFiles();
@ -95,8 +93,6 @@ namespace Aucam.Core.PerfusionService
app.UseQuartzJobMildd(tasksQzService, schedulerCenter); app.UseQuartzJobMildd(tasksQzService, schedulerCenter);
//PLC //PLC
app.UsePlcMildd(runPlcService); app.UsePlcMildd(runPlcService);
app.AucmaTaskMildds(aucamTaskService);
} }
#region 注册服务 #region 注册服务

@ -109,7 +109,7 @@
"TriggerType": 1, "TriggerType": 1,
"IntervalSecond": 1, "IntervalSecond": 1,
"CycleRunTimes": 1, "CycleRunTimes": 1,
"IsStart": false, "IsStart": true,
"JobParams": null, "JobParams": null,
"DelFlag": false, "DelFlag": false,
"CreateBy": "admin", "CreateBy": "admin",
@ -165,11 +165,11 @@
"Enabled": true "Enabled": true
}, },
"QuartzNetJob": { "QuartzNetJob": {
"Enabled": false "Enabled": true
}, },
"AucamTask": { "AucamTask": {
"Enabled": true "Enabled": false
} }
}, },
"PLCServer": [ "PLCServer": [

@ -89,7 +89,7 @@
"DBType": 1, "DBType": 1,
"Enabled": true, "Enabled": true,
"HitRate": 40, "HitRate": 40,
"Connection": "Data Source=localhost;Initial Catalog=Hsdb;User ID=sa;Password=sa;", "Connection": "Data Source=10.10.92.147;Initial Catalog=TOPLINE_T10_E_P2_32_AUCMA;User ID=mes;Password=mes;",
"ProviderName": "System.Data.SqlClient" "ProviderName": "System.Data.SqlClient"
} }
], ],

@ -110,6 +110,7 @@ namespace Aucma.Core.DoorFoam.Business
// ch:打印设备信息 | en:Print device info // ch:打印设备信息 | en:Print device info
for (Int32 i = 0; i < stDevList.nDeviceNum; i++) for (Int32 i = 0; i < stDevList.nDeviceNum; i++)
{ {
stDevInfo = (MvCodeReader.MV_CODEREADER_DEVICE_INFO)Marshal.PtrToStructure(stDevList.pDeviceInfo[i], typeof(MvCodeReader.MV_CODEREADER_DEVICE_INFO)); stDevInfo = (MvCodeReader.MV_CODEREADER_DEVICE_INFO)Marshal.PtrToStructure(stDevList.pDeviceInfo[i], typeof(MvCodeReader.MV_CODEREADER_DEVICE_INFO));
if (MvCodeReader.MV_CODEREADER_GIGE_DEVICE == stDevInfo.nTLayerType) if (MvCodeReader.MV_CODEREADER_GIGE_DEVICE == stDevInfo.nTLayerType)
@ -141,7 +142,7 @@ namespace Aucma.Core.DoorFoam.Business
} }
// ch:打开设备 | en:Open device // ch:打开设备 | en:Open device
nRet = device.MV_CODEREADER_OpenDevice_NET(); nRet = device.MV_CODEREADER_OpenDevice_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet) if (MvCodeReader.MV_CODEREADER_OK != nRet)
{ {
Console.WriteLine("Open device failed:{0:x8}", nRet); Console.WriteLine("Open device failed:{0:x8}", nRet);

@ -32,9 +32,9 @@ namespace Aucma.Core.Palletiz.Business
#region 初始化对象 #region 初始化对象
private static readonly log4net.ILog logHelper = LogManager.GetLogger(typeof(InstoreBusiness)); private static readonly log4net.ILog logHelper = LogManager.GetLogger(typeof(InstoreBusiness));
private readonly IBaseSpaceInfoServices? _baseSpaceInfoServices; private readonly IBaseSpaceInfoServices _baseSpaceInfoServices;
private readonly ICodeBindingRecordServices? _codeBindingServices; private readonly ICodeBindingRecordServices _codeBindingServices;
private readonly IRecordInStoreServices? _recordInstoreServices; private readonly IRecordInStoreServices _recordInstoreServices;
#endregion #endregion
#region 构造函数 #region 构造函数
@ -130,7 +130,7 @@ namespace Aucma.Core.Palletiz.Business
Console.WriteLine($"上位机获取配置的扫码器【IP:{model.ToJson()}》名称:{model.Name}】"); Console.WriteLine($"上位机获取配置的扫码器【IP:{model.ToJson()}》名称:{model.Name}】");
LogInStoreInfoDelegateEvent?.Invoke($"上位机获取配置的扫码器【IP:{model.ToJson()}》名称:{model.Name}】","White"); LogInStoreInfoDelegateEvent?.Invoke($"上位机获取配置的扫码器【IP:{model.ToJson()}》名称:{model.Name}】","White");
//1.根据成品码找货道 //1.根据成品码找货道
List<BaseSpaceInfo>? spaceList = GetSpaceBySNCode(SNCode, recordInstore); List<BaseSpaceInfo> spaceList = GetSpaceBySNCode(SNCode, recordInstore);
Console.WriteLine($"上位机获取配置的货道数量【{spaceList.Count}】"); Console.WriteLine($"上位机获取配置的货道数量【{spaceList.Count}】");
// 根据货道信息判断下发plc信号 // 根据货道信息判断下发plc信号
@ -153,7 +153,7 @@ namespace Aucma.Core.Palletiz.Business
{ {
spaceNumList.Add(int.Parse(finalSpace.SpaceCode.Substring(5, 3))); spaceNumList.Add(int.Parse(finalSpace.SpaceCode.Substring(5, 3)));
spaceNumList.Add(int.Parse(GetOtherSpace(finalSpace, spaceList).SpaceCode.Substring(5, 3))); spaceNumList.Add(int.Parse(GetOtherSpace(finalSpace, spaceList).SpaceCode.Substring(5, 3)));
plcResult = SendAndAnswerPlc(scannerIp, spaceList[0].RotationRange, spaceNumList); plcResult = SendAndAnswerPlc(scannerIp, spaceList[0].RotationRange, 1);
recordInstore.SpaceCode = finalSpace.SpaceCode; recordInstore.SpaceCode = finalSpace.SpaceCode;
recordInstore.StoreCode = finalSpace.StoreCode; recordInstore.StoreCode = finalSpace.StoreCode;
// 更新货道信息,大产品last存objId大的储存上一个货道的主键 如货道7,8存8 // 更新货道信息,大产品last存objId大的储存上一个货道的主键 如货道7,8存8
@ -173,7 +173,7 @@ namespace Aucma.Core.Palletiz.Business
{ {
spaceNumList.Add(int.Parse(finalSpace.SpaceCode.Substring(5, 3))); spaceNumList.Add(int.Parse(finalSpace.SpaceCode.Substring(5, 3)));
spaceNumList.Add(0); spaceNumList.Add(0);
plcResult = SendAndAnswerPlc(scannerIp, finalSpace.RotationRange, spaceNumList); plcResult = SendAndAnswerPlc(scannerIp, finalSpace.RotationRange, 1);
UpdateSapceList(finalSpace.ObjId, spaceList); UpdateSapceList(finalSpace.ObjId, spaceList);
Console.WriteLine("更新货道信息成功!"); Console.WriteLine("更新货道信息成功!");
LogInStoreInfoDelegateEvent?.Invoke("更新货道信息成功!", "White"); LogInStoreInfoDelegateEvent?.Invoke("更新货道信息成功!", "White");
@ -182,7 +182,7 @@ namespace Aucma.Core.Palletiz.Business
{ {
spaceNumList.Add(0); spaceNumList.Add(0);
spaceNumList.Add(int.Parse(finalSpace.SpaceCode.Substring(5, 3))); spaceNumList.Add(int.Parse(finalSpace.SpaceCode.Substring(5, 3)));
plcResult = SendAndAnswerPlc(scannerIp, finalSpace.RotationRange, spaceNumList);//给PLC下传入库信号 plcResult = SendAndAnswerPlc(scannerIp, finalSpace.RotationRange, 1);//给PLC下传入库信号
UpdateSapceList(finalSpace.ObjId, spaceList); UpdateSapceList(finalSpace.ObjId, spaceList);
Console.WriteLine("更新货道信息成功!"); Console.WriteLine("更新货道信息成功!");
LogInStoreInfoDelegateEvent?.Invoke("更新货道信息成功!", "White"); LogInStoreInfoDelegateEvent?.Invoke("更新货道信息成功!", "White");
@ -224,7 +224,7 @@ namespace Aucma.Core.Palletiz.Business
/// </summary> /// </summary>
/// <param name="SNCode"></param> /// <param name="SNCode"></param>
/// <returns></returns> /// <returns></returns>
private List<BaseSpaceInfo>? GetSpaceBySNCode(string SNCode, RecordInStore recordInstore) private List<BaseSpaceInfo> GetSpaceBySNCode(string SNCode, RecordInStore recordInstore)
{ {
try try
{ {
@ -356,7 +356,7 @@ namespace Aucma.Core.Palletiz.Business
/// <param name="range">转向角度</param> /// <param name="range">转向角度</param>
/// <param name="spaceNum">货道号int集合</param> /// <param name="spaceNum">货道号int集合</param>
/// <returns></returns> /// <returns></returns>
private bool SendAndAnswerPlc(string scannerIp, int range, List<int> spaceNum) private bool SendAndAnswerPlc(string scannerIp, int range,int spaceNum)
{ {
bool result = false; bool result = false;
try try
@ -391,10 +391,10 @@ namespace Aucma.Core.Palletiz.Business
/// 下发plc信号 /// 下发plc信号
/// </summary> /// </summary>
/// <param name="obj"></param> /// <param name="obj"></param>
/// <param name="range"></param> /// <param name="range">转向</param>
/// <param name="spaceNum"></param> /// <param name="spaceNum">库数量</param>
/// <returns></returns> /// <returns></returns>
private bool SendPlc(PlcModel obj, int range, List<int> spaceNum) private bool SendPlc(PlcModel obj, int range,int spaceNum)
{ {
try try
{ {
@ -403,24 +403,22 @@ namespace Aucma.Core.Palletiz.Business
DateTime targetTime = DateTime.Now.AddSeconds(8); DateTime targetTime = DateTime.Now.AddSeconds(8);
while (true) while (true)
{ {
if (DateTime.Now > targetTime) // plc超最大时限无反馈 Console.WriteLine($"是否可以下发:【{obj.plc.ReadBool("D1000")}】");
if (obj.plc.ReadBool("D1000"))//如果为true 则可以下发 任务
{ {
logHelper.Error("等待plc放行反馈信号超时"); // 应答字允许下发
Console.WriteLine("等待plc放行反馈信号超时"); int storeNum = GetStoreNum(obj, spaceNum);
return false; Console.WriteLine($"读取当前货道数量:【{storeNum}】");
} if (storeNum == 1)
// 应答字允许下发 {
Console.WriteLine($"读取应答字是否下传成功!【{obj.plc.ReadInt32("D102")}】"); obj.plc.WriteInt32("D7010", range);//旋转角度1=》90 2=>反转90 D2 1正转 2反转
if (obj.plc.ReadInt32("D102") == 1) obj.plc.WriteInt32("D29", spaceNum); //货道号
{ Console.WriteLine($"plc信号货道信号下发成功!【货道号:{spaceNum}");
//obj.plc.WriteInt32("D110", range);//旋转角度暂时不赋值由PLC转向 result = true;
break;
obj.plc.WriteInt32("D112", spaceNum[0]); //货道号 }
obj.plc.WriteInt32("D114", spaceNum[1]); //货道号
Console.WriteLine($"plc信号货道信号下发成功!【D112:{spaceNum[0]}】D114:{spaceNum[1]}");
result = true;
break;
} }
Thread.Sleep(500); Thread.Sleep(500);
} }
return result; return result;
@ -432,6 +430,58 @@ namespace Aucma.Core.Palletiz.Business
} }
} }
public int GetStoreNum(PlcModel obj, int spaceNum)
{
int storeNum = 0;
switch (spaceNum)
{
case 1:
storeNum = obj.plc.ReadInt16("D1001");
break;
case 2:
storeNum = obj.plc.ReadInt16("D1002");
break;
case 3:
storeNum = obj.plc.ReadInt16("D1003");
break;
case 4:
storeNum = obj.plc.ReadInt16("D1004");
break;
case 5:
storeNum = obj.plc.ReadInt16("D1005");
break;
case 6:
storeNum = obj.plc.ReadInt16("D1006");
break;
case 7:
storeNum = obj.plc.ReadInt16("D1007");
break;
case 8:
storeNum = obj.plc.ReadInt16("D1008");
break;
case 9:
storeNum = obj.plc.ReadInt16("D1009");
break;
case 10:
storeNum = obj.plc.ReadInt16("D1010");
break;
case 11:
storeNum = obj.plc.ReadInt16("D1011");
break;
case 12:
storeNum = obj.plc.ReadInt16("D1012");
break;
case 13:
storeNum = obj.plc.ReadInt16("D1013");
break;
case 14:
storeNum = obj.plc.ReadInt16("D1014");
break;
default:
break;
}
return storeNum;
}
#endregion #endregion
#region 等待plc信号反馈 #region 等待plc信号反馈

@ -207,16 +207,8 @@
"EquipName": "InStoreAPlc", "EquipName": "InStoreAPlc",
"PlcType": "Melsec", "PlcType": "Melsec",
"Enabled": true, "Enabled": true,
"IP": "127.0.0.1", "IP": "127.0.0.1", //10.10.92.80
"Port": 6000 "Port": 2015
},
{
"Id": 2,
"EquipName": "InStoreBPlc",
"PlcType": "Melsec",
"Enabled": true,
"IP": "127.0.0.1",
"Port": 6001
} }
], ],
"StoreInfo": { "StoreInfo": {

@ -163,7 +163,7 @@ namespace Aucma.Core.PrintTo.ViewModels
/// 打印 /// 打印
/// </summary> /// </summary>
[RelayCommand] [RelayCommand]
private async void Print(string obj) private void Print(string obj)
{ {
if (string.IsNullOrEmpty(obj)) if (string.IsNullOrEmpty(obj))
{ {
@ -205,8 +205,8 @@ namespace Aucma.Core.PrintTo.ViewModels
PrintIsEnabled = "False"; PrintIsEnabled = "False";
//更新打印名称 //更新打印名称
var baseOrder=await _baseOrderInfoServices.FirstAsync(d=>d.OrderCode== order_code); var baseOrder= _baseOrderInfoServices.FirstAsync(d=>d.OrderCode== order_code).Result;
await _baseOrderInfoServices.UpdatePrintName(baseOrder); _ = _baseOrderInfoServices.UpdatePrintName(baseOrder).Result;
PrintToDevView printToDev = new PrintToDevView(order_code,product_code, product_name, standard_amount, printName,printType); PrintToDevView printToDev = new PrintToDevView(order_code,product_code, product_name, standard_amount, printName,printType);
printToDev.ShowDialog(); printToDev.ShowDialog();
} }

@ -368,6 +368,7 @@ namespace Aucma.Core.PrintTo.ViewModels
var num= _printBarCodeServices.AddAsync(printBarCode).Result; var num= _printBarCodeServices.AddAsync(printBarCode).Result;
if (num<=0) if (num<=0)
{ {
Console.WriteLine($"数据已保存【订单:{printBarCode.OrderCode}》条码:{printBarCode.MaterialBarcode}】");
BarcodesPrinted.Enqueue(BarcodesUnprinted.Dequeue()); BarcodesPrinted.Enqueue(BarcodesUnprinted.Dequeue());
Thread.Sleep(1000); Thread.Sleep(1000);
} }

Loading…
Cancel
Save