Commit 187fca30 刘韬

稳定版本

1 个父辈 c4a95896
...@@ -6,6 +6,7 @@ using System.Drawing; ...@@ -6,6 +6,7 @@ using System.Drawing;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Runtime.ExceptionServices;
using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Serialization.Formatters.Binary;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
...@@ -102,6 +103,7 @@ namespace DeviceLibrary ...@@ -102,6 +103,7 @@ namespace DeviceLibrary
/// <param name="Label_R_Offset">贴标臂偏移</param> /// <param name="Label_R_Offset">贴标臂偏移</param>
/// <param name="labelAngle">贴标角度</param> /// <param name="labelAngle">贴标角度</param>
/// <returns></returns> /// <returns></returns>
[HandleProcessCorruptedStateExceptions]
public static Point CalcLabelPoint(ReelParam labelParam, Point org, int Label_R_Offset, int Label_R_Angle_Diff, out int labelAngle) public static Point CalcLabelPoint(ReelParam labelParam, Point org, int Label_R_Offset, int Label_R_Angle_Diff, out int labelAngle)
{ {
...@@ -115,7 +117,14 @@ namespace DeviceLibrary ...@@ -115,7 +117,14 @@ namespace DeviceLibrary
Bitmap srcbitmap; Bitmap srcbitmap;
if (BitmapCache.HasBmp(labelParam.bitmapfilename)) if (BitmapCache.HasBmp(labelParam.bitmapfilename))
{ {
try
{
srcbitmap = BitmapCache.GetBmp(labelParam.bitmapfilename); srcbitmap = BitmapCache.GetBmp(labelParam.bitmapfilename);
var w=srcbitmap.Width;
}
catch {
srcbitmap = new Bitmap(3648, 3648);
}
} }
else else
{ {
......
...@@ -248,6 +248,8 @@ namespace DeviceLibrary ...@@ -248,6 +248,8 @@ namespace DeviceLibrary
} }
public void Stop() { public void Stop() {
mstart = false; mstart = false;
PrintJob = null;
CurrentPrintJob = null;
ServerCM.StopConnectServer(); ServerCM.StopConnectServer();
Thread.Sleep(300); Thread.Sleep(300);
Alarm(AlarmType.None); Alarm(AlarmType.None);
...@@ -349,6 +351,7 @@ namespace DeviceLibrary ...@@ -349,6 +351,7 @@ namespace DeviceLibrary
OutCarMoveInfo.NewMove(MoveStep.Wait); OutCarMoveInfo.NewMove(MoveStep.Wait);
OutMoveInfo.NewMove(MoveStep.Wait); OutMoveInfo.NewMove(MoveStep.Wait);
LabelMoveInfo.NewMove(MoveStep.Wait); LabelMoveInfo.NewMove(MoveStep.Wait);
PrintMoveInfo.NewMove(MoveStep.Wait);
CylinderMove(ResetMoveInfo, IO_Type.Counting_EnterDoor_Close, IO_Type.Counting_EnterDoor_Open, IO_VALUE.LOW); CylinderMove(ResetMoveInfo, IO_Type.Counting_EnterDoor_Close, IO_Type.Counting_EnterDoor_Open, IO_VALUE.LOW);
CylinderMove(ResetMoveInfo, IO_Type.Counting_ExitDoor_Close, IO_Type.Counting_ExitDoor_Open, IO_VALUE.LOW); CylinderMove(ResetMoveInfo, IO_Type.Counting_ExitDoor_Close, IO_Type.Counting_ExitDoor_Open, IO_VALUE.LOW);
if (IOValue(IO_Type.Counting_Reel_Check).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.Counting_Reel_Check).Equals(IO_VALUE.HIGH))
......
...@@ -22,7 +22,7 @@ namespace DeviceLibrary ...@@ -22,7 +22,7 @@ namespace DeviceLibrary
CountMoveInfo.log("打印时 Code:" + String.Join("##", cc)); CountMoveInfo.log("打印时 Code:" + String.Join("##", cc));
} }
readonly MoveInfo PrintMoveInfo = new MoveInfo("", false); readonly MoveInfo PrintMoveInfo = new MoveInfo("打印机", false);
ReelParam PrintJob = null; ReelParam PrintJob = null;
ReelParam CurrentPrintJob = null; ReelParam CurrentPrintJob = null;
Task<(bool, string)> PrintTask = null; Task<(bool, string)> PrintTask = null;
...@@ -51,7 +51,7 @@ namespace DeviceLibrary ...@@ -51,7 +51,7 @@ namespace DeviceLibrary
case MoveStep.Print_02: case MoveStep.Print_02:
if (PrintTask.IsCompleted) if (PrintTask.IsCompleted)
{ {
var (result,msg) = PrintTask.Result; var (result, msg) = PrintTask.Result;
if (result) if (result)
{ {
PrintMoveInfo.NextMoveStep(MoveStep.Print_04); PrintMoveInfo.NextMoveStep(MoveStep.Print_04);
...@@ -66,6 +66,9 @@ namespace DeviceLibrary ...@@ -66,6 +66,9 @@ namespace DeviceLibrary
PrintMoveInfo.log("打印失败,再次打印"); PrintMoveInfo.log("打印失败,再次打印");
} }
} }
else if (PrintMoveInfo.IsTimeOut(30)) {
Msg.add("打印标签超时请检查打印机状态", MsgLevel.alarm);
}
break; break;
case MoveStep.Print_04: case MoveStep.Print_04:
PrintMoveInfo.NextMoveStep(MoveStep.Print_WaitTakeLabel); PrintMoveInfo.NextMoveStep(MoveStep.Print_WaitTakeLabel);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!