Commit ef9490c0 刘韬

同步491修改

1 个父辈 8887225f
......@@ -171,11 +171,12 @@ namespace OnlineStore.Common
}
public static void ClearLog()
{
showLogEvent?.Invoke("",Color.Black);
logList.Clear();
if (logBox != null)
{
LastText = "";
logList.Clear();
logBox.Text = "";
logBox.Text = "";
}
}
......
......@@ -23,6 +23,9 @@
<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="1" />
<add key="Store_CID_2_disabled" value="1" />
<!--end one store config-->
<add key="ACBaudRate" value="115200" />
<add key="Config_Pwd" value="123456" />
......
......@@ -64,6 +64,7 @@ namespace OnlineStore.DUOStore
this.txtMiddleP3 = new System.Windows.Forms.TextBox();
this.btnMiddleP3 = new System.Windows.Forms.Button();
this.axisMoveControl1 = new OnlineStore.DUOStore.AxisMoveControl();
this.btnSotreReset = new System.Windows.Forms.Button();
this.groupInout.SuspendLayout();
this.SuspendLayout();
//
......@@ -701,11 +702,23 @@ namespace OnlineStore.DUOStore
this.axisMoveControl1.Size = new System.Drawing.Size(568, 407);
this.axisMoveControl1.TabIndex = 274;
//
// btnSotreReset
//
this.btnSotreReset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSotreReset.Location = new System.Drawing.Point(12, 414);
this.btnSotreReset.Name = "btnSotreReset";
this.btnSotreReset.Size = new System.Drawing.Size(128, 39);
this.btnSotreReset.TabIndex = 276;
this.btnSotreReset.Text = "复位";
this.btnSotreReset.UseVisualStyleBackColor = true;
this.btnSotreReset.Click += new System.EventHandler(this.btnSotreReset_Click);
//
// FrmAxisMove
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(1323, 559);
this.Controls.Add(this.btnSotreReset);
this.Controls.Add(this.groupInout);
this.Controls.Add(this.axisMoveControl1);
this.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
......@@ -761,6 +774,7 @@ namespace OnlineStore.DUOStore
public System.Windows.Forms.Button btnInOutP2;
public System.Windows.Forms.TextBox txtInOutP3;
public System.Windows.Forms.Button btnInOutP3;
private System.Windows.Forms.Button btnSotreReset;
}
}
......@@ -220,5 +220,13 @@ namespace OnlineStore.DUOStore
AxisABSMove(StoreManager.Store.T2_MiddleAxis, txtT2P4, StoreManager.Store.Config.MiddleAxis_P4Speed);
}
private void btnSotreReset_Click(object sender, EventArgs e)
{
if (StoreManager.Store.runStatus >= StoreRunStatus.HomeMoving)
{
StoreManager.Store.ResetLine();
//btnSotreReset.Enabled = false;
}
}
}
}
......@@ -110,6 +110,7 @@ namespace OnlineStore.DUOStore
this.btnStoreStart = new System.Windows.Forms.Button();
this.lblWarnMsg = new System.Windows.Forms.Label();
this.lblThisSta = new System.Windows.Forms.Label();
this.chbDisable = new System.Windows.Forms.CheckBox();
this.groupBox4.SuspendLayout();
this.groupBox1.SuspendLayout();
this.tabControl1.SuspendLayout();
......@@ -130,7 +131,7 @@ namespace OnlineStore.DUOStore
this.chbDebug.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.chbDebug.AutoSize = true;
this.chbDebug.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbDebug.Location = new System.Drawing.Point(20, 405);
this.chbDebug.Location = new System.Drawing.Point(10, 597);
this.chbDebug.Name = "chbDebug";
this.chbDebug.Size = new System.Drawing.Size(84, 24);
this.chbDebug.TabIndex = 271;
......@@ -222,7 +223,7 @@ namespace OnlineStore.DUOStore
this.tabControl1.Location = new System.Drawing.Point(239, 112);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(1054, 612);
this.tabControl1.Size = new System.Drawing.Size(1054, 605);
this.tabControl1.TabIndex = 272;
//
// tabPage4
......@@ -231,7 +232,7 @@ namespace OnlineStore.DUOStore
this.tabPage4.Controls.Add(this.groupInout);
this.tabPage4.Location = new System.Drawing.Point(4, 29);
this.tabPage4.Name = "tabPage4";
this.tabPage4.Size = new System.Drawing.Size(1046, 579);
this.tabPage4.Size = new System.Drawing.Size(1046, 572);
this.tabPage4.TabIndex = 3;
this.tabPage4.Text = " 库位信息 ";
this.tabPage4.UseVisualStyleBackColor = true;
......@@ -443,6 +444,7 @@ namespace OnlineStore.DUOStore
this.txtComP2.AcceptsReturn = true;
this.txtComP2.BackColor = System.Drawing.SystemColors.Window;
this.txtComP2.Cursor = System.Windows.Forms.Cursors.IBeam;
this.txtComP2.Enabled = false;
this.txtComP2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtComP2.ForeColor = System.Drawing.SystemColors.WindowText;
this.txtComP2.Location = new System.Drawing.Point(408, 309);
......@@ -680,6 +682,7 @@ namespace OnlineStore.DUOStore
this.btnComP2.AutoSize = true;
this.btnComP2.BackColor = System.Drawing.SystemColors.Control;
this.btnComP2.Cursor = System.Windows.Forms.Cursors.Default;
this.btnComP2.Enabled = false;
this.btnComP2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnComP2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnComP2.ForeColor = System.Drawing.Color.Purple;
......@@ -1042,7 +1045,6 @@ namespace OnlineStore.DUOStore
// tabPage1
//
this.tabPage1.Controls.Add(this.btnUpdown);
this.tabPage1.Controls.Add(this.chbDebug);
this.tabPage1.Controls.Add(this.groupBox7);
this.tabPage1.Controls.Add(this.btnAxisOff);
this.tabPage1.Controls.Add(this.btnAxisOn);
......@@ -1050,7 +1052,7 @@ namespace OnlineStore.DUOStore
this.tabPage1.Location = new System.Drawing.Point(4, 29);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(1046, 579);
this.tabPage1.Size = new System.Drawing.Size(1046, 572);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = " 伺服/温湿度 ";
this.tabPage1.UseVisualStyleBackColor = true;
......@@ -1330,11 +1332,26 @@ namespace OnlineStore.DUOStore
this.lblThisSta.TabIndex = 216;
this.lblThisSta.Text = "等待启动";
//
// chbDisable
//
this.chbDisable.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.chbDisable.AutoSize = true;
this.chbDisable.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbDisable.Location = new System.Drawing.Point(10, 617);
this.chbDisable.Name = "chbDisable";
this.chbDisable.Size = new System.Drawing.Size(84, 24);
this.chbDisable.TabIndex = 274;
this.chbDisable.Text = "禁用料仓";
this.chbDisable.UseVisualStyleBackColor = true;
this.chbDisable.CheckedChanged += new System.EventHandler(this.chbDisable_CheckedChanged);
//
// FrmBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(1294, 729);
this.Controls.Add(this.chbDisable);
this.Controls.Add(this.chbDebug);
this.Controls.Add(this.groupBox4);
this.Controls.Add(this.lblTemp);
this.Controls.Add(this.btnDoorDown);
......@@ -1357,7 +1374,6 @@ namespace OnlineStore.DUOStore
this.groupInout.ResumeLayout(false);
this.groupInout.PerformLayout();
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
this.groupBox7.ResumeLayout(false);
this.groupBox7.PerformLayout();
this.groupBox3.ResumeLayout(false);
......@@ -1453,6 +1469,7 @@ namespace OnlineStore.DUOStore
private System.Windows.Forms.Button btnSingleOut;
private System.Windows.Forms.Button btnNgPro;
private System.Windows.Forms.Label lblCanOut;
private System.Windows.Forms.CheckBox chbDisable;
}
}
......@@ -59,7 +59,7 @@ namespace OnlineStore.DUOStore
acPosition = CSVPositionReader<ACBoxPosition>.GetPositon(cmbPosition.Text);
//BoxBean.PositionNumList = positionNumList;
}
chbDisable.Checked = ConfigAppSettings.GetIntValue("Store_CID_" + BoxBean.ID + "_disabled") == 1 ? true : false;
txtMiddleP1.Text = BoxBean.Config.MiddleAxis_P1.ToString();
txtUpdownP11.Text = BoxBean.Config.UpDownAxis_P11.ToString();
......@@ -277,7 +277,7 @@ namespace OnlineStore.DUOStore
txtUpDownP6.Text = acPosition.UpdownAxis_OL_P6.ToString();
txtInOutP3.Text = acPosition.InoutAxis_P3.ToString();
txtMiddleP2.Text = acPosition.MiddleAxis_P2.ToString();
txtComP2.Text = acPosition.ComAxis_P2.ToString();
//txtComP2.Text = BoxBean.Config.GetComP2(acPosition.BagHigh).ToString();
txtComP3.Text = acPosition.ComAxis_P3.ToString();
lblSize.Text = "尺寸:" + acPosition.BagWidth + "*" + acPosition.BagHigh;
......@@ -323,7 +323,7 @@ namespace OnlineStore.DUOStore
int comp1 = FormUtil.GetIntValue(txtComP1);
int comp2 = FormUtil.GetIntValue(txtComP2);
int comp3 = FormUtil.GetIntValue(txtComP3);
//int comp3 = FormUtil.GetIntValue(txtComP3);
int mP1 = FormUtil.GetIntValue(txtMiddleP1);
int mp11 = FormUtil.GetIntValue(txtMiddleP11);
......@@ -471,7 +471,7 @@ namespace OnlineStore.DUOStore
}
private void btnInoutP11_Click(object sender, EventArgs e)
{
AxisAbsMove(BoxBean.Config.UpDown_Axis, txtInoutP11, BoxBean.Config.InOutAxis_P11_Speed);
AxisAbsMove(BoxBean.Config.InOut_Axis, txtInoutP11, BoxBean.Config.InOutAxis_P11_Speed);
}
private void btnMiddleP11_Click(object sender, EventArgs e)
......@@ -830,5 +830,12 @@ namespace OnlineStore.DUOStore
MessageBox.Show("请先启动料仓!");
}
}
private void chbDisable_CheckedChanged(object sender, EventArgs e)
{
BoxBean.Disabled = chbDisable.Checked;
ConfigAppSettings.SaveValue("Store_CID_" + BoxBean.ID + "_disabled", chbDisable.Checked ? 1 : 0);
}
}
}
......@@ -33,7 +33,6 @@
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.panel1 = new System.Windows.Forms.Panel();
this.button1 = new System.Windows.Forms.Button();
this.chbInstoreEnd = new System.Windows.Forms.CheckBox();
this.chkDebug = new System.Windows.Forms.CheckBox();
this.lblMoveInfo = new System.Windows.Forms.Label();
......@@ -65,6 +64,7 @@
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
this.扫码测试ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator();
this.显示日志ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.帮助ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.版本号ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
......@@ -114,7 +114,6 @@
//
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.button1);
this.panel1.Controls.Add(this.chbInstoreEnd);
this.panel1.Controls.Add(this.chkDebug);
this.panel1.Controls.Add(this.lblMoveInfo);
......@@ -129,19 +128,6 @@
this.panel1.Size = new System.Drawing.Size(182, 623);
this.panel1.TabIndex = 271;
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.button1.BackColor = System.Drawing.Color.White;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Location = new System.Drawing.Point(12, 490);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(105, 35);
this.button1.TabIndex = 272;
this.button1.Text = "测试";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// chbInstoreEnd
//
this.chbInstoreEnd.AutoSize = true;
......@@ -199,6 +185,7 @@
this.btnCopyLog.TabIndex = 191;
this.btnCopyLog.Text = "复制日志";
this.btnCopyLog.UseVisualStyleBackColor = false;
this.btnCopyLog.Visible = false;
this.btnCopyLog.Click += new System.EventHandler(this.btnCopyLog_Click);
//
// btnClearLog
......@@ -212,6 +199,7 @@
this.btnClearLog.TabIndex = 190;
this.btnClearLog.Text = "清空日志";
this.btnClearLog.UseVisualStyleBackColor = false;
this.btnClearLog.Visible = false;
this.btnClearLog.Click += new System.EventHandler(this.btnClearLog_Click);
//
// lblShelf
......@@ -285,6 +273,7 @@
this.logBox.Size = new System.Drawing.Size(1098, 500);
this.logBox.TabIndex = 106;
this.logBox.Text = "";
this.logBox.Visible = false;
this.logBox.VisibleChanged += new System.EventHandler(this.logBox_VisibleChanged);
//
// lblWarnMsg
......@@ -333,54 +322,54 @@
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator1.Size = new System.Drawing.Size(114, 6);
//
// 启动AToolStripMenuItem
//
this.启动AToolStripMenuItem.Name = "启动AToolStripMenuItem";
this.启动AToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.启动AToolStripMenuItem.Size = new System.Drawing.Size(117, 26);
this.启动AToolStripMenuItem.Text = "启动 ";
this.启动AToolStripMenuItem.Click += new System.EventHandler(this.启动所有料仓AToolStripMenuItem_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator4.Size = new System.Drawing.Size(114, 6);
//
// 复位RToolStripMenuItem
//
this.复位RToolStripMenuItem.Name = "复位RToolStripMenuItem";
this.复位RToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.复位RToolStripMenuItem.Size = new System.Drawing.Size(117, 26);
this.复位RToolStripMenuItem.Text = "复位";
this.复位RToolStripMenuItem.Click += new System.EventHandler(this.复位RToolStripMenuItem_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator3.Size = new System.Drawing.Size(114, 6);
//
// 停止TToolStripMenuItem
//
this.停止TToolStripMenuItem.Name = "停止TToolStripMenuItem";
this.停止TToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.停止TToolStripMenuItem.Size = new System.Drawing.Size(117, 26);
this.停止TToolStripMenuItem.Text = "停止";
this.停止TToolStripMenuItem.Click += new System.EventHandler(this.停止所有料仓TToolStripMenuItem_Click);
//
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator5.Size = new System.Drawing.Size(114, 6);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator2.Size = new System.Drawing.Size(114, 6);
this.toolStripSeparator2.Visible = false;
//
// 退出ToolStripMenuItem
//
this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem";
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(117, 26);
this.退出ToolStripMenuItem.Text = "退出";
this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click_1);
//
......@@ -392,7 +381,8 @@
this.二维码学习ToolStripMenuItem,
this.toolStripSeparator7,
this.扫码测试ToolStripMenuItem,
this.toolStripSeparator9});
this.toolStripSeparator9,
this.显示日志ToolStripMenuItem});
this.设置TToolStripMenuItem.Name = "设置TToolStripMenuItem";
this.设置TToolStripMenuItem.Size = new System.Drawing.Size(91, 25);
this.设置TToolStripMenuItem.Text = "设备调试 ";
......@@ -433,6 +423,13 @@
this.toolStripSeparator9.Name = "toolStripSeparator9";
this.toolStripSeparator9.Size = new System.Drawing.Size(157, 6);
//
// 显示日志ToolStripMenuItem
//
this.显示日志ToolStripMenuItem.Name = "显示日志ToolStripMenuItem";
this.显示日志ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
this.显示日志ToolStripMenuItem.Text = "显示日志";
this.显示日志ToolStripMenuItem.Click += new System.EventHandler(this.显示日志ToolStripMenuItem_Click);
//
// 帮助ToolStripMenuItem
//
this.帮助ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
......@@ -566,7 +563,7 @@
private System.Windows.Forms.Label lblMoveInfo;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.CheckBox chbInstoreEnd;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.ToolStripMenuItem 显示日志ToolStripMenuItem;
}
}
......@@ -170,7 +170,7 @@ namespace OnlineStore.DUOStore
//BoxBean _equip = (BoxBean)equip;
//LogUtil.info(_equip.MoveInfo.ToString());
//LogUtil.info(_equip.MoveInfo.MoveParam.ToString());
if (equip.MoveInfo.MoveParam != null)
if (equip.MoveInfo != null && equip.MoveInfo.MoveParam != null)
trayInfo = equip.MoveInfo.MoveParam.ToStr();
}
SetItemText(i, item_move_info_index, trayInfo);
......@@ -730,40 +730,13 @@ namespace OnlineStore.DUOStore
}
private async void button1_Click(object sender, EventArgs e)
{
int contentLength = await AccessTheWebAsync();
this.logBox.Text+= $"\r\nLength of the downloaded string: {contentLength}.\r\n";
}
async Task<int> AccessTheWebAsync()
private void 显示日志ToolStripMenuItem_Click(object sender, EventArgs e)
{
// You need to add a reference to System.Net.Http to declare client.
var client = new HttpClient();
// GetStringAsync returns a Task<string>. That means that when you await the
// task you'll get a string (urlContents).
Task<string> getStringTask = client.GetStringAsync("https://docs.microsoft.com/dotnet");
// You can do work here that doesn't rely on the string from GetStringAsync.
DoIndependentWork();
logBox.Visible = logBox.Visible ? false : true;
btnCopyLog.Visible = logBox.Visible;
btnClearLog.Visible = logBox.Visible;
// The await operator suspends AccessTheWebAsync.
// - AccessTheWebAsync can't continue until getStringTask is complete.
// - Meanwhile, control returns to the caller of AccessTheWebAsync.
// - Control resumes here when getStringTask is complete.
// - The await operator then retrieves the string result from getStringTask.
string urlContents = await getStringTask;
// The return statement specifies an integer result.
// Any methods that are awaiting AccessTheWebAsync retrieve the length value.
return urlContents.Length;
}
private void DoIndependentWork()
{
Console.WriteLine("Working ... .... ");
this.logBox.Text += $"\r\nWorking ... .... .\r\n";
}
}
}
......@@ -33,7 +33,7 @@ namespace OnlineStore.DUOStore
{
InitializeComponent();
this.PortName = configMoveAxis.ProName;
this.SlvAddr = configMoveAxis.SlaveID;
this.SlvAddr = configMoveAxis.GetAxisValue();
this.IoIp = "";
this.IoIndex = ioIndex;
this.subType = ioSubType;
......
......@@ -90,20 +90,18 @@ namespace OnlineStore.DeviceLibrary
{
try
{
//UpdateAction(id, ClientAction.Ready);
LogUtil.info("收到 AgvClient_Ready [" + id + "] [" + rfid + "] " + GetAction(id).ToString());
if (GetAction(id) == ClientAction.NeedEnter || id == "D1")
if (GetAction(id) == ClientAction.NeedEnter || id == StoreManager.Config.AgvInName)
{
SetStatus(id, "", ClientAction.MayEnter);
_ = StoreManager.Store.AgvSendShelfIn();
}
else if (GetAction(id) == ClientAction.NeedLeave || id == "D2")
else if (GetAction(id) == ClientAction.NeedLeave || id == StoreManager.Config.AgvOutName)
{
SetStatus(id, "", ClientAction.MayLeave);
StoreManager.Store.OneShelfOutProcess();
}
else
{
LogUtil.error("收到 AgvClient_Arrive [" + id + "] [" + rfid + "] 未找到对应的设备 ,暂不处理");
......
......@@ -36,8 +36,9 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Asa.IOModule.AIOBOX">
<HintPath>..\..\dll\Asa.IOModule.AIOBOX.dll</HintPath>
<Reference Include="Asa.IOModule.AIOBOX, Version=2.4.0.7, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\AIOBOX\AIOBOX\bin\Debug\Asa.IOModule.AIOBOX.dll</HintPath>
</Reference>
<Reference Include="Client, Version=1.0.0.1, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
......
......@@ -10,6 +10,7 @@ PRO,,L2_上下轴_P2入料口高点,UpDownAxis_P2,10,,,,,,,,,,,,
PRO,,L1_旋转轴_P1待机点/入料口位置,MiddleAxis_P1,10,,,,,,,,,,,,
PRO,,L3_进出轴_P1待机点,InOutAxis_P1,10,,,,,,,,,,,,
PRO,,L4_压紧轴_P1待机点,CompAxis_P1,10,,,,,,,,,,,,
PRO,,L4_压紧轴_P2压紧点范围对应值,CompAxis_P2_List,8=247455;12=383001;16=379001;,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,,L2_上下轴_P11-出料口-低点,UpDownAxis_P11,10,,,,,,,,,,,,
PRO,,L2_上下轴_P12-出料口-高点,UpDownAxis_P12,10,,,,,,,,,,,,
......
......@@ -10,6 +10,7 @@ PRO,,R2_上下轴_P2扫码放料高点缓冲点,UpDownAxis_P2,10,,,,,,,,,,,,
PRO,,R1_旋转轴_P1待机点/扫码放料点,MiddleAxis_P1,10,,,,,,,,,,,,
PRO,,R3_进出轴_P1待机点,InOutAxis_P1,10,,,,,,,,,,,,
PRO,,R4_压紧轴_P1待机点,CompAxis_P1,10,,,,,,,,,,,,
PRO,,L4_压紧轴_P2压紧点范围对应值,CompAxis_P2_List,8=247455;12=383001;16=379001;,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,,R2_上下轴_P11-出料口-低点,UpDownAxis_P11,10,,,,,,,,,,,,
PRO,,R2_上下轴_P12-出料口-高点,UpDownAxis_P12,10,,,,,,,,,,,,
......
......@@ -50,14 +50,6 @@ DI,0,设备左侧防护门打开端,LeftDoor_Open,35,HC,X35,*,,,,,,,,,
DI,0,设备左侧防护门关闭端,LeftDoor_Close,36,HC,X36,*,,,,,,,,,
DI,0,设备右侧防护门打开端,RightDoor_Open,37,HC,X37,*,,,,,,,,,
DI,0,设备右侧防护门关闭端,RightDoor_Close,38,HC,X38,*,,,,,,,,,
DI,0,卡爪到位确认,Clamp_OnPosition,39,HC,X39,*,,,,,,,,,
DI,0,卡爪范围确认,Clamp_InRange,40,HC,X40,*,,,,,,,,,
DI,0,卡爪动作中,Clamp_Busy,41,HC,X41,*,,,,,,,,,
DI,0,卡爪异常代码1,Clamp_Abnormal1,42,HC,X42,*,,,,,,,,,
DI,0,卡爪异常代码2,Clamp_Abnormal2,43,HC,X43,*,,,,,,,,,
DI,0,卡爪物件辨识1,Clamp_ObjRecognize1,44,HC,X44,*,,,,,,,,,
DI,0,卡爪物件辨识2,Clamp_ObjRecognize2,45,HC,X45,*,,,,,,,,,
DI,0,卡爪物件辨识3,Clamp_ObjRecognize3,46,HC,X46,*,,,,,,,,,
,,,,,,,,,,,,,,,,
DO,0,自动指示灯,AutoRun_HddLed,0,HC,Y00,,,,,,,,,,
DO,0,故障指示灯,Alarm_HddLed,1,HC,Y01,,,,,,,,,,
......@@ -90,12 +82,6 @@ DO,0,设备右侧防护门打开,RightDoor_Open,27,HC,Y27,*,,,,,,,,,
DO,0,设备右侧防护门关闭,RightDoor_Close,28,HC,Y28,*,,,,,,,,,
DO,2,右侧出料口门上升,OutDoor_Up,29,HC,Y29,,,,,,,,,,
DO,2,右侧出料口门下降,OutDoor_Down,30,HC,Y30,,,,,,,,,,
DO,0,卡爪指令编码0,Clamp_SetPos0,31,HC,Y31,*,,,,,,,,,
DO,1,卡爪指令编码1,Clamp_SetPos1,32,HC,Y32,*,,,,,,,,,
DO,2,卡爪指令编码2,Clamp_SetPos2,33,HC,Y33,*,,,,,,,,,
DO,3,卡爪指令编码3,Clamp_SetPos3,34,HC,Y34,*,,,,,,,,,
DO,4,卡爪指令编码4,Clamp_SetPos4,35,HC,Y35,*,,,,,,,,,
DO,5,卡爪动作指令,Clamp_DoAction,36,HC,Y36,*,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,0,T1_提升轴待机点 P1,BatchAxis_P1,5000,,,,, ,,,,,,,
PRO,0,T1_提升轴上升目标点_P2,BatchAxis_P2,4000,,,,, ,,,,,,,
......
......@@ -147,7 +147,7 @@ namespace OnlineStore.DeviceLibrary
string r = "";
List<CodeInfo> tlci = EyemDecode.Decoder(ref bmp);
List<CodeInfo> tlci = EyemDecode.Decoder(ref bmp,null,15);
foreach (CodeInfo code in tlci)
{
......
......@@ -28,6 +28,7 @@ namespace OnlineStore.DeviceLibrary
public AxisBean ComAxis = null;
public AxisBean InoutAxis = null;
public bool Disabled = false;
/// <summary>
/// 出料口最后一盘料信息,0=暂无,1=单盘出库料亮绿灯,2=入库NG料亮红灯
/// </summary>
......@@ -107,6 +108,12 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(Name + "启动失败:设备未初始化完成");
return false;
}
if (Disabled)
{
WarnMsg = "启动失败:设备被禁用";
LogUtil.error(Name + "启动失败:设备被禁用");
return false;
}
LogInfo("开始启动,启动时间:" + StartTime.ToString());
AutoInout.StopAuto();
mainTimer.Enabled = false;
......@@ -166,6 +173,8 @@ namespace OnlineStore.DeviceLibrary
public override void Reset(bool isNeedClearAuto = true)
{
if (Disabled)
return;
AutoInout.ClearCount();
//复位之前先停止运行
if (isNeedClearAuto)
......@@ -310,13 +319,33 @@ namespace OnlineStore.DeviceLibrary
CheckAxisAlarm(new AxisBean[] { MiddleAxis, UpdownAxis, InoutAxis, ComAxis });
ShowTimeLog("轴报警检测完成");
}
if (runStatus >= StoreRunStatus.Runing)
{
IOMinoitor();
}
}
catch (Exception ex)
{
LogUtil.error(Name + "定时处理出错" + ex.ToString());
}
}
int OutDoorCloseCountDown = 5;
void IOMinoitor() {
if (IOValue(IO_Type.OutDoor_Up).Equals(IO_VALUE.HIGH)
&& IOValue(IO_Type.OutDoor_Check).Equals(IO_VALUE.LOW)
&& IOValue(IO_Type.OutDoor_SafeSignal).Equals(IO_VALUE.LOW))
{
OutDoorCloseCountDown--;
while (OutDoorCloseCountDown == 0)
{
CylinderMove(MoveInfo, IO_Type.OutDoor_Up, IO_Type.OutDoor_Down);
LogInfo("料已被取走,关门");
}
}
else {
OutDoorCloseCountDown = 5;
}
}
private void AutoResetProcess()
{
......@@ -336,6 +365,21 @@ namespace OnlineStore.DeviceLibrary
}
return;
}
else if (IOValue(IO_Type.OutDoor_Check).Equals(IO_VALUE.HIGH) && noInStore && IsDebug.Equals(false))
{
LogInfo("发现紧急出口有料");
InOutParam inOutParam = new InOutParam(MoveType.InStore);
inOutParam.InStoreNg = true;
inOutParam.TargetPosition = 1;
inOutParam.moveType = MoveType.InStore;
StoreManager.LoadInoutParam(inOutParam, MoveType.InStore, true, this);
runStatus = StoreRunStatus.Busy;
storeStatus = StoreStatus.InStoreExecute;
MoveInfo.NewMove(MoveType.InStore, inOutParam);
MoveInfo.NextMoveStep(StoreMoveStep.SI_24_PurReel);
//InoutAxis.AbsMove(MoveInfo, Config.InOutAxis_P1, Config.InOutAxis_P1_Speed);
}
else if (waitInStoreParam != null && noInStore && IsDebug.Equals(false))
{
if (!StartInStoreMove(waitInStoreParam))
......@@ -383,11 +427,11 @@ namespace OnlineStore.DeviceLibrary
public bool OpenAllAxis(bool isCheck)
{
return RunMultiAxis(true,new AxisBean[] { MiddleAxis, UpdownAxis, InoutAxis, ComAxis });
return RunMultiAxis(isCheck, new AxisBean[] { MiddleAxis, UpdownAxis, InoutAxis, ComAxis });
}
public void CloseAllAxis()
{
LogUtil.info(Name + "关闭刹车,关闭伺服");
LogUtil.info(Name + "关闭伺服");
CloseMultiAxis(new AxisBean[] { MiddleAxis, UpdownAxis, InoutAxis, ComAxis });
}
......
......@@ -198,6 +198,58 @@ namespace OnlineStore.DeviceLibrary
}
}
public bool ReviceInStoreCMD(string posId, int plateH, int plateW, string message)
{
string logName = "入库库位验证【 " + message + "】【" + posId + "】:";
try
{
if (runStatus.Equals(StoreRunStatus.Wait))
{
LogUtil.info(logName + " 设备未启动,验证失败");
return false;
}
//发送扫码内容到服务器进行入库操作
Operation operation = getLineBoxStatus();
operation.op = 1;
operation.data = new Dictionary<string, string>() { { "code", message }, { "boxId", this.ID.ToString() } };
operation.data.Add("inPos", posId);
string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
for (int i = 1; i <= 3; i++)
{
bool timeOut = false;
Operation resultOperation = HttpHelper.PostOperation(StoreManager.GetPostApi(server), operation);
if (timeOut)
{
LogUtil.info(logName + " 第" + i + "次发送超时 ");
continue;
}
if (resultOperation == null)
{
// CodeMsg = "二维码【" + message + "】没有收到服务器反馈";
LogUtil.info(logName + " 没有收到服务器反馈 ");
}
else if (!string.IsNullOrEmpty(resultOperation.msg))
{
//如果有提示消息,直接显示提示
LogUtil.info(logName + "服务器反馈 :" + resultOperation.msg);
}
else if (resultOperation.op.Equals(1))
{
LogUtil.info(logName + " 成功");
return true;
}
break;
}
}
catch (Exception ex)
{
LogUtil.info(logName + " 出错:" + ex.ToString());
}
return false;
}
private void ReviceOutStoreProcess(Operation resultOperation)
{
......
......@@ -77,7 +77,8 @@ namespace OnlineStore.DeviceLibrary
foreach (BOX_Config config in configList.Values)
{
BoxBean equip = new BoxBean(config);
bool boxDisable = ConfigAppSettings.GetIntValue("Store_CID_" + config.Id + "_disabled") == 1 ? true : false;
equip.Disabled = boxDisable;
AddDeviceName(ioList, config.IOIPList);
BoxMap.Add(config.Id, equip);
BoxConfigMap.Add(config.Id, config);
......@@ -103,6 +104,7 @@ namespace OnlineStore.DeviceLibrary
CodeManager.LoadConfig();
CurrShelfNum = ConfigAppSettings.GetIntValue(Setting_Init.CurrShelfNum);
CurrShelfType = ConfigAppSettings.GetIntValue(Setting_Init.CurrShelfType);
UpdateShelfNum(CurrShelfNum, CurrShelfType);
HasT4Axis = Convert.ToBoolean(ConfigAppSettings.GetValue(Setting_Init.HasT4Axis));
Task.Factory.StartNew(delegate
{
......@@ -194,7 +196,7 @@ namespace OnlineStore.DeviceLibrary
}
return false;
}
bool boxreset = true;
public override void Reset(bool isNeedClearAuto = true)
{
mainTimer.Enabled = false;
......@@ -208,7 +210,7 @@ namespace OnlineStore.DeviceLibrary
}
runStatus = StoreRunStatus.Reset;
StartResetMove();
boxreset = true;
foreach (BoxBean equip in BoxMap.Values)
{
if (!equip.alarmType.Equals(AlarmType.None))
......@@ -223,6 +225,21 @@ namespace OnlineStore.DeviceLibrary
}
mainTimer.Enabled = true;
}
public void ResetLine()
{
mainTimer.Enabled = false;
boxreset = false;
//停止运动
MoveInfo.EndMove();
if (!OpenAllAxis(true))
{
LogInfo("复位时打开轴失败,需要再次复位,直接报警停止复位");
return;
}
runStatus = StoreRunStatus.Reset;
StartResetMove();
mainTimer.Enabled = true;
}
private void StartResetMove()
{
mainTimer.Enabled = false;
......@@ -313,10 +330,19 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StoreMoveStep.LR_07_WaitBox))
{
bool isOk = true;
if (!boxreset)
{
LogUtil.info(Name + "线体重置完成");
MoveEndP();
return;
}
//判断是否所有的已经返回完成
string msg = "等待BOX复位完成超时";
foreach (BoxBean box in this.BoxMap.Values)
{
if (box.Disabled)
continue;
if ((box.runStatus.Equals(StoreRunStatus.HomeMoving) || box.runStatus.Equals(StoreRunStatus.Reset)))
//if ((box.storeRunStatus.Equals(StoreRunStatus.HomeMoving) || box.storeRunStatus.Equals(StoreRunStatus.Reset)) && box.IsDebug.Equals(false))
{
......@@ -465,6 +491,22 @@ namespace OnlineStore.DeviceLibrary
{
IOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW);
}
if (IOValue(IO_Type.Line_OutCheck).Equals(IO_VALUE.HIGH))
{
//IOMove(IO_Type.LineOut_Led, IO_VALUE.HIGH);
}
else
{
//IOMove(IO_Type.LineOut_Led, IO_VALUE.LOW);
}
if (IOValue(IO_Type.Line_InCheck).Equals(IO_VALUE.LOW))
{
//IOMove(IO_Type.LineIn_Led, IO_VALUE.HIGH);
}
else
{
//IOMove(IO_Type.LineIn_Led, IO_VALUE.LOW);
}
}
catch (Exception ex)
......@@ -618,6 +660,7 @@ namespace OnlineStore.DeviceLibrary
if (runStatus.Equals(StoreRunStatus.Runing) || runStatus.Equals(StoreRunStatus.Busy))
{
ShelfOutProcess();
IOMinoitor();
ShowTimeLog("ShelfOutProcess");
}
}
......@@ -667,7 +710,54 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(Name + " ShelfOutProcess 出错:" + ex.ToString());
}
}
public void OneShelfOutProcess()
{
try
{
if (IOValue(IO_Type.Line_OutCheck).Equals(IO_VALUE.HIGH) &&
IOValue(IO_Type.Line_Run).Equals(IO_VALUE.LOW) &&
LowProcess.Equals(false))
{
if (StoreManager.checkWatch(lowWatch, 3000))
{
//左侧下层需要放个料架
Task.Run(() =>
{
LowProcess = true;
LogUtil.info(Name + "送出一个料架");
IOMove(IO_Type.Line_Run, IO_VALUE.HIGH, false, 30000);
IOMove(IO_Type.Line_Stop4_Out, IO_VALUE.HIGH, false, 1000);
if (WaitIo(IO_Type.Line_OutCheck, IO_VALUE.LOW, 30000, "送出一个料架"))
{
LineStop();
}
LowProcess = false;
});
}
}
else
{
lowWatch.Stop();
}
}
catch (Exception ex)
{
LogUtil.error(Name + " OneShelfOutProcess 出错:" + ex.ToString());
}
}
#endregion
void IOMinoitor() {
if (IOValue(IO_Type.Line_WaitCheck).Equals(IO_VALUE.LOW) && AgvClient.GetAction(Config.AgvInName) == ClientAction.None)
{
AgvClient.NeedEnter(Config.AgvInName);
}
if (IOValue(IO_Type.Line_OutCheck).Equals(IO_VALUE.HIGH) && AgvClient.GetAction(Config.AgvOutName) == ClientAction.None)
{
AgvClient.NeedLeave(Config.AgvOutName);
}
}
public int GetShelfNum()
{
......
......@@ -239,7 +239,6 @@ namespace OnlineStore.DeviceLibrary
}
else if (span.TotalMilliseconds > timeOutMs && NoAlarm())
{
WarnMsg = Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "] 等待(" + io.DisplayStr + "=" + wait.IoValue + ") 超时";
Alarm(AlarmType.IoSingleTimeOut, io.ElectricalDefinition, WarnMsg, MoveInfo.MoveType);
LogUtil.error(Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "] 等待(" + io.DisplayStr + "=" + wait.IoValue + ") 超时", logType + 14);
......@@ -289,9 +288,8 @@ namespace OnlineStore.DeviceLibrary
{
WarnMsg = Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "]等待" + NotOkMsg
+ "超时[" + Math.Round(span.TotalSeconds, 1) + "]秒";
int second = 10;
second = (int)(MoveInfo.TimeOutSeconds / span.TotalSeconds) * 10;
int second = (int)(MoveInfo.TimeOutSeconds / span.TotalSeconds) * 10;
if (second > 120)
{
second = 120;
......
......@@ -201,35 +201,43 @@ namespace OnlineStore.DeviceLibrary
p.UpDown_P2 = box.Config.UpDownAxis_P2;
// p.UpDown_P7 = box.Config.UpDownAxis_DoorOBPosition_P7;
ACBoxPosition position = CSVPositionReader<ACBoxPosition>.GetPositon(param.PosID);
if (position == null)
if (param.TargetPosition == 1)
{
if (movetype.Equals(MoveType.InStore) && param.TargetPosition.Equals(1))
{
return true;
}
LogUtil.error(box.Name + "GetPositon[" + param.PosID + "]=null,没有库位不能执行出入库");
return false;
}
if (param.PlateH<=0)
{
param.PlateH = position.BagHigh;
p.ComPress_P2 = box.Config.GetComP2(param.PlateH);
p.ComPress_P3 = box.Config.CompAxis_P1;
}
if (param.PlateW<=0)
else
{
param.PlateW = position.BagWidth;
ACBoxPosition position = CSVPositionReader<ACBoxPosition>.GetPositon(param.PosID);
if (position == null)
{
if (movetype.Equals(MoveType.InStore) && param.TargetPosition.Equals(1))
{
return true;
}
LogUtil.error(box.Name + "GetPositon[" + param.PosID + "]=null,没有库位不能执行出入库");
return false;
}
if (param.PlateH <= 0)
{
param.PlateH = position.BagHigh;
}
if (param.PlateW <= 0)
{
param.PlateW = position.BagWidth;
}
//p.ComPress_P2 = box.Config.GetComP2(position.BagHigh);
//p.ComPress_P3 = box.Config.CompAxis_P3;
p.ComPress_P2 = position.ComAxis_P2;
p.ComPress_P3 = position.ComAxis_P3;
p.InOut_P3 = position.InoutAxis_P3;
p.Middle_P2 = position.MiddleAxis_P2;
p.UpDown_P3 = position.UpdownAxis_IH_P3;
p.UpDown_P4 = position.UpdownAxis_IL_P4;
p.UpDown_P5 = position.UpdownAxis_OH_P5;
p.UpDown_P6 = position.UpdownAxis_OL_P6;
}
//p.ComPress_P2 = box.Config.GetComP2(position.BagHigh);
//p.ComPress_P3 = box.Config.CompAxis_P3;
p.ComPress_P2 = position.ComAxis_P2;
p.ComPress_P3 = position.ComAxis_P3;
p.InOut_P3 = position.InoutAxis_P3;
p.Middle_P2 = position.MiddleAxis_P2;
p.UpDown_P3 = position.UpdownAxis_IH_P3;
p.UpDown_P4 = position.UpdownAxis_IL_P4;
p.UpDown_P5 = position.UpdownAxis_OH_P5;
p.UpDown_P6 = position.UpdownAxis_OL_P6;
param.MoveP = p;
......@@ -357,7 +365,17 @@ namespace OnlineStore.DeviceLibrary
// 参数:cids: 多个 cid
//code: 条码内容
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("cids", Config.All_CIDs);
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))
{
cids += Store.BoxMap[k].CID+",";
}
}
cids = cids.TrimEnd(',');
paramMap.Add("cids", cids);
paramMap.Add("code", codeStr);
paramMap.Add(ParamDefine.rfid, shelfNum.ToString());
......@@ -402,22 +420,10 @@ namespace OnlineStore.DeviceLibrary
if (Store.BoxMap.ContainsKey(storeId))
{
BoxBean box = Store.BoxMap[storeId];
if (box.IsReviceInPosId( posId))
{
result.Param.InStoreNg = true;
result.Param.NgMsg = "入库库位重复";
result.Msg = deviceName + ("收到入库命令:" + "入库库位重复: " + result.Param.ToStr() + " ,入库失败!");
return result;
}
LogUtil.info(deviceName + "收到入库命令: " + result.Param.ToStr() + " ");
if (!box.StartInStoreMove(result.Param))
{
if (box.waitInStoreParam == null)
{
result.Msg = deviceName + ("收到入库命令:" + "启动入库失败,缓存到waitInStoreList等待稍后入库: " + result.Param.ToStr() + " ");
box.waitInStoreParam = result.Param;
}
}
result.Param.InStoreNg = false;
result.Msg = "";
return result;
}
else
{
......
......@@ -55,7 +55,7 @@ namespace OnlineStore.DeviceLibrary
}
if (storeMoveType.Equals(MoveType.InStore))
{
int newIndex = positionIndex;
int newIndex = positionIndex - Jiange;
if (newIndex < 0)
{
if (startIndex >= 0 && startIndex < boxBean.PositionNumList.Count)
......@@ -92,7 +92,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (storeMoveType.Equals(MoveType.OutStore))
{
int newIndex = positionIndex - Jiange;
int newIndex = positionIndex;
if (newIndex < 0)
{
if (startIndex >= 0 && startIndex < boxBean.PositionNumList.Count)
......
......@@ -149,7 +149,10 @@ namespace OnlineStore.DeviceLibrary
}
}
}
public InOutParam clone()
{
return (InOutParam)this.MemberwiseClone();
}
}
}
......@@ -494,19 +494,6 @@ namespace OnlineStore.DeviceLibrary
}
}
Thread.Sleep(500);
//打开所有轴
//if (isCheck)
//{
// foreach (AxisBean axis in axisArray)
// {
// if (!axis.OpenAxis(out msg))
// {
// SetWarnMsg(Name + msg);
// Alarm(AlarmType.AxisAlarm);
// return false;
// }
// }
//}
return true;
}
......
......@@ -285,7 +285,10 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
SO_12_WaitTrayGo,
SO_14_InoutToP1,
SO_15_AxisBack,
SO_16_InoutToP2,
SO_17_GetReel,
/// <summary>
/// 单盘出库:移动到出料口,旋转轴到P11,升降轴到P12高点
/// </summary>
......
......@@ -87,7 +87,7 @@ namespace OnlineStore.DeviceLibrary
{
param = new InOutParam(type);
}
this.MoveParam = param;
this.MoveParam = param.clone(); ;
LastSetpTime = DateTime.Now;
WaitList = new List<WaitResultInfo>();
}
......
......@@ -68,11 +68,11 @@ namespace OnlineStore.LoadCSVLibrary
///// </summary>
//[ConfigProAttribute("CompAxis_P3")]
//public int CompAxis_P3 { get; set; }
///// <summary>
///// PRO,,L4_压紧轴_P2压紧点范围对应值,CompAxis_P2_List,8=385001;12=383001;16=379001;
///// </summary>
//[ConfigProAttribute("CompAxis_P2_List")]
//public string CompAxis_P2_List { get; set; }
/// <summary>
/// PRO,,L4_压紧轴_P2压紧点范围对应值,CompAxis_P2_List,8=385001;12=383001;16=379001;
/// </summary>
[ConfigProAttribute("CompAxis_P2_List")]
public string CompAxis_P2_List { get; set; }
/// <summary>
/// PRO,,L2_上下轴_P11-出料口-低点,UpDownAxis_P11,1000000
/// </summary>
......@@ -211,70 +211,69 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("IsInDebug")]
public int IsInDebug { get; set; }
//private Dictionary< int,int > ComP2Map =null ;
//public int GetComP2(int plateh)
//{
// //查找指定的高度
// analysisComP2();
// if (ComP2Map.ContainsKey(plateh))
// {
// return ComP2Map[plateh];
// }
// return new List<int>(ComP2Map.Values).First<int>();
//}
private Dictionary<int, int> ComP2Map = null;
public int GetComP2(int plateh)
{
//查找指定的高度
analysisComP2();
if (ComP2Map.ContainsKey(plateh))
{
return ComP2Map[plateh];
}
return new List<int>(ComP2Map.Values).First<int>();
}
public void UpdateComP2(int height, int p2)
{
analysisComP2();
if (ComP2Map.ContainsKey(height))
{
ComP2Map[height] = p2;
}
else
{
ComP2Map.Add(height, p2);
}
string tt = "";
foreach (int p in ComP2Map.Keys)
{
tt += p + "=" + ComP2Map[p] + ";";
}
CompAxis_P2_List = tt;
}
private void analysisComP2()
{
if (ComP2Map == null)
{
try
{
// 8=385001;424000#12=383001;385000#16=379001;
ComP2Map = new Dictionary<int, int>();
string[] arrayList = CompAxis_P2_List.Split(';');
foreach (string str in arrayList)
{
if (str.Equals(""))
{
continue;
}
string[] com2A = str.Split('=');
if (com2A.Length.Equals(2))
{
int plateH = Convert.ToInt32(com2A[0]);
int p2 = Convert.ToInt32(com2A[1]);
ComP2Map.Add(plateH, p2);
}
}
}
catch (Exception ex)
{
LogUtil.error("解析CompAxis_P2_List【" + CompAxis_P2_List + "】出错:" + ex.ToString());
}
}
}
//public void UpdateComP2(int height, int p2)
//{
// analysisComP2();
// if (ComP2Map.ContainsKey(height))
// {
// ComP2Map[height] = p2;
// }
// else
// {
// ComP2Map.Add(height, p2);
// }
// string tt = "";
// foreach (int p in ComP2Map.Keys)
// {
// tt += p + "=" + ComP2Map[p] + ";";
// }
// CompAxis_P2_List = tt;
//}
//private void analysisComP2()
//{
// if (ComP2Map == null)
// {
// try
// {
// // 8=385001;424000#12=383001;385000#16=379001;
// ComP2Map = new Dictionary<int, int>();
// string[] arrayList = CompAxis_P2_List.Split(';');
// foreach (string str in arrayList)
// {
// if (str.Equals(""))
// {
// continue;
// }
// string[] com2A = str.Split('=');
// if (com2A.Length.Equals(2))
// {
// int plateH = Convert.ToInt32(com2A[0]);
// int p2 = Convert.ToInt32(com2A[1]);
// ComP2Map.Add(plateH, p2);
// }
// }
// }
// catch (Exception ex)
// {
// LogUtil.error("解析CompAxis_P2_List【" + CompAxis_P2_List + "】出错:" + ex.ToString());
// }
// }
//}
}
......
......@@ -299,10 +299,10 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("Clamp1Port")]
public string Clamp1Port { get; set; }
private List<string> CameraList = new List<string>();
private List<string> CameraList = null;
public List<string> GetCameraList()
{
if (CameraList.Count==0)
if (CameraList==null)
{
CameraList = new List<string>();
string[] arrayList = CameraNameList.Split('#');
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!