Commit fc8303c0 LN

增加扫码方式配置,datalogic=0,halcon=1

1 个父辈 aa4cd176
此文件类型无法预览
......@@ -53,6 +53,10 @@
<ApplicationIcon>box.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="CodeLibrary, Version=1.0.7499.24663, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\CodeLibrary.dll</HintPath>
</Reference>
<Reference Include="log4net">
<HintPath>..\..\dll\log4net.dll</HintPath>
</Reference>
......
......@@ -6,8 +6,7 @@
<appSettings>
<!--是否开机自动启动料仓-->
<add key="App_AutoRun" value="1"/>
<add key="App_Title" value="AC_SA_料仓_1"/>
<add key="scanner_start_command" value="S"/>
<add key="App_Title" value="AC_SA_料仓_1"/>
<!-- 开始吹气的判断值(配置值=服务器发送的湿度值-开始吹气值)-->
<add key="StartBlowValue" value="4"/>
<!-- 停止吹气的判断值(配置值=服务器发送的湿度值-停止吹气值)-->
......@@ -16,8 +15,7 @@
<!--Server address-->
<!--<add key="http.server" value="http://localhost:80/"/>-->
<!--storeType-->
<add key="store_count" value="1"/>
<!--start one store config-->
<add key="store_count" value="1"/>
<add key="Store_Position_Config" value="\StoreConfig\AC\linePositions.csv"/>
<add key="Store_ConfigPath" value="\StoreConfig\AC\StoreConfig.csv"/>
<add key="Store_Type" value="RC_AC_SA"/>
......@@ -26,21 +24,19 @@
<add key="InOutDefaultPosition" value="8000"/>
<add key="Config_Pwd" value="123456"/>
<add key="Config_Pwd" value="123456"/>
<!--出库等待料盘拿走的时间,秒-->
<add key="OutStoreWaitSeconds" value="10"/>
<!--温控器类型,0=壁挂王字壳温湿度变送器,1=妙昕温湿度记录仪-->
<add key="HumitureControllerType" value="0"/>
<!--解码方式,0=halcon 解码,1=西安料仓 使用zxing解码,2=成都料仓-->
<add key="DeCodeType" value="0"/>
<add key ="DefaultPWD" value ="123456"/>
<add key="HumitureControllerType" value="0"/>
<add key="UseAIOBOX" value="1"/>
<!--是否使用蜂鸣器-->
<add key ="UseBuzzer" value ="1"/>
<add key ="StartScan_CMD" value ="S"/>
<add key ="UseBuzzer" value ="1"/>
<add key ="ShowLanguageMsg" value ="1"/>
<!--每盘料扫码的次数-->
<add key ="MaxScanCount" value ="2"/>
<add key ="MaxScanCount" value ="2"/>
<!--halcon扫码参数文件所在路径,文件名与二维码类型名一样-->
<add key="CodeParamPath" value="\CodeParam\"/>
</appSettings>
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
......@@ -55,6 +55,7 @@
this.btnLogDebug = new System.Windows.Forms.Button();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.btnHul = new System.Windows.Forms.Button();
this.btnCloseDLed = new System.Windows.Forms.Button();
this.btnOpenDLed = new System.Windows.Forms.Button();
this.btnCloseLed = new System.Windows.Forms.Button();
......@@ -165,7 +166,8 @@
this.开启DEBUGToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator();
this.清理日志ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.btnHul = new System.Windows.Forms.Button();
this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator();
this.btnCodeLearn = new System.Windows.Forms.Button();
this.contextMenuStrip1.SuspendLayout();
this.tabControl2.SuspendLayout();
this.tabPage4.SuspendLayout();
......@@ -193,9 +195,10 @@
this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.显示ToolStripMenuItem,
this.toolStripSeparator11,
this.toolStripMenuItem1});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(125, 52);
this.contextMenuStrip1.Size = new System.Drawing.Size(125, 58);
//
// 显示ToolStripMenuItem
//
......@@ -244,7 +247,7 @@
this.tabPage4.Controls.Add(this.btnStoreStart);
this.tabPage4.Location = new System.Drawing.Point(4, 29);
this.tabPage4.Name = "tabPage4";
this.tabPage4.Padding = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.tabPage4.Padding = new System.Windows.Forms.Padding(3);
this.tabPage4.Size = new System.Drawing.Size(1083, 47);
this.tabPage4.TabIndex = 0;
this.tabPage4.Text = " 料仓操作 ";
......@@ -280,7 +283,7 @@
//
this.btnStoreExit.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnStoreExit.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnStoreExit.Location = new System.Drawing.Point(541, 1);
this.btnStoreExit.Location = new System.Drawing.Point(535, 1);
this.btnStoreExit.Name = "btnStoreExit";
this.btnStoreExit.Size = new System.Drawing.Size(132, 45);
this.btnStoreExit.TabIndex = 4;
......@@ -292,7 +295,7 @@
//
this.btnStoreHome.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnStoreHome.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnStoreHome.Location = new System.Drawing.Point(406, 1);
this.btnStoreHome.Location = new System.Drawing.Point(402, 1);
this.btnStoreHome.Name = "btnStoreHome";
this.btnStoreHome.Size = new System.Drawing.Size(132, 45);
this.btnStoreHome.TabIndex = 3;
......@@ -317,7 +320,7 @@
//
this.btnSotreReset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSotreReset.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSotreReset.Location = new System.Drawing.Point(273, 1);
this.btnSotreReset.Location = new System.Drawing.Point(269, 1);
this.btnSotreReset.Name = "btnSotreReset";
this.btnSotreReset.Size = new System.Drawing.Size(132, 45);
this.btnSotreReset.TabIndex = 2;
......@@ -329,7 +332,7 @@
//
this.btnStoreStop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnStoreStop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnStoreStop.Location = new System.Drawing.Point(140, 1);
this.btnStoreStop.Location = new System.Drawing.Point(136, 1);
this.btnStoreStop.Name = "btnStoreStop";
this.btnStoreStop.Size = new System.Drawing.Size(132, 45);
this.btnStoreStop.TabIndex = 1;
......@@ -341,7 +344,7 @@
//
this.btnStoreStart.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnStoreStart.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnStoreStart.Location = new System.Drawing.Point(7, 1);
this.btnStoreStart.Location = new System.Drawing.Point(3, 1);
this.btnStoreStart.Name = "btnStoreStart";
this.btnStoreStart.Size = new System.Drawing.Size(132, 45);
this.btnStoreStart.TabIndex = 0;
......@@ -351,16 +354,14 @@
//
// tabPage5
//
this.tabPage5.Controls.Add(this.btnUpdown);
this.tabPage5.Controls.Add(this.btnCodeLearn);
this.tabPage5.Controls.Add(this.btnOpenAutoInOut);
this.tabPage5.Controls.Add(this.btnDebug);
this.tabPage5.Controls.Add(this.btnAxisOff);
this.tabPage5.Controls.Add(this.btnAxisOn);
this.tabPage5.Controls.Add(this.btnScanCode);
this.tabPage5.Controls.Add(this.btnAxisP);
this.tabPage5.Controls.Add(this.btnIO);
this.tabPage5.Location = new System.Drawing.Point(4, 29);
this.tabPage5.Name = "tabPage5";
this.tabPage5.Padding = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.tabPage5.Padding = new System.Windows.Forms.Padding(3);
this.tabPage5.Size = new System.Drawing.Size(1083, 47);
this.tabPage5.TabIndex = 1;
this.tabPage5.Text = " 设备调试 ";
......@@ -370,7 +371,7 @@
//
this.btnUpdown.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnUpdown.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnUpdown.Location = new System.Drawing.Point(672, 0);
this.btnUpdown.Location = new System.Drawing.Point(409, 539);
this.btnUpdown.Name = "btnUpdown";
this.btnUpdown.Size = new System.Drawing.Size(132, 45);
this.btnUpdown.TabIndex = 272;
......@@ -382,7 +383,7 @@
//
this.btnDebug.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnDebug.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDebug.Location = new System.Drawing.Point(806, 0);
this.btnDebug.Location = new System.Drawing.Point(270, 1);
this.btnDebug.Name = "btnDebug";
this.btnDebug.Size = new System.Drawing.Size(132, 45);
this.btnDebug.TabIndex = 12;
......@@ -394,7 +395,7 @@
//
this.btnAxisOff.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisOff.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAxisOff.Location = new System.Drawing.Point(539, 0);
this.btnAxisOff.Location = new System.Drawing.Point(143, 539);
this.btnAxisOff.Name = "btnAxisOff";
this.btnAxisOff.Size = new System.Drawing.Size(132, 45);
this.btnAxisOff.TabIndex = 11;
......@@ -406,7 +407,7 @@
//
this.btnAxisOn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisOn.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAxisOn.Location = new System.Drawing.Point(406, 0);
this.btnAxisOn.Location = new System.Drawing.Point(10, 539);
this.btnAxisOn.Name = "btnAxisOn";
this.btnAxisOn.Size = new System.Drawing.Size(132, 45);
this.btnAxisOn.TabIndex = 10;
......@@ -418,7 +419,7 @@
//
this.btnScanCode.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnScanCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnScanCode.Location = new System.Drawing.Point(140, 0);
this.btnScanCode.Location = new System.Drawing.Point(137, 1);
this.btnScanCode.Name = "btnScanCode";
this.btnScanCode.Size = new System.Drawing.Size(132, 45);
this.btnScanCode.TabIndex = 9;
......@@ -430,7 +431,7 @@
//
this.btnAxisP.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisP.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAxisP.Location = new System.Drawing.Point(273, 0);
this.btnAxisP.Location = new System.Drawing.Point(276, 539);
this.btnAxisP.Name = "btnAxisP";
this.btnAxisP.Size = new System.Drawing.Size(132, 45);
this.btnAxisP.TabIndex = 8;
......@@ -442,7 +443,7 @@
//
this.btnIO.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnIO.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnIO.Location = new System.Drawing.Point(7, 0);
this.btnIO.Location = new System.Drawing.Point(4, 1);
this.btnIO.Name = "btnIO";
this.btnIO.Size = new System.Drawing.Size(132, 45);
this.btnIO.TabIndex = 5;
......@@ -452,7 +453,6 @@
//
// tabPage6
//
this.tabPage6.Controls.Add(this.btnOpenAutoInOut);
this.tabPage6.Controls.Add(this.btnLan);
this.tabPage6.Controls.Add(this.button4);
this.tabPage6.Controls.Add(this.btnClearL);
......@@ -469,7 +469,7 @@
this.btnOpenAutoInOut.BackColor = System.Drawing.Color.Transparent;
this.btnOpenAutoInOut.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOpenAutoInOut.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOpenAutoInOut.Location = new System.Drawing.Point(550, 1);
this.btnOpenAutoInOut.Location = new System.Drawing.Point(403, 1);
this.btnOpenAutoInOut.Name = "btnOpenAutoInOut";
this.btnOpenAutoInOut.Size = new System.Drawing.Size(132, 45);
this.btnOpenAutoInOut.TabIndex = 271;
......@@ -481,7 +481,7 @@
//
this.btnLan.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnLan.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnLan.Location = new System.Drawing.Point(4, 1);
this.btnLan.Location = new System.Drawing.Point(3, 1);
this.btnLan.Name = "btnLan";
this.btnLan.Size = new System.Drawing.Size(132, 45);
this.btnLan.TabIndex = 225;
......@@ -493,7 +493,7 @@
//
this.button4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button4.Location = new System.Drawing.Point(403, 1);
this.button4.Location = new System.Drawing.Point(402, 1);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(132, 45);
this.button4.TabIndex = 15;
......@@ -505,7 +505,7 @@
//
this.btnClearL.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnClearL.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnClearL.Location = new System.Drawing.Point(270, 1);
this.btnClearL.Location = new System.Drawing.Point(269, 1);
this.btnClearL.Name = "btnClearL";
this.btnClearL.Size = new System.Drawing.Size(132, 45);
this.btnClearL.TabIndex = 14;
......@@ -517,7 +517,7 @@
//
this.btnLogDebug.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnLogDebug.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnLogDebug.Location = new System.Drawing.Point(137, 1);
this.btnLogDebug.Location = new System.Drawing.Point(136, 1);
this.btnLogDebug.Name = "btnLogDebug";
this.btnLogDebug.Size = new System.Drawing.Size(132, 45);
this.btnLogDebug.TabIndex = 13;
......@@ -557,6 +557,20 @@
this.tabPage3.Text = " 操作日志 ";
this.tabPage3.UseVisualStyleBackColor = true;
//
// btnHul
//
this.btnHul.BackColor = System.Drawing.Color.White;
this.btnHul.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnHul.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnHul.Location = new System.Drawing.Point(374, 9);
this.btnHul.Name = "btnHul";
this.btnHul.Size = new System.Drawing.Size(149, 38);
this.btnHul.TabIndex = 263;
this.btnHul.Text = "忽略夹爪检测信号";
this.btnHul.UseVisualStyleBackColor = false;
this.btnHul.Visible = false;
this.btnHul.Click += new System.EventHandler(this.btnHul_Click);
//
// btnCloseDLed
//
this.btnCloseDLed.BackColor = System.Drawing.Color.White;
......@@ -663,9 +677,13 @@
// tabPage1
//
this.tabPage1.Controls.Add(this.axisMoveControl1);
this.tabPage1.Controls.Add(this.btnUpdown);
this.tabPage1.Controls.Add(this.btnAxisOff);
this.tabPage1.Controls.Add(this.btnAxisOn);
this.tabPage1.Controls.Add(this.btnAxisP);
this.tabPage1.Location = new System.Drawing.Point(4, 29);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(547, 622);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = " 伺服调试 ";
......@@ -673,7 +691,7 @@
//
// axisMoveControl1
//
this.axisMoveControl1.Location = new System.Drawing.Point(4, 8);
this.axisMoveControl1.Location = new System.Drawing.Point(4, 5);
this.axisMoveControl1.Name = "axisMoveControl1";
this.axisMoveControl1.Size = new System.Drawing.Size(540, 529);
this.axisMoveControl1.TabIndex = 0;
......@@ -683,7 +701,7 @@
this.tabPage2.Controls.Add(this.groupBox7);
this.tabPage2.Location = new System.Drawing.Point(4, 29);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(547, 622);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = " 压紧轴/温湿度 ";
......@@ -1463,7 +1481,7 @@
this.btnUpDownP7.Location = new System.Drawing.Point(5, 224);
this.btnUpDownP7.Name = "btnUpDownP7";
this.btnUpDownP7.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnUpDownP7.Size = new System.Drawing.Size(174, 33);
this.btnUpDownP7.Size = new System.Drawing.Size(171, 33);
this.btnUpDownP7.TabIndex = 203;
this.btnUpDownP7.Text = "升降轴入料缓冲点P7:";
this.btnUpDownP7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
......@@ -1482,7 +1500,7 @@
this.btnUpDownP8.Location = new System.Drawing.Point(5, 264);
this.btnUpDownP8.Name = "btnUpDownP8";
this.btnUpDownP8.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnUpDownP8.Size = new System.Drawing.Size(174, 33);
this.btnUpDownP8.Size = new System.Drawing.Size(171, 33);
this.btnUpDownP8.TabIndex = 205;
this.btnUpDownP8.Text = "升降轴出料缓冲点P8:";
this.btnUpDownP8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
......@@ -1628,7 +1646,7 @@
this.btnUpDownP6.Location = new System.Drawing.Point(267, 264);
this.btnUpDownP6.Name = "btnUpDownP6";
this.btnUpDownP6.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnUpDownP6.Size = new System.Drawing.Size(174, 33);
this.btnUpDownP6.Size = new System.Drawing.Size(171, 33);
this.btnUpDownP6.TabIndex = 189;
this.btnUpDownP6.Text = "升降轴出料缓冲点P6:";
this.btnUpDownP6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
......@@ -1664,7 +1682,7 @@
this.btnUpDownP4.Location = new System.Drawing.Point(267, 184);
this.btnUpDownP4.Name = "btnUpDownP4";
this.btnUpDownP4.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnUpDownP4.Size = new System.Drawing.Size(174, 33);
this.btnUpDownP4.Size = new System.Drawing.Size(171, 33);
this.btnUpDownP4.TabIndex = 165;
this.btnUpDownP4.Text = "升降轴入料缓冲点P4:";
this.btnUpDownP4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
......@@ -1911,19 +1929,23 @@
this.清理日志ToolStripMenuItem.Text = "清理日志";
this.清理日志ToolStripMenuItem.Click += new System.EventHandler(this.清理日志ToolStripMenuItem_Click);
//
// btnHul
// toolStripSeparator11
//
this.btnHul.BackColor = System.Drawing.Color.White;
this.btnHul.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnHul.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnHul.Location = new System.Drawing.Point(374, 9);
this.btnHul.Name = "btnHul";
this.btnHul.Size = new System.Drawing.Size(149, 38);
this.btnHul.TabIndex = 263;
this.btnHul.Text = "忽略夹爪检测信号";
this.btnHul.UseVisualStyleBackColor = false;
this.btnHul.Visible = false;
this.btnHul.Click += new System.EventHandler(this.btnHul_Click);
this.toolStripSeparator11.Name = "toolStripSeparator11";
this.toolStripSeparator11.Size = new System.Drawing.Size(121, 6);
//
// btnCodeLearn
//
this.btnCodeLearn.BackColor = System.Drawing.Color.Transparent;
this.btnCodeLearn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCodeLearn.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCodeLearn.Location = new System.Drawing.Point(536, 1);
this.btnCodeLearn.Name = "btnCodeLearn";
this.btnCodeLearn.Size = new System.Drawing.Size(132, 45);
this.btnCodeLearn.TabIndex = 272;
this.btnCodeLearn.Text = "二维码学习";
this.btnCodeLearn.UseVisualStyleBackColor = false;
this.btnCodeLearn.Click += new System.EventHandler(this.btnCodeLearn_Click);
//
// FrmStoreBox
//
......@@ -1938,7 +1960,7 @@
this.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MainMenuStrip = this.menuStrip1;
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "FrmStoreBox";
this.Text = "AC_SA_料仓";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
......@@ -2115,6 +2137,8 @@
private System.Windows.Forms.Button btnOpenDLed;
private System.Windows.Forms.Button btnOpenAutoInOut;
private System.Windows.Forms.Button btnHul;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator11;
private System.Windows.Forms.Button btnCodeLearn;
}
}
......@@ -15,7 +15,8 @@ using System.Reflection;
using log4net;
using OnlineStore.DeviceLibrary;
using System.IO.Ports;
using OnlineStore.LoadCSVLibrary;
using OnlineStore.LoadCSVLibrary;
using CodeLibrary;
namespace OnlineStore.ACSingleStore
{
......@@ -168,8 +169,9 @@ namespace OnlineStore.ACSingleStore
{
groupHistory.Visible = false;
}
btnCodeLearn.Visible = store.Config.ScanCodeType.Equals(1);
// this.tabControl1.TabPages.Remove(tabPage3);
// groupCode.Visible = false;
// groupCode.Visible = false;
}
private string WaitStart = ResourceCulture.GetString("等待启动");
private string dooropen = ResourceCulture.GetString("前门未关");
......@@ -787,7 +789,7 @@ namespace OnlineStore.ACSingleStore
private void 扫码测试ToolStripMenuItem_Click(object sender, EventArgs e)
{
store.dlScanSocket.StartConnect();
ScanManager.Instance.StartConnect();
store.GetCameraCode();
}
......@@ -1233,5 +1235,19 @@ namespace OnlineStore.ACSingleStore
bool result= store.BtnNextPro();
btnHul.Visible = store.NeedShowBtn();
}
private void btnCodeLearn_Click(object sender, EventArgs e)
{
if(store.Config.ScanCodeType.Equals(1))
{
if (Camera._cam != null)
{
Camera._cam.CloseAll();
}
CodeLibrary.FrmCodeDecode frm = new CodeLibrary.FrmCodeDecode();
frm.ShowDialog();
frm.Dispose();
}
}
}
}
......@@ -135,7 +135,7 @@
this.groupAxis.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupAxis.Location = new System.Drawing.Point(6, 4);
this.groupAxis.Name = "groupAxis";
this.groupAxis.Size = new System.Drawing.Size(531, 312);
this.groupAxis.Size = new System.Drawing.Size(531, 296);
this.groupAxis.TabIndex = 217;
this.groupAxis.TabStop = false;
this.groupAxis.Text = "伺服运动";
......@@ -143,7 +143,7 @@
//
// label7
//
this.label7.Location = new System.Drawing.Point(10, 172);
this.label7.Location = new System.Drawing.Point(10, 164);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(99, 17);
this.label7.TabIndex = 328;
......@@ -153,14 +153,14 @@
// txtServoStatue
//
this.txtServoStatue.Enabled = false;
this.txtServoStatue.Location = new System.Drawing.Point(112, 169);
this.txtServoStatue.Location = new System.Drawing.Point(112, 161);
this.txtServoStatue.Name = "txtServoStatue";
this.txtServoStatue.Size = new System.Drawing.Size(25, 23);
this.txtServoStatue.TabIndex = 327;
//
// label17
//
this.label17.Location = new System.Drawing.Point(144, 272);
this.label17.Location = new System.Drawing.Point(144, 264);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(99, 17);
this.label17.TabIndex = 316;
......@@ -170,14 +170,14 @@
// txtLimit2
//
this.txtLimit2.Enabled = false;
this.txtLimit2.Location = new System.Drawing.Point(247, 269);
this.txtLimit2.Location = new System.Drawing.Point(247, 261);
this.txtLimit2.Name = "txtLimit2";
this.txtLimit2.Size = new System.Drawing.Size(25, 23);
this.txtLimit2.TabIndex = 313;
//
// label19
//
this.label19.Location = new System.Drawing.Point(144, 238);
this.label19.Location = new System.Drawing.Point(144, 230);
this.label19.Name = "label19";
this.label19.Size = new System.Drawing.Size(99, 17);
this.label19.TabIndex = 312;
......@@ -187,14 +187,14 @@
// txtLimit1
//
this.txtLimit1.Enabled = false;
this.txtLimit1.Location = new System.Drawing.Point(247, 235);
this.txtLimit1.Location = new System.Drawing.Point(247, 227);
this.txtLimit1.Name = "txtLimit1";
this.txtLimit1.Size = new System.Drawing.Size(25, 23);
this.txtLimit1.TabIndex = 309;
//
// label6
//
this.label6.Location = new System.Drawing.Point(144, 204);
this.label6.Location = new System.Drawing.Point(144, 196);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(99, 17);
this.label6.TabIndex = 300;
......@@ -204,14 +204,14 @@
// txtHomeSingle
//
this.txtHomeSingle.Enabled = false;
this.txtHomeSingle.Location = new System.Drawing.Point(247, 201);
this.txtHomeSingle.Location = new System.Drawing.Point(247, 193);
this.txtHomeSingle.Name = "txtHomeSingle";
this.txtHomeSingle.Size = new System.Drawing.Size(25, 23);
this.txtHomeSingle.TabIndex = 297;
//
// label11
//
this.label11.Location = new System.Drawing.Point(10, 272);
this.label11.Location = new System.Drawing.Point(10, 264);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(99, 17);
this.label11.TabIndex = 292;
......@@ -221,14 +221,14 @@
// txtHomeStatus
//
this.txtHomeStatus.Enabled = false;
this.txtHomeStatus.Location = new System.Drawing.Point(112, 269);
this.txtHomeStatus.Location = new System.Drawing.Point(112, 261);
this.txtHomeStatus.Name = "txtHomeStatus";
this.txtHomeStatus.Size = new System.Drawing.Size(25, 23);
this.txtHomeStatus.TabIndex = 291;
//
// label10
//
this.label10.Location = new System.Drawing.Point(10, 238);
this.label10.Location = new System.Drawing.Point(10, 230);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(99, 17);
this.label10.TabIndex = 289;
......@@ -238,14 +238,14 @@
// txtBusyStatus
//
this.txtBusyStatus.Enabled = false;
this.txtBusyStatus.Location = new System.Drawing.Point(112, 235);
this.txtBusyStatus.Location = new System.Drawing.Point(112, 227);
this.txtBusyStatus.Name = "txtBusyStatus";
this.txtBusyStatus.Size = new System.Drawing.Size(25, 23);
this.txtBusyStatus.TabIndex = 288;
//
// label2
//
this.label2.Location = new System.Drawing.Point(10, 204);
this.label2.Location = new System.Drawing.Point(10, 196);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(99, 17);
this.label2.TabIndex = 286;
......@@ -255,7 +255,7 @@
// txtAlarmStatus
//
this.txtAlarmStatus.Enabled = false;
this.txtAlarmStatus.Location = new System.Drawing.Point(112, 201);
this.txtAlarmStatus.Location = new System.Drawing.Point(112, 193);
this.txtAlarmStatus.Name = "txtAlarmStatus";
this.txtAlarmStatus.Size = new System.Drawing.Size(25, 23);
this.txtAlarmStatus.TabIndex = 285;
......@@ -264,7 +264,7 @@
//
this.btnGetAlarm.BackColor = System.Drawing.SystemColors.Control;
this.btnGetAlarm.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnGetAlarm.Location = new System.Drawing.Point(301, 205);
this.btnGetAlarm.Location = new System.Drawing.Point(301, 197);
this.btnGetAlarm.Name = "btnGetAlarm";
this.btnGetAlarm.Size = new System.Drawing.Size(105, 33);
this.btnGetAlarm.TabIndex = 284;
......@@ -279,7 +279,7 @@
this.btnReadPosition.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnReadPosition.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnReadPosition.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnReadPosition.Location = new System.Drawing.Point(416, 244);
this.btnReadPosition.Location = new System.Drawing.Point(416, 236);
this.btnReadPosition.Name = "btnReadPosition";
this.btnReadPosition.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnReadPosition.Size = new System.Drawing.Size(105, 33);
......@@ -291,7 +291,7 @@
// label8
//
this.label8.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label8.Location = new System.Drawing.Point(144, 171);
this.label8.Location = new System.Drawing.Point(144, 163);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(99, 17);
this.label8.TabIndex = 255;
......@@ -332,7 +332,7 @@
//
// txtP
//
this.txtP.Location = new System.Drawing.Point(247, 169);
this.txtP.Location = new System.Drawing.Point(247, 161);
this.txtP.Name = "txtP";
this.txtP.ReadOnly = true;
this.txtP.Size = new System.Drawing.Size(87, 23);
......@@ -405,7 +405,7 @@
this.btnAxisReturnHome.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisReturnHome.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAxisReturnHome.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnAxisReturnHome.Location = new System.Drawing.Point(416, 205);
this.btnAxisReturnHome.Location = new System.Drawing.Point(416, 197);
this.btnAxisReturnHome.Name = "btnAxisReturnHome";
this.btnAxisReturnHome.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnAxisReturnHome.Size = new System.Drawing.Size(105, 33);
......@@ -434,7 +434,7 @@
//
this.btnComAlarmClear.BackColor = System.Drawing.SystemColors.Control;
this.btnComAlarmClear.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnComAlarmClear.Location = new System.Drawing.Point(301, 244);
this.btnComAlarmClear.Location = new System.Drawing.Point(301, 236);
this.btnComAlarmClear.Name = "btnComAlarmClear";
this.btnComAlarmClear.Size = new System.Drawing.Size(105, 33);
this.btnComAlarmClear.TabIndex = 50;
......@@ -570,9 +570,9 @@
this.groupBox1.Controls.Add(this.label43);
this.groupBox1.Controls.Add(this.label42);
this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox1.Location = new System.Drawing.Point(6, 315);
this.groupBox1.Location = new System.Drawing.Point(6, 304);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(531, 207);
this.groupBox1.Size = new System.Drawing.Size(531, 194);
this.groupBox1.TabIndex = 218;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "伺服状态";
......@@ -799,7 +799,7 @@
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.groupAxis);
this.Name = "AxisMoveControl";
this.Size = new System.Drawing.Size(542, 525);
this.Size = new System.Drawing.Size(542, 503);
this.groupAxis.ResumeLayout(false);
this.groupAxis.PerformLayout();
this.groupBox1.ResumeLayout(false);
......
......@@ -19,11 +19,7 @@ namespace OnlineStore.Common
/// <summary>
/// 系统主界面标题
/// </summary>
public static string App_Title = "App_Title";
/// <summary>
/// 扫码枪开始命令发送给socket的消息
/// </summary>
public static string StartScan_CMD = "StartScan_CMD";
public static string App_Title = "App_Title";
public static string http_server = "http.server";
public static string Store_CID = "Store_CID";
......@@ -39,14 +35,7 @@ namespace OnlineStore.Common
public static string Store_ConfigPath = "Store_ConfigPath";
public static string Store_Position_Config = "Store_Position_Config";
///// <summary>
///// 摄像机名称,多个中间使用#分割
///// </summary>
//public static string CameraName = "CameraName";
///// <summary>
///// 需要识别的二维码类型,多个中间使用#分割
///// </summary>
//public static string CodeType = "CodeType";
/// <summary>
/// 开始吹气的判断值(配置值=服务器发送的湿度值-开始吹气值)
......@@ -56,12 +45,7 @@ namespace OnlineStore.Common
/// 停止吹气的判断值(配置值=服务器发送的湿度值-停止吹气值)
/// </summary>
public static string StopBlowValue = "StopBlowValue";
///// <summary>
///// 配置文件路径 Data Matrix ECC 200.dcm
///// </summary>
//public static string CodeParamPath = "CodeParamPath";
/// <summary>
/// 进出轴最大待机点,需要小于3000
/// </summary>
......@@ -104,5 +88,7 @@ namespace OnlineStore.Common
public static string Default_Language= "Default_Language";
public static string MaxScanCount = "MaxScanCount";
public static string CodeParamPath = "CodeParamPath";
}
}
......@@ -39,6 +39,12 @@
<Reference Include="Asa.IOModule.AIOBOX">
<HintPath>..\..\dll\Asa.IOModule.AIOBOX.dll</HintPath>
</Reference>
<Reference Include="CodeLibrary">
<HintPath>..\..\dll\CodeLibrary.dll</HintPath>
</Reference>
<Reference Include="halcondotnet">
<HintPath>..\..\dll\halcondotnet.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\log4net.dll</HintPath>
......@@ -59,7 +65,8 @@
<Compile Include="acSingleStore\AC_SA_BoxBean.cs" />
<Compile Include="acSingleStore\AC_SA_BoxBean_Partial.cs" />
<Compile Include="acSingleStore\StoreManager.cs" />
<Compile Include="dataLogic\DLScanSocket.cs" />
<Compile Include="scanCode\dataLogic\DLScanSocket.cs" />
<Compile Include="scanCode\halcon\HalconScan.cs" />
<Compile Include="IO\AIManager.cs" />
<Compile Include="IO\AIOBOX\AIOAIManager.cs" />
<Compile Include="IO\AIOBOX\AIOBOXManager.cs" />
......@@ -72,6 +79,7 @@
<Compile Include="PanasonicServo\ACServerManager.cs" />
<Compile Include="PanasonicServo\ACServerManager_Partial.cs" />
<Compile Include="ResourceControl.cs" />
<Compile Include="scanCode\ScanManager.cs" />
<Compile Include="store\LineMoveP.cs" />
<Compile Include="store\LineAlarm.cs">
<SubType>Code</SubType>
......
......@@ -132,8 +132,13 @@ PRO,模拟转换系数,AI_ConvertPosition,55,,,,,,,
,,,,,,,,, ,
PRO,默认的料盘宽度(多种尺寸为0),Default_TrayWidth,7,,,,,,,
PRO,特殊二维码尺寸配置,CodeSizeConfig,XA=13x48#XB=13x32,,,,,,,
PRO,大盘宽度(13寸或15寸),Big_TrayWidth,15,,,,,, ,
,,,,,,,,,,
PRO,解码方式0=datalogic;1=halcon,ScanCodeType,1,,,,,,,
,,,,,,,,, ,
PRO,扫码枪IP,Scanner_Ip,192.168.201.21,,,,,,,
PRO,扫码枪端口号,Scanner_Port,51236,,,,,,,
PRO,DataLogic扫码枪-IP,Scanner_Ip,192.168.201.21,,,,,,,
PRO,DataLogic扫码枪端口号,Scanner_Port,51236,,,,,,,
PRO,DataLogic扫码枪-开始扫码命令,StartScan_CMD,51236,,,,,,,
,,,,,,,,, ,
PRO,大盘宽度(13寸或15寸),Big_TrayWidth,15,,,,,,,
PRO,halcon-相机名称多个用#分割,CameraName,GigE:MV-CE100-30GC (00C69898483),,,,,,,
PRO,halcon-条码类型多个用#分割,CodeType,QR Code#Data Matrix ECC 200#Micro QR Code,,,,,,,
......@@ -15,8 +15,7 @@ namespace OnlineStore.DeviceLibrary
/// 流水线自动料仓-Box类
/// </summary>
public partial class AC_SA_BoxBean : KTK_Store
{
public DLScanSocket dlScanSocket;
{
private static bool IsIntSlvBlock = false;
/// <summary>
/// 开始运行
......@@ -46,21 +45,14 @@ namespace OnlineStore.DeviceLibrary
public int MaxScanCount = ConfigAppSettings.GetIntValue(Setting_Init.MaxScanCount);
public int CurrScanCount = 1;
//public ScanSocket scanSocket = new ScanSocket();
private System.Timers.Timer serverConnectTimer = new System.Timers.Timer();
private System.Timers.Timer IoCheckTimer = new System.Timers.Timer();
public AC_SA_BoxBean(AC_SA_Config config)
{
// int value= CalHeight(37);
Init();
serverConnectTimer = new System.Timers.Timer();
serverConnectTimer.Interval = 1000;
serverConnectTimer.AutoReset = true;
serverConnectTimer.Enabled = false;
serverConnectTimer.Elapsed += server_connect_timer_Tick;
IoCheckTimer = new System.Timers.Timer();
IoCheckTimer.Interval = 400;
IoCheckTimer.AutoReset = true;
IoCheckTimer.Enabled = false;
IoCheckTimer.Elapsed += IoCheckTimer_Elapsed;
//添加调试
if (config.IsInDebug == 1)
......@@ -90,8 +82,7 @@ namespace OnlineStore.DeviceLibrary
}
}
}
dlScanSocket = new DLScanSocket(config.Scanner_Ip, config.Scanner_Port, onCodeReceived);
ScanManager.LoadConfig( config, onCodeReceived);
//初始化摄像机配置
// CodeManager.LoadConfig( );
IOManager.Init();
......@@ -208,7 +199,7 @@ namespace OnlineStore.DeviceLibrary
storeStatus = StoreStatus.ResetMove;
//启动温湿度服务器
HumitureController.Init(Config.Humiture_Port);
dlScanSocket.StartConnect();
ScanManager.Instance.StartConnect();
ReturnHome();
StartTime = DateTime.Now;
mainTimer.Enabled = true;
......@@ -675,7 +666,7 @@ namespace OnlineStore.DeviceLibrary
mainTimer.Enabled = false;
TimeSpan span = DateTime.Now - StartTime;
IsRun = false;
dlScanSocket.Close();
ScanManager.Instance.Close();
IOManager.instance.CloseAllDO();
LogUtil.info(LOGGER, StoreName + ",停止运行,总运行时间:" + span.ToString());
......@@ -1128,7 +1119,7 @@ namespace OnlineStore.DeviceLibrary
// GetCameraCode();
IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.HIGH);
LastScanTime = DateTime.Now;
dlScanSocket.BeginScan();
ScanManager.Instance.BeginScan();
}
}
else
......@@ -1549,7 +1540,7 @@ namespace OnlineStore.DeviceLibrary
{
IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.HIGH);
LastScanTime = DateTime.Now;
dlScanSocket.BeginScan();
ScanManager.Instance.BeginScan();
}
else
{
......@@ -1582,7 +1573,7 @@ namespace OnlineStore.DeviceLibrary
}
if (!String.IsNullOrEmpty(code))
{
message = message +"="+codeSize+"="+ code + dlScanSocket.spiltStr;
message = message +"="+codeSize+"="+ code + ScanManager.Instance.spiltStr;
}
}
return message;
......
......@@ -248,7 +248,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(LOGGER, StoreName + " 启动入库【" + posId + "】出错,叉子料盘检测有料");
return;
}
LogUtil.info(LOGGER, StoreName + " 启动入库【" + posId + "】", storeMoveColor);
LogUtil.info(LOGGER, StoreName + " 启动入库【" + posId + "】");
storeRunStatus = StoreRunStatus.Busy;
storeStatus = StoreStatus.InStoreExecute;
StoreMove.NewMove(StoreMoveType.InStore, param);
......@@ -478,7 +478,7 @@ namespace OnlineStore.DeviceLibrary
{
TimeSpan span = DateTime.Now - startInStoreTime;
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : "";
LogUtil.info(LOGGER, StoreName + " 【" + posId + "】 入库结束[" + FormUtil.GetSpanStr(span) + "]", storeMoveColor);
LogUtil.info(LOGGER, StoreName + " 【" + posId + "】 入库结束[" + FormUtil.GetSpanStr(span) + "]");
StoreMove.EndMove();
storeRunStatus = StoreRunStatus.Runing;
//设备连接,入库后,BOX恢复原始状态
......@@ -518,7 +518,7 @@ namespace OnlineStore.DeviceLibrary
return false;
}
storeStatus = StoreStatus.OutStoreExecute;
LogUtil.info(LOGGER, StoreName + "启动出库【" + posId + "】 ", storeMoveColor);
LogUtil.info(LOGGER, StoreName + "启动出库【" + posId + "】 ");
storeRunStatus = StoreRunStatus.Busy;
StoreMove.NewMove(StoreMoveType.OutStore, param);
if (IsHasCompress_Axis || Config.IsHasLocationCylinder.Equals(0))
......@@ -718,7 +718,7 @@ namespace OnlineStore.DeviceLibrary
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : "";
storeStatus = StoreStatus.StoreOnline;
LogUtil.info(LOGGER, StoreName + " 【" + posId + "】出库结束[" + FormUtil.GetSpanStr(span) + "]", storeMoveColor);
LogUtil.info(LOGGER, StoreName + " 【" + posId + "】出库结束[" + FormUtil.GetSpanStr(span) + "]");
StoreMove.EndMove();
storeRunStatus = StoreRunStatus.Runing;
//InOutEndProcess(StoreMoveType.OutStore);
......@@ -896,12 +896,12 @@ namespace OnlineStore.DeviceLibrary
private void InStoreLog(string msg)
{
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : "";
LogUtil.info(LOGGER, "【" + posId + "】" + msg, storeMoveColor);
LogUtil.info(LOGGER, "【" + posId + "】" + msg);
}
private void OutStoreLog(string msg)
{
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : "";
LogUtil.info(LOGGER, "【" + posId + "】" + msg, storeMoveColor);
LogUtil.info(LOGGER, "【" + posId + "】" + msg);
}
......
......@@ -23,6 +23,7 @@ namespace OnlineStore.DeviceLibrary
public static AC_SA_Config Config = null;
private static bool isInit = false;
public static bool IsConnectServer = !ConfigAppSettings.GetValue(Setting_Init.http_server).Equals("");
public StoreManager()
{
}
......@@ -95,10 +96,8 @@ namespace OnlineStore.DeviceLibrary
}
return Store;
}
/// <summary>
/// 修改了料仓配置,更新缓存,更新配置文件(只能更新PRO的配置)
/// </summary>
/// <param name="kTK_LA_Store_Config"></param>
public static void UpdateBoxConfig(AC_SA_Config storeConfig)
{
try
......@@ -155,4 +154,11 @@ namespace OnlineStore.DeviceLibrary
return host + api_nextFeeder;
}
}
public class ScanType
{
public const int DataLogic = 0;
public const int Halcon = 1;
}
}
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
public abstract class ScanManager
{
public string spiltStr = "##";
public static ScanManager Instance = null;
public static void LoadConfig(AC_SA_Config config, OnCodeRevice onCodeReceived)
{
if (config.ScanCodeType.Equals(0))
{
Instance = new DLScanSocket(config.Scanner_Ip, config.Scanner_Port, onCodeReceived);
}
else
{
Instance = new HalconScan(config.CameraName, config.CodeType, onCodeReceived);
}
}
public delegate void OnCodeRevice(string[] codeList);
public abstract bool StartConnect(bool isMustCon = false);
public abstract void Close();
public abstract void BeginScan();
}
}
\ No newline at end of file
......@@ -7,8 +7,9 @@ using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
public class DLScanSocket
{ /// <summary>
public class DLScanSocket: ScanManager
{
/// <summary>
/// 扫码枪链接
/// </summary>
private TcpClient scannerSocket;
......@@ -18,7 +19,7 @@ namespace OnlineStore.DeviceLibrary
private bool isScannerRun = false;
private string ScannerIP = "";
private int ScannerPort = 0;
public delegate void OnCodeRevice(string[] codeList);
public event OnCodeRevice CodeReviceEvent;
public DLScanSocket(string serverIp, int port,OnCodeRevice revicePro)
{
......@@ -29,7 +30,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 开启扫码枪
/// </summary>
public bool StartConnect( bool isMustCon = false)
public override bool StartConnect( bool isMustCon = false)
{
bool result = true;
try
......@@ -53,18 +54,8 @@ namespace OnlineStore.DeviceLibrary
}
return result;
}
//public void TimerCheck()
//{
// if (!scannerSocket.IsConnected())
// {
// StartConnect( false );
// LogUtil.info( "重新连接扫码枪【" + ScannerIP + "】 ");
// }
//}
/// <summary>
/// 停止扫码枪
/// </summary>
public void Close()
public override void Close()
{
try
{
......@@ -76,15 +67,12 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error("出错:" + ex);
}
}
/// <summary>
/// 发送扫码命令开始扫码
/// </summary>
public void BeginScan()
public override void BeginScan()
{
try
{
string str = ConfigAppSettings.GetValue(Setting_Init.StartScan_CMD);
scannerSocket.send(str);
{
scannerSocket.send(StoreManager.Config.StartScan_CMD);
}
catch (Exception ex)
{
......@@ -92,13 +80,11 @@ namespace OnlineStore.DeviceLibrary
}
}
public string spiltStr = "##";
/// <summary>
/// 扫码枪数据接收
/// </summary>
/// <param name="message"></param>
protected virtual void onCodeReceived(string message)
protected void onCodeReceived(string message)
{
try
{
......
......@@ -11,24 +11,24 @@ using System.Windows.Forms;
using CodeLibrary;
namespace OnlineStore.DeviceLibrary
{
public class CodeManager
public class HalconScan : ScanManager
{
public static int DeCodeType = ConfigAppSettings.GetIntValue(Setting_Init.DeCodeType);
public int DeCodeType = ConfigAppSettings.GetIntValue(Setting_Init.DeCodeType);
public static List<string> cameraNameList = new List<string>();
public static List<string> codeTypeList = new List<string>();
public List<string> cameraNameList = new List<string>();
public List<string> codeTypeList = new List<string>();
public static List<string> balserNameList = new List<string>();
public static List<string> hikNameList = new List<string>();
public List<string> balserNameList = new List<string>();
public List<string> hikNameList = new List<string>();
private static char spiltChar = '#';
public event OnCodeRevice CodeReviceEvent;
/// <summary>
/// 初始化摄像机名称和二维码类型
/// </summary>
public static void LoadConfig()
public HalconScan(string nameStr, string codeStr, OnCodeRevice revicePro)
{
string nameStr = ConfigAppSettings.GetValue(Setting_Init.CameraName);
string codeStr = ConfigAppSettings.GetValue(Setting_Init.CodeType);
char spiltChar = '#';
CodeReviceEvent += revicePro;
cameraNameList = new List<string>();
codeTypeList = new List<string>();
HDLogUtil.LogName = "RollingLogFileAppender";
......@@ -57,171 +57,144 @@ namespace OnlineStore.DeviceLibrary
LoadCamera(false);
CodeLibrary.HDCodeLearnHelper.LoadConfig(nameStr, codeStr);
//如果未加载到配置相机,自动配置
if (cameraNameList.Count <= 0 && hikNameList.Count > 0)
{
cameraNameList = new List<string>(hikNameList);
string cameraStr = "";
foreach (string name in hikNameList)
{
cameraStr += name + spiltChar;
}
cameraStr = cameraStr.Substring(0, cameraStr.Length - 1);
ConfigAppSettings.SaveValue(Setting_Init.CameraName, cameraStr);
LogUtil.info("未配置扫码相机,默认【" + Setting_Init.CameraName + "】=【" + cameraStr + "】");
}
}
catch (Exception ex)
{
LogUtil.error("解析摄像机配置出错:" + ex.StackTrace);
}
}
private static void LoadCamera(bool isReLoad)
private void LoadCamera(bool isReLoad)
{
if (isReLoad)
if (isReLoad || Camera._cam == null)
{
try
{
CodeLibrary.HIKCamera.Instance.Load();
if (Camera._cam != null)
{
Camera._cam.CloseAll();
}
Camera.Type = CameraType.HIK;
Camera._cam.Load();
}
catch (Exception ex)
{
LogUtil.error("加载HIK相机出错:" + ex.ToString());
}
try
{
CodeLibrary.BaslerCamera.Instance.Load();
}
catch (Exception ex)
{
LogUtil.error("加载Basler相机出错:" + ex.ToString());
}
}
string[] names = CodeLibrary.HIKCamera.Instance.CameraName;
string[] names = Camera._cam.Name;
hikNameList = new List<string>();
if (names != null)
{
hikNameList.AddRange(names);
foreach (string name in hikNameList)
foreach (string n in names)
{
LogUtil.info("加载到HIK相机:" + name);
if (!hikNameList.Contains(n))
{
hikNameList.Add(n);
}
}
}
names = CodeLibrary.BaslerCamera.Instance.CameraName;
if (names != null)
{
balserNameList.AddRange(names);
foreach (string name in balserNameList)
// hikNameList.AddRange(names);
foreach (string name in hikNameList)
{
LogUtil.info("加载到Balser相机:" + name);
LogUtil.info("加载到HIK相机:" + name);
}
}
}
public static void CloseCamera()
public void CloseCamera(string cameraName)
{
BaslerCamera.Instance.Close();
HIKCamera.Instance.Close();
Camera._cam.Close(cameraName);
}
public static Bitmap GetCamerImage(string cameraName)
public void CloseAllCamera()
{
Bitmap bitm = null;
try
if (Camera._cam != null)
{
if (balserNameList.Contains(cameraName))
{
bool result = BaslerCamera.Instance.Open(cameraName);
// LogUtil.info("打开相机:" + cameraName + "(" + result + ")");
if (result)
{
BaslerCamera.Instance.GrabOne();
bitm = BaslerCamera.Instance.Image;
BaslerCamera.Instance.Close();
}
else
{
LogUtil.error("相机【" + cameraName + "】打开失败:" + BaslerCamera.Instance.ErrInfo);
}
}
else if (hikNameList.Contains(cameraName))
{
bool result = HIKCamera.Instance.Open(cameraName);
// LogUtil.info("打开相机:" + cameraName + "(" + result + ")");
if (result)
{
HIKCamera.Instance.GrabOne();
bitm = HIKCamera.Instance.Image;
HIKCamera.Instance.Close();
}
else
{
LogUtil.error("相机【" + cameraName + "】打开失败:" + HIKCamera.Instance.ErrInfo);
}
}
else
{
LogUtil.info("未找到相机【" + cameraName + "】无法获取图片");
//若未加载到相机,需要重新加载相机
if (balserNameList.Count <= 0 && hikNameList.Count <= 0)
{
LogUtil.error("获取图片时发现未加载到相机,重新加载相机");
LoadCamera(true);
}
}
}
catch (Exception ex)
{
LogUtil.error("从相机【" + cameraName + "】获取图片出错:" + ex.ToString());
Camera._cam.CloseAll();
}
return bitm;
}
[HandleProcessCorruptedStateExceptions]
public static List<string> CameraScan()
public List<string> CameraScan()
{
List<string> codeList = new List<string>();
//List<CodeInfo> allCodeList = new List<CodeInfo>();
if (cameraNameList == null || cameraNameList.Count <= 0)
{
return codeList;
}
if (hikNameList.Count <= 0)
{
LogUtil.info("CameraScan 发现未加载到相机,重新加载相机");
LoadCamera(true);
}
try
{
foreach (string cameraName in cameraNameList)
{
using (Bitmap bitmap = GetCamerImage(cameraName))
if (cameraName.Trim().Equals(""))
{
if (bitmap == null)
{
LogUtil.error(" 摄像机【" + cameraName + "】获取图片失败,关闭相机");
CloseCamera();
continue;
}
LogUtil.debug(" 摄像机【" + cameraName + "】获取图片完成");
System.Threading.Thread.Sleep(1);
HalconDotNet.HObject ho_Image = HDCodeHelper.Bitmap2HObjectBpp24(bitmap);
LogUtil.debug(" 摄像机【" + cameraName + "】转换图片完成,开始扫码");
List<CodeInfo> cc = new List<CodeInfo>();
foreach (string codeType in codeTypeList)
continue;
}
DateTime startTime = DateTime.Now;
LogUtil.info(" 【" + cameraName + "】开始取图片");
if (DeCodeType.Equals(1))
{
Bitmap bitmap = Camera._cam.GrabOneImage(cameraName);
List<string> result = CodeLibrary.ZXingCodeHelper.DecodeQRCodes(bitmap);
return result;
}
else
{
HalconDotNet.HObject ho_Image = null;
try
{
//判断是否是一维码
if (codeType.ToLower().Equals("barcode"))
ho_Image = Camera._cam.CaptureOnImage(cameraName);
if (ho_Image == null)
{
cc = HDCodeHelper.DecodeBarCode(ho_Image);
LogUtil.error(" 【" + cameraName + "】取图片失败[" + Camera._cam.ErrInfo + "],关闭相机");
CloseCamera(cameraName);
continue;
}
else
LogUtil.info(" 【" + cameraName + "】取图片完成,开始扫码");
List<CodeInfo> cc = new List<CodeInfo>();
foreach (string codeType in codeTypeList)
{
cc = HDCodeHelper.DecodeCode(ho_Image, 1, GetCodeParamFilePath(codeType), codeType);
}
if (cc.Count > 0)
{
string r = "";
foreach (CodeInfo c in cc)
//判断是否是一维码
if (codeType.ToLower().Equals("barcode"))
{
cc = HDCodeHelper.DecodeBarCode(ho_Image);
}
else
{
cc = HDCodeHelper.DecodeCode(ho_Image, 0, GetCodeParamFilePath(codeType), codeType);
}
if (cc.Count > 0)
{
codeList.Add(c.CodeStr);
r = r + "##" + c.CodeStr;
string r = "";
foreach (CodeInfo c in cc)
{
codeList.Add(c.CodeStr);
r = r + "##" + c.CodeStr;
}
LogUtil.info(" 【" + cameraName + "】【" + codeType + "】扫码完成:" + r);
}
LogUtil.debug(" 【" + cameraName + "】【" + codeType + "】扫码完成:" + r);
}
}
catch (AccessViolationException e)
{
LogUtil.error(" 扫码出现AccessViolationException异常,关闭相机【" + cameraName + "】:" + e.ToString());
Camera._cam.Close(cameraName);
}
catch (Exception ex)
{
LogUtil.error(" 扫码出错:" + ex.ToString());
}
finally
{
if (ho_Image != null)
{
ho_Image.Dispose();
}
}
}
......@@ -237,10 +210,9 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error("扫码出错:" + ex.ToString());
}
return codeList;
}
}
public static string GetCodeParamFilePath(string codePath)
public string GetCodeParamFilePath(string codePath)
{
string appPath = Application.StartupPath;
string path = appPath + ConfigAppSettings.GetValue(Setting_Init.CodeParamPath);
......@@ -254,91 +226,21 @@ namespace OnlineStore.DeviceLibrary
return "";
}
}
/// <summary>
/// 西安料仓二维码解析处理
/// </summary>
public static string GetBarcode(string codeStr)
{
if (!string.IsNullOrEmpty(codeStr))
{
string[] codeInfos = codeStr.Replace("\r", "").Split('\n');
string ri = "";
string qty = "";
string youxiao = "";
foreach (string codeInfo in codeInfos)
{
if (codeInfo.StartsWith("物料编码:")||codeInfo.StartsWith("物料编码:"))
{
ri = codeInfo.Substring(5);
}
else if (codeInfo.StartsWith("入库数量:")|| codeInfo.StartsWith("入库数量:"))
{
qty = codeInfo.Substring(5);
}
else if (codeInfo.StartsWith("有效期限:")|| codeInfo.StartsWith("有效期限:"))
{
youxiao = codeInfo.Substring(5);
}
}
if (!string.IsNullOrEmpty(ri))
{
string pn = ri.Split(' ')[0];
return pn + ";" + qty + ";" + ri + ";" + youxiao;
}
}
return "";
public override bool StartConnect(bool isMustCon = false)
{
return true;
}
public static string ProcessChengDuCode(List<string> codeList)
public override void Close()
{
string split = ";";
string result = "";
try
{
List<string> rCodes = new List<string>();
rCodes.Add(GetCodeByStart(codeList, "RI"));
rCodes.Add(GetCodeByStart(codeList, "PN"));
//P条码改为 P;H;Q或者 D;H;Q的格式
foreach (string s in rCodes)
{
if (!s.Equals(""))
{
if (result.Equals(""))
{
result = s;
}
else
{
result = result + split + s;
}
}
}
return result;
}
catch (Exception ex)
{
LogUtil.error("处理二维码出错:" + ex.ToString());
}
return result;
CloseAllCamera();
}
private static string GetCodeByStart(List<string> codeList, string start)
public override void BeginScan()
{
List<string> pCode = (from m in codeList where m.StartsWith(start) select m).ToList<string>();
if (pCode.Count > 0)
{
int subCount = start.Length;
if (pCode[0].Substring(start.Length, 1).Equals(":"))
{
subCount = start.Length + 1;
}
return pCode[0].Substring(subCount, pCode[0].Length - subCount);
}
return "";
List<string> list = CameraScan();
this.CodeReviceEvent?.Invoke(list.ToArray());
}
}
}
......@@ -25,14 +25,7 @@ namespace OnlineStore.DeviceLibrary
/// 9=出库执行,10=出仓完成,11=出库失败
/// </summary>
public StoreStatus storeStatus = StoreStatus.ResetMove;
/// <summary>
/// 提示消息,一般发给服务器后清空(LineBean表示报警提示消息,BoxBean表示出入库失败的原因记录)
/// </summary>
// public string WarnMsg = "";
/// <summary>
/// 日志颜色
/// </summary>
protected static Color storeMoveColor = Color.Blue;
protected static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public string StoreName { get; set; }
public int StoreID { get; set; }
......@@ -44,7 +37,8 @@ namespace OnlineStore.DeviceLibrary
/// 定时器
/// </summary>
protected System.Timers.Timer mainTimer;
protected System.Timers.Timer serverConnectTimer = new System.Timers.Timer();
protected System.Timers.Timer IoCheckTimer = new System.Timers.Timer();
private bool isInit = false;
/// <summary>
/// 初始化
......@@ -54,6 +48,14 @@ namespace OnlineStore.DeviceLibrary
if (!isInit)
{
StoreMove = new StoreMoveInfo(StoreID);
IoCheckTimer = new System.Timers.Timer();
IoCheckTimer.Interval = 400;
IoCheckTimer.AutoReset = true;
IoCheckTimer.Enabled = false;
serverConnectTimer = new System.Timers.Timer();
serverConnectTimer.Interval = 1000;
serverConnectTimer.AutoReset = true;
serverConnectTimer.Enabled = false;
mainTimer = new System.Timers.Timer();
mainTimer.Enabled = false;
......
......@@ -16,17 +16,7 @@ namespace OnlineStore.LoadCSVLibrary
: base(id, cid, type, filepath)
{
}
///// <summary>
///// 温湿度传感器地址/COM口配置
///// </summary>
//[ConfigProAttribute("TemperateServer_Port")]
//public int TemperateServer_Port { get; set; }
///// <summary>
///// 温湿度 传感器地址
///// </summary>
//[ConfigProAttribute("Temperate_ServerAddress")]
//public string Temperate_Serveraddress { get; set; }
/// <summary>
/// 预警温度
/// </summary>
......@@ -57,16 +47,16 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
[ConfigProAttribute("IsHasDoorLimit")]
public int IsHasDoorLimit { get; set; }
/// <summary>
/// PRO 扫码枪IP Scanner_Ip 192.168.200.13
/// </summary>
[ConfigProAttribute("Scanner_Ip")]
public string Scanner_Ip { get; set; }
/// <summary>
/// PRO 扫码枪端口号 Scanner_Port 51236
/// </summary>
[ConfigProAttribute("Scanner_Port")]
public int Scanner_Port { get; set; }
///// <summary>
///// PRO 扫码枪IP Scanner_Ip 192.168.200.13
///// </summary>
//[ConfigProAttribute("Scanner_Ip")]
//public string Scanner_Ip { get; set; }
///// <summary>
///// PRO 扫码枪端口号 Scanner_Port 51236
///// </summary>
//[ConfigProAttribute("Scanner_Port")]
//public int Scanner_Port { get; set; }
/// <summary>
/// PRO (轴一)旋转轴原点目标速度 MiddleAxis_TargetSpeed 30000
/// </summary>
......@@ -567,6 +557,39 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("Big_TrayWidth")]
public int Big_TrayWidth { get; set; }
private Dictionary<string, string> CodeSizeMap =null ;
/// <summary>
/// PPRO,解码方式0=datalogic;1=halcon,ScanCodeType,1,,,,,,,
/// /// </summary>
[ConfigProAttribute("ScanCodeType")]
public int ScanCodeType { get; set; }
/// <summary>
/// PRO,DataLogic扫码枪-IP,Scanner_Ip,192.168.201.21,,,,,,,
/// /// </summary>
[ConfigProAttribute("Scanner_Ip")]
public string Scanner_Ip { get; set; }
/// <summary>
/// PRO,DataLogic扫码枪端口号,Scanner_Port,51236
/// /// </summary>
[ConfigProAttribute("Scanner_Port")]
public int Scanner_Port { get; set; }
/// <summary>
/// PRO,DataLogic扫码枪-开始扫码命令,StartScan_CMD,S,,,,,,,,,
/// /// </summary>
[ConfigProAttribute("StartScan_CMD")]
public string StartScan_CMD { get; set; }
/// <summary>
/// PRO,halcon-相机名称多个用#分割,CameraName,GigE:MV-CE100-30GC (00C69898483),,,,,,,
/// /// </summary>
[ConfigProAttribute("CameraName")]
public string CameraName { get; set; }
/// <summary>
/// PRO, halcon-条码类型,CodeType,QR Code#Data Matrix ECC 200#Micro QR Code
/// /// </summary>
[ConfigProAttribute("CodeType")]
public string CodeType { get; set; }
private static char codeSpilt= '#';
public string GetCodeSize(string code)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!