Commit 733ba004 刘韬

优化工单切换逻辑

1 个父辈 05c38db6
正在显示 37 个修改的文件 包含 611 行增加208 行删除
......@@ -236,5 +236,6 @@ namespace OnlineStore.Common
/// 真实料架号,可能为空
/// </summary>
public static string realRfid = "realRfid";
public static string singleOut = "singleOut";
}
}
......@@ -96,6 +96,7 @@ namespace OnlineStore.Common
{
//LogUtil.info("【"+url+"】发送【" + json + "】收到【" + result + "】");
}
LogUtil.OutputDebugString("【" + url + "】发送【" + json + "】收到【" + result + "】");
return reOP;
}
catch (Exception ex)
......
......@@ -100,7 +100,7 @@ namespace OnlineStore.Common
public static HumitureParam QueryData(string port)
{
HumitureParam param = new HumitureParam(0, 0);
List<double> data = queryData(port );
List<double> data = queryData(port);
if (data.Count.Equals(2))
{
param = new HumitureParam(data[1], data[0]);
......
......@@ -199,6 +199,7 @@ namespace OnlineStore.Common
{
info(LOGGER, msg);
}
[System.Runtime.InteropServices.DllImport("kernel32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto)]
public static extern void OutputDebugString(string message);
}
}
......@@ -38,6 +38,7 @@
<ApplicationIcon>box.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Agv, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Reference Include="CodeLibrary, Version=1.0.7380.18241, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\GeneralClassLibrary\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath>
......@@ -181,6 +182,7 @@
<EmbeddedResource Include="useControl\AxisMoveControl.resx">
<DependentUpon>AxisMoveControl.cs</DependentUpon>
</EmbeddedResource>
<None Include="DUOStore.exe.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
......
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</configSections>
<appSettings>
<!--是否开机自动启动料仓-->
<add key="App_AutoRun" value="1" />
<add key="App_Title" value="DUO料仓" />
<!-- 开始吹气的判断值(配置值=服务器发送的湿度值-开始吹气值)-->
<add key="StartBlowValue" value="4" />
<!-- 停止吹气的判断值(配置值=服务器发送的湿度值-停止吹气值)-->
<add key="StopBlowValue" value="4" />
<!--Server address-->
<add key="http.server" value="http://10.21.69.201/smdbox/" />
<!--storeType-->
<add key="store_count" value="2" />
<add key="Store_ConfigPath" value="\StoreConfig\StoreConfig.csv" />
<!--start one store config-->
<add key="Store_Position_Config" value="\StoreConfig\linePositions.csv" />
<add key="BOX_ConfigPath" value="\StoreConfig\BoxConfig.csv" />
<add key="Store_Type" value="RC_AC_PA" />
<add key="Store_CID" value="duo-store" />
<add key="Store_CID_1" value="duo-1" />
<add key="Store_CID_2" value="duo-2" />
<add key="Store_CID_1_disabled" value="0" />
<add key="Store_CID_2_disabled" value="0" />
<!--end one store config-->
<add key="ACBaudRate" value="115200" />
<add key="Config_Pwd" value="123456" />
<!--二维码类型列表配置,用#分割,一维码=Barcode 二维码: QR Code#Data Matrix ECC 200#Micro QR Code-->
<add key="CodeType" value="QR Code#Data Matrix ECC 200" />
<!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<add key="CodeParamPath" value="\CodeParam\" />
<!--出库等待料盘拿走的时间,秒-->
<add key="OutStoreWaitSeconds" value="1" />
<!--温控器类型,0=壁挂王字壳温湿度变送器,1=妙昕温湿度记录仪-->
<add key="HumitureControllerType" value="0" />
<add key="UseBuzzer" value="0" />
<!--IO模块是否主动上传-->
<add key="AIOAutoUpload" value="0" />
<add key="CodeCount" value="3" />
<add key="Tool_P3_Offset" value="70" />
<add key="Tool_P4_Offset" value="-20" />
<add key="Tool_P5_Offset" value="-20" />
<add key="Tool_P6_Offset" value="70" />
<add key="Tool_TargetSpeed" value="20" />
<add key="Tool_TargetPosition" value="10420" />
<add key="Agv_Log_Open" value="1" />
<!--进出轴位置-->
<add key="InOutDefaultPosition" value="300000" />
<!--当前料架信息-料架号-->
<add key="CurrShelfNum" value="B2" />
<!--当前料架信息-料架类型,0=空料架,1=入库料架,2=出库料架-->
<add key="CurrShelfType" value="-1" />
<add key="LastOutShelfType" value="1" />
<add key="HasT4Axis" value="false" />
<add key="AgvServerIp" value="10.21.69.52" />
<add key="AgvServerPort" value="9501" />
<add key="code_block_size_list" value="13,17" />
<add key="InstoreEndSendShelf" value="1" />
<add key="OutstoreEndSendShelf" value="1" />
</appSettings>
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="logs/duoStore.log" />
<param name="Encoding" value="UTF-8" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyy-MM-dd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n" />
</layout>
</appender>
<appender name="Rmaxis" type="log4net.Appender.RollingFileAppender">
<file value="logs/Rmaxis.log" />
<param name="Encoding" value="UTF-8" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyy-MM-dd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n" />
</layout>
</appender>
<appender name="AIOBOX" type="log4net.Appender.RollingFileAppender">
<file value="logs/aio/AIOBOX.log" />
<param name="Encoding" value="UTF-8" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyy-MM-dd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n" />
</layout>
</appender>
<appender name="HCBOARD" type="log4net.Appender.RollingFileAppender">
<file value="logs/HCBOARD.log" />
<param name="Encoding" value="UTF-8" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyy-MM-dd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t] %m%n" />
</layout>
</appender>
<appender name="AgvClient" type="log4net.Appender.RollingFileAppender">
<file value="logs/AgvClient.log" />
<param name="Encoding" value="UTF-8" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyy-MM-dd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t] %m%n" />
</layout>
</appender>
<appender name="TheRFID" type="log4net.Appender.RollingFileAppender">
<file value="logs/TheRFID.log" />
<param name="Encoding" value="UTF-8" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyy-MM-dd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t] %m%n" />
</layout>
</appender>
<logger name="RollingLogFileAppender" additivity="false">
<level value="Info" />
<appender-ref ref="RollingLogFileAppender" />
</logger>
<logger name="AIOBOX" additivity="false">
<level value="Info" />
<appender-ref ref="AIOBOX" />
</logger>
<logger name="Rmaxis" additivity="false">
<level value="ALL" />
<appender-ref ref="Rmaxis" />
</logger>
<logger name="HCBOARD" additivity="false">
<level value="ALL" />
<appender-ref ref="HCBOARD" />
</logger>
<logger name="Agv">
<level value="ALL" />
<appender-ref ref="Agv" />
</logger>
<logger name="TheRFID">
<level value="ALL" />
<appender-ref ref="TheRFID" />
</logger>
<!--
<root>
<level value="All" />
<appender-ref ref="RollingLogFileAppender" />
</root>-->
</log4net>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" />
<codeBase version="2.0.8.0" href="log4netv2.0.8.0\log4net.dll" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
\ No newline at end of file
......@@ -37,6 +37,7 @@ namespace OnlineStore.DUOStore
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage4 = new System.Windows.Forms.TabPage();
this.groupInout = new System.Windows.Forms.GroupBox();
this.cmbHight = new System.Windows.Forms.ComboBox();
this.btnNgPro = new System.Windows.Forms.Button();
this.btnAxisP = new System.Windows.Forms.Button();
this.btnSingleOut = new System.Windows.Forms.Button();
......@@ -111,7 +112,7 @@ namespace OnlineStore.DUOStore
this.lblWarnMsg = new System.Windows.Forms.Label();
this.lblThisSta = new System.Windows.Forms.Label();
this.chbDisable = new System.Windows.Forms.CheckBox();
this.cmbHight = new System.Windows.Forms.ComboBox();
this.btn_clearTimeout = new System.Windows.Forms.Button();
this.groupBox4.SuspendLayout();
this.groupBox1.SuspendLayout();
this.tabControl1.SuspendLayout();
......@@ -284,6 +285,7 @@ namespace OnlineStore.DUOStore
this.groupInout.Controls.Add(this.btnUpdownP11);
this.groupInout.Controls.Add(this.btnMiddleP11);
this.groupInout.Controls.Add(this.lblMsg);
this.groupInout.Controls.Add(this.btn_clearTimeout);
this.groupInout.Controls.Add(this.btnSavePosition);
this.groupInout.Controls.Add(this.btnStartAuTo);
this.groupInout.Controls.Add(this.label9);
......@@ -299,6 +301,22 @@ namespace OnlineStore.DUOStore
this.groupInout.TabStop = false;
this.groupInout.Text = "料仓操作";
//
// cmbHight
//
this.cmbHight.FormattingEnabled = true;
this.cmbHight.Items.AddRange(new object[] {
"8",
"12",
"16",
"24",
"32",
"56"});
this.cmbHight.Location = new System.Drawing.Point(252, 25);
this.cmbHight.Name = "cmbHight";
this.cmbHight.Size = new System.Drawing.Size(88, 28);
this.cmbHight.TabIndex = 311;
this.cmbHight.Text = "8";
//
// btnNgPro
//
this.btnNgPro.BackColor = System.Drawing.Color.White;
......@@ -1347,21 +1365,18 @@ namespace OnlineStore.DUOStore
this.chbDisable.UseVisualStyleBackColor = true;
this.chbDisable.CheckedChanged += new System.EventHandler(this.chbDisable_CheckedChanged);
//
// cmbHight
// btn_clearTimeout
//
this.cmbHight.FormattingEnabled = true;
this.cmbHight.Items.AddRange(new object[] {
"8",
"12",
"16",
"24",
"32",
"56"});
this.cmbHight.Location = new System.Drawing.Point(252, 25);
this.cmbHight.Name = "cmbHight";
this.cmbHight.Size = new System.Drawing.Size(88, 28);
this.cmbHight.TabIndex = 311;
this.cmbHight.Text = "8";
this.btn_clearTimeout.BackColor = System.Drawing.Color.White;
this.btn_clearTimeout.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_clearTimeout.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_clearTimeout.Location = new System.Drawing.Point(898, 21);
this.btn_clearTimeout.Name = "btn_clearTimeout";
this.btn_clearTimeout.Size = new System.Drawing.Size(128, 39);
this.btn_clearTimeout.TabIndex = 217;
this.btn_clearTimeout.Text = "清除等待超时";
this.btn_clearTimeout.UseVisualStyleBackColor = false;
this.btn_clearTimeout.Click += new System.EventHandler(this.btn_clearTimeout_Click);
//
// FrmBox
//
......@@ -1489,6 +1504,7 @@ namespace OnlineStore.DUOStore
private System.Windows.Forms.Label lblCanOut;
private System.Windows.Forms.CheckBox chbDisable;
private System.Windows.Forms.ComboBox cmbHight;
private System.Windows.Forms.Button btn_clearTimeout;
}
}
......@@ -838,5 +838,11 @@ namespace OnlineStore.DUOStore
ConfigAppSettings.SaveValue("Store_CID_" + BoxBean.ID + "_disabled", chbDisable.Checked ? 1 : 0);
}
private void btn_clearTimeout_Click(object sender, EventArgs e)
{
if (BoxBean.alarmType == AlarmType.IoSingleTimeOut)
BoxBean.MoveInfo.EndStepWait();
}
}
}
......@@ -335,13 +335,13 @@ namespace OnlineStore.DUOStore
private void btnLineRun_Click(object sender, EventArgs e)
{
StoreManager.Store.LineRun(null);
StoreManager.Store.LineRun(null, "btnLineRun_Click");
}
private void btnLineStop_Click(object sender, EventArgs e)
{
StoreManager.Store.LineStop(null);
StoreManager.Store.LineStop(null, "btnLineStop_Click");
}
private void groupBox1_Enter(object sender, EventArgs e)
......
......@@ -35,6 +35,7 @@
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.panel1 = new System.Windows.Forms.Panel();
this.btn_ClearMission = new System.Windows.Forms.Button();
this.BTN_ReleaseShelf = new System.Windows.Forms.Button();
this.chbInstoreEnd = new System.Windows.Forms.CheckBox();
this.chkDebug = new System.Windows.Forms.CheckBox();
......@@ -42,6 +43,7 @@
this.chbAutoRun = new System.Windows.Forms.CheckBox();
this.btnCopyLog = new System.Windows.Forms.Button();
this.btnClearLog = new System.Windows.Forms.Button();
this.lblMission = new System.Windows.Forms.Label();
this.lblShelf = new System.Windows.Forms.Label();
this.chbUseBuzzer = new System.Windows.Forms.CheckBox();
this.chbOutstoreEnd = new System.Windows.Forms.CheckBox();
......@@ -76,6 +78,7 @@
this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.lblAgv = new System.Windows.Forms.Label();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
......@@ -139,6 +142,7 @@
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel1.Controls.Add(this.btn_ClearMission);
this.panel1.Controls.Add(this.BTN_ReleaseShelf);
this.panel1.Controls.Add(this.chbInstoreEnd);
this.panel1.Controls.Add(this.chkDebug);
......@@ -146,6 +150,8 @@
this.panel1.Controls.Add(this.chbAutoRun);
this.panel1.Controls.Add(this.btnCopyLog);
this.panel1.Controls.Add(this.btnClearLog);
this.panel1.Controls.Add(this.lblAgv);
this.panel1.Controls.Add(this.lblMission);
this.panel1.Controls.Add(this.lblShelf);
this.panel1.Controls.Add(this.chbUseBuzzer);
this.panel1.Controls.Add(this.chbOutstoreEnd);
......@@ -154,12 +160,25 @@
this.panel1.Size = new System.Drawing.Size(182, 623);
this.panel1.TabIndex = 271;
//
// btn_ClearMission
//
this.btn_ClearMission.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btn_ClearMission.BackColor = System.Drawing.Color.White;
this.btn_ClearMission.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_ClearMission.Location = new System.Drawing.Point(12, 465);
this.btn_ClearMission.Name = "btn_ClearMission";
this.btn_ClearMission.Size = new System.Drawing.Size(140, 35);
this.btn_ClearMission.TabIndex = 272;
this.btn_ClearMission.Text = "释放需求单绑定";
this.btn_ClearMission.UseVisualStyleBackColor = false;
this.btn_ClearMission.Click += new System.EventHandler(this.btn_ClearMission_Click);
//
// BTN_ReleaseShelf
//
this.BTN_ReleaseShelf.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.BTN_ReleaseShelf.BackColor = System.Drawing.Color.White;
this.BTN_ReleaseShelf.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.BTN_ReleaseShelf.Location = new System.Drawing.Point(12, 366);
this.BTN_ReleaseShelf.Location = new System.Drawing.Point(12, 401);
this.BTN_ReleaseShelf.Name = "BTN_ReleaseShelf";
this.BTN_ReleaseShelf.Size = new System.Drawing.Size(140, 35);
this.BTN_ReleaseShelf.TabIndex = 272;
......@@ -171,7 +190,7 @@
//
this.chbInstoreEnd.AutoSize = true;
this.chbInstoreEnd.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbInstoreEnd.Location = new System.Drawing.Point(12, 241);
this.chbInstoreEnd.Location = new System.Drawing.Point(12, 303);
this.chbInstoreEnd.Name = "chbInstoreEnd";
this.chbInstoreEnd.Size = new System.Drawing.Size(140, 24);
this.chbInstoreEnd.TabIndex = 271;
......@@ -183,7 +202,7 @@
//
this.chkDebug.AutoSize = true;
this.chkDebug.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chkDebug.Location = new System.Drawing.Point(12, 205);
this.chkDebug.Location = new System.Drawing.Point(12, 267);
this.chkDebug.Name = "chkDebug";
this.chkDebug.Size = new System.Drawing.Size(132, 24);
this.chkDebug.TabIndex = 194;
......@@ -195,7 +214,7 @@
//
this.lblMoveInfo.AutoSize = true;
this.lblMoveInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblMoveInfo.Location = new System.Drawing.Point(12, 41);
this.lblMoveInfo.Location = new System.Drawing.Point(3, 41);
this.lblMoveInfo.Name = "lblMoveInfo";
this.lblMoveInfo.Size = new System.Drawing.Size(56, 17);
this.lblMoveInfo.TabIndex = 270;
......@@ -205,7 +224,7 @@
//
this.chbAutoRun.AutoSize = true;
this.chbAutoRun.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbAutoRun.Location = new System.Drawing.Point(12, 133);
this.chbAutoRun.Location = new System.Drawing.Point(12, 195);
this.chbAutoRun.Name = "chbAutoRun";
this.chbAutoRun.Size = new System.Drawing.Size(140, 24);
this.chbAutoRun.TabIndex = 94;
......@@ -241,11 +260,21 @@
this.btnClearLog.Visible = false;
this.btnClearLog.Click += new System.EventHandler(this.btnClearLog_Click);
//
// lblMission
//
this.lblMission.AutoSize = true;
this.lblMission.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblMission.Location = new System.Drawing.Point(3, 24);
this.lblMission.Name = "lblMission";
this.lblMission.Size = new System.Drawing.Size(68, 17);
this.lblMission.TabIndex = 204;
this.lblMission.Text = "当前任务:";
//
// lblShelf
//
this.lblShelf.AutoSize = true;
this.lblShelf.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblShelf.Location = new System.Drawing.Point(12, 10);
this.lblShelf.Location = new System.Drawing.Point(3, 7);
this.lblShelf.Name = "lblShelf";
this.lblShelf.Size = new System.Drawing.Size(68, 17);
this.lblShelf.TabIndex = 204;
......@@ -255,7 +284,7 @@
//
this.chbUseBuzzer.AutoSize = true;
this.chbUseBuzzer.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbUseBuzzer.Location = new System.Drawing.Point(12, 169);
this.chbUseBuzzer.Location = new System.Drawing.Point(12, 231);
this.chbUseBuzzer.Name = "chbUseBuzzer";
this.chbUseBuzzer.Size = new System.Drawing.Size(98, 24);
this.chbUseBuzzer.TabIndex = 195;
......@@ -267,7 +296,7 @@
//
this.chbOutstoreEnd.AutoSize = true;
this.chbOutstoreEnd.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbOutstoreEnd.Location = new System.Drawing.Point(12, 277);
this.chbOutstoreEnd.Location = new System.Drawing.Point(12, 339);
this.chbOutstoreEnd.Name = "chbOutstoreEnd";
this.chbOutstoreEnd.Size = new System.Drawing.Size(140, 24);
this.chbOutstoreEnd.TabIndex = 202;
......@@ -526,6 +555,16 @@
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// lblAgv
//
this.lblAgv.AutoSize = true;
this.lblAgv.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblAgv.Location = new System.Drawing.Point(3, 111);
this.lblAgv.Name = "lblAgv";
this.lblAgv.Size = new System.Drawing.Size(57, 17);
this.lblAgv.TabIndex = 204;
this.lblAgv.Text = "AGV状态";
//
// FrmStore
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
......@@ -608,6 +647,9 @@
private System.Windows.Forms.Button BTN_ReleaseShelf;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.PictureBox pictureBox2;
private System.Windows.Forms.Label lblMission;
private System.Windows.Forms.Button btn_ClearMission;
private System.Windows.Forms.Label lblAgv;
}
}
......@@ -507,6 +507,7 @@ namespace OnlineStore.DUOStore
}
lblShelf.Text = "当前" + type + ":" + store.CurrShelfNum;
lblMission.Text = "当前需求单:"+StoreManager.LastVisualRfid;
string msg = "";
foreach(BoxBean box in store.BoxMap.Values)
{
......@@ -516,8 +517,16 @@ namespace OnlineStore.DUOStore
msg += box.Name+":"+s+ "\r" ;
}
}
if (!string.IsNullOrWhiteSpace(store.WarnMsg))
msg += store.Name + ":" + store.WarnMsg + "\r";
UpdateListBox();
lblWarnMsg.Text = msg;
lblAgv.Text = "AGV状态:\n";
lblAgv.Text += $" 入口{StoreManager.Store.Config.AgvInName}:{AgvClient.GetAction(StoreManager.Store.Config.AgvInName)},{AgvClient.GetShelf(StoreManager.Store.Config.AgvInName)}\n";
lblAgv.Text += $" 出口{StoreManager.Store.Config.AgvOutName}:{AgvClient.GetAction(StoreManager.Store.Config.AgvOutName)},{AgvClient.GetShelf(StoreManager.Store.Config.AgvOutName)}\n";
LogM();
}
......@@ -757,5 +766,10 @@ namespace OnlineStore.DUOStore
MessageBox.Show("料串正在出入库中,不满足释放条件");
}
}
private void btn_ClearMission_Click(object sender, EventArgs e)
{
StoreManager.LastVisualRfid = "";
}
}
}
using log4net;
using log4net.Config;
using OnlineStore.Common;
using OnlineStore.DeviceLibrary;
using OnlineStore.DUOStore;
using System;
using System.Collections.Generic;
......@@ -57,6 +58,12 @@ namespace OnlineStore.DUOStore
//string path = @"http://localhost:4090/rest/api/v1/station/status";
//HttpHelper.PostOperation(path, new Operation());
List<InOutParam> aa = new List<InOutParam>();
aa.Add(new InOutParam(MoveType.InStore, "123", "123", 7, 8, 1));
var aaa = from a in aa where a.TargetPosition == 1 select a;
var xccsaf = aaa.Count();
//string a = "LZAUJN0208MAN;E20210105 0365;BQT001200261510792021010515000;R107920210118A1049";
//a = a.Replace("\u001a", "");
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
......
......@@ -29,22 +29,23 @@ namespace OnlineStore.DeviceLibrary
agvClient.Connected += AgvClient_Connected;
//NodeList.Add(StoreManager.Config.AgvInName);
//NodeList.Add(StoreManager.Config.AgvOutName);
actionMap = new Dictionary<string, Agv.ClientAction>();
shelfMap = new Dictionary<string, Agv.ClientShelf>();
foreach (string key in NodeList)
{
actionMap.Add(key, Agv.ClientAction.None);
shelfMap.Add(key, Agv.ClientShelf.None);
}
agvClient.Connect(ServerIp, ServerPort);
foreach (string id in NodeList)
{
//SetStatus(id, "");
agvClient.SetStatus(id);
LogUtil.info("agv init ,SetStatus[" + id + "]=none ");
}
SetCancelState(false);
}
actionMap = new Dictionary<string, Agv.ClientAction>();
shelfMap = new Dictionary<string, Agv.ClientShelf>();
foreach (string key in NodeList)
{
actionMap.Add(key, Agv.ClientAction.None);
shelfMap.Add(key, Agv.ClientShelf.None);
}
agvClient.Connect(ServerIp, ServerPort);
foreach (string id in NodeList)
{
//SetStatus(id, "");
agvClient.SetStatus(id);
LogUtil.info("agv init ,SetStatus[" + id + "]=none ");
}
SetCancelState(false);
}
catch (Exception ex)
{
......@@ -80,10 +81,11 @@ namespace OnlineStore.DeviceLibrary
if (agvClient == null)
return;
if (actionMap.ContainsKey(id))
if (actionMap.ContainsKey(id) && shelfMap.ContainsKey(id))
{
Agv.ClientAction currA = actionMap[id]; //相同状态就设置一次
if (currA.Equals(action))
Agv.ClientShelf clientShelf1 = shelfMap[id];
if (currA.Equals(action) && clientShelf1.Equals(clientShelf))
{
return;
}
......@@ -100,7 +102,8 @@ namespace OnlineStore.DeviceLibrary
{
try
{
LogUtil.info("收到 AgvClient_Ready [" + id + "] [" + rfid + "] " + GetAction(id).ToString());
if (rfid!= "Heartbeat package")
LogUtil.info("收到 AgvClient_Ready [" + id + "] [" + rfid + "] " + GetAction(id).ToString());
if (GetAction(id) == ClientAction.NeedEnter || id == StoreManager.Config.AgvInName)
{
......@@ -114,7 +117,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
LogUtil.error("收到 AgvClient_Arrive [" + id + "] [" + rfid + "] 未找到对应的设备 ,暂不处理");
//LogUtil.error("收到 AgvClient_Arrive [" + id + "] [" + rfid + "] 未找到对应的设备 ,暂不处理");
}
}
catch (Exception ex)
......
......@@ -144,6 +144,12 @@
</ItemGroup>
<ItemGroup />
<ItemGroup>
<None Include="StoreConfig\box_1_Camera.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="StoreConfig\box_2_Camera.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="StoreConfig\FixPositions.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
......@@ -154,13 +160,13 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="StoreConfig\StoreConfig.csv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="StoreConfig\BoxConfig_2.csv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="StoreConfig\BoxConfig_1.csv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
......
类型,分类编号,说明,名称,属性值,设备名称,电器定义,目标速度,加速时间,减速时间,原点低速度,原点高速,原点加速度,脉冲最小误差,脉冲最大误差,脉冲最小限位,脉冲最大限位
AXIS,,L1_旋转轴,Middle_Axis,0,HC,,800,2400,2400,50,250,3000,5,20,0,0
AXIS,,L2_上下轴,UpDown_Axis,1,HC,,2000,3000,6000,50,250,3000,10,100,0,0
AXIS,,L3_进出轴,InOut_Axis,2,HC,,1000,5000,5000,50,300,8000,10,1000,0,0
AXIS,,L4_压紧轴,Comp_Axis,3,HC,,10000,60000,60000,3000,10000,20000,10,1000,0,0
AXIS,,L3_进出轴,InOut_Axis,2,HC,,1000,15000,17000,50,300,8000,10,1000,0,0
AXIS,,L4_压紧轴,Comp_Axis,3,HC,,10000,90000,90000,3000,10000,20000,10,1000,0,0
,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,,L2_上下轴_P1待机点/入料口低点,UpDownAxis_P1,4510,,,,,,,,,,,,
PRO,,L2_上下轴_P2入料口高点,UpDownAxis_P2,4726,,,,,,,,,,,,
PRO,,L1_旋转轴_P1待机点/入料口位置,MiddleAxis_P1,8041,,,,,,,,,,,,
PRO,,L2_上下轴_P1待机点/入料口低点,UpDownAxis_P1,4382,,,,,,,,,,,,
PRO,,L2_上下轴_P2入料口高点,UpDownAxis_P2,4745,,,,,,,,,,,,
PRO,,L1_旋转轴_P1待机点/入料口位置,MiddleAxis_P1,8330,,,,,,,,,,,,
PRO,,L3_进出轴_P1待机点,InOutAxis_P1,0,,,,,,,,,,,,
PRO,,L4_压紧轴_P1待机点,CompAxis_P1,20000,,,,,,,,,,,,
PRO,,L4_压紧轴_P2压紧点范围对应值,CompAxis_P2_List,8=49514;12=44615;16=39596;,,,,,,,,,,,,
PRO,,L4_压紧轴_P1待机点,CompAxis_P1,2000,,,,,,,,,,,,
PRO,,L4_压紧轴_P2压紧点范围对应值,CompAxis_P2_List,8=49928;12=45455;16=42495;,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,,L2_上下轴_P11-出料口-低点,UpDownAxis_P11,2815,,,,,,,,,,,,
PRO,,L2_上下轴_P12-出料口-高点,UpDownAxis_P12,2919,,,,,,,,,,,,
PRO,,L1_旋转轴_P11-出料口位置,MiddleAxis_P11,1237,,,,,,,,,,,,
PRO,,L3_进出轴_P2-入料口取放料点,InOutAxis_P2,4623,,,,,,,,,,,,
PRO,,L2_上下轴_P11-出料口-低点,UpDownAxis_P11,2783,,,,,,,,,,,,
PRO,,L2_上下轴_P12-出料口-高点,UpDownAxis_P12,2907,,,,,,,,,,,,
PRO,,L1_旋转轴_P11-出料口位置,MiddleAxis_P11,1304,,,,,,,,,,,,
PRO,,L3_进出轴_P2-入料口取放料点,InOutAxis_P2,4730,,,,,,,,,,,,
PRO,,L3_进出轴_P11-出料口取放料点,InOutAxis_P11,4497,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,,L2_上下轴_P1速度/高速,UpDownAxis_P1_Speed,1500,,,,,,,,,,,,
PRO,,L2_上下轴_P2速度/低速,UpDownAxis_P2_Speed,150,,,,,,,,,,,,
PRO,,L2_上下轴_P3速度,UpDownAxis_P3_Speed,2000,,, ,,,,,,,,,
PRO,,L2_上下轴_P1速度/高速,UpDownAxis_P1_Speed,5000,,,,,,,,,,,,
PRO,,L2_上下轴_P2速度/低速,UpDownAxis_P2_Speed,450,,,,,,,,,,,,
PRO,,L2_上下轴_P3速度,UpDownAxis_P3_Speed,5000,,, ,,,,,,,,,
PRO,,L2_上下轴_P4速度,UpDownAxis_P4_Speed,150,,,,,,,,,,,,
PRO,,L2_上下轴_P5速度,UpDownAxis_P5_Speed,2000,,,,,,,,,,,,
PRO,,L2_上下轴_P5速度,UpDownAxis_P5_Speed,5000,,,,,,,,,,,,
PRO,,L2_上下轴_P6速度,UpDownAxis_P6_Speed,150,,,,,,,,,,,,
PRO,,L2_上下轴_P7速度,UpDownAxis_P7_Speed,2000,,,,,,,,,,,,
PRO,,L2_上下轴_P7速度,UpDownAxis_P7_Speed,5000,,,,,,,,,,,,
PRO,,L2_上下轴_P8速度,UpDownAxis_P8_Speed,100,,,,,,,,,,,,
PRO,,L1_旋转轴_P1速度,MiddleAxis_P1_Speed,1000,,,,,,,,,,,,
PRO,,L1_旋转轴_P2速度,MiddleAxis_P2_Speed,1000,,,,,,,,,,,,
PRO,,L3_进出轴_P1速度,InOutAxis_P1_Speed,3000,,,,,,,,,,,,
PRO,,L3_进出轴_P2速度,InOutAxis_P2_Speed,3000,,,,,,,,,,,,
PRO,,L3_进出轴_P3速度,InOutAxis_P3_Speed,3000,,,,,,,,,,,,
PRO,,L1_旋转轴_P1速度,MiddleAxis_P1_Speed,1200,,,,,,,,,,,,
PRO,,L1_旋转轴_P2速度,MiddleAxis_P2_Speed,1200,,,,,,,,,,,,
PRO,,L3_进出轴_P1速度,InOutAxis_P1_Speed,6000,,,,,,,,,,,,
PRO,,L3_进出轴_P2速度,InOutAxis_P2_Speed,6000,,,,,,,,,,,,
PRO,,L3_进出轴_P3速度,InOutAxis_P3_Speed,6000,,,,,,,,,,,,
PRO,,L4_压紧轴_P1速度,CompAxis_P1_Speed,8000,,,,,,,,,,,,
PRO,,L4_压紧轴_P2速度,CompAxis_P2_Speed,30000,,,,,,,,,,,,
PRO,,L4_压紧轴_P3速度,CompAxis_P3_Speed,10000,,,,,,,,,,,,
PRO,,L4_压紧轴_P2速度,CompAxis_P2_Speed,60000,,,,,,,,,,,,
PRO,,L4_压紧轴_P3速度,CompAxis_P3_Speed,30000,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,,L2_上下轴_P11速度/低速,UpDownAxis_P11_Speed,150,,,,,,,,,,,,
PRO,,L2_上下轴_P12速度/高速,UpDownAxis_P12_Speed,1500,,,,,,,,,,,,
PRO,,L3_进出轴_P11速度,InOutAxis_P11_Speed,3000,,,,,,,,,,,,
PRO,,L1_旋转轴_P11速度,MiddleAxis_P11_Speed,1000,,,,,,,,,,,,
PRO,,L3_进出轴_P11速度,InOutAxis_P11_Speed,4000,,,,,,,,,,,,
PRO,,L1_旋转轴_P11速度,MiddleAxis_P11_Speed,1200,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,,温湿度端口号,Humiture_Port,COM5,,,,,,,,,,,,
PRO,,是否是调试状态,IsInDebug,0,,,,,,,,,,,,
PRO,,是否使用料叉盘检测信号,IsUse_Tray_Check,0,,,,,,,,,,,,
PRO,,旋转轴反转点位补偿,MiddleAxis_Reverse_Offset,11,,,,,,,,,,,,
PRO,,是否使用料叉盘检测信号,IsUse_Tray_Check,1,,,,,,,,,,,,
PRO,,旋转轴反转点位补偿,MiddleAxis_Reverse_Offset,5,,,,,,,,,,,,
类型,分类编号,说明,名称,属性值,设备名称,电器定义,目标速度,加速时间,减速时间,原点低速度,原点高速,原点加速度,脉冲最小误差,脉冲最大误差,脉冲最小限位,脉冲最大限位
AXIS,,R1_旋转轴,Middle_Axis,8,HC,,800,2400,2400,50,250,3000,10,1000,0,0
AXIS,,R2_上下轴,UpDown_Axis,9,HC,,2000,3000,6000,50,250,3000,10,1000,0,0
AXIS,,R3_进出轴,InOut_Axis,10,HC,,1000,5000,5000,50,300,8000,10,1000,0,0
AXIS,,R4_压紧轴,Comp_Axis,11,HC,,10000,25000,25000,3000,10000,20000,10,1000,0,0
AXIS,,R3_进出轴,InOut_Axis,10,HC,,1000,5000,6000,50,250,4000,10,1000,0,0
AXIS,,R4_压紧轴,Comp_Axis,11,HC,,10000,90000,90000,3000,10000,20000,10,1000,0,0
,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,,R2_上下轴_P1待机点/扫码放料低点,UpDownAxis_P1,4542,,,,,,,,,,,,
PRO,,R2_上下轴_P2扫码放料高点缓冲点,UpDownAxis_P2,4759,,,,,,,,,,,,
PRO,,R1_旋转轴_P1待机点/扫码放料点,MiddleAxis_P1,1806,,,,,,,,,,,,
PRO,,R2_上下轴_P1待机点/扫码放料低点,UpDownAxis_P1,4425,,,,,,,,,,,,
PRO,,R2_上下轴_P2扫码放料高点缓冲点,UpDownAxis_P2,4780,,,,,,,,,,,,
PRO,,R1_旋转轴_P1待机点/扫码放料点,MiddleAxis_P1,1829,,,,,,,,,,,,
PRO,,R3_进出轴_P1待机点,InOutAxis_P1,0,,,,,,,,,,,,
PRO,,R4_压紧轴_P1待机点,CompAxis_P1,20000,,,,,,,,,,,,
PRO,,L4_压紧轴_P2压紧点范围对应值,CompAxis_P2_List,8=49514;12=44615;16=39596;,,,,,,,,,,,,
PRO,,R4_压紧轴_P1待机点,CompAxis_P1,0,,,,,,,,,,,,
PRO,,L4_压紧轴_P2压紧点范围对应值,CompAxis_P2_List,8=72480;12=66663;16=63358;24=56449;32=46239;44=36239;56=23755,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,,R2_上下轴_P11-出料口-低点,UpDownAxis_P11,2849,,,,,,,,,,,,
PRO,,R2_上下轴_P12-出料口-高点,UpDownAxis_P12,2979,,,,,,,,,,,,
PRO,,R1_旋转轴_P11-出料口位置,MiddleAxis_P11,8607,,,,,,,,,,,,
PRO,,R3_进出轴_P2-入料口取放料点,InOutAxis_P2,4623,,,,,,,,,,,,
PRO,,R3_进出轴_P11-出料口取放料点,InOutAxis_P11,4497,,,,,,,,,,,,
PRO,,R2_上下轴_P11-出料口-低点,UpDownAxis_P11,2729,,,,,,,,,,,,
PRO,,R2_上下轴_P12-出料口-高点,UpDownAxis_P12,2899,,,,,,,,,,,,
PRO,,R1_旋转轴_P11-出料口位置,MiddleAxis_P11,8508,,,,,,,,,,,,
PRO,,R3_进出轴_P2-入料口取放料点,InOutAxis_P2,4025,,,,,,,,,,,,
PRO,,R3_进出轴_P11-出料口取放料点,InOutAxis_P11,4073,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,,R2_上下轴_P1速度/高速,UpDownAxis_P1_Speed,1500,,,,,,,,,,,,
PRO,,R2_上下轴_P2速度/低速,UpDownAxis_P2_Speed,150,,,,,,,,,,,,
PRO,,R2_上下轴_P3速度,UpDownAxis_P3_Speed,2000,,, ,,,,,,,,,
PRO,,R2_上下轴_P1速度/高速,UpDownAxis_P1_Speed,3000,,,,,,,,,,,,
PRO,,R2_上下轴_P2速度/低速,UpDownAxis_P2_Speed,450,,,,,,,,,,,,
PRO,,R2_上下轴_P3速度,UpDownAxis_P3_Speed,3000,,, ,,,,,,,,,
PRO,,R2_上下轴_P4速度,UpDownAxis_P4_Speed,150,,,,,,,,,,,,
PRO,,R2_上下轴_P5速度,UpDownAxis_P5_Speed,2000,,,,,,,,,,,,
PRO,,R2_上下轴_P5速度,UpDownAxis_P5_Speed,3000,,,,,,,,,,,,
PRO,,R2_上下轴_P6速度,UpDownAxis_P6_Speed,150,,,,,,,,,,,,
PRO,,R2_上下轴_P7速度,UpDownAxis_P7_Speed,2000,,,,,,,,,,,,
PRO,,R2_上下轴_P7速度,UpDownAxis_P7_Speed,3000,,,,,,,,,,,,
PRO,,R2_上下轴_P8速度,UpDownAxis_P8_Speed,100,,,,,,,,,,,,
PRO,,R1_旋转轴_P1速度,MiddleAxis_P1_Speed,1000,,,,,,,,,,,,
PRO,,R1_旋转轴_P2速度,MiddleAxis_P2_Speed,1000,,,,,,,,,,,,
PRO,,R3_进出轴_P1速度,InOutAxis_P1_Speed,3000,,,,,,,,,,,,
PRO,,R3_进出轴_P2速度,InOutAxis_P2_Speed,3000,,,,,,,,,,,,
PRO,,R3_进出轴_P3速度,InOutAxis_P3_Speed,3000,,,,,,,,,,,,
PRO,,R4_压紧轴_P1速度,CompAxis_P1_Speed,6000,,,,,,,,,,,,
PRO,,R4_压紧轴_P2速度,CompAxis_P2_Speed,9500,,,,,,,,,,,,
PRO,,R4_压紧轴_P3速度,CompAxis_P3_Speed,9500,,,,,,,,,,,,
PRO,,R3_进出轴_P1速度,InOutAxis_P1_Speed,5000,,,,,,,,,,,,
PRO,,R3_进出轴_P2速度,InOutAxis_P2_Speed,4000,,,,,,,,,,,,
PRO,,R3_进出轴_P3速度,InOutAxis_P3_Speed,4000,,,,,,,,,,,,
PRO,,R4_压紧轴_P1速度,CompAxis_P1_Speed,8000,,,,,,,,,,,,
PRO,,R4_压紧轴_P2速度,CompAxis_P2_Speed,60000,,,,,,,,,,,,
PRO,,R4_压紧轴_P3速度,CompAxis_P3_Speed,30000,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,,R2_上下轴_P11速度/低速,UpDownAxis_P11_Speed,150,,,,,,,,,,,,
PRO,,R2_上下轴_P12速度/高速,UpDownAxis_P12_Speed,1500,,,,,,,,,,,,
PRO,,R3_进出轴_P11速度,InOutAxis_P11_Speed,3000,,,,,,,,,,,,
PRO,,R1_旋转轴_P11速度,MiddleAxis_P11_Speed,1000,,,,,,,,,,,,
PRO,,R3_进出轴_P11速度,InOutAxis_P11_Speed,4000,,,,,,,,,,,,
PRO,,R1_旋转轴_P11速度,MiddleAxis_P11_Speed,1200,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,,温湿度端口号,Humiture_Port,COM5,,,,,,,,,,,,
PRO,,是否是调试状态,IsInDebug,0,,,,,,,,,,,,
PRO,,是否使用料叉盘检测信号,IsUse_Tray_Check,0,,,,,,,,,,,,
PRO,,旋转轴反转点位补偿,MiddleAxis_Reverse_Offset,6,,,,,,,,,,,,
\ No newline at end of file
PRO,,是否使用料叉盘检测信号,IsUse_Tray_Check,1,,,,,,,,,,,,
PRO,,旋转轴反转点位补偿,MiddleAxis_Reverse_Offset,10,,,,,,,,,,,,
位置,优先级,高度,宽度,料仓ID,旋转轴库位点P2,升降轴库位出料前点P5,升降轴库位出料缓冲点P6,升降轴库位入料前点P3,升降轴库位入料缓冲点P4,进出轴库位点取料点P3,压紧轴压紧点P2,压紧轴压紧前点P3
fix_1#7,1,8,7,1,306200,1290614,1299614,1299614,1290614,110692,10,10
fix_2#11,2,8,7,2,306200,1290614,1299614,1299614,1290614,110692,10,10
fix_2#13,3,8,7,2,306200,1290614,1299614,1299614,1290614,110692,10,10
fix_1#7,1,16,7,1,8330,3785,4088,4088,3785,4693,1,25127
fix_2#13#,2,56,13,2,8478,3136,3475,3475,3136,4120,1,0
类型,分类编号,说明,名称,属性值,设备名称,电器定义,目标速度,加速时间,减速时间,原点低速度,原点高速,原点加速度,脉冲最小误差,脉冲最大误差,脉冲最小限位,脉冲最大限位
AXIS,,T1_提升机构升降轴,T1_Batch_Axis,4,HC,,18000,60000,60000,8000,18000,40000,1000,1000,0,0
AXIS,,T2_取料机构旋转轴,T2_Middle_Axis,6,HC,,1500,3000,3000,100,500,3000,10,1000,0,0
AXIS,,T3_取料机构上下轴,T3_Updown_Axis,5,HC,,20000,60000,60000,2000,7000,21000,10,1000,0,0
AXIS,,T4_取料机构进出轴,T4_InOut_Axis,7,HC,,600,1500,1500,50,300,1500,10,1000,0,0
AXIS,,T1_提升机构升降轴,T1_Batch_Axis,4,HC,,18000,60000,60000,8000,18000,40000,1000,500,0,0
AXIS,,T2_取料机构旋转轴,T2_Middle_Axis,6,HC,,1500,45000,47000,100,500,3000,10,1000,0,0
AXIS,,T3_取料机构上下轴,T3_Updown_Axis,5,HC,,20000,900000,950000,2000,7000,21000,10,1000,0,0
AXIS,,T4_取料机构进出轴,T4_InOut_Axis,7,HC,,5000,8000,9000,50,200,1500,10,1000,0,0
,,,,,,,,,,,,,,,,
PRO,,IO模块对应的DI数量,IO_DILength,192.168.201.21#16;192.168.201.22#16;192.168.200.23#8,,,,,,,,,,,,
PRO,,IO模块对应的DO数量,IO_DOLength,192.168.201.21#16;192.168.201.22#16;192.168.200.23#8,,,,,,,,,,,,
......@@ -98,47 +98,46 @@ DO,4,卡爪指令编码4,Clamp_SetPos4,35,HC,Y35,*,,,,,,,,,
DO,5,卡爪动作指令,Clamp_DoAction,36,HC,Y36,*,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,0,T1_提升轴待机点 P1,BatchAxis_P1,500,,,,, ,,,,,,,
PRO,0,T1_提升轴上升目标点_P2,BatchAxis_P2,562083,,,,, ,,,,,,,
PRO,0,T1_提升轴P1速度,BatchAxis_P1Speed,18000,,,,,,,,,,,,
PRO,0,T1_提升轴上升目标点_P2,BatchAxis_P2,553847,,,,, ,,,,,,,
PRO,0,T1_提升轴P1速度,BatchAxis_P1Speed,45000,,,,,,,,,,,,
PRO,0,T1_提升轴P2速度,BatchAxis_P2Speed,12000,,,,, ,,,,,,,
PRO,0,T1_提升轴高度转换系数(1mm对应的脉冲),BatchAxis_ChangeValue,996,,,,,,,,,,,,
PRO,0,T1_提升轴高度转换系数(1mm对应的脉冲),BatchAxis_ChangeValue,1022,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,0,T2_旋转轴待机点/取放料点 P1,MiddleAxis_P1,500,,,,,,,,,,,,
PRO,0,T2_旋转轴左侧料仓取放料点_P2,MiddleAxis_P2,4774,,,,,,,,,,,,
PRO,0,T2_旋转轴右侧料仓取放料点_P3,MiddleAxis_P3,-24,,,,,,,,,,,,
PRO,0,T2_旋转轴_料串取放料点_P4,MiddleAxis_P4,2354,,,,,,,,,,,,
PRO,0,T2_旋转轴P1速度,MiddleAxis_P1Speed,1500,,,,,,,,,,,,
PRO,0,T2_旋转轴P2速度,MiddleAxis_P2Speed,1500,,,,,,,,,,,,
PRO,0,T2_旋转轴P3速度,MiddleAxis_P3Speed,1500,,,,,,,,,,,,
PRO,0,T2_旋转轴P4速度,MiddleAxis_P4Speed,1500,,,,,,,,,,,,
PRO,0,T2_旋转轴待机点/取放料点 P1,MiddleAxis_P1,1589,,,,,,,,,,,,
PRO,0,T2_旋转轴左侧料仓取放料点_P2,MiddleAxis_P2,4806,,,,,,,,,,,,
PRO,0,T2_旋转轴右侧料仓取放料点_P3,MiddleAxis_P3,0,,,,,,,,,,,,
PRO,0,T2_旋转轴_料串取放料点_P4,MiddleAxis_P4,2883,,,,,,,,,,,,
PRO,0,T2_旋转轴P1速度,MiddleAxis_P1Speed,15000,,,,,,,,,,,,
PRO,0,T2_旋转轴P2速度,MiddleAxis_P2Speed,15000,,,,,,,,,,,,
PRO,0,T2_旋转轴P3速度,MiddleAxis_P3Speed,15000,,,,,,,,,,,,
PRO,0,T2_旋转轴P4速度,MiddleAxis_P4Speed,15000,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,0,T3_升降轴料串取放料低点 P1,UpdownAxis_P1,129763,,,,,,,,,,,,
PRO,0,T3_升降轴料串取放料高点/待机点 P2,UpdownAxis_P2,0,,,,,,,,,,,,
PRO,0,T3_升降轴左侧料仓取放料低点 P3,UpdownAxis_P3,74285,,,,,,,,,,,,
PRO,0,T3_升降轴左侧料仓取放料高点 P4,UpdownAxis_P4,22181,,,,,,,,,,,,
PRO,0,T3_升降轴右侧料仓取放料低点 P5,UpdownAxis_P5,71798,,,,,,,,,,,,
PRO,0,T3_升降轴右侧料仓取放料高点 P6,UpdownAxis_P6,22181,,,,,,,,,,,,
PRO,0,T3_升降轴P1速度/慢速度,UpdownAxis_P1Speed,50000,,,,,,,,,,,,
PRO,0,T3_升降轴P2速度/快速度,UpdownAxis_P2Speed,70000,,,,,,,,,,,,
PRO,0,T3_升降轴P3速度/慢速度,UpdownAxis_P3Speed,50000,,,,,,,,,,,,
PRO,0,T3_升降轴P4速度/快速度,UpdownAxis_P4Speed,70000,,,,,,,,,,,,
PRO,0,T3_升降轴P5速度/慢速度,UpdownAxis_P5Speed,50000,,,,,,,,,,,,
PRO,0,T3_升降轴P6速度/快速度,UpdownAxis_P6Speed,70000,,,,,,,,,,,,
PRO,0,T3_升降轴高度转换系数(1mm对应的脉冲),UpdownAxis_ChangeValue,10041,,,,,,,,,,,,
PRO,0,T3_升降轴料串取放料低点 P1,UpdownAxis_P1,155237,,,,,,,,,,,,
PRO,0,T3_升降轴料串取放料高点/待机点 P2,UpdownAxis_P2,5425,,,,,,,,,,,,
PRO,0,T3_升降轴左侧料仓取放料低点 P3,UpdownAxis_P3,135959,,,,,,,,,,,,
PRO,0,T3_升降轴左侧料仓取放料高点 P4,UpdownAxis_P4,17612,,,,,,,,,,,,
PRO,0,T3_升降轴右侧料仓取放料低点 P5,UpdownAxis_P5,121300,,,,,,,,,,,,
PRO,0,T3_升降轴右侧料仓取放料高点 P6,UpdownAxis_P6,2590,,,,,,,,,,,,
PRO,0,T3_升降轴P1速度/慢速度,UpdownAxis_P1Speed,250000,,,,,,,,,,,,
PRO,0,T3_升降轴P2速度/快速度,UpdownAxis_P2Speed,300000,,,,,,,,,,,,
PRO,0,T3_升降轴P3速度/慢速度,UpdownAxis_P3Speed,250000,,,,,,,,,,,,
PRO,0,T3_升降轴P4速度/快速度,UpdownAxis_P4Speed,300000,,,,,,,,,,,,
PRO,0,T3_升降轴P5速度/慢速度,UpdownAxis_P5Speed,250000,,,,,,,,,,,,
PRO,0,T3_升降轴P6速度/快速度,UpdownAxis_P6Speed,300000,,,,,,,,,,,,
PRO,0,T3_升降轴高度转换系数(1mm对应的脉冲),UpdownAxis_ChangeValue,1004,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,0,T4_进出轴待机点 P1,InOutAxis_P1,500,,,,,,,,,,,,
PRO,0,T4_进出轴7寸取料点P2,InOutAxis_P2,500,,,,,,,,,,,,
PRO,0,T4_进出轴13寸取料点P3,InOutAxis_P3,500,,,,,,,,,,,,
PRO,0,T4_进出轴放料点P4,InOutAxis_P4,500,,,,,,,,,,,,
PRO,0,T4_进出轴待机点 P1Speed,InOutAxis_P1Speed,5000,,,,,,,,,,,,
PRO,0,T4_进出轴7寸取料点P2Speed,InOutAxis_P2Speed,5000,,,,,,,,,,,,
PRO,0,T4_进出轴13寸取料点P3Speed,InOutAxis_P3Speed,5000,,,,,,,,,,,,
PRO,0,T4_进出轴放料点P4Speed,InOutAxis_P4Speed,5000,,,,,,,,,,,,
PRO,0,T4_进出轴右侧缓冲点P6,InOutAxis_P6,500,,,,,,,,,,,,
PRO,0,T4_进出轴待机点 P1,InOutAxis_P1,-10,,,,,,,,,,,,
PRO,0,T4_进出轴7寸取料点P2,InOutAxis_P2,999,,,,,,,,,,,,
PRO,0,T4_进出轴13寸取料点P3,InOutAxis_P3,693,,,,,,,,,,,,
PRO,0,T4_进出轴放料点P4,InOutAxis_P4,673,,,,,,,,,,,,
PRO,0,T4_进出轴13寸取料点进入前点P6,InOutAxis_P6,743,,,,,,,,,,,,
PRO,0,T4_进出轴待机点 P1Speed,InOutAxis_P1Speed,2000,,,,,,,,,,,,
PRO,0,T4_进出轴7寸取料点P2Speed,InOutAxis_P2Speed,2000,,,,,,,,,,,,
PRO,0,T4_进出轴13寸取料点P3Speed,InOutAxis_P3Speed,2000,,,,,,,,,,,,
PRO,0,T4_进出轴放料点P4Speed,InOutAxis_P4Speed,2000,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,0,AgvInName,AgvInName,D1,,,,,,,,,,,,
PRO,0,AgvOutName,AgvOutName,D2,,,,,,,,,,,,
PRO,0,AgvInName,AgvInName,D3,,,,,,,,,,,,
PRO,0,AgvOutName,AgvOutName,D4,,,,,,,,,,,,
PRO,0,电夹爪1端口,Clamp1Port,COM12,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,,预警温度,WarnTemperate,80,,,,,,,,,,,,
......@@ -155,7 +154,7 @@ PRO,,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,,,,,,,
PRO,0,是否调试状态(1=调试,0=正常),IsDebug,1,,,,,,,,,,,,
PRO,,气压检测IO关闭需要持续的时间,AirCheckSeconds,3,,,,,,,,,,,,
PRO,,所有料仓的CID(用#号分隔),All_CIDs,duo-2,,,,,,,,,,,,
PRO,,扫码的相机名称(多个用#分隔),CameraNameList,GigE:MV-CE200-10GC (00E96448339)#,,,,,,,,,,,,
PRO,,最后一盘料需要补充的高度,LastTrayAddHeight,10,,,,,,,,,,,,
PRO,,入料Rfid_IP,In_Rfid_IP,192.168.202.21,,,,,,,,,,,,
PRO,,出料Rfid IP,Out_Rfid_IP,192.168.201.21,,,,,,,,,,,,
PRO,,扫码的相机名称(多个用#分隔),CameraNameList,GigE:MV-CE200-10GC (00E76280382)#,,,,,,,,,,,,
PRO,,最后一盘料需要补充的高度,LastTrayAddHeight,9,,,,,,,,,,,,
PRO,,入料Rfid_IP,In_Rfid_IP,192.168.201.21,,,,,,,,,,,,
PRO,,出料Rfid IP,Out_Rfid_IP,192.168.202.21,,,,,,,,,,,,
{
"HIKIPCamera":
[
{
"Name":"Box_1",
"IP":"192.168.9.64",
"User":"admin",
"Pwd":"acc12345678",
"Port":"8000"
}
]
}
\ No newline at end of file
{
"HIKIPCamera":
[
{
"Name":"box_2",
"IP":"192.168.2.64",
"User":"admin",
"Pwd":"acc12345678",
"Port":"8000"
}
]
}
\ No newline at end of file
......@@ -292,6 +292,8 @@ namespace OnlineStore.DeviceLibrary
message = message.Replace("\n", "");
char a = (char)02;
message = message.Replace(a.ToString(), "");
message = message.Replace("\u0026", "");
message = message.Replace("\\000026", "");
message = message.Trim();
System.Text.ASCIIEncoding asciiEncoding = new System.Text.ASCIIEncoding();
byte[] bytes = asciiEncoding.GetBytes(message);
......@@ -299,7 +301,7 @@ namespace OnlineStore.DeviceLibrary
foreach (byte by in bytes)
{
int value = (int)by;
if (value.Equals(24) || value.Equals(30) || value.Equals(29) || value.Equals(4))
if (value.Equals(24) || value.Equals(30) || value.Equals(29) || value.Equals(4) || value.Equals(26))
{
continue;
}
......
......@@ -250,7 +250,7 @@ namespace OnlineStore.DeviceLibrary
LastPosition = -1;
if (targetSpeed > Config.TargetSpeed || targetSpeed <= 0)
{
targetSpeed = Config.TargetSpeed;
//targetSpeed = Config.TargetSpeed;
}
//小于1,表示是目标速度的百分比
else if (targetSpeed <= 1)
......
......@@ -251,7 +251,44 @@ namespace OnlineStore.DeviceLibrary
break;
case StoreMoveStep.BOX_H03_OtherAxisHome_wait:
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H03_OtherAxisHome);
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H03_SendOut_01);
if (IOValue(IO_Type.OutDoor_Check).Equals(IO_VALUE.HIGH))
{
CylinderMove(MoveInfo, IO_Type.OutDoor_Down, IO_Type.OutDoor_Up);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.OutDoor_Check, IO_VALUE.LOW));
}
break;
case StoreMoveStep.BOX_H03_SendOut_01:
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H03_SendOut_02);
InOutStoreLog("复位:" + "移动到出料口,旋转轴到P11[" + Config.MiddleAxis_P11 + "],升降轴到P12高点[" + Config.UpDownAxis_P12 + "] ");
MiddleAxis.AbsMove(MoveInfo, Config.MiddleAxis_P11, Config.MiddleAxis_P11_Speed);
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxis_P12, Config.UpDownAxis_P12_Speed);
break;
case StoreMoveStep.BOX_H03_SendOut_02:
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H03_SendOut_03);
InOutStoreLog("复位:" + "进出轴到_P11-出料口取放料点 [" + Config.InOutAxis_P11 + "] ");
InoutAxis.AbsMove(MoveInfo, Config.InOutAxis_P11, Config.InOutAxis_P11_Speed);
break;
case StoreMoveStep.BOX_H03_SendOut_03:
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H03_SendOut_04);
InOutStoreLog("复位:" + "升降轴到_P11-出料口-低点[" + Config.UpDownAxis_P11 + "]");
//ComAxis.AbsMove(MoveInfo, Config.CompAxis_P1, Config.CompAxis_P3_Speed);
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxis_P11, Config.UpDownAxis_P11_Speed);
break;
case StoreMoveStep.BOX_H03_SendOut_04:
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H03_SendOut_05);
InOutStoreLog("复位:" + "进出轴返回P1 [" + Config.InOutAxis_P1 + "], 打开出料口门 ");
InOutBackToP1(Config.InOutAxis_P1);
OutDoorReelType = 2;
CylinderMove(MoveInfo, IO_Type.OutDoor_Down, IO_Type.OutDoor_Up);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.OutDoor_Check, IO_VALUE.LOW));
break;
case StoreMoveStep.BOX_H03_SendOut_05:
if (IOValue(IO_Type.OutDoor_SafeSignal).Equals(IO_VALUE.HIGH))
{
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H03_OtherAxisHome);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
}
break;
case StoreMoveStep.BOX_H03_OtherAxisHome:
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H04_OtherAxisBack);
......@@ -260,12 +297,13 @@ namespace OnlineStore.DeviceLibrary
MiddleAxis.AbsMove(MoveInfo, Config.MiddleAxis_P1, Config.MiddleAxis_P1_Speed);
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxis_P1, Config.UpDownAxis_P1_Speed);
ComAxis.AbsMove(MoveInfo, Config.CompAxis_P1, Config.CompAxis_P1_Speed);
CylinderMove(MoveInfo, IO_Type.OutDoor_Up, IO_Type.OutDoor_Down);
OutDoorReelType = 0;
break;
case StoreMoveStep.BOX_H04_OtherAxisBack:
HuichuanLibrary.HCBoardManager.SetAxBacklash(MiddleAxis.Config.GetAxisValue(),Config.MiddleAxis_Reverse_Offset, MiddleAxis.Config.HomeLowSpeed,-1);
LogInfo(MoveInfo.MoveType + ": 完成");
MoveEndP();
if (IOValue(IO_Type.InDoor_Check).Equals(IO_VALUE.HIGH) && IsDebug.Equals(false))
{
LogInfo("发现入口有无信息料");
......@@ -365,6 +403,7 @@ namespace OnlineStore.DeviceLibrary
OutDoorCloseCountDown = 5;
}
}
string lastOutPosID = "";
private void AutoResetProcess()
{
try
......@@ -427,12 +466,19 @@ namespace OnlineStore.DeviceLibrary
}
else if (waitOutStoreList.Count > 0 && noInStore && IsDebug.Equals(false))
{
InOutParam param = null;
bool result = waitOutStoreList.TryDequeue(out param);
if (result && param != null)
lock (waitOutStoreList)
{
LogInfo("执行排队的出库【" + param.ToStr() + "】");
StartExecuctOut(param);
InOutParam param = null;
bool result = waitOutStoreList.TryDequeue(out param);
if (result && param != null)
{
if (lastOutPosID != param.PosID)
{
LogInfo("执行排队的出库【" + param.ToStr() + "】");
}
LogUtil.OutputDebugString(Name + "执行排队的出库【" + param.ToStr() + "】");
StartExecuctOut(param);
}
}
}
else if (false && IOValue(IO_Type.InDoor_Check).Equals(IO_VALUE.HIGH) && noInStore && IsDebug.Equals(false))
......
......@@ -97,6 +97,13 @@ namespace OnlineStore.DeviceLibrary
lineOperation.cid = CID;
lineOperation.seq = ConfigAppSettings.nextSeq();
lineOperation.status = 1;
string cids = "";
foreach (int k in StoreManager.Store.BoxMap.Keys)
{
cids += StoreManager.Store.BoxMap[k].CID + ",";
}
cids = cids.TrimEnd(',');
lineOperation.data.Add("cidGroup", cids);
if (WarnMsg != "")
{
lineOperation.status = (int)StoreStatus.Warning;
......@@ -265,21 +272,14 @@ namespace OnlineStore.DeviceLibrary
string[] posIdArray = data[ParamDefine.posId].Split(splitChar);
string[] plateWArray = data[ParamDefine.plateW].Split(splitChar);
string[] plateHArray = data[ParamDefine.plateH].Split(splitChar);
if (string.IsNullOrEmpty(StoreManager.LastVisualRfid))
{
StoreManager.LastVisualRfid = data[ParamDefine.rfid];
}
else if (StoreManager.LastVisualRfid != data[ParamDefine.rfid])
{
LogUtil.error(Name + $" 上一个工单还未结束LastVisualRfid={StoreManager.LastVisualRfid}, CurrentVisualRfid={data[ParamDefine.rfid]}");
return;
}
bool urgentReel = FormUtil.GetBoolData(data, ParamDefine.urgentReel);
bool singleOut = FormUtil.GetBoolData(data, ParamDefine.singleOut);
//bool cutReel = FormUtil.GetBoolData(data, ParamDefine.cutReel);
//bool smallReel = FormUtil.GetBoolData(data, ParamDefine.smallReel);
//string rfid = data.ContainsKey(ParamDefine.rfid) ? data[ParamDefine.rfid] : "";
//int rfidLoc = FormUtil.GetIntData(data, ParamDefine.rfidLoc);
string barcode = data.ContainsKey(ParamDefine.barcode) ? data[ParamDefine.barcode] : "";
string barcode = data.ContainsKey(ParamDefine.barcode) ? data[ParamDefine.barcode] : "";
//string realRfid = data.ContainsKey(ParamDefine.realRfid) ? data[ParamDefine.realRfid] : "";
//int taskCount = FormUtil.GetIntData(data, ParamDefine.taskCount, 0);
......@@ -289,6 +289,33 @@ namespace OnlineStore.DeviceLibrary
//rfid: 分配的料架RFID
//rfidLoc: 料架的架位,值为 - 1时,可以自由分配皮带线, 小料时,架位为1 - 46优先走1 / 2号皮带线,47 - 92优先走3 / 4号皮带线, 70,71,72时只能分配到3 / 4号皮带线; 大料时,架位1 - 6优先走1 / 2号皮带线, 7 - 12优先走3 / 4号皮带线
if (!singleOut)
{
lock (StoreManager.Store)
{
string vrfid = data[ParamDefine.rfid];
if (vrfid.IndexOf("-") > 0)
{
vrfid = vrfid.Substring(0, vrfid.IndexOf("-"));
//if (vrfid == "1")
//{
// LogUtil.info(Name + $" 单盘出库,不保存需求单号");
// vrfid = "";
//}
}
if (string.IsNullOrEmpty(StoreManager.LastVisualRfid))
{
StoreManager.LastVisualRfid = vrfid;
LogUtil.info(Name + $" 新需求单号 LastVisualRfid={StoreManager.LastVisualRfid}");
}
else if (StoreManager.LastVisualRfid != vrfid)
{
LogUtil.error(Name + $" 上一个需求单还未结束LastVisualRfid={StoreManager.LastVisualRfid}, CurrentVisualRfid={vrfid}");
StoreManager.ShelfNeedOut = true;
return;
}
}
}
string dataStr = JsonHelper.SerializeObject(data);
LogUtil.info("收到服务器出库消息:【" + dataStr + "】");
......@@ -298,7 +325,7 @@ namespace OnlineStore.DeviceLibrary
index++;
int plateW =Convert.ToInt32( plateWArray[index]);
int plateH = Convert.ToInt32(plateHArray[index]);
InOutParam inoutParam = new InOutParam(MoveType.OutStore, barcode, posId, plateW, plateH, (urgentReel ? 1 : 0));
InOutParam inoutParam = new InOutParam(MoveType.OutStore, barcode, posId, plateW, plateH, singleOut ? 1 : 0);
//根据发送的posId获取位置列表
ACBoxPosition position = CSVPositionReader<ACBoxPosition>.GetPositon(posId);
......@@ -342,7 +369,6 @@ namespace OnlineStore.DeviceLibrary
}
}
}
#endregion
#endregion
}
}
......@@ -45,6 +45,7 @@ namespace OnlineStore.DeviceLibrary
public AxisBean T4_InOut_Axis = null;
public bool HasT4Axis = false;
/// <summary>
/// 轴列表
/// </summary>
......@@ -101,9 +102,7 @@ namespace OnlineStore.DeviceLibrary
IOManager.Init();
CodeManager.LoadConfig();
CurrShelfNum = ConfigAppSettings.GetValue(Setting_Init.CurrShelfNum);
CurrShelfType = ConfigAppSettings.GetIntValue(Setting_Init.CurrShelfType);
UpdateShelfNum(CurrShelfNum, CurrShelfType);
HasT4Axis = Convert.ToBoolean(ConfigAppSettings.GetValue(Setting_Init.HasT4Axis));
Task.Factory.StartNew(delegate
{
......@@ -330,6 +329,10 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StoreMoveStep.LR_06_TopDown))
{
MoveInfo.NextMoveStep(StoreMoveStep.LR_07_WaitBox);
CurrShelfNum = ConfigAppSettings.GetValue(Setting_Init.CurrShelfNum);
CurrShelfType = ConfigAppSettings.GetIntValue(Setting_Init.CurrShelfType);
UpdateShelfNum(CurrShelfNum, CurrShelfType);
StoreManager.LastVisualRfid = "";
LogUtil.info(Name + "复位 " + MoveInfo.MoveStep + " :等待料仓复位完成");
}
else if (MoveInfo.IsStep(StoreMoveStep.LR_07_WaitBox))
......@@ -785,12 +788,12 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.Line_Stop4_Out, IO_VALUE.HIGH, false, 1000);
if (WaitIo(IO_Type.Line_OutCheck, IO_VALUE.LOW, 30000, "送出一个料架"))
{
LineRun("agvout",15);
Task.Delay(5*1000);
LineRun("agvout",30);
Task.Delay(10*1000);
AgvClient.SetStatus(StoreManager.Config.AgvOutName, "", Agv.ClientAction.FinishLeave);
_ = Task.Run(() => {
Task.Delay(2000);
AgvClient.SetStatus(StoreManager.Config.AgvInName, "", Agv.ClientAction.None);
AgvClient.SetStatus(StoreManager.Config.AgvOutName, "", Agv.ClientAction.None);
});
}
});
......@@ -799,13 +802,32 @@ namespace OnlineStore.DeviceLibrary
Agv.ClientShelf AgvNeedInshelf = Agv.ClientShelf.None;
Agv.ClientShelf AgvNeedOutshelf = Agv.ClientShelf.None;
void IOMinoitor() {
if (IOValue(IO_Type.Line_WaitCheck).Equals(IO_VALUE.LOW) && AgvClient.GetAction(Config.AgvInName) == Agv.ClientAction.None
&& MoveInfo.MoveType.Equals(MoveType.None) && BoxMap[1].waitOutStoreList.Count==0 && BoxMap[2].waitOutStoreList.Count == 0)
{
// bool isLineEmpty = IOValue(IO_Type.Line_WaitCheck).Equals(IO_VALUE.LOW) || IOValue(IO_Type.Line_WaitCheck).Equals(IO_VALUE.LOW);
LogUtil.OutputDebugString($"IOMinoitor Line_OutCheck:{IOValue(IO_Type.Line_OutCheck)},Line_WaitCheck:{IOValue(IO_Type.Line_WaitCheck)},MoveType:{MoveInfo.MoveType},Box1Count:{BoxMap[1].waitOutStoreList.Count},Box2Count:{BoxMap[2].waitOutStoreList.Count},{Config.AgvInName}:{AgvClient.GetAction(Config.AgvInName)},{AgvClient.GetShelf(Config.AgvInName)}");
bool boxwaitout = BoxMap[1].MoveInfo.MoveStep == StoreMoveStep.SO_11_GoBack || BoxMap[2].MoveInfo.MoveStep == StoreMoveStep.SO_11_GoBack;
bool boxmovetype = BoxMap[1].MoveInfo.MoveType == MoveType.OutStore || BoxMap[2].MoveInfo.MoveType == MoveType.OutStore;
//有料盘正在舱口等待出库
if (boxwaitout && MoveInfo.MoveType.Equals(MoveType.None)
&& (AgvClient.GetAction(Config.AgvInName) != Agv.ClientAction.NeedEnter || AgvClient.GetShelf(Config.AgvInName)!= Agv.ClientShelf.Empty) )
{
AgvNeedInshelf = Agv.ClientShelf.Empty;
AgvClient.NeedEnter(Config.AgvInName, "", AgvNeedInshelf);
LogUtil.info(Name + "IOMinoitor AgvClient.NeedEnter:" + Config.AgvInName + ",AgvNeedInshelf:" + AgvClient.GetShelf(Config.AgvInName));
}
//线体等待区没有料串,同时没有出库任务
else if (IOValue(IO_Type.Line_WaitCheck).Equals(IO_VALUE.LOW) && AgvClient.GetAction(Config.AgvInName) == Agv.ClientAction.None
&& BoxMap[1].waitOutStoreList.Count == 0 && BoxMap[2].waitOutStoreList.Count == 0 && !boxwaitout && !boxmovetype) //&& MoveInfo.MoveType.Equals(MoveType.None) //线体不在运动中
{
//排除单盘出库任务
//if (BoxMap[1].waitOutStoreList.ToList().Select(x => x.TargetPosition == 0).Count() > 0
// || BoxMap[2].waitOutStoreList.ToList().Select(x => x.TargetPosition == 0).Count() > 0)
//{
AgvNeedInshelf = Agv.ClientShelf.Full;
AgvClient.NeedEnter(Config.AgvInName,"", AgvNeedInshelf);
LogUtil.info(Name + "IOMinoitor AgvClient.NeedEnter" + Config.AgvInName+ ",AgvNeedInshelf:" + AgvNeedInshelf);
AgvClient.NeedEnter(Config.AgvInName, "", AgvNeedInshelf);
LogUtil.info(Name + "IOMinoitor AgvClient.NeedEnter:" + Config.AgvInName + ",AgvNeedInshelf:" + AgvNeedInshelf);
//AgvNeedInshelf = Agv.ClientShelf.None;
// }
}
if (IOValue(IO_Type.Line_OutCheck).Equals(IO_VALUE.HIGH) && AgvClient.GetAction(Config.AgvOutName) == Agv.ClientAction.None)
{
......@@ -845,7 +867,7 @@ namespace OnlineStore.DeviceLibrary
)
{
LineRun("releashelf", 4);
IOMove(IO_Type.Line_Stop2_Work, IO_VALUE.HIGH, false, 2000);
IOMove(IO_Type.Line_Stop2_Work, IO_VALUE.HIGH, false, 1000);
LogUtil.info(Name + "料串手动出库, 工作区放行");
return true;
}
......@@ -865,22 +887,22 @@ namespace OnlineStore.DeviceLibrary
return false;
}
public void LineRun(StoreMoveInfo move=null )
public void LineRun(StoreMoveInfo move=null, string parentname="")
{
if (move != null)
{
move.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_Run, IO_VALUE.HIGH));
}
LineRun("n", 999);
LineRun("n", 999, parentname);
}
public void LineStop(StoreMoveInfo move=null )
public void LineStop(StoreMoveInfo move=null, string parentname = "")
{
if (move != null)
{
move.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_Run, IO_VALUE.LOW));
}
LineStop("n");
LineStop("n", parentname);
}
public void OpenGate(StoreMoveInfo move = null) {
......
......@@ -14,7 +14,6 @@ namespace OnlineStore.DeviceLibrary
Timer lineTimer = null;
Dictionary<string, DateTime> linrunlist = new Dictionary<string, DateTime>();
void LineInit() {
if (lineTimer == null) {
lineTimer = new Timer(300);
......@@ -26,8 +25,14 @@ namespace OnlineStore.DeviceLibrary
private void LineTimer_Elapsed(object sender, ElapsedEventArgs e)
{
if (canStopLine(out _))
IOMove(IO_Type.Line_Run, IO_VALUE.LOW);
lock (linrunlist)
{
if (canStopLine(out _) && IOValue(IO_Type.Line_Run).Equals(IO_VALUE.HIGH))
{
IOMove(IO_Type.Line_Run, IO_VALUE.LOW);
LogUtil.info(Name + $" 线体管理器 停止线体.");
}
}
}
......@@ -36,12 +41,13 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
/// <param name="id">需求方标识</param>
/// <param name="seconds">秒数</param>
void LineRun(string id, int seconds) {
void LineRun(string id, int seconds, string parentname="") {
LineInit();
IOMove(IO_Type.Line_Run, IO_VALUE.HIGH);
lock (linrunlist)
{
IOMove(IO_Type.Line_Run, IO_VALUE.HIGH);
if (!string.IsNullOrEmpty(id) && seconds > 0)
{
if (linrunlist.ContainsKey(id))
......@@ -50,18 +56,18 @@ namespace OnlineStore.DeviceLibrary
{
linrunlist.Add(id, DateTime.Now.AddSeconds(seconds));
}
LogUtil.info(Name + $" {id} 请求链条运行 {seconds}秒.");
LogUtil.info(Name + $" 线体管理器 {id},{parentname} 请求链条运行 {seconds}秒.");
}
}
}
void LineStop(string id = "") {
void LineStop(string id = "", string parentname = "") {
lock (linrunlist)
{
if (!string.IsNullOrEmpty(id))
{
if (linrunlist.ContainsKey(id))
linrunlist.Remove(id);
LogUtil.info(Name + $" {id} 请求立刻停止线体.");
LogUtil.info(Name + $" 线体管理器 {id},{parentname} 请求立刻停止线体.");
}
}
if (!canStopLine(out string msg))
......@@ -78,11 +84,11 @@ namespace OnlineStore.DeviceLibrary
if (x.Value > DateTime.Now)
{
canStop = false;
msg = Name + $" {x.Key} 不允许停止线体 需求停止时间 {x.Value.ToString()}.";
msg = Name + $" 线体管理器 {x.Key} 不允许停止线体 需求停止时间 {x.Value.ToString()}.";
//LogUtil.info(Name + $" {x.Key} 不允许停止线体 需求停止时间 {x.Value.ToString()}.");
}
else {
LogUtil.info(Name + $" {x.Key} 请求时间已过期,删除.");
LogUtil.info(Name + $" 线体管理器 {x.Key} 请求时间已过期,删除.");
linrunlist.Remove(x.Key);
}
......
......@@ -30,11 +30,11 @@ namespace OnlineStore.DeviceLibrary
//if (plateW > 7)
if (true)
{
axis.Push(99, 7, 500);
axis.Push(99, 7, 10);
}
else
{
axis.Push(50, 7, 500);
axis.Push(50, 7, 10);
}
if (moveInfo!=null)
moveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
......@@ -71,7 +71,7 @@ namespace OnlineStore.DeviceLibrary
}
public bool IsBusy {
get {
axis.GetPosition();
//axis.GetPosition();
return !axis.IsReached;
}
}
......
......@@ -292,6 +292,8 @@ namespace OnlineStore.DeviceLibrary
if (isOk)
{
MoveInfo.EndStepWait();
alarmType = AlarmType.None;
WarnMsg = "";
}
else if (span.TotalSeconds > MoveInfo.TimeOutSeconds)
{
......
......@@ -80,6 +80,7 @@ namespace OnlineStore.DeviceLibrary
if (param != null)
{
humidity = param.Humidity;
LastData = param;
temp = param.Temperate;
currTempStr = Name + ("湿度:" + humidity.ToString() + ",温度:" + temp);
}
......
......@@ -22,6 +22,7 @@ namespace OnlineStore.DeviceLibrary
public static bool IsConnectServer = !ConfigAppSettings.GetValue(Setting_Init.http_server).Equals("");
public static string LastVisualRfid = "";
public volatile static bool ShelfNeedOut = false;
public StoreManager()
{
......@@ -108,7 +109,7 @@ namespace OnlineStore.DeviceLibrary
CSVPositionReader<ACBoxPosition>.AddCSVFile(positionConfigFile);
}
CSVPositionReader<ACBoxPosition>.AddCSVFile(Path.Combine(appPath, @"StoreConfig\FixPositions.csv"));
AgvClient.Init();
//AgvClient.Init();
LogUtil.info("加载料仓完成!");
}
......@@ -369,7 +370,8 @@ namespace OnlineStore.DeviceLibrary
string cids = "";
foreach(int k in Store.BoxMap.Keys)
{
if (Store.BoxMap[k].runStatus > StoreRunStatus.Wait && Store.BoxMap[k].IOValue(IO_Type.InDoor_Check).Equals(IO_VALUE.LOW))
//if (Store.BoxMap[k].runStatus > StoreRunStatus.Wait && Store.BoxMap[k].IOValue(IO_Type.InDoor_Check).Equals(IO_VALUE.LOW))
if (!Store.BoxMap[k].IsDebug && !Store.BoxMap[k].Disabled && Store.BoxMap[k].runStatus > StoreRunStatus.Wait)
{
cids += Store.BoxMap[k].CID+",";
}
......@@ -384,7 +386,7 @@ namespace OnlineStore.DeviceLibrary
DateTime startTime = DateTime.Now;
LogUtil.info(deviceName + "【" + shelfNum + "】【 " + codeStr + "】 ,获取入库库位:");
string resultStr = HttpHelper.Post(server, "", Encoding.UTF8, 10000, out result.IsTimeOut);
string resultStr = HttpHelper.Post(server, "", Encoding.UTF8, 3500, out result.IsTimeOut);
LogUtil.info(deviceName + "CodeReceived " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
if (result.IsTimeOut)
......
......@@ -126,25 +126,27 @@ namespace OnlineStore.DeviceLibrary
}
public string ToStr()
{
var TargetPositionTxt = TargetPosition == 1 ? "单盘出口":"料串";
var NGTxt = InStoreNg ? "[NG料]" : "";
if (InStoreNg)
{
return " 入库失败[BOX_" + TargetBox + "] [" + WareCode + "], [" + PlateW + "x" + PlateH + "] [" + TargetPosition + "] [isNG:" + InStoreNg + "]";
return " 入库失败[BOX_" + TargetBox + "] [" + WareCode + "], [" + PlateW + "x" + PlateH + "] [" + TargetPositionTxt + "] " + NGTxt + "";
}
else
{
if (moveType.Equals(MoveType.InStore))
{
return " 入库 [" + PosID + "] [" + WareCode + "], [" + PlateW + "x" + PlateH + "] [" + TargetPosition + "] [isNG:" + InStoreNg + "]";
return " 入库 [" + PosID + "] [" + WareCode + "], [" + PlateW + "x" + PlateH + "] [" + TargetPositionTxt + "] " + NGTxt + "";
}
else
{
if (TargetPosition.Equals(1))
{
return " 批量出库 [" + PosID + "] [" + WareCode + "], [" + PlateW + "x" + PlateH + "] [" + TargetPosition + "] [isNG:" + InStoreNg + "]";
return $" 批量出库 [{PosID}] [{WareCode}], [{PlateW}x{PlateH}] [{TargetPositionTxt}] {NGTxt}[需求单:" + StoreManager.LastVisualRfid + "]";
}
else
{
return " 单盘出库 [" + PosID + "] [" + WareCode + "], [" + PlateW + "x" + PlateH + "] [" + TargetPosition + "] [isNG:" + InStoreNg + "]";
return $" 单盘出库 [{PosID}] [{WareCode}], [{PlateW}x{PlateH}] [" + TargetPositionTxt + "] " + NGTxt + "[需求单:" + StoreManager.LastVisualRfid + "]";
}
}
}
......
......@@ -94,7 +94,7 @@ namespace OnlineStore.DeviceLibrary
/// 运动处理
/// </summary>
protected bool isInPro = false;
object worklock = new object();
protected object worklock = new object();
protected virtual void BusyMoveProcess()
{
//if (isInPro)
......
......@@ -576,6 +576,7 @@ namespace OnlineStore.DeviceLibrary
/// 料盘移栽: 夹爪气缸放松
/// </summary>
LO_19_CylinderRelax,
LO_20_BatchAxisToP2,
/// <summary>
/// 料盘移栽: 升降轴到料串高点
/// </summary>
......@@ -619,6 +620,12 @@ namespace OnlineStore.DeviceLibrary
///送出料架, 流水线停止转动,
/// </summary>
LO_37_LineStop,
BOX_H03_SendOut_01,
BOX_H03_SendOut_02,
BOX_H03_SendOut_03,
BOX_H03_SendOut_04,
BOX_H03_SendOut_05,
LO_20_UpdownUp_wait,
#endregion
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!