Commit c29a02c2 LN

上传结果bug修改

1 个父辈 7e43b5c1
......@@ -31,7 +31,7 @@ namespace OnlineStore.DeviceLibrary
public string LastXRayState = "未知";
public bool InXWork = false;
//private string path_XRAY = Application.StartupPath + @"\XRAY";
private string path_XRAY = Application.StartupPath + @"\XRAY\";
private string path1_tif = Application.StartupPath + @"\XRAY\tif";
private string path2_png = Application.StartupPath + @"\XRAY\png";
private string path3_out = Application.StartupPath + @"\XRAY\out";
......
......@@ -115,6 +115,7 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(StepEnum.XW06_WaitTime);
Work_ReelInfo = In_ReelInfo.GetReelInfo();
MoveInfo.MoveParam.SetReelInfo(Work_ReelInfo);
In_ReelInfo = new ReelInfo();
WorkLog("料盘处理:更新Work_ReelInfo【" + Work_ReelInfo.ToStr() + "】,清空 In_ReelInfo,再转动2秒钟");
......@@ -174,8 +175,8 @@ namespace OnlineStore.DeviceLibrary
WorkLog("点料:未启用X射线点料,模拟点料结果:" + count + "");
if (Work_ReelInfo.WareCount <= 0)
{
MoveInfo.MoveParam.WareCount = count;
Work_ReelInfo.WareCount = count;
MoveInfo.MoveParam.SetReelInfo(Work_ReelInfo);
}
}
else if (IOValue(IO_Type.X_Lock_On).Equals(IO_VALUE.HIGH))
......@@ -280,6 +281,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.IsStep(StepEnum.XW27_OutDoorClose))
{
runStatus = RobotRunStatus.Runing;
MoveInfo.EndMove();
WorkLog("料盘处理:料盘处理结束");
// MoveInfo.NextMoveStep(StepEnum.XW28_EndPro);
......@@ -287,6 +289,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StepEnum.XW28_EndPro))
{
MoveInfo.EndMove();
runStatus = RobotRunStatus.Runing;
}
}
......@@ -311,7 +314,7 @@ namespace OnlineStore.DeviceLibrary
}
MoveInfo.NextMoveStep(StepEnum.XW13_GetXRayImage);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(8000));
WorkLog("点料:清理"+path1_tif+"内容,开始获取X射线图形 ");
WorkLog("点料:清理" + path1_tif + "内容,开始获取X射线图形 ");
string lastData = DateTime.Now.ToString("yyyy-MM-dd");
ConfigAppSettings.SaveValue(Setting_Init.XRay_Data, lastData);
......@@ -320,10 +323,19 @@ namespace OnlineStore.DeviceLibrary
carerayImage.WindowWidth = Config.WindowWidth;
carerayImage.WindowLevel = Config.WindowLevel;
Bitmap bmp = carerayImage.Get48bImage();
lastFileName= DateTime.Now.ToString("yyyyMMddHHmmss") + ".png";
string fileP = path1_tif +@"\"+ lastFileName;
lastFileName = DateTime.Now.ToString("yyyyMMddHHmmss") + ".png";
string fileP = path1_tif + @"\" + lastFileName;
bmp.Save(fileP, System.Drawing.Imaging.ImageFormat.Png);
WorkLog("点料:获取X射线图形,保存到: " + fileP + ",记录时间" + lastData + ",停止X射线");
string backFile = path_XRAY + lastFileName;
try
{
bmp.Save(backFile, System.Drawing.Imaging.ImageFormat.Png);
}
catch (Exception ex)
{
LogUtil.error("X图片备份到【" + backFile + "】错误:" + ex.ToString());
}
WorkLog("点料:获取X射线图形,保存到: " + fileP + ",备份到:" + backFile + ",记录时间" + lastData + ",停止X射线");
GetImageEvent?.Invoke(bmp);
bool result = xRay.Stop();
if (!result)
......@@ -346,7 +358,7 @@ namespace OnlineStore.DeviceLibrary
return;
}
MoveInfo.NextMoveStep(StepEnum.XW15_GetResult);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(9000));
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(15000));
if (xRay.IsRayOpen)
{
xRay.Stop();
......@@ -360,16 +372,10 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.MoveParam.WareCount = count;
Work_ReelInfo.WareCount = count;
}
Task.Factory.StartNew(delegate
{
string msg = "暂不上传";
// string msg= SServerManager.Return_Material(Name, MoveInfo.MoveParam.WareCode, Work_ReelInfo.WareCount);
if (!String.IsNullOrEmpty(msg))
string outF = path3_out + @"\" + lastFileName;
try
{
LogUtil.error(Name + "上传【" + MoveInfo.MoveParam.OutStr() + "】点料结果失败:" + msg);
}
});
string outF = path3_out +@"\"+ lastFileName;
if (System.IO.File.Exists(outF))
{
WorkLog("点料:读取结果图片【" + outF + "】");
......@@ -380,6 +386,20 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil.error("点料:未找到结果图片【" + outF + "】");
}
}
catch (Exception ex)
{
LogUtil.error("读取结果图片【" + outF + "】出错:" + ex.ToString());
}
Task.Factory.StartNew(delegate
{
// string msg = "暂不上传";
string msg = SServerManager.Return_Material(Name, Work_ReelInfo.WareCode, Work_ReelInfo.WareCount);
if (!String.IsNullOrEmpty(msg))
{
LogUtil.error(Name + "上传【" + Work_ReelInfo.ToStr() + "】点料结果失败:" + msg);
}
});
MoveInfo.EndStepWait();
}
private void ClearFilePath()
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!