Commit 0db1f480 LN

中英文修改,增加贴图,贴图英文未完善

1 个父辈 1100c85d
正在显示 40 个修改的文件 包含 319 行增加76 行删除
此文件类型无法预览
...@@ -115,6 +115,7 @@ ...@@ -115,6 +115,7 @@
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FrmStoreBox.resx"> <EmbeddedResource Include="FrmStoreBox.resx">
<DependentUpon>FrmStoreBox.cs</DependentUpon> <DependentUpon>FrmStoreBox.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="positionTool\FrmPositionTool.resx"> <EmbeddedResource Include="positionTool\FrmPositionTool.resx">
<DependentUpon>FrmPositionTool.cs</DependentUpon> <DependentUpon>FrmPositionTool.cs</DependentUpon>
...@@ -177,6 +178,42 @@ ...@@ -177,6 +178,42 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="box.ico" /> <Content Include="box.ico" />
<Content Include="image\cn\axis.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="image\cn\axis2.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="image\cn\axis4.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="image\cn\pPoint.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="image\jp\axis.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="image\jp\axis2.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="image\jp\axis4.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="image\jp\pPoint.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="image\us\axis.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="image\us\axis2.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="image\us\axis4.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="image\us\pPoint.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="记录.txt" /> <Content Include="记录.txt" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
...@@ -59,6 +59,19 @@ namespace OnlineStore.AutoInOutStore ...@@ -59,6 +59,19 @@ namespace OnlineStore.AutoInOutStore
UpdateUpdownPosition(); UpdateUpdownPosition();
UpdateAutoPosition(); UpdateAutoPosition();
UpdateCompPosition(); UpdateCompPosition();
if (CurrLanguage.Equals(ResourceCulture.English))
{
this.picAxis.Image = ResourceCulture.M_US_axis;
}
else if (CurrLanguage.Equals(ResourceCulture.Japanese))
{
this.picAxis.Image = ResourceCulture.M_JP_axis;
}
else
{
this.picAxis.Image = ResourceCulture.M_axis;
}
// txtComPosition.Text = ShuoKeControls.GetABSPosition(compress_Slv).ToString(); // txtComPosition.Text = ShuoKeControls.GetABSPosition(compress_Slv).ToString();
} }
/// <summary> /// <summary>
......
...@@ -50,7 +50,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -50,7 +50,7 @@ namespace OnlineStore.AutoInOutStore
foreach (ConfigIO ioValue in boxBean.Config.DILIst.Values) foreach (ConfigIO ioValue in boxBean.Config.DILIst.Values)
{ {
this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 26)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 26));
IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + ResourceCulture.GetString(ioValue.ElectricalDefinition, ioValue.Explain), ioValue.ProName,240); IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + ResourceCulture.GetString(ioValue.ElectricalDefinition, ioValue.Explain), ioValue.ProName,355);
this.tableLayoutPanel1.Controls.Add(control, 0, roleindex); this.tableLayoutPanel1.Controls.Add(control, 0, roleindex);
roleindex++; roleindex++;
DIControlList.Add(ioValue.ProName, control); DIControlList.Add(ioValue.ProName, control);
...@@ -62,7 +62,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -62,7 +62,7 @@ namespace OnlineStore.AutoInOutStore
foreach (ConfigIO ioValue in boxBean.Config.DOList.Values) foreach (ConfigIO ioValue in boxBean.Config.DOList.Values)
{ {
this.tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Absolute, 28)); this.tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Absolute, 28));
IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + ResourceCulture.GetString(ioValue.ElectricalDefinition, ioValue.Explain), ioValue.ProName, 240); IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + ResourceCulture.GetString(ioValue.ElectricalDefinition, ioValue.Explain), ioValue.ProName, 355);
this.tableLayoutPanel2.Controls.Add(control, 0, roleindex); this.tableLayoutPanel2.Controls.Add(control, 0, roleindex);
roleindex++; roleindex++;
DOControlList.Add(ioValue.ProName, control); DOControlList.Add(ioValue.ProName, control);
......
...@@ -36,13 +36,13 @@ ...@@ -36,13 +36,13 @@
// //
// label1 // label1
// //
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label1.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(153, 61); this.label1.Location = new System.Drawing.Point(12, 42);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(126, 25); this.label1.Size = new System.Drawing.Size(413, 52);
this.label1.TabIndex = 0; this.label1.TabIndex = 0;
this.label1.Text = "请输入密码:"; this.label1.Text = "请输入密码:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// btnNext // btnNext
// //
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
// txtPwd // txtPwd
// //
this.txtPwd.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.txtPwd.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtPwd.Location = new System.Drawing.Point(112, 97); this.txtPwd.Location = new System.Drawing.Point(112, 100);
this.txtPwd.Name = "txtPwd"; this.txtPwd.Name = "txtPwd";
this.txtPwd.PasswordChar = '*'; this.txtPwd.PasswordChar = '*';
this.txtPwd.Size = new System.Drawing.Size(215, 33); this.txtPwd.Size = new System.Drawing.Size(215, 33);
......
...@@ -93,7 +93,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -93,7 +93,7 @@ namespace OnlineStore.AutoInOutStore
} }
#endregion #endregion
private string WaitStart = ResourceCulture.GetString(ResourceCulture.WaitStart, "等待启动"); private string WaitStart = ResourceCulture.GetString(ResourceCulture.WaitStart, "等待启动");
private string dooropen = ResourceCulture.GetString(ResourceCulture.DoorHasOpen, " 前门未关"); //private string dooropen = ResourceCulture.GetString(ResourceCulture.DoorHasOpen, " 前门未关");
private string HasWare = ResourceCulture.GetString(ResourceCulture.HasWare, " 叉子料盘检测有料,请检查"); private string HasWare = ResourceCulture.GetString(ResourceCulture.HasWare, " 叉子料盘检测有料,请检查");
private string StartAuto = ResourceCulture.GetString(ResourceCulture.StartAuto,"开始自动出入库"); private string StartAuto = ResourceCulture.GetString(ResourceCulture.StartAuto,"开始自动出入库");
private string StopAuto = ResourceCulture.GetString(ResourceCulture.StopAuto, "停止自动出入库"); private string StopAuto = ResourceCulture.GetString(ResourceCulture.StopAuto, "停止自动出入库");
...@@ -115,9 +115,9 @@ namespace OnlineStore.AutoInOutStore ...@@ -115,9 +115,9 @@ namespace OnlineStore.AutoInOutStore
warn = ResourceCulture.GetString(ResourceCulture.WarnMsg, "警告"); warn = ResourceCulture.GetString(ResourceCulture.WarnMsg, "警告");
WaitStart = ResourceCulture.GetString(ResourceCulture.WaitStart, "等待启动"); WaitStart = ResourceCulture.GetString(ResourceCulture.WaitStart, "等待启动");
dooropen = ResourceCulture.GetString(ResourceCulture.DoorHasOpen, " 前门未关"); //dooropen = ResourceCulture.GetString(ResourceCulture.DoorHasOpen, " 前门未关");
HasWare = ResourceCulture.GetString(ResourceCulture.HasWare, " 叉子料盘检测有料,请检查"); HasWare = ResourceCulture.GetString(ResourceCulture.HasWare, " 叉子料盘检测有料,请检查");
StartAuto = ResourceCulture.GetString(ResourceCulture.StartAuto,StartAuto); StartAuto = ResourceCulture.GetString(ResourceCulture.StartAuto, StartAuto);
StopAuto = ResourceCulture.GetString(ResourceCulture.StopAuto, StopAuto); StopAuto = ResourceCulture.GetString(ResourceCulture.StopAuto, StopAuto);
AutoOut = ResourceCulture.GetString(ResourceCulture.AutoOut, "自动出库:"); AutoOut = ResourceCulture.GetString(ResourceCulture.AutoOut, "自动出库:");
AutoIn = ResourceCulture.GetString(ResourceCulture.AutoIn, "自动入库:"); AutoIn = ResourceCulture.GetString(ResourceCulture.AutoIn, "自动入库:");
...@@ -150,13 +150,13 @@ namespace OnlineStore.AutoInOutStore ...@@ -150,13 +150,13 @@ namespace OnlineStore.AutoInOutStore
} }
if (tabControl1.TabPages.Contains(tabPage4)) if (tabControl1.TabPages.Contains(tabPage4))
{ {
打开日志ToolStripMenuItem.Text = closeLog ; 打开日志ToolStripMenuItem.Text = closeLog;
} }
else else
{ {
打开日志ToolStripMenuItem.Text = openLog; 打开日志ToolStripMenuItem.Text = openLog;
} }
tabPage4.Text= ResourceCulture.GetString(ResourceCulture.GetTextIdStr(className, tabPage4.Name), tabPage4.Text); tabPage4.Text = ResourceCulture.GetString(ResourceCulture.GetTextIdStr(className, tabPage4.Name), tabPage4.Text);
显示ToolStripMenuItem.Text = ResourceCulture.GetString(ResourceCulture.GetTextIdStr(className, 显示ToolStripMenuItem.Name), 显示ToolStripMenuItem.Text); 显示ToolStripMenuItem.Text = ResourceCulture.GetString(ResourceCulture.GetTextIdStr(className, 显示ToolStripMenuItem.Name), 显示ToolStripMenuItem.Text);
toolStripMenuItem1.Text = ResourceCulture.GetString(ResourceCulture.GetTextIdStr(className, toolStripMenuItem1.Name), toolStripMenuItem1.Text); toolStripMenuItem1.Text = ResourceCulture.GetString(ResourceCulture.GetTextIdStr(className, toolStripMenuItem1.Name), toolStripMenuItem1.Text);
notifyIcon1.Text = this.Text; notifyIcon1.Text = this.Text;
...@@ -170,6 +170,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -170,6 +170,7 @@ namespace OnlineStore.AutoInOutStore
LogUtil.logBox = null; LogUtil.logBox = null;
this.richTextBox1.Clear(); this.richTextBox1.Clear();
} }
SetImage();
} }
private void start_button_Click(object sender, EventArgs e) private void start_button_Click(object sender, EventArgs e)
...@@ -259,6 +260,28 @@ namespace OnlineStore.AutoInOutStore ...@@ -259,6 +260,28 @@ namespace OnlineStore.AutoInOutStore
tabControl1.TabPages.Remove(tabPage4); tabControl1.TabPages.Remove(tabPage4);
} }
打开日志ToolStripMenuItem.Text = openLog; 打开日志ToolStripMenuItem.Text = openLog;
SetImage();
}
private void SetImage()
{
this.picAxis4.Image = null;
this.picPPoint.Image = null;
if (CurrLanguage.Equals(ResourceCulture.English))
{
this.picAxis4.Image = ResourceCulture.M_US_axis4;
this.picPPoint.Image = ResourceCulture.M_US_pPoint;
}
else if (CurrLanguage.Equals(ResourceCulture.Japanese))
{
this.picAxis4.Image = ResourceCulture.M_JP_axis4;
this.picPPoint.Image = ResourceCulture.M_JP_pPoint;
}
else
{
this.picAxis4.Image = ResourceCulture.M_axis4;
this.picPPoint.Image = ResourceCulture.M_pPoint;
}
} }
private void Store_ResetEvent() private void Store_ResetEvent()
...@@ -1763,5 +1786,31 @@ namespace OnlineStore.AutoInOutStore ...@@ -1763,5 +1786,31 @@ namespace OnlineStore.AutoInOutStore
打开日志ToolStripMenuItem.Text = openLog; 打开日志ToolStripMenuItem.Text = openLog;
} }
} }
private void chbDebug_CheckedChanged(object sender, EventArgs e)
{
if (!LoadOk)
{
return;
}
if (chbDebug.Checked.Equals(store.IsDebug))
{
return;
}
if (chbDebug.Checked)
{
store.IsDebug = true;
LogUtil.info("勾选:调试模式");
store.Config.IsInDebug = 1;
StoreManager.UpdateBoxConfig(store.Config);
}
else
{
store.IsDebug = false;
LogUtil.info("去掉:调试模式");
store.Config.IsInDebug = 0;
StoreManager.UpdateBoxConfig(store.Config);
}
}
} }
} }
...@@ -45,10 +45,10 @@ namespace OnlineStore.AutoInOutStore ...@@ -45,10 +45,10 @@ namespace OnlineStore.AutoInOutStore
private void Form1_Load(object sender, EventArgs e) private void Form1_Load(object sender, EventArgs e)
{ {
ACServerManager.IsShowMsg = false; ACServerManager.IsShowMsg = false;
if (ResourceCulture.CurrLanguage.Equals(ResourceCulture.China)) //if (ResourceCulture.CurrLanguage.Equals(ResourceCulture.China))
{ //{
LogUtil.logBox = this.richTextBox1; // LogUtil.logBox = this.richTextBox1;
} //}
//ACServerManager.richeBox = this.richTextBox1; //ACServerManager.richeBox = this.richTextBox1;
CheckForIllegalCrossThreadCalls = false; CheckForIllegalCrossThreadCalls = false;
...@@ -90,7 +90,21 @@ namespace OnlineStore.AutoInOutStore ...@@ -90,7 +90,21 @@ namespace OnlineStore.AutoInOutStore
bool isOn = ACServerManager.ServerOnStatus(PortName, SlvAddr); bool isOn = ACServerManager.ServerOnStatus(PortName, SlvAddr);
formStatus(isOn); formStatus(isOn);
timer1.Start(); timer1.Start();
ioStatusControl1.IOName =ResourceCulture.GetString( "检测信号"); //ResourceCulture.GetString(ioValue.ElectricalDefinition, ioValue.Explain)
if (CurrLanguage.Equals(ResourceCulture.English))
{
picAxis2.Image = ResourceCulture.M_US_axis2;
}
else if (CurrLanguage.Equals(ResourceCulture.Japanese))
{
picAxis2.Image = ResourceCulture.M_JP_axis2;
}
else
{
picAxis2.Image = ResourceCulture.M_axis2;
}
ioSingleControl.IOName = ResourceCulture.GetString("检测信号");
ioSingleControl.ShowData();
} }
private void SaveConfig(int speed, int position) private void SaveConfig(int speed, int position)
{ {
...@@ -173,11 +187,6 @@ namespace OnlineStore.AutoInOutStore ...@@ -173,11 +187,6 @@ namespace OnlineStore.AutoInOutStore
btnGetActualPosition.Enabled = p; btnGetActualPosition.Enabled = p;
} }
private void btnClear_Click(object sender, EventArgs e)
{
this.richTextBox1.Text = "";
}
private void btnRelMove_Click(object sender, EventArgs e) private void btnRelMove_Click(object sender, EventArgs e)
{ {
int position = Convert.ToInt32(txtPosition.Text); int position = Convert.ToInt32(txtPosition.Text);
...@@ -296,10 +305,10 @@ namespace OnlineStore.AutoInOutStore ...@@ -296,10 +305,10 @@ namespace OnlineStore.AutoInOutStore
preValue = PositionList[num - 2]; preValue = PositionList[num - 2];
} }
LogUtil.info(LogName + "【"+ num + "】【" + currPos+"】【"+Math.Abs(currPos-preValue)+"】"); LogUtil.info(LogName + "【"+ num + "】【" + currPos+"】【"+Math.Abs(currPos-preValue)+"】");
if (LogUtil.logBox == null) //if (LogUtil.logBox == null)
{ //{
this.richTextBox1.AppendText(LogName + "【" + num + "】【" + currPos + "】【" + Math.Abs(currPos - preValue) + "】"+Environment.NewLine); // this.richTextBox1.AppendText(LogName + "【" + num + "】【" + currPos + "】【" + Math.Abs(currPos - preValue) + "】"+Environment.NewLine);
} //}
LastValue = IO_VALUE.HIGH; LastValue = IO_VALUE.HIGH;
LastGetPTime = DateTime.Now; LastGetPTime = DateTime.Now;
} }
...@@ -360,8 +369,8 @@ namespace OnlineStore.AutoInOutStore ...@@ -360,8 +369,8 @@ namespace OnlineStore.AutoInOutStore
{ {
try try
{ {
ioStatusControl1.IOValue = (int)GetSingleValue(); ioSingleControl.IOValue = (int)GetSingleValue();
ioStatusControl1.ShowData(); ioSingleControl.ShowData();
} }
catch (Exception ex) catch (Exception ex)
{ {
...@@ -392,5 +401,10 @@ namespace OnlineStore.AutoInOutStore ...@@ -392,5 +401,10 @@ namespace OnlineStore.AutoInOutStore
{ {
this.Close(); this.Close();
} }
private void FrmPositionTool_Shown(object sender, EventArgs e)
{
}
} }
} }
...@@ -3,52 +3,52 @@ DI,急停,SuddenStop_BTN,0,192.168.200.11,0,急停,X01,DI-01,0, ...@@ -3,52 +3,52 @@ DI,急停,SuddenStop_BTN,0,192.168.200.11,0,急停,X01,DI-01,0,
DI,复位,Reset_BTN,1,192.168.200.11,0,复位,X02,DI-02,0, DI,复位,Reset_BTN,1,192.168.200.11,0,复位,X02,DI-02,0,
DI,自动启动,AutoRun_Single,2,192.168.200.11,0,自动启动,X03,DI-03,0, DI,自动启动,AutoRun_Single,2,192.168.200.11,0,自动启动,X03,DI-03,0,
DI,安全光栅,SafetyLightCurtains,3,192.168.200.11,0,安全光栅,X04,DI-04,0, DI,安全光栅,SafetyLightCurtains,3,192.168.200.11,0,安全光栅,X04,DI-04,0,
DI,进料口门上升端,Door_Up,4,192.168.200.11,0,进料口门上升端,X05,DI-05,0, DI,单料门上升端,Door_Up,4,192.168.200.11,0,单料门上升端,X05,DI-05,0,
DI,进料口门下降端,Door_Down,5,192.168.200.11,0,进料口门下降端,X06,DI-06,0, DI,单料门下降端,Door_Down,5,192.168.200.11,0,单料门下降端,X06,DI-06,0,
DI,抓取气缸上升端,ClampingDisc_Up,6,192.168.200.11,0,抓取气缸上升端,X07,DI-07,0, DI,分料机构气缸上升端,ClampingDisc_Up,6,192.168.200.11,0,分料机构气缸上升端,X07,DI-07,0,
DI,抓取气缸下降端,ClampingDisc_Down,7,192.168.200.11,0,抓取气缸下降端,X08,DI-08,0, DI,分料机构气缸下降端,ClampingDisc_Down,7,192.168.200.11,0,分料机构气缸下降端,X08,DI-08,0,
DI,料盘宽度检测1,WidthCheck1,8,192.168.200.11,0,料盘宽度检测1,X09,DI-09,0, DI,料盘宽度检测1,WidthCheck1,8,192.168.200.11,0,料盘宽度检测1,X09,DI-09,0,
DI,料盘宽度检测2,WidthCheck2,9,192.168.200.11,0,料盘宽度检测2,X10,DI-10,0, DI,料盘宽度检测2,WidthCheck2,9,192.168.200.11,0,料盘宽度检测2,X10,DI-10,0,
DI,料盘检测1(上料机构),TrayCheck_LoadMaterial,10,192.168.200.11,0,料盘检测1(上料机构),X11,DI-11,0, DI,料盘检测1(上料机构),TrayCheck_LoadMaterial,10,192.168.200.11,0,料盘检测1(上料机构),X11,DI-11,0,
DI,上料机构出料检测,OutCheck,11,192.168.200.11,0,上料机构出料检测,X12,DI-12,0, DI,上料机构出料检测,OutCheck,11,192.168.200.11,0,上料机构出料检测,X12,DI-12,0,
DI,门锁气缸打开端,BatchDoor_Open,12,192.168.200.11,0,门锁气缸打开端,X13,DI-13,0, DI,批量门锁气缸打开端,BatchDoor_Open,12,192.168.200.11,0,批量门锁气缸打开端,X13,DI-13,0,
DI,门锁气缸关闭端,BatchDoor_Close,13,192.168.200.11,0,门锁气缸关闭端,X14,DI-14,0, DI,批量门锁气缸关闭端,BatchDoor_Close,13,192.168.200.11,0,批量门锁气缸关闭端,X14,DI-14,0,
DI,料盘检测2(料叉机构),TrayCheck_Fixture,14,192.168.200.11,0,料盘检测2(料叉机构),X15,DI-15,0, DI,料盘检测2(夹取机构),TrayCheck_Fixture,14,192.168.200.11,0,料盘检测2(夹取机构),X15,DI-15,0,
,压紧机构计量检测,CompressAxis_Check,15,192.168.200.11,0,压紧机构计量检测,X16,DI-16,0, ,压紧机构计量检测,CompressAxis_Check,15,192.168.200.11,0,压紧机构计量检测,X16,DI-16,0,
DO,自动指示灯,AutoRun_HddLed,0,192.168.200.11,0,自动指示灯,Y01,DO-01,0, DO,自动指示灯,AutoRun_HddLed,0,192.168.200.11,0,自动指示灯,Y01,DO-01,0,
DO,故障指示灯,Alarm_HddLed,1,192.168.200.11,0,故障指示灯,Y02,DO-02,0, DO,故障指示灯,Alarm_HddLed,1,192.168.200.11,0,故障指示灯,Y02,DO-02,0,
DO,待机指示灯,RunSign_HddLed,2,192.168.200.11,0,待机指示灯,Y03,DO-03,0, DO,待机指示灯,RunSign_HddLed,2,192.168.200.11,0,待机指示灯,Y03,DO-03,0,
DO,吹气SOL ON,StartOrStopBlow,3,192.168.200.11,0,吹气SOL ON,Y04,DO-04,0, DO,进气口打开,StartOrStopBlow,3,192.168.200.11,0,进气口打开,Y04,DO-04,0,
DO,料仓运转ON,Run_Sign,4,192.168.200.11,0,料仓运转ON,Y05,DO-05,0, DO,料仓伺服电源打开,Run_Sign,4,192.168.200.11,0,料仓伺服电源打开,Y05,DO-05,0,
DO,轴2刹车电源ON,Axis_Brake,5,192.168.200.11,0,轴2刹车电源ON,Y06,DO-06,0, DO,轴2刹车电源打开,Axis_Brake,5,192.168.200.11,0,轴2刹车电源打开,Y06,DO-06,0,
DO,相机照明开,CameraLight_Power,6,192.168.200.11,0,相机照明开,Y07,DO-07,0, DO,相机辅助光源打开,CameraLight_Power,6,192.168.200.11,0,相机辅助光源打开,Y07,DO-07,0,
,备用,,7,192.168.200.11,0,备用,Y08,DO-08,0, ,设备照明打开,,7,192.168.200.11,0,设备照明打开,Y08,DO-08,0,
DO,进料口门上升SOL,Door_Up,8,192.168.200.11,0,进料口门上升SOL,Y09,DO-09,0, DO,单料门上升,Door_Up,8,192.168.200.11,0,单料门上升,Y09,DO-09,0,
DO,进料口门下降SOL,Door_Down,9,192.168.200.11,0,进料口门下降SOL,Y10,DO-10,0, DO,单料门下降,Door_Down,9,192.168.200.11,0,单料门下降,Y10,DO-10,0,
DO,抓取气缸上升SOL,ClampingDisc_Up,10,192.168.200.11,0,抓取气缸上升SOL,Y11,DO-11,0, DO,分料机构气缸上升,ClampingDisc_Up,10,192.168.200.11,0,分料机构气缸上升,Y11,DO-11,0,
DO,抓取气缸下降SOL,ClampingDisc_Down,11,192.168.200.11,0,抓取气缸下降SOL,Y12,DO-12,0, DO,分料机构气缸下降,ClampingDisc_Down,11,192.168.200.11,0,分料机构气缸下降,Y12,DO-12,0,
DO,门锁气缸打开SOL,BatchDoor_Open,12,192.168.200.11,0,门锁气缸打开SOL,Y13,DO-13,0, DO,批量门锁气缸打开,BatchDoor_Open,12,192.168.200.11,0,批量门锁气缸打开,Y13,DO-13,0,
DO,门锁气缸关闭SOL,BatchDoor_Close,13,192.168.200.11,0,门锁气缸关闭SOL,Y14,DO-14,0, DO,批量门锁气缸关闭,BatchDoor_Close,13,192.168.200.11,0,批量门锁气缸关闭,Y14,DO-14,0,
DO,门禁功能屏蔽,DisableDoorControl,14,192.168.200.11,0,门禁功能屏蔽,Y15,DO-15,0, DO,电气维护门警报关闭,DisableDoorControl,14,192.168.200.11,0,电气维护门警报关闭,Y15,DO-15,0,
DO,报警蜂鸣器,Buzzer_Sign,15,192.168.200.11,0,报警蜂鸣器,Y16,DO-16,0, DO,报警蜂鸣器,Buzzer_Sign,15,192.168.200.11,0,报警蜂鸣器,Y16,DO-16,0,
DI,上料机构门关闭,DoorClose_LoadMaterial,0,192.168.200.12,0,上料机构门关闭,X21,DI-21,0, DI,批量门关闭,DoorClose_LoadMaterial,0,192.168.200.12,0,批量门关闭,X21,DI-21,0,
DI,气压检测,Airpressure_Check,1,192.168.200.12,0,气压检测,X22,DI-22,0, DI,气压检测,Airpressure_Check,1,192.168.200.12,0,气压检测,X22,DI-22,0,
DI,左侧门关闭,LeftDoorColse_Single,2,192.168.200.12,0,左侧门关闭,X23,DI-23,0, DI,左侧电器维护门关闭,LeftDoorColse_Single,2,192.168.200.12,0,左侧电器维护门关闭,X23,DI-23,0,
DI,右侧门关闭,RightDoorColse_Single,3,192.168.200.12,0,右侧门关闭,X24,DI-24,0, DI,右侧电器维护门关闭,RightDoorColse_Single,3,192.168.200.12,0,右侧电器维护门关闭,X24,DI-24,0,
DI,门锁气缸打开端2,BatchDoor_Open2,4,192.168.200.12,0,门锁气缸打开端2,X25,DI-25,0, DI,批量门锁气缸打开端2,BatchDoor_Open2,4,192.168.200.12,0,批量门锁气缸打开端2,X25,DI-25,0,
DI,门锁气缸关闭端2,BatchDoor_Close2,5,192.168.200.12,0,门锁气缸关闭端2,X26,DI-26,0, DI,批量门锁气缸关闭端2,BatchDoor_Close2,5,192.168.200.12,0,批量门锁气缸关闭端2,X26,DI-26,0,
DI,上料机构上极限,BatchAxis_Limit,6,192.168.200.12,0,上料机构上极限,X27,DI-27,0, DI,轴5上极限,BatchAxis_Limit,6,192.168.200.12,0,轴5上极限,X27,DI-27,0,
DI,入料口料盘检测,TrayCheck_Door,7,192.168.200.12,0,入料口料盘检测,X28,DI-28,0, DI,单料门料盘检测,TrayCheck_Door,7,192.168.200.12,0,单料门料盘检测,X28,DI-28,0,
DI,夹爪气缸夹紧端,Clamping_Work,8,192.168.200.12,0,夹爪气缸夹紧端,X29,DI-29,0, DI,抓取机构气缸夹紧端,Clamping_Work,8,192.168.200.12,0,抓取机构气缸夹紧端,X29,DI-29,0,
DI,夹爪气缸放松端,Clamping_Relax,9,192.168.200.12,0,夹爪气缸放松端,X30,DI-30,0, DI,抓取机构气缸放松端,Clamping_Relax,9,192.168.200.12,0,抓取机构气缸放松端,X30,DI-30,0,
,,,10,192.168.200.12,0,,X31,DI-31,0, ,分料机构气缸料盘检测,,10,192.168.200.12,0,分料机构气缸料盘检测,X31,DI-31,0,
,,,11,192.168.200.12,0,,X32,DI-32,0, ,,,11,192.168.200.12,0,,X32,DI-32,0,
,,,12,192.168.200.12,0,,X33,DI-33,0, ,,,12,192.168.200.12,0,,X33,DI-33,0,
,,,13,192.168.200.12,0,,X34,DI-34,0, ,,,13,192.168.200.12,0,,X34,DI-34,0,
,,,14,192.168.200.12,0,,X35,DI-35,0, ,,,14,192.168.200.12,0,,X35,DI-35,0,
,,,15,192.168.200.12,0,,X36,DI-36,0, ,,,15,192.168.200.12,0,,X36,DI-36,0,
DO,夹爪气缸夹紧SOL,Clamping_Work,0,192.168.200.12,0,,Y21,DO-21,0, DO,分料机构气缸夹紧,Clamping_Work,0,192.168.200.12,0,分料机构气缸夹紧,Y21,DO-21,0,
DO,夹爪气缸放松SOL,Clamping_Relax,1,192.168.200.12,0,,Y22,DO-22,0, DO,分料机构气缸放松,Clamping_Relax,1,192.168.200.12,0,分料机构气缸放松,Y22,DO-22,0,
,,,2,192.168.200.12,0,,Y23,DO-23,0, ,,,2,192.168.200.12,0,,Y23,DO-23,0,
,,,3,192.168.200.12,0,,Y24,DO-24,0, ,,,3,192.168.200.12,0,,Y24,DO-24,0,
,,,4,192.168.200.12,0,,Y25,DO-25,0, ,,,4,192.168.200.12,0,,Y25,DO-25,0,
......
...@@ -982,6 +982,24 @@ namespace OnlineStore.DeviceLibrary ...@@ -982,6 +982,24 @@ namespace OnlineStore.DeviceLibrary
//报警时只需要亮红灯 //报警时只需要亮红灯
if (storeRunStatus <= StoreRunStatus.Wait)
{
if (IOManager.IOValue(IO_Type.Alarm_HddLed).Equals(IO_VALUE.HIGH))
{
IOManager.IOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW);
}
if (IOManager.IOValue(IO_Type.RunSign_HddLed).Equals(IO_VALUE.HIGH))
{
IOManager.IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
}
if (IOManager.IOValue(IO_Type.AutoRun_HddLed).Equals(IO_VALUE.HIGH))
{
IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW);
}
}
else
{
DateTime time = DateTime.Now; DateTime time = DateTime.Now;
bool isTemp30M = false; bool isTemp30M = false;
if (TempOrHumidityIsAlarm) if (TempOrHumidityIsAlarm)
...@@ -993,7 +1011,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -993,7 +1011,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
bool isNeedAlarmLed = false; bool isNeedAlarmLed = false;
//报警灯 //报警灯,报警或温湿度报警30分钟,红灯闪
if (!alarmType.Equals(StoreAlarmType.None) || isTemp30M) if (!alarmType.Equals(StoreAlarmType.None) || isTemp30M)
{ {
isNeedAlarmLed = true; isNeedAlarmLed = true;
...@@ -1010,19 +1028,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -1010,19 +1028,14 @@ namespace OnlineStore.DeviceLibrary
} }
} }
//绿灯闪 bool isBusy = StoreMove.MoveType.Equals(StoreMoveType.InStore) || StoreMove.MoveType.Equals(StoreMoveType.OutStore) ||
if (isNeedAlarmLed || TempOrHumidityIsAlarm || isTemp30M) AutomaticBaiting.StoreMove.MoveType.Equals(StoreMoveType.InStore) || AutomaticBaiting.StoreMove.MoveType.Equals(StoreMoveType.OutStore);
{ bool isReset = StoreMove.MoveType.Equals(StoreMoveType.ReturnHome) || StoreMove.MoveType.Equals(StoreMoveType.StoreReset) ||
if (IOManager.IOValue(IO_Type.AutoRun_HddLed).Equals(IO_VALUE.LOW)) AutomaticBaiting.StoreMove.MoveType.Equals(StoreMoveType.ReturnHome) || AutomaticBaiting.StoreMove.MoveType.Equals(StoreMoveType.StoreReset);
{
IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH);
} //绿灯,正常常亮,复位,出入库时闪烁
} if ((isBusy || isReset) && IOManager.IOValue(IO_Type.AutoRun_HddLed).Equals(IO_VALUE.HIGH))
else
{
if ((StoreMove.MoveType.Equals(StoreMoveType.InStore) || StoreMove.MoveType.Equals(StoreMoveType.OutStore)
|| storeRunStatus.Equals(StoreRunStatus.HomeMoving) || storeRunStatus.Equals(StoreRunStatus.Reset))
&& IOManager.IOValue(IO_Type.AutoRun_HddLed).Equals(IO_VALUE.HIGH))
{ {
IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW); IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW);
} }
...@@ -1031,9 +1044,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -1031,9 +1044,9 @@ namespace OnlineStore.DeviceLibrary
//绿灯亮 //绿灯亮
IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH); IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH);
} }
}
//黄灯 //黄灯 复位待机时灭,出入库或温湿度报警时闪烁
if (StoreMove.MoveType.Equals(StoreMoveType.InStore) || StoreMove.MoveType.Equals(StoreMoveType.OutStore) || TempOrHumidityIsAlarm || isTemp30M) if (isBusy || TempOrHumidityIsAlarm || isTemp30M)
{ {
if (IOManager.IOValue(IO_Type.RunSign_HddLed).Equals(IO_VALUE.HIGH)) if (IOManager.IOValue(IO_Type.RunSign_HddLed).Equals(IO_VALUE.HIGH))
{ {
...@@ -1051,7 +1064,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1051,7 +1064,7 @@ namespace OnlineStore.DeviceLibrary
IOManager.IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW); IOManager.IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
} }
} }
}
//仓门打开,打开照明 //仓门打开,打开照明
bool doorIsOpen = false; bool doorIsOpen = false;
if (Config.DILIst.ContainsKey(IO_Type.LeftDoorColse_Single) && IOManager.IOValue(IO_Type.LeftDoorColse_Single).Equals(IO_VALUE.LOW)) if (Config.DILIst.ContainsKey(IO_Type.LeftDoorColse_Single) && IOManager.IOValue(IO_Type.LeftDoorColse_Single).Equals(IO_VALUE.LOW))
......
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace OnlineStore.LoadCSVLibrary
{
public class FileEncoding
{
public static string[] GetFileLines(string filePath)
{
if (!File.Exists(filePath))
{
return new string[] { };
}
Encoding encoding = Encoding.UTF8;
if (!FileEncoding.GetType(filePath).Equals(Encoding.UTF8))
{
encoding = Encoding.GetEncoding("gb2312");
}
string[] lines = File.ReadAllLines(filePath, encoding);
return lines;
}
/// <summary>
/// 给定文件的路径,读取文件的二进制数据,判断文件的编码类型
/// </summary>
/// <param name=“FILE_NAME“>文件路径</param>
/// <returns>文件的编码类型</returns>
public static System.Text.Encoding GetType(string FILE_NAME)
{
FileStream fs = new FileStream(FILE_NAME, FileMode.Open, FileAccess.Read);
Encoding r = GetType(fs);
fs.Close();
return r;
}
/// <summary>
/// 通过给定的文件流,判断文件的编码类型
/// </summary>
/// <param name=“fs“>文件流</param>
/// <returns>文件的编码类型</returns>
public static System.Text.Encoding GetType(FileStream fs)
{
byte[] Unicode = new byte[] { 0xFF, 0xFE, 0x41 };
byte[] UnicodeBIG = new byte[] { 0xFE, 0xFF, 0x00 };
byte[] UTF8 = new byte[] { 0xEF, 0xBB, 0xBF }; //带BOM
Encoding reVal = Encoding.Default;
BinaryReader r = new BinaryReader(fs, System.Text.Encoding.Default);
int i;
int.TryParse(fs.Length.ToString(), out i);
byte[] ss = r.ReadBytes(i);
if (IsUTF8Bytes(ss) || (ss[0] == 0xEF && ss[1] == 0xBB && ss[2] == 0xBF))
{
reVal = Encoding.UTF8;
}
else if (ss[0] == 0xFE && ss[1] == 0xFF && ss[2] == 0x00)
{
reVal = Encoding.BigEndianUnicode;
}
else if (ss[0] == 0xFF && ss[1] == 0xFE && ss[2] == 0x41)
{
reVal = Encoding.Unicode;
}
r.Close();
return reVal;
}
/// <summary>
/// 判断是否是不带 BOM 的 UTF8 格式
/// </summary>
/// <param name=“data“></param>
/// <returns></returns>
private static bool IsUTF8Bytes(byte[] data)
{
int charByteCounter = 1; //计算当前正分析的字符应还有的字节数
byte curByte; //当前分析的字节.
for (int i = 0; i < data.Length; i++)
{
curByte = data[i];
if (charByteCounter == 1)
{
if (curByte >= 0x80)
{
//判断当前
while (((curByte <<= 1) & 0x80) != 0)
{
charByteCounter++;
}
//标记位首位若为非0 则至少以2个1开始 如:110XXXXX...........1111110X
if (charByteCounter == 1 || charByteCounter > 6)
{
return false;
}
}
}
else
{
//若是UTF-8 此时第一位必须为1
if ((curByte & 0xC0) != 0x80)
{
return false;
}
charByteCounter--;
}
}
if (charByteCounter > 1)
{
throw new Exception("非预期的byte格式");
}
return true;
}
}
}
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
<ItemGroup> <ItemGroup>
<Compile Include="CSVExection.cs" /> <Compile Include="CSVExection.cs" />
<Compile Include="CSVResourceControl.cs" /> <Compile Include="CSVResourceControl.cs" />
<Compile Include="FileEncoding.cs" />
<Compile Include="position\AutoStorePosition.cs" /> <Compile Include="position\AutoStorePosition.cs" />
<Compile Include="storeConfig\ConfigItemBase.cs" /> <Compile Include="storeConfig\ConfigItemBase.cs" />
<Compile Include="storeConfig\ConfigProAttribute.cs" /> <Compile Include="storeConfig\ConfigProAttribute.cs" />
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!