Commit 9c954c62 刘韬

1

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