Commit 9c954c62 刘韬

1

1 个父辈 a3ea18af
...@@ -244,6 +244,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -244,6 +244,7 @@ namespace OnlineStore.AutoInOutStore
this.toolStripSeparator16.Visible = StoreManager.HasDisableDoorControl; this.toolStripSeparator16.Visible = StoreManager.HasDisableDoorControl;
this.toolStripSeparator18.Visible = StoreManager.HasDisableDoorControl; this.toolStripSeparator18.Visible = StoreManager.HasDisableDoorControl;
txtTempPort.Text = store.Config.Humiture_Port; txtTempPort.Text = store.Config.Humiture_Port;
chbDebug.Checked = store.IsDebug;
LoadOk = true; LoadOk = true;
// cmbHomeType.SelectedIndex = 1; // cmbHomeType.SelectedIndex = 1;
timer1.Start(); timer1.Start();
...@@ -1275,6 +1276,10 @@ namespace OnlineStore.AutoInOutStore ...@@ -1275,6 +1276,10 @@ namespace OnlineStore.AutoInOutStore
return; return;
} }
IOManager.IOMove(IO_Type.CameraLight_Power, IO_VALUE.HIGH); IOManager.IOMove(IO_Type.CameraLight_Power, IO_VALUE.HIGH);
if (Camera._cam != null)
{
Camera._cam.CloseAll();
}
CodeLibrary.FrmCodeDecode frm = new FrmCodeDecode(); CodeLibrary.FrmCodeDecode frm = new FrmCodeDecode();
frm.chbZxing.Checked = false; frm.chbZxing.Checked = false;
frm.ShowDialog(); frm.ShowDialog();
......
...@@ -53,6 +53,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -53,6 +53,7 @@ namespace OnlineStore.AutoInOutStore
[STAThread] [STAThread]
static void Main(string[] Args) static void Main(string[] Args)
{ {
Environment.CurrentDirectory = Application.StartupPath;
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
...@@ -94,6 +95,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -94,6 +95,7 @@ namespace OnlineStore.AutoInOutStore
if (!isShow) if (!isShow)
{ {
XmlConfigurator.Configure(); XmlConfigurator.Configure();
Environment.CurrentDirectory = Application.StartupPath;
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
#if PositionTool #if PositionTool
......
...@@ -1215,4 +1215,7 @@ ...@@ -1215,4 +1215,7 @@
<data name="FrmStoreBox_tabPage6_Text" xml:space="preserve"> <data name="FrmStoreBox_tabPage6_Text" xml:space="preserve">
<value>Storage Adjust</value> <value>Storage Adjust</value>
</data> </data>
<data name="FrmStoreBox_tabPage6_Text1" xml:space="preserve">
<value>Storage location</value>
</data>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -1215,4 +1215,7 @@ ...@@ -1215,4 +1215,7 @@
<data name="InstoreInfo" xml:space="preserve"> <data name="InstoreInfo" xml:space="preserve">
<value> マルチ入出庫情報:入庫: </value> <value> マルチ入出庫情報:入庫: </value>
</data> </data>
<data name="FrmStoreBox_tabPage6_Text" xml:space="preserve">
<value>ロケーションデバッグ</value>
</data>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -19,7 +19,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -19,7 +19,7 @@ namespace OnlineStore.AutoInOutStore
{ {
public class ResourceCulture public class ResourceCulture
{ {
public static bool ShowLog = false ; public static bool ShowLog = true ;
public static string China = "zh-CN"; public static string China = "zh-CN";
public static string English = "en-US"; public static string English = "en-US";
public static string German = "ge-DE"; public static string German = "ge-DE";
......
...@@ -74,7 +74,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -74,7 +74,7 @@ namespace OnlineStore.DeviceLibrary
aioBox = new AIOBOX("AIOBOX"); aioBox = new AIOBOX("AIOBOX");
aioBox.SetType(Asa.IOModule.Box_Type.DI, DILength, Asa.IOModule.Box_Type.DO, DOLength); aioBox.SetType(Asa.IOModule.Box_Type.DI, DILength, Asa.IOModule.Box_Type.DO, DOLength);
aioBox.IP = ioIp; aioBox.IP = ioIp;
aioBox.Upload = false; aioBox.Upload = true;
aioBox.DI_Changed_Event += AioBox_DI_Changed_Event; aioBox.DI_Changed_Event += AioBox_DI_Changed_Event;
aioBox.DO_Changed_Event += AioBox_DO_Changed_Event; aioBox.DO_Changed_Event += AioBox_DO_Changed_Event;
......
...@@ -23,7 +23,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -23,7 +23,7 @@ namespace OnlineStore.DeviceLibrary
{ {
checkTimer = new System.Timers.Timer(); checkTimer = new System.Timers.Timer();
checkTimer.AutoReset = true; checkTimer.AutoReset = true;
checkTimer.Interval += 10; checkTimer.Interval += 30;
checkTimer.Elapsed += CheckTimer_Elapsed; checkTimer.Elapsed += CheckTimer_Elapsed;
checkTimer.Enabled = false; checkTimer.Enabled = false;
} }
......
...@@ -157,15 +157,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -157,15 +157,16 @@ namespace OnlineStore.DeviceLibrary
DateTime startTime = DateTime.Now; DateTime startTime = DateTime.Now;
LogUtil.info( " 【" + cameraName + "】开始取图片"); LogUtil.info( " 【" + cameraName + "】开始取图片");
HalconDotNet.HObject ho_Image = null; HalconDotNet.HObject ho_Image = null;
Bitmap bit=null;
try try
{ {
ho_Image = Camera._cam.CaptureOnImage(cameraName); ho_Image = Camera._cam.CaptureOnImage(cameraName,out bit,true);
if (ho_Image == null) //if (ho_Image == null)
{ //{
LogUtil.error( " 【" + cameraName + "】取图片失败[" + Camera._cam.ErrInfo + "],关闭相机"); // LogUtil.error( " 【" + cameraName + "】取图片失败[" + Camera._cam.ErrInfo + "],关闭相机");
CloseCamera(cameraName); // CloseCamera(cameraName);
continue; // continue;
} //}
LogUtil.info( " 【" + cameraName + "】取图片完成,开始扫码"); LogUtil.info( " 【" + cameraName + "】取图片完成,开始扫码");
List<CodeInfo> cc = new List<CodeInfo>(); List<CodeInfo> cc = new List<CodeInfo>();
string r = ""; string r = "";
...@@ -196,11 +197,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -196,11 +197,12 @@ namespace OnlineStore.DeviceLibrary
codeCount = QRCodeCount, codeCount = QRCodeCount,
timeout = 3000 timeout = 3000
}; };
cc = RemoteDecodeHelper.DecodeRequest(ho_Image, remoteDecodeParam); cc = RemoteDecodeHelper.DecodeRequest(bit, remoteDecodeParam);
if (cc==null) if (cc==null || cc.Count==0)
{ {
cc = new List<CodeInfo>(); cc = new List<CodeInfo>();
// SaveImageToFile(deviceName, cameraName, bit); SaveImageToFile("MIMO", cameraName, bit);
LogUtil.info(" 【" + cameraName + "】" + " 扫码失败"); LogUtil.info(" 【" + cameraName + "】" + " 扫码失败");
} }
foreach (CodeInfo c in cc) foreach (CodeInfo c in cc)
...@@ -213,6 +215,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -213,6 +215,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
LogUtil.info( " 【" + cameraName + "】"+ " 扫码完成【" + FormUtil.GetSpanStr(DateTime.Now - startTime) + "】 :" + r); LogUtil.info( " 【" + cameraName + "】"+ " 扫码完成【" + FormUtil.GetSpanStr(DateTime.Now - startTime) + "】 :" + r);
} }
catch (AccessViolationException e) catch (AccessViolationException e)
{ {
...@@ -230,6 +233,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -230,6 +233,8 @@ namespace OnlineStore.DeviceLibrary
{ {
ho_Image.Dispose(); ho_Image.Dispose();
} }
if (bit != null)
bit.Dispose();
} }
} }
} }
......
...@@ -1274,7 +1274,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1274,7 +1274,7 @@ namespace OnlineStore.DeviceLibrary
try try
{ {
TimeSpan span = DateTime.Now - preProTime; TimeSpan span = DateTime.Now - preProTime;
if (span.TotalSeconds < 10) if (span.TotalSeconds < 2)
{ {
return; return;
} }
...@@ -1513,7 +1513,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1513,7 +1513,7 @@ namespace OnlineStore.DeviceLibrary
} }
public void LoguStatus() public void LoguStatus()
{ {
LogUtil.error(StoreName + "当前状态:" + "isInSuddenDown[" + isInSuddenDown + "],isNoAirCheck[" + isNoAirCheck + "]," + "StoreMove.MoveType[" + StoreMove.MoveType + "],storeRunStatus[" + storeRunStatus + "]", 106); LogUtil.error(StoreName + "当前状态:" + $"lastPosId[{lastPosId}], isInSuddenDown[" + isInSuddenDown + "],isNoAirCheck[" + isNoAirCheck + "]," + "StoreMove.MoveType[" + StoreMove.MoveType + "],storeRunStatus[" + storeRunStatus + "]", 106);
} }
#region 温湿度处理 #region 温湿度处理
...@@ -1743,10 +1743,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -1743,10 +1743,6 @@ namespace OnlineStore.DeviceLibrary
{ {
boxStatus.status = (int)StoreStatus.Debugging; boxStatus.status = (int)StoreStatus.Debugging;
} }
else if (storeStatus.Equals(StoreStatus.OutStoreBoxEnd) || storeStatus.Equals(StoreStatus.InStoreEnd))
{
boxStatus.data.Add(ParamDefine.posId, lastPosId);
}
else if (!lastPosId.Equals("")) else if (!lastPosId.Equals(""))
{ {
boxStatus.data.Add(ParamDefine.posId, lastPosId); boxStatus.data.Add(ParamDefine.posId, lastPosId);
...@@ -1757,6 +1753,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -1757,6 +1753,10 @@ namespace OnlineStore.DeviceLibrary
} }
lastPosId = ""; lastPosId = "";
} }
else if (storeStatus.Equals(StoreStatus.OutStoreBoxEnd) || storeStatus.Equals(StoreStatus.InStoreEnd))
{
boxStatus.data.Add(ParamDefine.posId, lastPosId);
}
ASTemperateParam param = HumitureController.LastData; ASTemperateParam param = HumitureController.LastData;
if (param != null) if (param != null)
......
...@@ -554,7 +554,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -554,7 +554,7 @@ namespace OnlineStore.DeviceLibrary
lastPosIdStatus = StoreStatus.InStoreEnd; lastPosIdStatus = StoreStatus.InStoreEnd;
storeStatus = StoreStatus.InStoreEnd; storeStatus = StoreStatus.InStoreEnd;
//手动发给服务器状态,防止没有手动 //手动发给服务器状态,防止没有手动
//Task.Factory.StartNew(delegate { SendLineStatus(); }); Task.Run(delegate { SendLineStatus(); });
StoreMove.NextMoveStep(StoreMoveStep.SI_12_PutWareToBag); StoreMove.NextMoveStep(StoreMoveStep.SI_12_PutWareToBag);
ComMoveToPosition(moveP.ComPress_P3, Config.CompAxis_P3_Speed); ComMoveToPosition(moveP.ComPress_P3, Config.CompAxis_P3_Speed);
...@@ -1088,9 +1088,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -1088,9 +1088,11 @@ namespace OnlineStore.DeviceLibrary
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : ""; string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : "";
storeStatus = StoreStatus.StoreOnline; storeStatus = StoreStatus.StoreOnline;
LogUtil.info(LOGGER, "【" + posId + "】出库结束,耗时【" + FormUtil.GetSpanStr(InOutWatch.Elapsed) + "】累积出库: " + AutomaticBaiting.BatchOutStoreCount + "盘共" + AutomaticBaiting.BatchOutStoreHeight + "mm"); LogUtil.info(LOGGER, "【" + posId + "】出库结束,耗时【" + FormUtil.GetSpanStr(InOutWatch.Elapsed) + "】累积出库: " + AutomaticBaiting.BatchOutStoreCount + "盘共" + AutomaticBaiting.BatchOutStoreHeight + "mm");
StoreMove.EndMove(); StoreMove.EndMove();
preProTime = DateTime.Now; preProTime = DateTime.Now;
storeRunStatus = StoreRunStatus.Runing; storeRunStatus = StoreRunStatus.Runing;
lastPosId = "";
InOutEndProcess(posId,StoreMoveType.OutStore); InOutEndProcess(posId,StoreMoveType.OutStore);
} }
......
...@@ -344,7 +344,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -344,7 +344,7 @@ namespace OnlineStore.DeviceLibrary
} }
if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I01_Wait)) if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I01_Wait))
{ {
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I02_MoveToUp); StoreMove.NextMoveStep(StoreMoveStep.AUTO_I02_MoveToDown);
if (IOManager.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH)) if (IOManager.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH))
{ {
InStoreLog(" 已检测到料盘,轴不需要上升"); InStoreLog(" 已检测到料盘,轴不需要上升");
...@@ -355,6 +355,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -355,6 +355,21 @@ namespace OnlineStore.DeviceLibrary
ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_P3, StoreManager.Config.Batch_Axis.TargetSpeed, IO_Type.TrayCheck_LoadMaterial); ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_P3, StoreManager.Config.Batch_Axis.TargetSpeed, IO_Type.TrayCheck_LoadMaterial);
} }
} }
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I02_MoveToDown))
{
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I02_MoveReUp);
int currBatchValue = ACServerManager.GetActualtPosition(StoreManager.Config.Batch_Axis.DeviceName, StoreManager.Config.Batch_Axis.GetAxisValue());
var tatget = currBatchValue - AutomaticBaiting.AxisChangeValue * 15;
InStoreLog($" 轴下降15mm,curr:{currBatchValue},target:{tatget}");
ACAxisAbsMove(StoreManager.Config.Batch_Axis, tatget, StoreManager.Config.BatchAxis_P1_Speed);
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I02_MoveReUp))
{
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I02_MoveToUp);
InStoreLog(" 轴重新上升到检测到料盘,速度【" + StoreManager.Config.BatchAxis_SlowSpeed + "】");
ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_P3, StoreManager.Config.BatchAxis_SlowSpeed, IO_Type.TrayCheck_LoadMaterial);
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I02_MoveToUp)) else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I02_MoveToUp))
{ {
IsNeedScanCode(); IsNeedScanCode();
...@@ -676,7 +691,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -676,7 +691,7 @@ namespace OnlineStore.DeviceLibrary
{ {
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I02_MoveToUp); StoreMove.NextMoveStep(StoreMoveStep.AUTO_I02_MoveToUp);
InStoreLog(" 轴上升到检测到料盘,速度【" + StoreManager.Config.Batch_Axis.TargetSpeed + "】"); InStoreLog(" 轴上升到检测到料盘,速度【" + StoreManager.Config.Batch_Axis.TargetSpeed + "】");
ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_P3, StoreManager.Config.Batch_Axis.TargetSpeed, IO_Type.TrayCheck_LoadMaterial); ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_P3, StoreManager.Config.BatchAxis_SlowSpeed, IO_Type.TrayCheck_LoadMaterial);
} }
} }
......
...@@ -506,6 +506,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -506,6 +506,8 @@ namespace OnlineStore.DeviceLibrary
#endregion #endregion
#region 自动上下料上料功能 #region 自动上下料上料功能
AUTO_I02_MoveToDown,
AUTO_I02_MoveReUp,
/// <summary> /// <summary>
/// 开始自动上料 /// 开始自动上料
/// </summary> /// </summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!