Commit 86cde185 几米阳光

修改界面,发送设备运行状态给服务器

1 个父辈 ab4b5c10
...@@ -108,6 +108,7 @@ ...@@ -108,6 +108,7 @@
this.label42 = new System.Windows.Forms.Label(); this.label42 = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox();
this.btnSave = new System.Windows.Forms.Button(); this.btnSave = new System.Windows.Forms.Button();
this.btnClearLog = new System.Windows.Forms.Button();
this.txtInoutP4 = new System.Windows.Forms.TextBox(); this.txtInoutP4 = new System.Windows.Forms.TextBox();
this.btnInOutP4 = new System.Windows.Forms.Button(); this.btnInOutP4 = new System.Windows.Forms.Button();
this.txtUpdownP8 = new System.Windows.Forms.TextBox(); this.txtUpdownP8 = new System.Windows.Forms.TextBox();
...@@ -147,7 +148,6 @@ ...@@ -147,7 +148,6 @@
this.btnUpDownP6 = new System.Windows.Forms.Button(); this.btnUpDownP6 = new System.Windows.Forms.Button();
this.btnUpDownP3 = new System.Windows.Forms.Button(); this.btnUpDownP3 = new System.Windows.Forms.Button();
this.btnUpDownP4 = new System.Windows.Forms.Button(); this.btnUpDownP4 = new System.Windows.Forms.Button();
this.btnClearLog = new System.Windows.Forms.Button();
this.lblTemp = new System.Windows.Forms.Label(); this.lblTemp = new System.Windows.Forms.Label();
this.lblMsg = new System.Windows.Forms.Label(); this.lblMsg = new System.Windows.Forms.Label();
this.btnStartAuTo = new System.Windows.Forms.Button(); this.btnStartAuTo = new System.Windows.Forms.Button();
...@@ -1260,6 +1260,17 @@ ...@@ -1260,6 +1260,17 @@
this.btnSave.UseVisualStyleBackColor = true; this.btnSave.UseVisualStyleBackColor = true;
this.btnSave.Click += new System.EventHandler(this.btnSave_Click); this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
// //
// btnClearLog
//
this.btnClearLog.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnClearLog.Location = new System.Drawing.Point(364, 500);
this.btnClearLog.Name = "btnClearLog";
this.btnClearLog.Size = new System.Drawing.Size(151, 38);
this.btnClearLog.TabIndex = 224;
this.btnClearLog.Text = "清理日志";
this.btnClearLog.UseVisualStyleBackColor = true;
this.btnClearLog.Click += new System.EventHandler(this.btnClearLog_Click);
//
// txtInoutP4 // txtInoutP4
// //
this.txtInoutP4.AcceptsReturn = true; this.txtInoutP4.AcceptsReturn = true;
...@@ -1724,7 +1735,7 @@ ...@@ -1724,7 +1735,7 @@
this.btnUpDownP1.RightToLeft = System.Windows.Forms.RightToLeft.No; this.btnUpDownP1.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnUpDownP1.Size = new System.Drawing.Size(174, 32); this.btnUpDownP1.Size = new System.Drawing.Size(174, 32);
this.btnUpDownP1.TabIndex = 199; this.btnUpDownP1.TabIndex = 199;
this.btnUpDownP1.Text = "升降轴料点P1:"; this.btnUpDownP1.Text = "升降轴吸盘下方取料点P1:";
this.btnUpDownP1.UseVisualStyleBackColor = true; this.btnUpDownP1.UseVisualStyleBackColor = true;
this.btnUpDownP1.Click += new System.EventHandler(this.btnUpDownP1_Click); this.btnUpDownP1.Click += new System.EventHandler(this.btnUpDownP1_Click);
// //
...@@ -1856,17 +1867,6 @@ ...@@ -1856,17 +1867,6 @@
this.btnUpDownP4.UseVisualStyleBackColor = true; this.btnUpDownP4.UseVisualStyleBackColor = true;
this.btnUpDownP4.Click += new System.EventHandler(this.btnUpDownP4_Click); this.btnUpDownP4.Click += new System.EventHandler(this.btnUpDownP4_Click);
// //
// btnClearLog
//
this.btnClearLog.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnClearLog.Location = new System.Drawing.Point(364, 500);
this.btnClearLog.Name = "btnClearLog";
this.btnClearLog.Size = new System.Drawing.Size(151, 38);
this.btnClearLog.TabIndex = 224;
this.btnClearLog.Text = "清理日志";
this.btnClearLog.UseVisualStyleBackColor = true;
this.btnClearLog.Click += new System.EventHandler(this.btnClearLog_Click);
//
// lblTemp // lblTemp
// //
this.lblTemp.AutoSize = true; this.lblTemp.AutoSize = true;
......
...@@ -580,16 +580,16 @@ ...@@ -580,16 +580,16 @@
<value>Close</value> <value>Close</value>
</data> </data>
<data name="FrmAxisDebug_btnInOutMovej_Text" xml:space="preserve"> <data name="FrmAxisDebug_btnInOutMovej_Text" xml:space="preserve">
<value>In-out axis+forward</value> <value>In-out axis-backward</value>
</data> </data>
<data name="FrmAxisDebug_btnUpDownMovej_Text" xml:space="preserve"> <data name="FrmAxisDebug_btnUpDownMovej_Text" xml:space="preserve">
<value>l-axis+descent</value> <value>l-axis-descent</value>
</data> </data>
<data name="FrmAxisDebug_btnMiddleMovej_Text" xml:space="preserve"> <data name="FrmAxisDebug_btnMiddleMovej_Text" xml:space="preserve">
<value>Rotation axis+clockwise</value> <value>Rotation axis+clockwise</value>
</data> </data>
<data name="FrmAxisDebug_btnInOutMove_Text" xml:space="preserve"> <data name="FrmAxisDebug_btnInOutMove_Text" xml:space="preserve">
<value>In-out axis+backward</value> <value>In-out axis+forward</value>
</data> </data>
<data name="FrmAxisDebug_btnUpDownMove_Text" xml:space="preserve"> <data name="FrmAxisDebug_btnUpDownMove_Text" xml:space="preserve">
<value>l-axis+ascent</value> <value>l-axis+ascent</value>
...@@ -631,10 +631,10 @@ ...@@ -631,10 +631,10 @@
<value>Exit</value> <value>Exit</value>
</data> </data>
<data name="FrmStoreBox_toolStripMenuItem2_Text" xml:space="preserve"> <data name="FrmStoreBox_toolStripMenuItem2_Text" xml:space="preserve">
<value>Access controller open</value> <value>Open light</value>
</data> </data>
<data name="FrmStoreBox_toolStripMenuItem3_Text" xml:space="preserve"> <data name="FrmStoreBox_toolStripMenuItem3_Text" xml:space="preserve">
<value>Access controller block</value> <value>Close light</value>
</data> </data>
<data name="FrmStoreBox_停止ToolStripMenuItem_Text" xml:space="preserve"> <data name="FrmStoreBox_停止ToolStripMenuItem_Text" xml:space="preserve">
<value>Stop</value> <value>Stop</value>
......
...@@ -460,7 +460,7 @@ ...@@ -460,7 +460,7 @@
<value>升降轴取料缓冲点P7:</value> <value>升降轴取料缓冲点P7:</value>
</data> </data>
<data name="FrmStoreBox_btnUpDownP1_Text" xml:space="preserve"> <data name="FrmStoreBox_btnUpDownP1_Text" xml:space="preserve">
<value>升降轴取料点P1:</value> <value>升降轴吸盘下方取料点P1:</value>
</data> </data>
<data name="FrmStoreBox_btnComP3_Text" xml:space="preserve"> <data name="FrmStoreBox_btnComP3_Text" xml:space="preserve">
<value>压紧轴压紧前点P3:</value> <value>压紧轴压紧前点P3:</value>
...@@ -580,7 +580,7 @@ ...@@ -580,7 +580,7 @@
<value>关闭</value> <value>关闭</value>
</data> </data>
<data name="FrmAxisDebug_btnInOutMovej_Text" xml:space="preserve"> <data name="FrmAxisDebug_btnInOutMovej_Text" xml:space="preserve">
<value>进出轴-(前进)</value> <value>进出轴-(后退)</value>
</data> </data>
<data name="FrmAxisDebug_btnUpDownMovej_Text" xml:space="preserve"> <data name="FrmAxisDebug_btnUpDownMovej_Text" xml:space="preserve">
<value>升降轴-(下降)</value> <value>升降轴-(下降)</value>
...@@ -589,7 +589,7 @@ ...@@ -589,7 +589,7 @@
<value>旋转轴-(顺时针)</value> <value>旋转轴-(顺时针)</value>
</data> </data>
<data name="FrmAxisDebug_btnInOutMove_Text" xml:space="preserve"> <data name="FrmAxisDebug_btnInOutMove_Text" xml:space="preserve">
<value>进出轴+(后退)</value> <value>进出轴+(前进)</value>
</data> </data>
<data name="FrmAxisDebug_btnUpDownMove_Text" xml:space="preserve"> <data name="FrmAxisDebug_btnUpDownMove_Text" xml:space="preserve">
<value>升降轴+(上升)</value> <value>升降轴+(上升)</value>
...@@ -628,10 +628,10 @@ ...@@ -628,10 +628,10 @@
<value>IO状态调试</value> <value>IO状态调试</value>
</data> </data>
<data name="FrmStoreBox_toolStripMenuItem2_Text" xml:space="preserve"> <data name="FrmStoreBox_toolStripMenuItem2_Text" xml:space="preserve">
<value>门禁功能打开</value> <value>打开照明</value>
</data> </data>
<data name="FrmStoreBox_toolStripMenuItem3_Text" xml:space="preserve"> <data name="FrmStoreBox_toolStripMenuItem3_Text" xml:space="preserve">
<value>门禁功能屏蔽</value> <value>关闭照明</value>
</data> </data>
<data name="FrmStoreBox_停止ToolStripMenuItem_Text" xml:space="preserve"> <data name="FrmStoreBox_停止ToolStripMenuItem_Text" xml:space="preserve">
<value>停止</value> <value>停止</value>
......
...@@ -232,5 +232,22 @@ namespace OnlineStore.Common ...@@ -232,5 +232,22 @@ namespace OnlineStore.Common
public static string enable = "enable"; public static string enable = "enable";
public static string disable = "disable"; public static string disable = "disable";
/// <summary>
/// 升降轴
/// </summary>
public static string updownAxis = "device.updownAxis";
/// <summary>
/// 旋转轴
/// </summary>
public static string middleAxis = "device.middleAxis";
/// <summary>
/// 进出轴
/// </summary>
public static string inoutAxis = "device.inoutAxis";
/// <summary>
/// 批量上下料轴
/// </summary>
public static string batchAxis = "device.batchAxis";
} }
} }
...@@ -308,7 +308,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -308,7 +308,7 @@ namespace OnlineStore.DeviceLibrary
int value = 2000; int value = 2000;
if ( StoreManager.Config.Batch_Axis.IsSameAxis(portName,slvAddr)) if ( StoreManager.Config.Batch_Axis.IsSameAxis(portName,slvAddr))
{ {
value = 8000; value = 40000;
} }
LogUtil.info("轴【" + portName +"_"+slvAddr +"】原点返回时发现原点已亮且回过原点,需要先相对走" + value); LogUtil.info("轴【" + portName +"_"+slvAddr +"】原点返回时发现原点已亮且回过原点,需要先相对走" + value);
RelMove(portName, slvAddr, value); RelMove(portName, slvAddr, value);
......
...@@ -50,9 +50,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -50,9 +50,11 @@ namespace OnlineStore.DeviceLibrary
public static void StopCheck() public static void StopCheck()
{ {
if(timer==null) if (timer==null)
{ return; } { return; }
timer.Stop(); timer.Stop();
TragetChangeCount = 0;
SignalChangeCount = 0;
} }
private static bool IsInProcess = false; private static bool IsInProcess = false;
protected static void Timer_Elapsed(object sender, ElapsedEventArgs e) protected static void Timer_Elapsed(object sender, ElapsedEventArgs e)
......
...@@ -1495,6 +1495,50 @@ namespace OnlineStore.DeviceLibrary ...@@ -1495,6 +1495,50 @@ namespace OnlineStore.DeviceLibrary
boxStatus.humidity = param.Humidity.ToString(); boxStatus.humidity = param.Humidity.ToString();
boxStatus.temperature = param.Temperate.ToString(); boxStatus.temperature = param.Temperate.ToString();
} }
//增加伺服的运动状态,1=运动中,0=停止
boxStatus.data.Add(ParamDefine.updownAxis, 0.ToString());
boxStatus.data.Add(ParamDefine.inoutAxis, 0.ToString());
boxStatus.data.Add(ParamDefine.middleAxis, 0.ToString());
boxStatus.data.Add(ParamDefine.batchAxis, 0.ToString());
try
{
List<WaitResultInfo> waitresult = new List<WaitResultInfo>();
if (StoreMove.IsInWait && (storeRunStatus.Equals(StoreRunStatus.HomeMoving) || storeRunStatus.Equals(StoreRunStatus.Busy) || storeRunStatus.Equals(StoreRunStatus.Reset)))
{
waitresult.AddRange(StoreMove.WaitList);
}
if (AutomaticBaiting.StoreMove.IsInWait && (AutomaticBaiting.AutoBaitingStatus.Equals(StoreRunStatus.HomeMoving) || AutomaticBaiting.AutoBaitingStatus.Equals(StoreRunStatus.Busy) || AutomaticBaiting.AutoBaitingStatus.Equals(StoreRunStatus.Reset)))
{
waitresult.AddRange(AutomaticBaiting.StoreMove.WaitList);
}
foreach (WaitResultInfo wait in waitresult)
{
if (wait.WaitType == 1 && (wait.IsEnd.Equals(false)) && wait.AxisInfo != null)
{
if (wait.AxisInfo.IsSameAxis(Config.InOut_Axis))
{
boxStatus.data[ParamDefine.inoutAxis] = 1.ToString();
}
else if (wait.AxisInfo.IsSameAxis(Config.UpDown_Axis))
{
boxStatus.data[ParamDefine.updownAxis] = 1.ToString();
}
else if (wait.AxisInfo.IsSameAxis(Config.Middle_Axis))
{
boxStatus.data[ParamDefine.middleAxis] = 1.ToString();
}
else if (wait.AxisInfo.IsSameAxis(Config.Batch_Axis))
{
boxStatus.data[ParamDefine.batchAxis] = 1.ToString();
}
}
}
}
catch (Exception ex)
{
LogUtil.error("获取轴状态出错:" + ex.ToString());
}
lineOperation.boxStatus.Add(StoreID, boxStatus); lineOperation.boxStatus.Add(StoreID, boxStatus);
if (!alarmType.Equals(StoreAlarmType.None)) if (!alarmType.Equals(StoreAlarmType.None))
......
...@@ -271,10 +271,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -271,10 +271,16 @@ namespace OnlineStore.DeviceLibrary
{ {
codeList = CodeManager.CameraScan(); codeList = CodeManager.CameraScan();
} }
//需要过滤重复的二维码
List<string> hasList = new List<string>();
foreach (string str in codeList) foreach (string str in codeList)
{ {
message = message + spiltStr + str;
//message = message + "=1+0x0-" + LastSize + "x" + LastHeight + " =" + str + spiltStr; //message = message + "=1+0x0-" + LastSize + "x" + LastHeight + " =" + str + spiltStr;
if (!hasList.Contains(str))
{
hasList.Add(str);
message = message + spiltStr + str;
}
} }
LastCode = message; LastCode = message;
if (LastCode.Equals("")&&StoreManager.Store.IsDebug) if (LastCode.Equals("")&&StoreManager.Store.IsDebug)
......
...@@ -198,7 +198,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -198,7 +198,7 @@ namespace OnlineStore.LoadCSVLibrary
} }
index++; index++;
} }
return true; return false ;
} }
private static string PostionToString(StorePostionBase position, Dictionary<string, int> titleIndex, Dictionary<string, string> proTitleMap) private static string PostionToString(StorePostionBase position, Dictionary<string, int> titleIndex, Dictionary<string, string> proTitleMap)
......
...@@ -136,6 +136,14 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -136,6 +136,14 @@ namespace OnlineStore.LoadCSVLibrary
} }
return false; return false;
} }
public bool IsSameAxis(ConfigMoveAxis axis)
{
if (DeviceName.Equals(axis.DeviceName) && axis.GetAxisValue().Equals(GetAxisValue()))
{
return true;
}
return false;
}
public string GetNameStr() public string GetNameStr()
{ {
return DeviceName + "_" + GetAxisValue(); return DeviceName + "_" + GetAxisValue();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!