Commit 38518ea8 LN

获取图片更新,增加验证

1 个父辈 033376d3
...@@ -197,6 +197,8 @@ ...@@ -197,6 +197,8 @@
// //
this.chbOpenX.AutoSize = true; this.chbOpenX.AutoSize = true;
this.chbOpenX.BackColor = System.Drawing.Color.Transparent; this.chbOpenX.BackColor = System.Drawing.Color.Transparent;
this.chbOpenX.Checked = true;
this.chbOpenX.CheckState = System.Windows.Forms.CheckState.Checked;
this.chbOpenX.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.chbOpenX.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbOpenX.Location = new System.Drawing.Point(188, 17); this.chbOpenX.Location = new System.Drawing.Point(188, 17);
this.chbOpenX.Name = "chbOpenX"; this.chbOpenX.Name = "chbOpenX";
......
...@@ -14,7 +14,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -14,7 +14,7 @@ namespace OnlineStore.DeviceLibrary
{ {
public partial class X_RAY_Equip : EquipBase public partial class X_RAY_Equip : EquipBase
{ {
public bool OpenXLine = false; public bool OpenXLine = true ;
public ReelInfo In_ReelInfo = new ReelInfo(); public ReelInfo In_ReelInfo = new ReelInfo();
public ReelInfo Work_ReelInfo = new ReelInfo(); public ReelInfo Work_ReelInfo = new ReelInfo();
......
...@@ -413,15 +413,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -413,15 +413,18 @@ namespace OnlineStore.DeviceLibrary
ConfigAppSettings.SaveValue(Setting_Init.XRay_Data, lastData); ConfigAppSettings.SaveValue(Setting_Init.XRay_Data, lastData);
ClearFilePath(); ClearFilePath();
carerayImage.GetImage(); bool imgResult = carerayImage.GetImage();
carerayImage.WindowWidth = Config.WindowWidth; carerayImage.WindowWidth = Config.WindowWidth;
carerayImage.WindowLevel = Config.WindowLevel; carerayImage.WindowLevel = Config.WindowLevel;
if (imgResult)
{
Bitmap bmp = carerayImage.Get48bImage(); Bitmap bmp = carerayImage.Get48bImage();
if (bmp != null)
{
lastFileName = Work_ReelInfo.GetRealId() + "-" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".png"; lastFileName = Work_ReelInfo.GetRealId() + "-" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".png";
string fileP = path1_tif + @"\" + lastFileName; string fileP = path1_tif + @"\" + lastFileName;
bmp.Save(fileP, System.Drawing.Imaging.ImageFormat.Png); bmp.Save(fileP, System.Drawing.Imaging.ImageFormat.Png);
string backFile = path_XRAY + lastFileName; string backFile = path_XRAY + @"back\" + lastFileName;
try try
{ {
bmp.Save(backFile, System.Drawing.Imaging.ImageFormat.Png); bmp.Save(backFile, System.Drawing.Imaging.ImageFormat.Png);
...@@ -432,6 +435,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -432,6 +435,18 @@ namespace OnlineStore.DeviceLibrary
} }
WorkLog("点料:获取X射线图形,保存到: " + fileP + ",备份到:" + backFile + ",记录时间" + lastData + ",停止X射线"); WorkLog("点料:获取X射线图形,保存到: " + fileP + ",备份到:" + backFile + ",记录时间" + lastData + ",停止X射线");
GetImageEvent?.Invoke(bmp); GetImageEvent?.Invoke(bmp);
}
else
{
WorkLog("点料:获取X射线图形,获取图片失败,carerayImage.Get48bImage()=null");
LogUtil.error(Name + " 获取图片失败,carerayImage.Get48bImage()=null");
}
}
else
{
WorkLog("点料:获取X射线图形,获取图片失败,carerayImage.GetImage()=" + imgResult);
LogUtil.error(Name + " 获取图片失败,carerayImage.GetImage()=" + imgResult);
}
bool result = xRay.Stop(); bool result = xRay.Stop();
if (!result) if (!result)
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!