Commit baca3254 张东亮

显示处理时间

1 个父辈 0aff9dd7
此文件类型无法预览
此文件类型无法预览
FrmCodeDecode_Text,二维码识别,Qr code recognition
FrmCodeDecode_label4_Text,参数路径,Parameters of the path
FrmCodeDecode_chbUseParam_Text,使用参数,operation parameter
FrmCodeDecode_btnAn_Text,变暗,darken
FrmCodeDecode_btnLight_Text,提亮,brighten
FrmCodeDecode_btnCopyN_Text,复制名称,Copy Name
FrmCodeDecode_label3_Text,条码类型:,Bar code type:
FrmCodeDecode_label2_Text,相机列表:,Camera list:
FrmCodeDecode_btnExit_Text,退出,Exit
FrmCodeDecode_btnCameraImage_Text,相机获取图片,camera image
FrmCodeDecode_lblCount_Text,条码数量:,Barcode number:
FrmCodeDecode_btnClearLog_Text,清理日志,Clear log
FrmCodeDecode_btnDCode_Text,二维码识别,Qr code recognition
FrmCodeDecode_btnLearn_Text,学习,learn
FrmCodeDecode_btnbarCode_Text,一维码识别,One dimensional code recognition
FrmCodeDecode_btnGray_Text,图像转灰,Turning grey
FrmCodeDecode_btnErZhi_Text,二值化,binaryzation 
FrmCodeDecode_btnSelImage_Text,打开本地图片,Open local image
FrmCodeDecode_label1_Text,图片路径,Image path
FrmCodeLearn_Text,条码参数学习,Bar code parameter learning
FrmCodeLearn_chbHalcon_Text,Halcon获取图片,Halcon Get photo
FrmCodeLearn_label4_Text,图片路径,Image path
FrmCodeLearn_btnDelOld_Text,删除旧参数,Delete old parameter
FrmCodeLearn_chbUseCamera_Text,相机获取实时图片,camera image
FrmCodeLearn_btnSelImage_Text,打开本地图片,Open local image
FrmCodeLearn_chbTest_Text,学习结束自动识别测试,Automatic identification test
FrmCodeLearn_btnClearLog_Text,清理日志,Clear log
FrmCodeLearn_lblCount_Text,条码数量:,Barcode number:
FrmCodeLearn_label3_Text,参数路径,Parameters of the path
FrmCodeLearn_label2_Text,类型:,Type:
FrmCodeLearn_label1_Text,相机:,camera:
FrmCodeLearn_btnExit_Text,退出,Exit
FrmCodeLearn_btnStop_Text,结束学习,End of learning
FrmCodeLearn_btnOpen_Text,开始学习,start to learn
selCamera,请先选择相机,Please select camera
selImage,请先选择图片,Please select picture
title,提示,Notice
imageIsNull,获取二维码图片为空,Get the two-dimensional code picture is empty
sureDelete,确定删除文件:,Make sure to delete the file:
\ No newline at end of file \ No newline at end of file
<?xml version="1.0"?> <?xml version="1.0"?>
<configuration> <configuration>
<configSections> <configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections> </configSections>
<appSettings> <appSettings>
<!--是否开机自动启动料仓--> <!--是否开机自动启动料仓-->
<add key="App_AutoRun" value="0" /> <add key="App_AutoRun" value="0"/>
<add key="App_Title" value="流水线客户端" /> <add key="App_Title" value="流水线客户端"/>
<!--Server address--> <!--Server address-->
<!--<add key="http.server" value="http://localhost/myproject/service/store/emptyPosForPutin"/>--> <!--<add key="http.server" value="http://localhost/myproject/service/store/emptyPosForPutin"/>-->
<add key="http.server" value="http://10.85.199.25/myproject/" /> <add key="http.server" value="http://10.85.199.25/myproject/"/>
<!--storeType--> <!--storeType-->
<add key="Line_moveEquip_count" value="24" /> <add key="Line_moveEquip_count" value="24"/>
<add key="Line_feedingEquip_count" value="5" /> <add key="Line_feedingEquip_count" value="5"/>
<add key="Line_HYEquip_count" value="21" /> <add key="Line_HYEquip_count" value="21"/>
<!--<add key="Line_dischargeLine_count" value="2" />--> <!--<add key="Line_dischargeLine_count" value="2" />-->
<!--start one store config--> <!--start one store config-->
<add key="ConfigPath_Line" value="\LineConfig\Config_Line.csv" /> <add key="ConfigPath_Line" value="\LineConfig\Config_Line.csv"/>
<add key="ConfigPath_MoveEquip" value="\LineConfig\MoveEquip\Config_MoveEquip.csv" /> <add key="ConfigPath_MoveEquip" value="\LineConfig\MoveEquip\Config_MoveEquip.csv"/>
<add key="ConfigPath_FeedingEquip" value="\LineConfig\Config_FeedingEquip.csv" /> <add key="ConfigPath_FeedingEquip" value="\LineConfig\Config_FeedingEquip.csv"/>
<add key="ConfigPath_HYEquip" value="\LineConfig\HY\Config_HYEquip.csv" /> <add key="ConfigPath_HYEquip" value="\LineConfig\HY\Config_HYEquip.csv"/>
<add key="ConfigPath_DischargeLine" value="\LineConfig\Config_DischargeLine.csv" /> <add key="ConfigPath_DischargeLine" value="\LineConfig\Config_DischargeLine.csv"/>
<add key ="ConfigPath_TrayList" value ="\LineConfig\TrayList.data"/> <add key="ConfigPath_TrayList" value="\LineConfig\TrayList.data"/>
<add key="Line_Type" value="Line" /> <add key="Line_Type" value="Line"/>
<add key="Line_CID" value="so664" /> <add key="Line_CID" value="so664"/>
<!--end one store config--> <!--end one store config-->
<!--摄像机名称列表配置,用#分割--> <!--摄像机名称列表配置,用#分割-->
<add key="CameraName" value="GigE:MV-CE100-30GC (00C69898519)#GigE:MV-CE100-30GC (00C95305929)" /> <add key="CameraName" value="GigE:MV-CE100-30GC (00C69898519)#GigE:MV-CE100-30GC (00C95305929)"/>
<!--二维码类型列表配置,用#分割,一维码=Barcode 二维码: QR Code#Data Matrix ECC 200#Micro QR Code--> <!--二维码类型列表配置,用#分割,一维码=Barcode 二维码: QR Code#Data Matrix ECC 200#Micro QR Code-->
<add key="CodeType" value="Data Matrix ECC 200#QR Code" /> <add key="CodeType" value="Data Matrix ECC 200#QR Code"/>
<!--<add key="CodeType" value="Data Matrix ECC 200"/>--> <!--<add key="CodeType" value="Data Matrix ECC 200"/>-->
<add key="ACBaudRate" value="115200" /> <add key="ACBaudRate" value="115200"/>
<!--二维码参数文件所在路径,文件名与二维码类型名一样--> <!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<add key="CodeParamPath" value="\CodeParam\" /> <add key="CodeParamPath" value="\CodeParam\"/>
<add key="Config_Pwd" value="123456" /> <add key="Config_Pwd" value="123456"/>
<!--出库等待料盘拿走的时间,秒--> <!--出库等待料盘拿走的时间,秒-->
<add key="OutStoreWaitSeconds" value="10" /> <add key="OutStoreWaitSeconds" value="10"/>
<add key="UseAIOBOX" value="1" /> <add key="UseAIOBOX" value="1"/>
<!--流水线监听端口--> <!--流水线监听端口-->
<add key="TCPServerPort" value="5246" /> <add key="TCPServerPort" value="5246"/>
<!--AGV调度服务器地址--> <!--AGV调度服务器地址-->
<add key="AgvServerIp" value="10.85.162.40" /> <add key="AgvServerIp" value="10.85.162.40"/>
<!--IO配置--> <!--IO配置-->
<add key="DIMS" value="60" /> <add key="DIMS" value="60"/>
<add key="DOMS" value="300" /> <add key="DOMS" value="300"/>
<add key="LineRunTest" value="1" /> <add key="LineRunTest" value="1"/>
<!--ABB机器人服务器--> <!--ABB机器人服务器-->
<add key="ABBServerPort" value="21" /> <add key="ABBServerPort" value="21"/>
<!--是否打开托盘编码界面--> <!--是否打开托盘编码界面-->
<add key="OpenRFIDWrite" value="1" /> <add key="OpenRFIDWrite" value="1"/>
<add key="DefaultPWD" value="123456" /> <add key="DefaultPWD" value="123456"/>
<add key="Server_Log_Open" value="0" /> <add key="Server_Log_Open" value="0"/>
<add key="CodeCount" value="4" /> <add key="CodeCount" value="4"/>
<add key="DefaultTrayNum" value="0" /> <add key="DefaultTrayNum" value="0"/>
<add key="NeedScanCode" value="1" /> <add key="NeedScanCode" value="1"/>
<add key="Agv_Log_Open" value="0" /> <add key="Agv_Log_Open" value="0"/>
<add key="NeedCheckTray" value="0" /> <add key="NeedCheckTray" value="0"/>
<add key="Feed_LastShelfID_101" value="B19" /> <add key="Feed_LastShelfID_101" value="B19"/>
<add key="Feed_LastShelfID_102" value="B23" /> <add key="Feed_LastShelfID_102" value="B23"/>
<add key="Feed_LastShelfID_103" value="B25" /> <add key="Feed_LastShelfID_103" value="B25"/>
<add key="Feed_LastShelfID_104" value="B7" /> <add key="Feed_LastShelfID_104" value="B7"/>
<add key ="SaveErrorImageToFile" value ="1"/> <add key="SaveErrorImageToFile" value="1"/>
<add key ="UseHCBoard" value ="1"/> <add key="UseHCBoard" value="1"/>
<add key ="ShowIOForm" value ="1"/> <add key="ShowIOForm" value="1"/>
<add key ="RfidServer_Port" value ="12001"/> <add key="RfidServer_Port" value="12001"/>
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="logs/Line-SO664.log" /> <file value="logs/Line-SO664.log"/>
<param name="Encoding" value="UTF-8" /> <param name="Encoding" value="UTF-8"/>
<param name="maxSizeRollBackups" value="100" /> <param name="maxSizeRollBackups" value="100"/>
<appendToFile value="true" /> <appendToFile value="true"/>
<rollingStyle value="Date" /> <rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd" /> <datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n" /> <conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout> </layout>
</appender> </appender>
<appender name="TheRFID" type="log4net.Appender.RollingFileAppender"> <appender name="TheRFID" type="log4net.Appender.RollingFileAppender">
<file value="logs/rfid/TheRFID-line.log" /> <file value="logs/rfid/TheRFID-line.log"/>
<param name="Encoding" value="UTF-8" /> <param name="Encoding" value="UTF-8"/>
<param name="maxSizeRollBackups" value="3" /> <param name="maxSizeRollBackups" value="3"/>
<appendToFile value="true" /> <appendToFile value="true"/>
<rollingStyle value="Date" /> <rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd" /> <datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n" /> <conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout> </layout>
</appender> </appender>
<appender name="AIOBOX" type="log4net.Appender.RollingFileAppender"> <appender name="AIOBOX" type="log4net.Appender.RollingFileAppender">
<file value="logs/aio/AIOBOX-line.log" /> <file value="logs/aio/AIOBOX-line.log"/>
<param name="Encoding" value="UTF-8" /> <param name="Encoding" value="UTF-8"/>
<param name="maxSizeRollBackups" value="100" /> <param name="maxSizeRollBackups" value="100"/>
<appendToFile value="true" /> <appendToFile value="true"/>
<rollingStyle value="Date" /> <rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd" /> <datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n" /> <conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout> </layout>
</appender> </appender>
<appender name="RunLog" type="log4net.Appender.RollingFileAppender"> <appender name="RunLog" type="log4net.Appender.RollingFileAppender">
<file value="logs/log/RunLog-line.log" /> <file value="logs/log/RunLog-line.log"/>
<param name="Encoding" value="UTF-8" /> <param name="Encoding" value="UTF-8"/>
<param name="maxSizeRollBackups" value="100" /> <param name="maxSizeRollBackups" value="100"/>
<appendToFile value="true" /> <appendToFile value="true"/>
<rollingStyle value="Date" /> <rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd" /> <datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">
<conversionPattern value=" %m%n" /> <conversionPattern value=" %m%n"/>
</layout> </layout>
</appender> </appender>
<logger name="RollingLogFileAppender"> <logger name="RollingLogFileAppender">
<level value="Info" /> <level value="Info"/>
<appender-ref ref="RollingLogFileAppender" /> <appender-ref ref="RollingLogFileAppender"/>
</logger> </logger>
<logger name="TheRFID"> <logger name="TheRFID">
<level value="Error" /> <level value="Error"/>
<appender-ref ref="TheRFID" /> <appender-ref ref="TheRFID"/>
</logger> </logger>
<logger name="AIOBOX"> <logger name="AIOBOX">
<level value="Info" /> <level value="Info"/>
<appender-ref ref="AIOBOX" /> <appender-ref ref="AIOBOX"/>
</logger> </logger>
<logger name="RunLog"> <logger name="RunLog">
<level value="Info" /> <level value="Info"/>
<appender-ref ref="RunLog" /> <appender-ref ref="RunLog"/>
</logger> </logger>
<!--<root> <!--<root>
<level value="Info" /> <level value="Info" />
...@@ -132,6 +132,6 @@ ...@@ -132,6 +132,6 @@
</root>--> </root>-->
</log4net> </log4net>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
</startup> </startup>
</configuration> </configuration>
...@@ -19,7 +19,7 @@ namespace OnlineStore.AssemblyLine.Properties { ...@@ -19,7 +19,7 @@ namespace OnlineStore.AssemblyLine.Properties {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。 // (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources { internal class Resources {
...@@ -47,8 +47,8 @@ namespace OnlineStore.AssemblyLine.Properties { ...@@ -47,8 +47,8 @@ namespace OnlineStore.AssemblyLine.Properties {
} }
/// <summary> /// <summary>
/// 重写当前线程的 CurrentUICulture 属性 /// 重写当前线程的 CurrentUICulture 属性,对
/// 重写当前线程的 CurrentUICulture 属性 /// 使用此强类型资源类的所有资源查找执行重写
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture { internal static global::System.Globalization.CultureInfo Culture {
......
...@@ -12,7 +12,7 @@ namespace OnlineStore.AssemblyLine.Properties { ...@@ -12,7 +12,7 @@ namespace OnlineStore.AssemblyLine.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
......
<?xml version="1.0"?> <?xml version="1.0"?>
<configuration> <configuration>
<configSections> <configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections> </configSections>
<appSettings> <appSettings>
...@@ -33,12 +33,12 @@ ...@@ -33,12 +33,12 @@
<add key="OutStoreWaitSeconds" value="10"/> <add key="OutStoreWaitSeconds" value="10"/>
<add key="UseAIOBOX" value="1"/> <add key="UseAIOBOX" value="1"/>
<!--流水线监听端口--> <!--流水线监听端口-->
<add key ="TCPServerPort" value ="5246"/> <add key="TCPServerPort" value="5246"/>
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="logs/Line-RC1246.log"/> <file value="logs/Line-RC1246.log"/>
<param name="Encoding" value="UTF-8" /> <param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/> <appendToFile value="true"/>
<rollingStyle value="Date"/> <rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/> <datePattern value="yyyy-MM-dd"/>
......
...@@ -99,6 +99,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -99,6 +99,7 @@ namespace OnlineStore.DeviceLibrary
} }
isInPro = true; isInPro = true;
lastProTimer = DateTime.Now; lastProTimer = DateTime.Now;
LastProcTime = lastProTimer;
try try
{ {
if (runStatus <= LineRunStatus.Wait && (!baseConfig.DType.Equals(DeviceType.FeedingEquip))) if (runStatus <= LineRunStatus.Wait && (!baseConfig.DType.Equals(DeviceType.FeedingEquip)))
...@@ -742,6 +743,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -742,6 +743,7 @@ namespace OnlineStore.DeviceLibrary
msg += "alarm: " + alarmType + " " + LastAlarmTime.ToLongTimeString() + "\n"; msg += "alarm: " + alarmType + " " + LastAlarmTime.ToLongTimeString() + "\n";
msg += "Move:" + MoveInfo.MoveType + " " + MoveInfo.SLog + "\n"; msg += "Move:" + MoveInfo.MoveType + " " + MoveInfo.SLog + "\n";
msg += "SMove:" + SecondMoveInfo.MoveType + " " + SecondMoveInfo.MoveStep + "\n"; msg += "SMove:" + SecondMoveInfo.MoveType + " " + SecondMoveInfo.MoveStep + "\n";
msg += $"LastTime: {LastProcTime.ToString("HH:mm:ss")}";
return msg; return msg;
} }
internal void MoveEndS() internal void MoveEndS()
......
...@@ -1260,6 +1260,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1260,6 +1260,7 @@ namespace OnlineStore.DeviceLibrary
msg += "runS: " + runStatus + "\n"; msg += "runS: " + runStatus + "\n";
msg += "alarm: " + alarmType + "\n"; msg += "alarm: " + alarmType + "\n";
msg += "MoveT:" + MoveInfo.MoveType + " " + MoveInfo.SLog + "\n"; msg += "MoveT:" + MoveInfo.MoveType + " " + MoveInfo.SLog + "\n";
msg += $"LastTime: {LastProcTime.ToString("HH:mm:ss")}";
return msg; return msg;
} }
public string GetLastTrayInfo() public string GetLastTrayInfo()
......
...@@ -1032,6 +1032,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1032,6 +1032,7 @@ namespace OnlineStore.DeviceLibrary
msg += "alarm: " + alarmType + " " + LastAlarmTime.ToLongTimeString() + "\n"; msg += "alarm: " + alarmType + " " + LastAlarmTime.ToLongTimeString() + "\n";
msg += "Move:" + MoveInfo.MoveType + " " + MoveInfo.SLog + "\n"; msg += "Move:" + MoveInfo.MoveType + " " + MoveInfo.SLog + "\n";
msg += "SMove:" + SecondMoveInfo.MoveType + " " + SecondMoveInfo.MoveStep + "\n"; msg += "SMove:" + SecondMoveInfo.MoveType + " " + SecondMoveInfo.MoveStep + "\n";
msg += $"LastTime: {LastProcTime.ToString("HH:mm:ss")}";
return msg; return msg;
} }
} }
......
...@@ -714,13 +714,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -714,13 +714,13 @@ namespace OnlineStore.DeviceLibrary
if (!moveEquip.IsMainStarted) if (!moveEquip.IsMainStarted)
{ {
moveEquip.TimerProcess(); moveEquip.TimerProcess();
LastProcTime = DateTime.Now;
} }
} }
} }
LastProcTime = DateTime.Now;
LineTimerPro(); LineTimerPro();
} }
TimeSpan span = DateTime.Now - time; TimeSpan span = DateTime.Now - time;
if (span.TotalMilliseconds > 2000) if (span.TotalMilliseconds > 2000)
{ {
...@@ -973,7 +973,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -973,7 +973,7 @@ namespace OnlineStore.DeviceLibrary
msg += "alarm: " + alarmType + "\n"; msg += "alarm: " + alarmType + "\n";
msg += "Move:" + MoveInfo.MoveType + " " + MoveInfo.SLog + "\n"; msg += "Move:" + MoveInfo.MoveType + " " + MoveInfo.SLog + "\n";
msg += "T3C1:" + T3C1_MoveInfo.MoveType + " " + T3C1_MoveInfo.MoveStep + "\n"; msg += "T3C1:" + T3C1_MoveInfo.MoveType + " " + T3C1_MoveInfo.MoveStep + "\n";
msg += $"LastTime: {LastProcTime.ToString("HH:mm:ss")}";
return msg; return msg;
} }
......
...@@ -44,7 +44,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -44,7 +44,6 @@ namespace OnlineStore.DeviceLibrary
LoadCamera(false); LoadCamera(false);
CodeLibrary.HDCodeLearnHelper.LoadConfig("", codeStr); CodeLibrary.HDCodeLearnHelper.LoadConfig("", codeStr);
CodeLibrary.EyemDecode.InitModel();
} }
catch (Exception ex) catch (Exception ex)
{ {
...@@ -140,7 +139,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -140,7 +139,8 @@ namespace OnlineStore.DeviceLibrary
string r = ""; string r = "";
bool eyemNoCode = false; bool eyemNoCode = false;
//Task eyemtask = Task.Factory.StartNew(delegate { //Task eyemtask = Task.Factory.StartNew(delegate
//{
// List<CodeInfo> tlci = EyemDecode.ModelDecoder(ref bmp); // List<CodeInfo> tlci = EyemDecode.ModelDecoder(ref bmp);
// foreach (CodeInfo code in tlci) // foreach (CodeInfo code in tlci)
// { // {
......
using CodeLibrary; //using CodeLibrary;
using HalconDotNet; //using HalconDotNet;
using OnlineStore.Common; //using OnlineStore.Common;
using System; //using System;
using System.Collections.Generic; //using System.Collections.Generic;
using System.Diagnostics; //using System.Diagnostics;
using System.Drawing; //using System.Drawing;
using System.IO; //using System.IO;
using System.Linq; //using System.Linq;
using System.Net; //using System.Net;
using System.Runtime.Serialization.Formatters.Binary; //using System.Runtime.Serialization.Formatters.Binary;
using System.Text; //using System.Text;
using System.Threading; //using System.Threading;
using System.Threading.Tasks; //using System.Threading.Tasks;
using System.Xml; //using System.Xml;
using System.Xml.Serialization; //using System.Xml.Serialization;
public class RemoteDecodeHelper //public class RemoteDecodeHelper
{ //{
private static int webclienttimeout = 30000; // private static int webclienttimeout = 30000;
private static Process p = new Process(); // private static Process p = new Process();
private const string serverhost = "http://127.0.0.1:58137/"; // private const string serverhost = "http://127.0.0.1:58137/";
public static List<CodeInfo> DecodeRequest(HObject hoimg, RemoteDecodeParam remoteDecodeParam) // public static List<CodeInfo> DecodeRequest(HObject hoimg, RemoteDecodeParam remoteDecodeParam)
{ // {
byte[] requestdata; // byte[] requestdata;
lock (hoimg) // lock (hoimg)
{ // {
using (MemoryStream memoryStream = new MemoryStream()) // using (MemoryStream memoryStream = new MemoryStream())
{ // {
hoimg.Serialize(memoryStream); // hoimg.Serialize(memoryStream);
requestdata = memoryStream.ToArray(); // requestdata = memoryStream.ToArray();
memoryStream.Close(); // memoryStream.Close();
} // }
} // }
return DecodeRequest(requestdata, remoteDecodeParam, isHObject: true); // return DecodeRequest(requestdata, remoteDecodeParam, isHObject: true);
} // }
public static List<CodeInfo> DecodeRequest(Bitmap bitmap, RemoteDecodeParam remoteDecodeParam) // public static List<CodeInfo> DecodeRequest(Bitmap bitmap, RemoteDecodeParam remoteDecodeParam)
{ // {
if (bitmap == null) // if (bitmap == null)
{ // {
return null; // return null;
} // }
byte[] requestdata; // byte[] requestdata;
lock (bitmap) // lock (bitmap)
{ // {
using (MemoryStream memoryStream = new MemoryStream()) // using (MemoryStream memoryStream = new MemoryStream())
{ // {
BinaryFormatter binaryFormatter = new BinaryFormatter(); // BinaryFormatter binaryFormatter = new BinaryFormatter();
binaryFormatter.Serialize(memoryStream, bitmap); // binaryFormatter.Serialize(memoryStream, bitmap);
requestdata = memoryStream.ToArray(); // requestdata = memoryStream.ToArray();
memoryStream.Close(); // memoryStream.Close();
} // }
} // }
return DecodeRequest(requestdata, remoteDecodeParam); // return DecodeRequest(requestdata, remoteDecodeParam);
} // }
private static List<CodeInfo> DecodeRequest(byte[] requestdata, RemoteDecodeParam remoteDecodeParam, bool isHObject = false) // private static List<CodeInfo> DecodeRequest(byte[] requestdata, RemoteDecodeParam remoteDecodeParam, bool isHObject = false)
{ // {
CheckAndRunServer(); // CheckAndRunServer();
string text; // string text;
using (MemoryStream memoryStream = new MemoryStream()) // using (MemoryStream memoryStream = new MemoryStream())
{ // {
XmlSerializer xmlSerializer = new XmlSerializer(typeof(RemoteDecodeParam)); // XmlSerializer xmlSerializer = new XmlSerializer(typeof(RemoteDecodeParam));
xmlSerializer.Serialize(memoryStream, remoteDecodeParam); // xmlSerializer.Serialize(memoryStream, remoteDecodeParam);
text = base64UrlEncode(memoryStream.ToArray()); // text = base64UrlEncode(memoryStream.ToArray());
memoryStream.Close(); // memoryStream.Close();
} // }
string text2 = "http://127.0.0.1:58137/ProcessBitmap?param="; // string text2 = "http://127.0.0.1:58137/ProcessBitmap?param=";
if (isHObject) // if (isHObject)
{ // {
text2 = "http://127.0.0.1:58137/Process?param="; // text2 = "http://127.0.0.1:58137/Process?param=";
} // }
byte[] bytes; // byte[] bytes;
try // try
{ // {
MyWebClient myWebClient = new MyWebClient(webclienttimeout); // MyWebClient myWebClient = new MyWebClient(webclienttimeout);
bytes = myWebClient.UploadData(text2 + text, requestdata); // bytes = myWebClient.UploadData(text2 + text, requestdata);
requestdata = null; // requestdata = null;
myWebClient.Dispose(); // myWebClient.Dispose();
} // }
catch (WebException) // catch (WebException)
{ // {
return null; // return null;
} // }
catch // catch
{ // {
return null; // return null;
} // }
List<CodeInfo> result = null; // List<CodeInfo> result = null;
string text3 = Encoding.UTF8.GetString(bytes).Trim().Trim('"'); // string text3 = Encoding.UTF8.GetString(bytes).Trim().Trim('"');
text3 = text3.Replace("\\/", "/"); // text3 = text3.Replace("\\/", "/");
try // try
{ // {
byte[] buffer = Convert.FromBase64String(text3); // byte[] buffer = Convert.FromBase64String(text3);
using (MemoryStream stream = new MemoryStream(buffer)) // using (MemoryStream stream = new MemoryStream(buffer))
{ // {
XmlSerializer xmlSerializer2 = new XmlSerializer(typeof(List<CodeInfo>)); // XmlSerializer xmlSerializer2 = new XmlSerializer(typeof(List<CodeInfo>));
result = (List<CodeInfo>)xmlSerializer2.Deserialize(stream); // result = (List<CodeInfo>)xmlSerializer2.Deserialize(stream);
} // }
} // }
catch // catch
{ // {
throw new Exception(text3); // throw new Exception(text3);
} // }
return result; // return result;
} // }
private static string base64UrlEncode(byte[] input) // private static string base64UrlEncode(byte[] input)
{ // {
return Convert.ToBase64String(input).Replace('+', '-').Replace('/', '_'); // return Convert.ToBase64String(input).Replace('+', '-').Replace('/', '_');
} // }
private static void CheckAndRunServer() // private static void CheckAndRunServer()
{ // {
lock (p) // lock (p)
{ // {
Process[] processesByName = Process.GetProcessesByName("ScanCodeServer"); // Process[] processesByName = Process.GetProcessesByName("ScanCodeServer");
if (processesByName.Length != 0) // if (processesByName.Length != 0)
{ // {
return; // return;
} // }
string text = "ScanCodeServer\\ScanCodeServer.exe"; // string text = "ScanCodeServer\\ScanCodeServer.exe";
if (!File.Exists(text)) // if (!File.Exists(text))
{ // {
throw new Exception("找不到扫码服务器文件"); // throw new Exception("找不到扫码服务器文件");
} // }
p.StartInfo = new ProcessStartInfo(text); // p.StartInfo = new ProcessStartInfo(text);
p.Start(); // p.Start();
int num = 5; // int num = 5;
while (num > 0) // while (num > 0)
{ // {
num--; // num--;
Thread.Sleep(500); // Thread.Sleep(500);
MyWebClient myWebClient = new MyWebClient(webclienttimeout); // MyWebClient myWebClient = new MyWebClient(webclienttimeout);
string text2 = myWebClient.DownloadString("http://127.0.0.1:58137/alive"); // string text2 = myWebClient.DownloadString("http://127.0.0.1:58137/alive");
if (text2.Trim() == "\"1\"") // if (text2.Trim() == "\"1\"")
{ // {
return; // return;
} // }
} // }
throw new Exception("扫码服务器打开失败"); // throw new Exception("扫码服务器打开失败");
} // }
} // }
[Serializable] // [Serializable]
public struct RemoteDecodeParam // public struct RemoteDecodeParam
{ // {
public string[] codeTypeList; // public string[] codeTypeList;
public int codeCount; // public int codeCount;
public int timeout; // public int timeout;
} // }
public class MyWebClient : WebClient // public class MyWebClient : WebClient
{ // {
private int _timeout; // private int _timeout;
public MyWebClient(int timeout) // public MyWebClient(int timeout)
{ // {
_timeout = timeout; // _timeout = timeout;
} // }
protected override WebRequest GetWebRequest(Uri address) // protected override WebRequest GetWebRequest(Uri address)
{ // {
WebRequest webRequest = base.GetWebRequest(address); // WebRequest webRequest = base.GetWebRequest(address);
webRequest.Timeout = _timeout; // webRequest.Timeout = _timeout;
return webRequest; // return webRequest;
} // }
} // }
} //}
...@@ -16,7 +16,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -16,7 +16,7 @@ namespace OnlineStore.DeviceLibrary
{ {
public LineRunStatus runStatus = LineRunStatus.Wait; public LineRunStatus runStatus = LineRunStatus.Wait;
public DateTime LastProcTime = DateTime.Now;
public string WarnMsg = ""; public string WarnMsg = "";
public DeviceConfig baseConfig = null; public DeviceConfig baseConfig = null;
...@@ -32,7 +32,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -32,7 +32,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 使用timer定时器 /// 使用timer定时器
/// </summary> /// </summary>
protected bool useTimer = ConfigHelper.Config.Get("Device_MainThreadUseTimer", true); protected bool useTimer = true;//ConfigHelper.Config.Get("Device_MainThreadUseTimer", true);
public bool IsMainStarted public bool IsMainStarted
{ {
get get
......
...@@ -90,7 +90,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -90,7 +90,7 @@ namespace OnlineStore.DeviceLibrary
} }
public string SLog public string SLog
{ {
get { return " "+MoveStep + " "; } get { return $" {PreMoveStep}->{MoveStep} "; }
} }
public bool IsTimeOut(int timeOutSeconds = 60) public bool IsTimeOut(int timeOutSeconds = 60)
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!