Commit fc21f2f3 LN

料仓ID改为配置

1 个父辈 2bb5d4ad
......@@ -20,7 +20,8 @@
<add key="Store_Position_Config" value="\StoreConfig\AC\linePositions.csv"/>
<add key="Store_ConfigPath" value="\StoreConfig\AC\StoreConfig.csv"/>
<add key="Store_Type" value="RC_AC_SA"/>
<add key="Store_CID" value="rc29ac-1"/>
<add key="Store_CID" value="rc1246ac-1"/>
<add key ="Store_ID" value ="1"/>
<!--end one store config-->
<!--摄像机名称列表配置,用#分割-->
......@@ -41,8 +42,8 @@
<add key="HumitureControllerType" value="0"/>
<add key="UseAIOBOX" value="1"/>
<!--流水线地址和端口配置-->
<add key ="LineServerIp" value ="192.168.200.69"/>
<add key ="LineServerPort" value ="1234"/>
<add key ="LineServerIp" value ="192.168.1.110"/>
<add key ="LineServerPort" value ="5246"/>
</appSettings>
<log4net>
......
......@@ -219,6 +219,9 @@
this.button4 = new System.Windows.Forms.Button();
this.btnClearL = new System.Windows.Forms.Button();
this.btnLogDebug = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.button5 = new System.Windows.Forms.Button();
this.button6 = new System.Windows.Forms.Button();
this.groupAxis.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupInout.SuspendLayout();
......@@ -789,7 +792,7 @@
this.richTextBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.richTextBox1.Location = new System.Drawing.Point(7, 9);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(545, 481);
this.richTextBox1.Size = new System.Drawing.Size(545, 536);
this.richTextBox1.TabIndex = 256;
this.richTextBox1.Text = "";
//
......@@ -1684,7 +1687,7 @@
//
this.btnClearLog.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
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(313, 515);
this.btnClearLog.Location = new System.Drawing.Point(310, 560);
this.btnClearLog.Name = "btnClearLog";
this.btnClearLog.Size = new System.Drawing.Size(105, 38);
this.btnClearLog.TabIndex = 224;
......@@ -2012,7 +2015,7 @@
this.tabControl1.Location = new System.Drawing.Point(509, 89);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(568, 703);
this.tabControl1.Size = new System.Drawing.Size(568, 649);
this.tabControl1.TabIndex = 272;
//
// tabPage3
......@@ -2023,7 +2026,7 @@
this.tabPage3.Controls.Add(this.richTextBox1);
this.tabPage3.Location = new System.Drawing.Point(4, 29);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(560, 670);
this.tabPage3.Size = new System.Drawing.Size(560, 616);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = " 操作日志 ";
this.tabPage3.UseVisualStyleBackColor = true;
......@@ -2032,7 +2035,7 @@
//
this.btnCloseDoor.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnCloseDoor.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCloseDoor.Location = new System.Drawing.Point(149, 515);
this.btnCloseDoor.Location = new System.Drawing.Point(146, 560);
this.btnCloseDoor.Name = "btnCloseDoor";
this.btnCloseDoor.Size = new System.Drawing.Size(105, 38);
this.btnCloseDoor.TabIndex = 258;
......@@ -2044,7 +2047,7 @@
//
this.btnOpenDoor.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnOpenDoor.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOpenDoor.Location = new System.Drawing.Point(32, 515);
this.btnOpenDoor.Location = new System.Drawing.Point(29, 560);
this.btnOpenDoor.Name = "btnOpenDoor";
this.btnOpenDoor.Size = new System.Drawing.Size(105, 38);
this.btnOpenDoor.TabIndex = 257;
......@@ -2059,18 +2062,21 @@
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(560, 670);
this.tabPage1.Size = new System.Drawing.Size(560, 616);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = " 伺服调试 ";
this.tabPage1.UseVisualStyleBackColor = true;
//
// tabPage2
//
this.tabPage2.Controls.Add(this.button6);
this.tabPage2.Controls.Add(this.button5);
this.tabPage2.Controls.Add(this.button3);
this.tabPage2.Controls.Add(this.groupBox7);
this.tabPage2.Location = new System.Drawing.Point(4, 29);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(560, 670);
this.tabPage2.Size = new System.Drawing.Size(560, 616);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = " 温湿度 ";
this.tabPage2.UseVisualStyleBackColor = true;
......@@ -2531,6 +2537,36 @@
this.btnLogDebug.UseVisualStyleBackColor = true;
this.btnLogDebug.Click += new System.EventHandler(this.开启DEBUGToolStripMenuItem_Click);
//
// button3
//
this.button3.Location = new System.Drawing.Point(100, 207);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(100, 33);
this.button3.TabIndex = 273;
this.button3.Text = "连接";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// button5
//
this.button5.Location = new System.Drawing.Point(229, 208);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(100, 33);
this.button5.TabIndex = 274;
this.button5.Text = "停止";
this.button5.UseVisualStyleBackColor = true;
this.button5.Click += new System.EventHandler(this.button5_Click);
//
// button6
//
this.button6.Location = new System.Drawing.Point(353, 208);
this.button6.Name = "button6";
this.button6.Size = new System.Drawing.Size(100, 33);
this.button6.TabIndex = 275;
this.button6.Text = "发送";
this.button6.UseVisualStyleBackColor = true;
this.button6.Click += new System.EventHandler(this.button6_Click);
//
// FrmStoreBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
......@@ -2777,6 +2813,9 @@
private System.Windows.Forms.Label label26;
private System.Windows.Forms.Button btnSelHistory;
private System.Windows.Forms.GroupBox groupHistory;
private System.Windows.Forms.Button button6;
private System.Windows.Forms.Button button5;
private System.Windows.Forms.Button button3;
}
}
......@@ -1399,5 +1399,20 @@ namespace OnlineStore.ACSingleStore
//IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.HIGH);
StoreManager.Store.CloseDoor(false);
}
private void button3_Click(object sender, EventArgs e)
{
LineConnect.StartConnect();
}
private void button5_Click(object sender, EventArgs e)
{
LineConnect.StopConnect();
}
private void button6_Click(object sender, EventArgs e)
{
LineConnect.SendHeart(StoreManager.Config.Id, StoreManager.Config.CID, (int)StoreStatus.StoreOnline, (int)StoreRunStatus.Runing, "");
}
}
}
......@@ -88,6 +88,7 @@
第四台是13寸料盘,有舱门
修改IO
去掉测高,测高在流水线处处理
去掉测高,测高在流水线处处理.
料仓ID改为配置,方便与流水线通信。
\ No newline at end of file
......@@ -27,6 +27,7 @@ namespace OnlineStore.Common
public static string http_server = "http.server";
public static string Store_CID = "Store_CID";
public static string Store_ID = "Store_ID";
/// <summary>
/// 料仓数量
......
......@@ -124,28 +124,51 @@ namespace OnlineStore.Common
return false;
}
private bool isInProcess = false;
private void ReConnectTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
try
{
if (isInProcess)
{
return;
}
isInProcess = true;
if (m_clientSocket != null)
{
if (!m_clientSocket.Connected)
if (m_clientSocket.Connected)
{
isInProcess = false;
return;
}
}
try
{
if (m_clientSocket != null)
{
IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Parse(ServerIp), ServerPort);
m_clientSocket.Connect(remoteEndPoint);
if (m_clientSocket.Connected)
{
m_clientSocket.BeginReceive(m_receiveBuffer, 0, m_receiveBuffer.Length, 0, new AsyncCallback(ReceiveCallBack), null);
LogUtil.info(LOGGER, "Connect to " + ServerIp + ":" + ServerPort + " success!");
}
m_clientSocket.Close();
LogUtil.info(LOGGER, "Socket closed!");
}
}catch(Exception ex)
{
LogUtil.error("m_clientSocket.Close Error"+ex.ToString());
}
m_clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Parse(ServerIp), ServerPort);
m_clientSocket.Connect(remoteEndPoint);
if (m_clientSocket.Connected)
{
m_clientSocket.BeginReceive(m_receiveBuffer, 0, m_receiveBuffer.Length, 0, new AsyncCallback(ReceiveCallBack), null);
LogUtil.info(LOGGER, "Connect to " + ServerIp + ":" + ServerPort + " success!");
}
isInProcess = false;
}
catch (Exception ex)
{
isInProcess = false;
LogUtil.error("重连处理出错:" + ex.ToString());
}
}
......
......@@ -654,6 +654,8 @@ namespace OnlineStore.DeviceLibrary
OutStoreLog("出库:SO_13 升降轴返回,轴2至P1(待机点) ,关闭舱门");
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
CloseDoor();
//发送消息给流水线
LineConnect.OutStoreEnd(Config.Id, Config.CID, (int)storeStatus, (int)storeRunStatus, StoreMove.MoveParam.PositionNum, StoreMove.MoveParam.PlateH,StoreMove.MoveParam.PlateW);
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_13_GoBack)
{
......
......@@ -90,8 +90,8 @@ namespace OnlineStore.DeviceLibrary
string appPath = Application.StartupPath;
string CID = ConfigAppSettings.GetValue(Setting_Init.Store_CID);
string linefilePath = appPath + ConfigAppSettings.GetValue(Setting_Init.Store_ConfigPath);
StoreConfig storeConfig = CSVConfigReader.LoadConfig(1, CID, StoreType.RC_AC_SA, linefilePath);
int storeID = ConfigAppSettings.GetIntValue(Setting_Init.Store_ID);
StoreConfig storeConfig = CSVConfigReader.LoadConfig(storeID, CID, StoreType.RC_AC_SA, linefilePath);
string positionConfigFile = appPath + ConfigAppSettings.GetValue(Setting_Init.Store_Position_Config);
if (File.Exists(positionConfigFile))
......
......@@ -41,8 +41,8 @@ namespace OnlineStore.DeviceLibrary
{
try
{
string heartMsg = cmd_heart + cmd_spilt + id + cmd_spilt + cid + cmd_spilt + nextSeq() + cmd_spilt + ss + cmd_spilt + runs + cmd_spilt + posid + cmd_spilt;
client.send(heartMsg + "\r\n");
string heartMsg = cmd_heart + cmd_spilt + id + cmd_spilt + cid + cmd_spilt + nextSeq() + cmd_spilt + ss + cmd_spilt + runs + cmd_spilt + posid + cmd_spilt+"\r";
client.send(heartMsg);
}catch(Exception ex)
{
LogUtil.error("SendHeart 出错:"+ex.ToString());
......@@ -53,8 +53,8 @@ namespace OnlineStore.DeviceLibrary
try
{
string heartMsg = cmd_outend + cmd_spilt + id + cmd_spilt + cid + cmd_spilt + nextSeq() + cmd_spilt + ss + cmd_spilt + runs + cmd_spilt + posid + cmd_spilt;
string msg = heartMsg + posid + cmd_spilt + plateH + cmd_spilt + plateW + cmd_spilt;
client.send(msg + "\r\n");
string msg = heartMsg + posid + cmd_spilt + plateH + cmd_spilt + plateW + cmd_spilt + "\r";
client.send(msg );
}
catch (Exception ex)
{
......
......@@ -41,7 +41,7 @@ namespace OnlineStore.DeviceLibrary
WareNumber = wareNo;
PositionNum = posId;
MoveP = null;
this.PlagtW = plateW;
this.PlateW = plateW;
this.PlateH = plateH;
IsSolderPaste = false;
}
......@@ -51,7 +51,7 @@ namespace OnlineStore.DeviceLibrary
WareNumber = wareNo;
PositionNum = posId;
MoveP = null;
this.PlagtW = plateW;
this.PlateW = plateW;
this.PlateH = plateH;
this.TrayCode = trayCode;
IsSolderPaste = false;
......@@ -113,7 +113,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 料盘宽度
/// </summary>
public string PlagtW { get; set; }
public string PlateW { get; set; }
/// <summary>
/// 是否是放入锡膏(在线料仓才需要此字段)
/// </summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!