..
This commit is contained in:
@@ -102,7 +102,7 @@ namespace Project
|
||||
|
||||
public static Boolean UserAdmin { get { return true; } }
|
||||
|
||||
public static bool OPT_CAMERA(eWorkPort target)
|
||||
public static bool OPT_CAMERA()
|
||||
{
|
||||
var retval = VAR.BOOL[eVarBool.Opt_DisableCamera];
|
||||
if (retval == false)
|
||||
@@ -210,17 +210,11 @@ namespace Project
|
||||
|
||||
public static bool UpdateWMS(Class.VisionData Data)
|
||||
{
|
||||
return false;
|
||||
PUB.log.AddE("updatewms wms 데이터베이스 기록 연결해야 함(아세테크)");
|
||||
return true;
|
||||
}
|
||||
public static bool SelectModelV(string modelName, bool bUploadConfig = true)
|
||||
{
|
||||
//
|
||||
//if (this.InvokeRequired)
|
||||
//{
|
||||
// this.Invoke(new SelectModelHandler(SelectModelV), new object[] { modelName, bUploadConfig });
|
||||
// return;
|
||||
//}
|
||||
|
||||
//Initialize
|
||||
PUB.Result.vModel.Title = string.Empty;
|
||||
PUB.PrinterL.ZPLFileName = UTIL.MakePath("Data", "zpl.txt"); //Set as default file
|
||||
@@ -302,9 +296,9 @@ namespace Project
|
||||
public static bool MemLoadBarcodeConfig(Device.KeyenceBarcode keyence)
|
||||
{
|
||||
var BarcodeMemoryNo = PUB.Result.vModel.BSave;
|
||||
if (BarcodeMemoryNo < 0)
|
||||
if (BarcodeMemoryNo < 1)
|
||||
{
|
||||
PUB.log.AddAT($"The currently selected model does not have a barcode memory number specified.");
|
||||
PUB.log.AddAT($"The currently selected model does not have a barcode memory number (BSAVE) specified.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -322,9 +316,11 @@ namespace Project
|
||||
{
|
||||
//접속되어잇ㅇ츠면 끈다
|
||||
var isTriggeronL = keyence.IsTriggerOn;
|
||||
var tagstr = keyence?.Tag ?? string.Empty;
|
||||
if (keyence.IsConnect)
|
||||
{
|
||||
keyence.Trigger(false);
|
||||
PUB.log.Add($"[{tagstr}] Send BLoad({BarcodeMemoryNo})");
|
||||
keyence.BLoad(BarcodeMemoryNo);
|
||||
}
|
||||
|
||||
@@ -825,6 +821,8 @@ namespace Project
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case "LOT":
|
||||
case "VLOT":
|
||||
if (vdata.VLOT.isEmpty())
|
||||
{
|
||||
@@ -958,6 +956,9 @@ namespace Project
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
PUB.log.AddAT($"Unknown RegEx Target Name : {TargetPos}");
|
||||
break;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
@@ -1731,24 +1732,99 @@ namespace Project
|
||||
|
||||
public static string GetErrorMessage(eECode err, params object[] args)
|
||||
{
|
||||
string ermsg = string.Empty;// $"[E{(int)err}] ";
|
||||
var dr = PUB.mdm.dataSet.ErrorDescription.Where(t => t.Idx == (short)err).FirstOrDefault();
|
||||
if (dr != null)
|
||||
string ermsg = string.Empty;
|
||||
string description = string.Empty;
|
||||
|
||||
// Get error description using switch statement with hardcoded messages
|
||||
switch (err)
|
||||
{
|
||||
//자료는 있으나 사용자가 입력하지 않은 상태
|
||||
if (dr.Description.isEmpty()) ermsg += "NO ERROR DESCRIPTION\nERR:" + err.ToString() + "\n{0}";
|
||||
else ermsg += dr.Description.Replace("\\n", "\n");
|
||||
case eECode.EMERGENCY:
|
||||
description = "Emergency stop activated\nPlease check the emergency button and reset";
|
||||
break;
|
||||
case eECode.NOMODELV:
|
||||
description = "Vision model not found\nPlease load or create a vision model";
|
||||
break;
|
||||
case eECode.NOMODELM:
|
||||
description = "Motion model not found\nPlease load or create a motion model";
|
||||
break;
|
||||
case eECode.HOME_TIMEOUT:
|
||||
description = "Home position timeout\nMotor failed to reach home position within timeout period";
|
||||
break;
|
||||
case eECode.NOFUNCTION:
|
||||
description = "Function not available\nThe requested function is not implemented";
|
||||
break;
|
||||
case eECode.DOOFF:
|
||||
description = "Digital output OFF failed\n{0}";
|
||||
break;
|
||||
case eECode.DOON:
|
||||
description = "Digital output ON failed\n{0}";
|
||||
break;
|
||||
case eECode.DIOFF:
|
||||
description = "Waiting for digital input OFF\n{0}";
|
||||
break;
|
||||
case eECode.DION:
|
||||
description = "Waiting for digital input ON\n{0}";
|
||||
break;
|
||||
case eECode.MESSAGE_INFO:
|
||||
description = "Information: {0}";
|
||||
break;
|
||||
case eECode.MESSAGE_ERROR:
|
||||
description = "Error: {0}";
|
||||
break;
|
||||
case eECode.AZJINIT:
|
||||
description = "Motion controller initialization failed\nPlease check the motion card connection";
|
||||
break;
|
||||
case eECode.MOT_SVOFF:
|
||||
description = "Motor servo is OFF\nPlease turn on the servo motor";
|
||||
break;
|
||||
case eECode.MOT_CMD:
|
||||
description = "Motion command error\n{0}";
|
||||
break;
|
||||
case eECode.USER_STOP:
|
||||
description = "User stop requested\nOperation stopped by user";
|
||||
break;
|
||||
case eECode.USER_STEP:
|
||||
description = "Step mode active\nPress continue to proceed";
|
||||
break;
|
||||
case eECode.POSITION_ERROR:
|
||||
description = "Position error\nAxis is not at the expected position\n{0}";
|
||||
break;
|
||||
case eECode.MOTIONMODEL_MISSMATCH:
|
||||
description = "Motion model mismatch\nThe loaded motion model does not match the system configuration";
|
||||
break;
|
||||
case eECode.VISCONF:
|
||||
description = "Vision configuration error\nPlease check vision system settings";
|
||||
break;
|
||||
|
||||
case eECode.PRINTER:
|
||||
description = "Printer error\nPlease check the printer connection and status\n{0}";
|
||||
break;
|
||||
case eECode.QRDATAMISSMATCHL:
|
||||
description = "Left QR data mismatch\nThe QR code data does not match expected format\n{0}";
|
||||
break;
|
||||
case eECode.QRDATAMISSMATCHR:
|
||||
description = "Right QR data mismatch\nThe QR code data does not match expected format\n{0}";
|
||||
break;
|
||||
case eECode.MOTX_SAFETY:
|
||||
description = "Motion X-axis safety error\nSafety condition violated for X-axis movement";
|
||||
break;
|
||||
|
||||
default:
|
||||
description = $"Unknown error code: {err}\n{{0}}";
|
||||
break;
|
||||
}
|
||||
else ermsg = "NO ERROR DATA\nERR:" + err.ToString() + "\n{0}"; //자료자체를 찾을 수 없다
|
||||
|
||||
// Format the message with any provided arguments
|
||||
try
|
||||
{
|
||||
var newermsg = string.Format(ermsg, args);
|
||||
ermsg = newermsg;
|
||||
ermsg = string.Format(description, args);
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch
|
||||
{
|
||||
|
||||
// If formatting fails, just use the description as is
|
||||
ermsg = description;
|
||||
}
|
||||
|
||||
return ermsg;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user