|
@@ -1,5 +1,6 @@
|
|
|
|
|
|
using Microsoft.DwayneNeed.Shapes;
|
|
|
+using Mysqlx.Session;
|
|
|
using Newtonsoft.Json;
|
|
|
using NPOI.POIFS.Crypt.Dsig.Facets;
|
|
|
using NPOI.SS.Formula.Functions;
|
|
@@ -227,6 +228,8 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
{
|
|
|
_Lbls = GetLabes(CustomerEnv.SortingMacConfigValue.CycFilePath);
|
|
|
Labels = new ObservableCollection<LabelModel>(_Lbls);
|
|
|
+ ExistSmallBoard();
|
|
|
+
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -244,10 +247,11 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
CuttingMac.READ_plc_register(7200, 7240, out ncName);
|
|
|
var path = CycFilePath(ncName);
|
|
|
CuttingMac.WRITE_plc_register(7200, 7240, new int[41]);
|
|
|
- if (path != null)
|
|
|
+ if (File.Exists(path))
|
|
|
{
|
|
|
_Lbls = GetLabes(path);
|
|
|
Labels = new ObservableCollection<LabelModel>(_Lbls);
|
|
|
+ ExistSmallBoard();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -407,6 +411,8 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
{
|
|
|
System.Threading.Thread.Sleep(1000);
|
|
|
GetListenReg(Tag_SortFinish).SetBit();
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
CurrentLabel.Status = Models.TaskStatus.Excuting;
|
|
|
|
|
@@ -439,7 +445,7 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
log.Info($"相机计算的偏差值为:X={_lbl.X},Y={_lbl.Y},R={_lbl.R}");
|
|
|
_lbl.X += CustomerEnv.SortingMacConfigValue.XCameraOffset;
|
|
|
}
|
|
|
- else
|
|
|
+ else
|
|
|
{
|
|
|
if (MessageBox.Show("连接相机失败,是否继续执行?", "相机数据", MessageBoxButton.YesNo) == MessageBoxResult.No)
|
|
|
{
|
|
@@ -540,6 +546,8 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
//{
|
|
|
// releaseXOffset -= 200;
|
|
|
//}
|
|
|
+ //都放在输送辊中心点,无需偏移
|
|
|
+ BoardInfo.ReleaseY = 0;
|
|
|
GetListenReg(Tag_CaptureX).WriteObject(null,
|
|
|
moveX + (float)xOffset, //D1512
|
|
|
moveY + (float)yOffset, //D1514
|
|
@@ -573,6 +581,17 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
|
|
|
//}
|
|
|
}
|
|
|
+ else if (reg.Comment.Variable == Tag_LastBoardPutOK && reg.Value == 1)
|
|
|
+ {
|
|
|
+ if (GetListenReg(Tag_SmallBoardManualConfirm).Value == 1)
|
|
|
+ {
|
|
|
+ if (MessageBox.Show("存在小板,请人工取走后点击确认按钮") == MessageBoxResult.OK)
|
|
|
+ {
|
|
|
+ GetListenReg(Tag_SmallBoardManualConfirm).ResetBit();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ reg.ResetBit();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -629,6 +648,25 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
return CustomerEnv.SortingMacConfigValue.CycFolder + $@"\{fileName}";
|
|
|
}
|
|
|
|
|
|
+ public void ExistSmallBoard()
|
|
|
+ {
|
|
|
+ var smallBoard = Labels.Where(t => Math.Min(t.ActualWidth, t.ActualLength) <= 80 ||
|
|
|
+ Math.Max(t.ActualWidth, t.ActualLength) <= 250).ToList();
|
|
|
+ if (smallBoard != null && smallBoard.Count > 0)
|
|
|
+ {
|
|
|
+ foreach (var t in smallBoard)
|
|
|
+ {
|
|
|
+ t.Status = Models.TaskStatus.Finished;
|
|
|
+ }
|
|
|
+ GetListenReg(Tag_SmallBoardManualConfirm).SetBit();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ GetListenReg(Tag_SmallBoardManualConfirm).ResetBit();
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
///
|
|
|
/// </summary>
|