Commit c820a1a4 几米阳光

增加中英文切换功能

1 个父辈 f2affbe0
正在显示 33 个修改的文件 包含 622 行增加477 行删除
...@@ -94,6 +94,7 @@ ...@@ -94,6 +94,7 @@
<Compile Include="ManagerUtil.cs" /> <Compile Include="ManagerUtil.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ResourceCulture.cs" />
<EmbeddedResource Include="FrmAxisDebug.resx"> <EmbeddedResource Include="FrmAxisDebug.resx">
<DependentUpon>FrmAxisDebug.cs</DependentUpon> <DependentUpon>FrmAxisDebug.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
...@@ -109,6 +110,13 @@ ...@@ -109,6 +110,13 @@
<EmbeddedResource Include="FrmStoreBox.resx"> <EmbeddedResource Include="FrmStoreBox.resx">
<DependentUpon>FrmStoreBox.cs</DependentUpon> <DependentUpon>FrmStoreBox.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Properties\Resource.en-US.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resource.ge-DE.resx" />
<EmbeddedResource Include="Properties\Resource.zh-CN.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
......
...@@ -68,7 +68,8 @@ namespace OnlineStore.AutoInOutStore ...@@ -68,7 +68,8 @@ namespace OnlineStore.AutoInOutStore
{ {
return true; return true;
} }
MessageBox.Show("叉子不在待机位,请先将叉子退回待机位("+InOutDefaultPosition+")", "警告(叉子在待机位时,才能移动升降轴和旋转轴) ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.InoutNotOk, "叉子不在待机位,请先将叉子退回待机位") + "(" + InOutDefaultPosition + ")!",
ResourceCulture.GetString(ResourceCulture.InoutWarn, "警告(叉子在待机位时,才能移动升降轴和旋转轴)"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return false; return false;
} }
private void btnMiddleMove_MouseDown(object sender, MouseEventArgs e) private void btnMiddleMove_MouseDown(object sender, MouseEventArgs e)
...@@ -83,7 +84,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -83,7 +84,7 @@ namespace OnlineStore.AutoInOutStore
int speed = FormUtil.GetIntValue(txtMiddleSpeed); int speed = FormUtil.GetIntValue(txtMiddleSpeed);
if (speed <= 0) if (speed <= 0)
{ {
MessageBox.Show("提示", "请先输入正确的速度"); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.MsgTitle,"提示"),ResourceCulture.GetString(ResourceCulture.PWSpeed, "请先输入正确的速度"));
return; return;
} }
btnMiddleMove.BackColor = Color.Green; btnMiddleMove.BackColor = Color.Green;
...@@ -112,7 +113,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -112,7 +113,7 @@ namespace OnlineStore.AutoInOutStore
int speed = FormUtil.GetIntValue(txtUpDownSpeed); int speed = FormUtil.GetIntValue(txtUpDownSpeed);
if (speed <= 0) if (speed <= 0)
{ {
MessageBox.Show("提示", "请先输入正确的速度"); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.MsgTitle,"提示"),ResourceCulture.GetString(ResourceCulture.PWSpeed, "请先输入正确的速度"));
return; return;
} }
btnUpDownMove.BackColor = Color.Green; btnUpDownMove.BackColor = Color.Green;
...@@ -136,13 +137,13 @@ namespace OnlineStore.AutoInOutStore ...@@ -136,13 +137,13 @@ namespace OnlineStore.AutoInOutStore
{ {
if (StoreManager.Store.InOutAxisCanMove().Equals(false)) if (StoreManager.Store.InOutAxisCanMove().Equals(false))
{ {
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); MessageBox.Show(FrmStoreBox.cannotMove, FrmStoreBox.warn, MessageBoxButtons.OK, MessageBoxIcon.Warning);
return; return;
} }
int speed = FormUtil.GetIntValue(txtInOutSpeed); int speed = FormUtil.GetIntValue(txtInOutSpeed);
if (speed <= 0) if (speed <= 0)
{ {
MessageBox.Show("提示", "请先输入正确的速度"); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.MsgTitle,"提示"),ResourceCulture.GetString(ResourceCulture.PWSpeed, "请先输入正确的速度"));
return; return;
} }
this.btnInOutMove.BackColor = Color.Green; this.btnInOutMove.BackColor = Color.Green;
...@@ -170,7 +171,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -170,7 +171,7 @@ namespace OnlineStore.AutoInOutStore
int speed = FormUtil.GetIntValue(txtMiddleSpeed); int speed = FormUtil.GetIntValue(txtMiddleSpeed);
if (speed <= 0) if (speed <= 0)
{ {
MessageBox.Show("提示", "请先输入正确的速度"); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.MsgTitle,"提示"),ResourceCulture.GetString(ResourceCulture.PWSpeed, "请先输入正确的速度"));
return; return;
} }
this.btnMiddleMovej.BackColor = Color.Green; this.btnMiddleMovej.BackColor = Color.Green;
...@@ -199,7 +200,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -199,7 +200,7 @@ namespace OnlineStore.AutoInOutStore
int speed = FormUtil.GetIntValue(txtUpDownSpeed); int speed = FormUtil.GetIntValue(txtUpDownSpeed);
if (speed <= 0) if (speed <= 0)
{ {
MessageBox.Show("提示", "请先输入正确的速度"); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.MsgTitle,"提示"),ResourceCulture.GetString(ResourceCulture.PWSpeed, "请先输入正确的速度"));
return; return;
} }
btnUpDownMovej.BackColor = Color.Green; btnUpDownMovej.BackColor = Color.Green;
...@@ -223,13 +224,13 @@ namespace OnlineStore.AutoInOutStore ...@@ -223,13 +224,13 @@ namespace OnlineStore.AutoInOutStore
{ {
if (StoreManager.Store.InOutAxisCanMove().Equals(false)) if (StoreManager.Store.InOutAxisCanMove().Equals(false))
{ {
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); MessageBox.Show(FrmStoreBox.cannotMove, FrmStoreBox.warn, MessageBoxButtons.OK, MessageBoxIcon.Warning);
return; return;
} }
int speed = FormUtil.GetIntValue(txtInOutSpeed); int speed = FormUtil.GetIntValue(txtInOutSpeed);
if (speed <= 0) if (speed <= 0)
{ {
MessageBox.Show("提示", "请先输入正确的速度"); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.MsgTitle,"提示"),ResourceCulture.GetString(ResourceCulture.PWSpeed, "请先输入正确的速度"));
return; return;
} }
this.btnInOutMovej.BackColor = Color.Green; this.btnInOutMovej.BackColor = Color.Green;
...@@ -251,7 +252,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -251,7 +252,7 @@ namespace OnlineStore.AutoInOutStore
int speed = FormUtil.GetIntValue(txtComSpeed); int speed = FormUtil.GetIntValue(txtComSpeed);
if (speed <= 0) if (speed <= 0)
{ {
MessageBox.Show("提示", "请先输入正确的速度"); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.MsgTitle,"提示"),ResourceCulture.GetString(ResourceCulture.PWSpeed, "请先输入正确的速度"));
return; return;
} }
this.btnComMove.BackColor = Color.Green; this.btnComMove.BackColor = Color.Green;
...@@ -275,7 +276,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -275,7 +276,7 @@ namespace OnlineStore.AutoInOutStore
int speed = FormUtil.GetIntValue(txtComSpeed); int speed = FormUtil.GetIntValue(txtComSpeed);
if (speed <= 0) if (speed <= 0)
{ {
MessageBox.Show("提示", "请先输入正确的速度"); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.MsgTitle,"提示"),ResourceCulture.GetString(ResourceCulture.PWSpeed, "请先输入正确的速度"));
return; return;
} }
this.btnComMovej.BackColor = Color.Green; this.btnComMovej.BackColor = Color.Green;
...@@ -358,7 +359,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -358,7 +359,7 @@ namespace OnlineStore.AutoInOutStore
int speed = FormUtil.GetIntValue(txtAutoSpeed); int speed = FormUtil.GetIntValue(txtAutoSpeed);
if (speed <= 0) if (speed <= 0)
{ {
MessageBox.Show("提示", "请先输入正确的速度"); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.MsgTitle,"提示"),ResourceCulture.GetString(ResourceCulture.PWSpeed, "请先输入正确的速度"));
return; return;
} }
btnAutoMove.BackColor = Color.Green; btnAutoMove.BackColor = Color.Green;
...@@ -383,7 +384,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -383,7 +384,7 @@ namespace OnlineStore.AutoInOutStore
int speed = FormUtil.GetIntValue(txtAutoSpeed); int speed = FormUtil.GetIntValue(txtAutoSpeed);
if (speed <= 0) if (speed <= 0)
{ {
MessageBox.Show("提示", "请先输入正确的速度"); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.MsgTitle,"提示"),ResourceCulture.GetString(ResourceCulture.PWSpeed, "请先输入正确的速度"));
return; return;
} }
btnAutoMovej.BackColor = Color.Green; btnAutoMovej.BackColor = Color.Green;
......
using OnlineStore.Common;
using OnlineStore.DeviceLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace OnlineStore.ACSingleStore
{
public partial class FrmAxisMoveConfig : FrmBase
{
private AC_SA_BoxBean boxBean = null;
public FrmAxisMoveConfig(AC_SA_BoxBean box )
{
this.boxBean = box;
InitializeComponent();
}
private void FrmAxisMoveConfig_Load(object sender, EventArgs e)
{
txtUpdownP1S.Text = boxBean.Config.UpDownAxis_P1_Speed.ToString();
txtUpdownP2S.Text = boxBean.Config.UpDownAxis_P2_Speed.ToString();
txtUpdownP3S.Text = boxBean.Config.UpDownAxis_P3_Speed.ToString();
txtUpdownP4S.Text = boxBean.Config.UpDownAxis_P4_Speed.ToString();
txtUpdownP5S.Text = boxBean.Config.UpDownAxis_P5_Speed.ToString();
txtUpdownP6S.Text = boxBean.Config.UpDownAxis_P6_Speed.ToString();
txtUpdownP7S.Text = boxBean.Config.UpDownAxis_P7_Speed.ToString();
txtUpdownP8S.Text = boxBean.Config.UpDownAxis_P8_Speed.ToString();
txtInOutP1S.Text = boxBean.Config.InOutAxis_P1_Speed.ToString();
txtInOutP2S.Text = boxBean.Config.InOutAxis_P2_Speed.ToString();
txtInOutP3S.Text = boxBean.Config.InOutAxis_P3_Speed.ToString();
txtMiddleP1S.Text = boxBean.Config.MiddleAxis_P1_Speed.ToString();
txtMiddleP2S.Text = boxBean.Config.MiddleAxis_P2_Speed.ToString();
//txtMiddleSpeed.Text = boxBean.Config.MiddleAxis_StartSpeed.ToString();
//txtInOutSpeed.Text = boxBean.Config.InoutAxis_StartSpeed.ToString();
//txtUpDownSpeed.Text = boxBean.Config.UpdownAxis_StartSpeed.ToString();
this.txtMSpeed.Text = boxBean.Config.MiddleAxis_TargetSpeed.ToString();
this.txtISpeed.Text = boxBean.Config.InoutAxis_TargetSpeed.ToString();
this.txtUSpeed.Text = boxBean.Config.UpdownAxis_TargetSpeed.ToString();
this.txtMAtime.Text = boxBean.Config.MiddleAxis_AddSpeed.ToString();
this.txtIAtime.Text = boxBean.Config.InoutAxis_DelSpeed.ToString();
this.txtUAtime.Text = boxBean.Config.UpdownAxis_AddSpeed.ToString();
this.txtMDtime.Text = boxBean.Config.MiddleAxis_DelSpeed.ToString();
this.txtIDtime.Text = boxBean.Config.InoutAxis_DelSpeed.ToString();
this.txtUDtime.Text = boxBean.Config.UpdownAxis_DelSpeed.ToString();
txtMiddleMax.Text = boxBean.Config.MiddleAxis_ErrorCountMax.ToString();
txtUpdownMax.Text = boxBean.Config.UpdownAxis_ErrorCountMax.ToString();
txtInoutMax.Text = boxBean.Config.InoutAxis_ErrorCountMax.ToString();
//txtComMax.Text = boxBean.Config.CompressAxis_ErrorCountMax.ToString();
txtMiddleMin.Text = boxBean.Config.MiddleAxis_ErrorCountMin.ToString();
txtUpdownMin.Text = boxBean.Config.UpdownAxis_ErrorCountMin.ToString();
txtInoutMin.Text = boxBean.Config.InoutAxis_ErrorCountMin.ToString();
//txtComMin.Text = boxBean.Config.CompressAxis_ErrorCountMin.ToString();
txtMRSpeed.Text = boxBean.Config.MiddleAxis_ResolveSpeed.ToString();
txtIRSpeed.Text = boxBean.Config.InoutAxis_ResolveSpeed.ToString();
txtURSpeed.Text = boxBean.Config.UpdownAxis_ResolveSpeed.ToString();
//txtCRSpeed.Text = boxBean.Config.CompressAxis_ResolveSpeed.ToString();
//txtAddSpeed.Text = boxBean.Config.CompressAxis_AddSpeed.ToString();
//txtDelSpeed.Text = boxBean.Config.CompressAxis_DelSpeed.ToString();
//txtMaxSpeed.Text = boxBean.Config.CompressAxis_MaxSpeed.ToString();
//txtBeginSpeed.Text = boxBean.Config.CompressAxis_StartSpeed.ToString();
//txtTargetSpeed.Text = boxBean.Config.CompressAxis_EndSpeed.ToString();
//this.txtCDtime.Text = boxBean.Config.CompressAxis_DecelTime.ToString();
//this.txtCSpeed.Text = boxBean.Config.CompressAxis_TargetSpeed.ToString();
//this.txtCAtime.Text = boxBean.Config.CompressAxis_AccelTime.ToString();
}
private void btnSaveAxisSpeed_Click(object sender, EventArgs e)
{
DialogResult resul = MessageBox.Show("配置使用地方过多,需要重启才能生效,是否确定保存?", "提示", MessageBoxButtons.YesNo);
if (!resul.Equals(DialogResult.Yes))
{
return;
}
boxBean.Config.UpDownAxis_P1_Speed = FormUtil.GetIntValue(txtUpdownP1S);
boxBean.Config.UpDownAxis_P2_Speed = FormUtil.GetIntValue(txtUpdownP2S);
boxBean.Config.UpDownAxis_P3_Speed = FormUtil.GetIntValue(txtUpdownP3S);
boxBean.Config.UpDownAxis_P4_Speed = FormUtil.GetIntValue(txtUpdownP4S);
boxBean.Config.UpDownAxis_P5_Speed = FormUtil.GetIntValue(txtUpdownP5S);
boxBean.Config.UpDownAxis_P6_Speed = FormUtil.GetIntValue(txtUpdownP6S);
boxBean.Config.UpDownAxis_P7_Speed = FormUtil.GetIntValue(txtUpdownP7S);
boxBean.Config.UpDownAxis_P8_Speed = FormUtil.GetIntValue(txtUpdownP8S);
boxBean.Config.InOutAxis_P1_Speed = FormUtil.GetIntValue(txtInOutP1S);
boxBean.Config.InOutAxis_P2_Speed = FormUtil.GetIntValue(txtInOutP2S);
boxBean.Config.InOutAxis_P3_Speed = FormUtil.GetIntValue(txtInOutP3S);
boxBean.Config.MiddleAxis_P1_Speed = FormUtil.GetIntValue(txtMiddleP1S);
boxBean.Config.MiddleAxis_P2_Speed = FormUtil.GetIntValue(txtMiddleP2S);
//boxBean.Config.CompressAxis_P1_Speed = FormUtil.GetIntValue(txtComPressP1S);
//boxBean.Config.CompressAxis_P2_Speed = FormUtil.GetIntValue(txtComPressP2S);
//boxBean.Config.CompressAxis_P3_Speed = FormUtil.GetIntValue(txtComPressP3S);
//boxBean.Config.MiddleAxis_StartSpeed = FormUtil.GetIntValue(txtMiddleSpeed);
//boxBean.Config.InoutAxis_StartSpeed = FormUtil.GetIntValue(txtInOutSpeed);
//boxBean.Config.UpdownAxis_StartSpeed = FormUtil.GetIntValue(txtUpDownSpeed);
//boxBean.Config.CompressAxis_StartSpeed = FormUtil.GetIntValue(txtComSpeed);
boxBean.Config.MiddleAxis_TargetSpeed = FormUtil.GetIntValue(txtMSpeed);
boxBean.Config.InoutAxis_TargetSpeed = FormUtil.GetIntValue(txtISpeed);
boxBean.Config.UpdownAxis_TargetSpeed = FormUtil.GetIntValue(txtUSpeed);
boxBean.Config.MiddleAxis_AddSpeed = FormUtil.GetShortValue(txtMAtime);
boxBean.Config.InoutAxis_AddSpeed = FormUtil.GetShortValue(txtIAtime);
boxBean.Config.UpdownAxis_AddSpeed = FormUtil.GetShortValue(txtUAtime);
boxBean.Config.MiddleAxis_DelSpeed = FormUtil.GetShortValue(txtMDtime);
boxBean.Config.InoutAxis_DelSpeed = FormUtil.GetShortValue(txtIDtime);
boxBean.Config.UpdownAxis_DelSpeed = FormUtil.GetShortValue(txtUDtime);
boxBean.Config.MiddleAxis_ErrorCountMax = FormUtil.GetShortValue(txtMiddleMax);
boxBean.Config.UpdownAxis_ErrorCountMax = FormUtil.GetShortValue(txtUpdownMax);
boxBean.Config.InoutAxis_ErrorCountMax = FormUtil.GetShortValue(txtInoutMax);
boxBean.Config.MiddleAxis_ErrorCountMin = FormUtil.GetShortValue(txtMiddleMin);
boxBean.Config.UpdownAxis_ErrorCountMin = FormUtil.GetShortValue(txtUpdownMin);
boxBean.Config.InoutAxis_ErrorCountMin = FormUtil.GetShortValue(txtInoutMin);
boxBean.Config.MiddleAxis_ResolveSpeed = FormUtil.GetShortValue(txtMRSpeed);
boxBean.Config.InoutAxis_ResolveSpeed = FormUtil.GetShortValue(txtIRSpeed);
boxBean.Config.UpdownAxis_ResolveSpeed = FormUtil.GetShortValue(txtURSpeed);
//boxBean.Config.CompressAxis_StartSpeed = FormUtil.GetIntValue(txtBeginSpeed);
//boxBean.Config.CompressAxis_AddSpeed = FormUtil.GetIntValue(txtAddSpeed);
//boxBean.Config.CompressAxis_DelSpeed = FormUtil.GetIntValue(txtDelSpeed);
//boxBean.Config.CompressAxis_EndSpeed = FormUtil.GetIntValue(txtTargetSpeed);
//boxBean.Config.CompressAxis_MaxSpeed = FormUtil.GetIntValue(txtMaxSpeed);
//boxBean.Config.CompressAxis_TargetSpeed = FormUtil.GetIntValue(txtCSpeed);
//boxBean.Config.CompressAxis_AccelTime = FormUtil.GetShortValue(txtCAtime);
//boxBean.Config.CompressAxis_DecelTime = FormUtil.GetShortValue(txtCDtime);
//更新缓存
ACStoreManager.UpdateBoxConfig(boxBean.Config);
}
private void FrmAxisMoveConfig_Shown(object sender, EventArgs e)
{
SetSkin(this);
}
}
}
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
this.Name = "FrmBase"; this.Name = "FrmBase";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "FrmBase"; this.Text = "FrmBase";
this.VisibleChanged += new System.EventHandler(this.FrmBase_VisibleChanged);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
......
...@@ -13,6 +13,17 @@ namespace OnlineStore.AutoInOutStore ...@@ -13,6 +13,17 @@ namespace OnlineStore.AutoInOutStore
{ {
public partial class FrmBase : Form public partial class FrmBase : Form
{ {
public string CurrLanguage = "";
public string ClassName
{
get
{
return this.GetType().Name;
}
set
{
}
}
public static string GetVersion() public static string GetVersion()
{ {
string str = ""; string str = "";
...@@ -50,5 +61,66 @@ namespace OnlineStore.AutoInOutStore ...@@ -50,5 +61,66 @@ namespace OnlineStore.AutoInOutStore
//skinEngine1.SkinFile = FormManager.SkinFileName; //skinEngine1.SkinFile = FormManager.SkinFileName;
//LogUtil.info("当前皮肤:" + skinEngine1.SkinFile); //LogUtil.info("当前皮肤:" + skinEngine1.SkinFile);
} }
public void LanguageProcess()
{
if (CurrLanguage.Equals(ResourceCulture.CurrLanguage))
{
return;
}
string className = this.ClassName;
CurrLanguage = ResourceCulture.CurrLanguage;
this.Text = ResourceCulture.GetString(ResourceCulture.GetTextIdStr(className), this.Text);
foreach (Control con in this.Controls)
{
if (con is Label || con is Button || con is RadioButton || con is CheckBox)
{
string newStr = ResourceCulture.GetString(ResourceCulture.GetTextIdStr(className, con.Name), con.Text);
con.Text = newStr;
con.Tag = newStr;
}
else if (con.Controls.Count > 0)
{
PreControlLanaguage(con);
}
}
if (this is FrmStoreBox)
{
((FrmStoreBox)this).processMenu();
}
}
private void PreControlLanaguage(Control partentControl)
{
if (partentControl is UserFromControl.IOTextControl && this is FrmIOStatus)
{
return;
}
string className = this.ClassName;
partentControl.Text = ResourceCulture.GetString(ResourceCulture.GetTextIdStr(className, partentControl.Name), partentControl.Text);
foreach (Control con in partentControl.Controls)
{
if (con is Label || con is Button || con is RadioButton || con is CheckBox)
{
string newStr = ResourceCulture.GetString(ResourceCulture.GetTextIdStr(className, con.Name), con.Text);
con.Text = newStr;
}
else if (con.Controls.Count > 0)
{
PreControlLanaguage(con);
}
}
}
private void FrmBase_VisibleChanged(object sender, EventArgs e)
{
if (this.Visible.Equals(true))
{
LanguageProcess();
}
}
} }
} }
...@@ -51,7 +51,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -51,7 +51,7 @@ namespace OnlineStore.AutoInOutStore
{ {
this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 28)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 28));
IOTextControl control = new IOTextControl(); IOTextControl control = new IOTextControl();
control.IOName = ioValue.ElectricalDefinition + "_" + ioValue.Explain; control.IOName = ioValue.ElectricalDefinition + "_" + ResourceCulture.GetString(ioValue.ElectricalDefinition, ioValue.Explain);
control.IOValue = 0; control.IOValue = 0;
control.isCanClick = false; control.isCanClick = false;
control.Name = "IO_" + ioValue.ProName; control.Name = "IO_" + ioValue.ProName;
...@@ -69,7 +69,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -69,7 +69,7 @@ namespace OnlineStore.AutoInOutStore
{ {
this.tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Absolute, 28)); this.tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Absolute, 28));
IOTextControl control = new IOTextControl(); IOTextControl control = new IOTextControl();
control.IOName = ioValue.ElectricalDefinition + "_" + ioValue.Explain; control.IOName = ioValue.ElectricalDefinition + "_" + ResourceCulture.GetString(ioValue.ElectricalDefinition, ioValue.Explain);
control.IOValue = 0; control.IOValue = 0;
control.isCanClick = true; control.isCanClick = true;
//control.Location = new System.Drawing.Point(0, 25*roleindex); //control.Location = new System.Drawing.Point(0, 25*roleindex);
...@@ -104,7 +104,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -104,7 +104,7 @@ namespace OnlineStore.AutoInOutStore
} }
catch (Exception ex) catch (Exception ex)
{ {
MessageBox.Show(ex.StackTrace, "Exception(异常)", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show(ex.StackTrace, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
LogUtil.error(LOGGER, ex.StackTrace); LogUtil.error(LOGGER, ex.StackTrace);
} }
} }
...@@ -307,7 +307,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -307,7 +307,7 @@ namespace OnlineStore.AutoInOutStore
} }
else else
{ {
MessageBox.Show("忙碌中,无法打开门锁"); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.CnotOpen,"忙碌中,无法打开门锁"));
} }
} }
private void btnDClose_Click(object sender, EventArgs e) private void btnDClose_Click(object sender, EventArgs e)
......
namespace OnlineStore.ACSingleStore
{
partial class FrmLogin
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmLogin));
this.panel1 = new System.Windows.Forms.Panel();
this.txtPwd = new System.Windows.Forms.TextBox();
this.txtUserName = new System.Windows.Forms.TextBox();
this.btnCancel = new System.Windows.Forms.Button();
this.btnLogin = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.Anchor = System.Windows.Forms.AnchorStyles.None;
this.panel1.Controls.Add(this.txtPwd);
this.panel1.Controls.Add(this.txtUserName);
this.panel1.Controls.Add(this.btnCancel);
this.panel1.Controls.Add(this.btnLogin);
this.panel1.Controls.Add(this.label2);
this.panel1.Controls.Add(this.label1);
this.panel1.Location = new System.Drawing.Point(229, 88);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(330, 230);
this.panel1.TabIndex = 0;
//
// txtPwd
//
this.txtPwd.Anchor = System.Windows.Forms.AnchorStyles.None;
this.txtPwd.Location = new System.Drawing.Point(145, 78);
this.txtPwd.MaxLength = 100;
this.txtPwd.Name = "txtPwd";
this.txtPwd.PasswordChar = '*';
this.txtPwd.Size = new System.Drawing.Size(100, 26);
this.txtPwd.TabIndex = 5;
//
// txtUserName
//
this.txtUserName.Anchor = System.Windows.Forms.AnchorStyles.None;
this.txtUserName.Location = new System.Drawing.Point(145, 32);
this.txtUserName.MaxLength = 100;
this.txtUserName.Name = "txtUserName";
this.txtUserName.Size = new System.Drawing.Size(100, 26);
this.txtUserName.TabIndex = 4;
//
// btnCancel
//
this.btnCancel.Anchor = System.Windows.Forms.AnchorStyles.None;
this.btnCancel.Location = new System.Drawing.Point(170, 148);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(84, 33);
this.btnCancel.TabIndex = 3;
this.btnCancel.Text = "取消(&C)";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnLogin
//
this.btnLogin.Anchor = System.Windows.Forms.AnchorStyles.None;
this.btnLogin.Location = new System.Drawing.Point(72, 148);
this.btnLogin.Name = "btnLogin";
this.btnLogin.Size = new System.Drawing.Size(84, 33);
this.btnLogin.TabIndex = 2;
this.btnLogin.Text = "登录(&L)";
this.btnLogin.UseVisualStyleBackColor = true;
this.btnLogin.Click += new System.EventHandler(this.btnLogin_Click);
//
// label2
//
this.label2.Anchor = System.Windows.Forms.AnchorStyles.None;
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(84, 78);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(51, 20);
this.label2.TabIndex = 1;
this.label2.Text = "密码:";
//
// label1
//
this.label1.Anchor = System.Windows.Forms.AnchorStyles.None;
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(72, 41);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(65, 20);
this.label1.TabIndex = 0;
this.label1.Text = "用户名:";
//
// FrmLogin
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(793, 397);
this.Controls.Add(this.panel1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmLogin";
this.Text = "FrmLogin";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Load += new System.EventHandler(this.FrmLogin_Load);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.TextBox txtPwd;
private System.Windows.Forms.TextBox txtUserName;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnLogin;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
}
}
\ No newline at end of file \ No newline at end of file
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace OnlineStore.ACSingleStore
{
public partial class FrmLogin : FrmBase
{
private string UserName = "admin".ToUpper();
private string UserPwd = "123456".ToUpper();
public FrmLogin()
{
string aa = ConfigAppSettings.GetValue(Setting_Init.UserName);
string ww = ConfigAppSettings.GetValue(Setting_Init.UserPwd);
if (!aa.Equals(""))
{
UserName = aa.ToUpper();
}
if (!ww.Equals(""))
{
UserPwd = ww;
}
InitializeComponent();
}
private void btnLogin_Click(object sender, EventArgs e)
{
string userName = txtUserName.Text.Trim();
string pwd = txtPwd.Text.Trim();
if (userName.ToUpper().Equals(UserName) && UserPwd.Equals(pwd))
{
FrmStoreBox lineStore = new FrmStoreBox();
this.Hide();
lineStore.ShowDialog();
this.Close();
}
else
{
if (!(userName.ToUpper().Equals(UserName)))
{
MessageBox.Show("请输入正确的用户名!");
txtUserName.Text = "";
txtUserName.Focus();
}
else
{
MessageBox.Show("请输入正确的密码!");
txtPwd.Focus();
txtPwd.Text = "";
}
}
}
private void FrmLogin_Load(object sender, EventArgs e)
{
this.AcceptButton = btnLogin;
string title = OnlineStore.Common.ConfigAppSettings.GetValue(Setting_Init.App_Title);
this.Text = title;
txtUserName.Focus();
int sizeH = this.Size.Height;
int sizeW = this.Size.Width;
int locationH=((sizeH-panel1.Size.Height)/2);
int locationW = (sizeH - panel1.Size.Width) / 2;
panel1.Size = new Size(locationW, locationH);
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
...@@ -63,7 +63,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -63,7 +63,7 @@ namespace OnlineStore.AutoInOutStore
else else
{ {
// this.DialogResult = DialogResult.No; // this.DialogResult = DialogResult.No;
MessageBox.Show("请输入正确的密码"); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.PWPwd,"请输入正确的密码"));
txtPwd.Focus(); txtPwd.Focus();
} }
} }
......
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file
...@@ -86,5 +86,6 @@ namespace OnlineStore.Common ...@@ -86,5 +86,6 @@ namespace OnlineStore.Common
/// 伺服波特率,默认9600 /// 伺服波特率,默认9600
/// </summary> /// </summary>
public static string ACBaudRate = "ACBaudRate"; public static string ACBaudRate = "ACBaudRate";
public static string Default_Language = "Default_Language";
} }
} }
...@@ -207,5 +207,10 @@ namespace OnlineStore.Common ...@@ -207,5 +207,10 @@ namespace OnlineStore.Common
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public static void SaveValue(object default_Language, string str)
{
throw new NotImplementedException();
}
} }
} }
...@@ -68,6 +68,7 @@ ...@@ -68,6 +68,7 @@
<Compile Include="PanasonicServo\ACServerManager.cs" /> <Compile Include="PanasonicServo\ACServerManager.cs" />
<Compile Include="PanasonicServo\ACServerManager_Partial.cs" /> <Compile Include="PanasonicServo\ACServerManager_Partial.cs" />
<Compile Include="PanasonicServo\BatchAxisController.cs" /> <Compile Include="PanasonicServo\BatchAxisController.cs" />
<Compile Include="ResourceControl.cs" />
<Compile Include="ShuoKe\MeteringSignalBean.cs" /> <Compile Include="ShuoKe\MeteringSignalBean.cs" />
<Compile Include="ShuoKe\ShuoKeController.cs" /> <Compile Include="ShuoKe\ShuoKeController.cs" />
<Compile Include="store\LineMoveP.cs" /> <Compile Include="store\LineMoveP.cs" />
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OnlineStore.DeviceLibrary
{
public class ResourceControl
{
public delegate string GetStrDelegate(string id, string defaultStr);
public static event GetStrDelegate GetStrEvent;
public delegate string GetStringDelegate(string id, string defaultStr, params object[] param);
public static event GetStringDelegate GetStringEvent;
public static string GetString(string id, string defaultStr)
{
string result = GetStrEvent?.Invoke(id, defaultStr);
return result;
}
public static string GetString(string id, string defaultStr, params object[] param)
{
string result = GetStringEvent?.Invoke(id, defaultStr, param);
return result;
}
/// <summary>
/// AutoOut 自动出库:
/// </summary>
public static string AutoOut = "AutoOut";
/// <summary>
/// AutoIn 自动入库:
/// </summary>
public static string AutoIn = "AutoIn";
/// <summary>
/// AutoEnd 自动出入库结束
/// </summary>
public static string AutoEnd = "AutoEnd";
/// <summary>
///"运行中"
/// </summary>
public static string Run = "Run";
/// <summary>
///"忙碌"
/// </summary>
public static string Busy = "Busy";
/// <summary>
///"原点返回"
/// </summary>
public static string HomeMove = "HomeMove";
/// <summary>
///"重置"
/// </summary>
public static string Reset = "Reset";
/// <summary>
///"运行中"
/// </summary>
public static string Runing = "Runing";
/// <summary>
///"等待启动"
/// </summary>
public static string Wait = "Wait";
/// <summary>
///"设备调试中"
/// </summary>
public static string Debugging = "Debugging";
/// <summary>
///"料盘入仓位完成"
/// </summary>
public static string InStoreEnd = "InStoreEnd";
/// <summary>
///"入库执行中"
/// </summary>
public static string InStoreExecute = "InStoreExecute";
/// <summary>
///"故障中"
/// </summary>
public static string InTrouble = "InTrouble";
/// <summary>
///"料盘出仓位完成"
/// </summary>
public static string OutStoreBoxEnd = "OutStoreBoxEnd";
/// <summary>
///"出库执行中"
/// </summary>
public static string OutStoreExecute = "OutStoreExecute";
/// <summary>
///"设备联机"
/// </summary>
public static string StoreOnline = "StoreOnline";
/// <summary>
///"急停中"
/// </summary>
public static string SuddenStop = "SuddenStop";
/// <summary>
///"出库完成"
/// </summary>
public static string OutMoveExecute = "OutMoveExecute";
/// <summary>
///"入库失败"
/// </summary>
public static string InStoreFailed = "InStoreFailed";
/// <summary>
///"出库失败"
/// </summary>
public static string OutStoreFailed = "OutStoreFailed";
/// <summary>
///"等待信号"
/// </summary>
public static string WaitSingle = "WaitSingle";
/// <summary>
///"超时"
/// </summary>
public static string TimeOut = "TimeOut";
/// <summary>
///"收到急停信号,报警急停"
/// </summary>
public static string inSuddenStop = "inSuddenStop";
/// <summary>
///"进出轴报警!复位失败,请检查"
/// </summary>
public static string InoutAlarm = "InoutAlarm";
/// <summary>
///"打开"
/// </summary>
public static string Open = "Open";
/// <summary>
///"失败"
/// </summary>
public static string Fail = "Fail";
/// <summary>
///"收到复位信号,自动复位"
/// </summary>
public static string AutoReset = "AutoReset";
/// <summary>
///"运动轴"
/// </summary>
public static string MoveAxis = "MoveAxis";
/// <summary>
///"报警"
/// </summary>
public static string Alarm = "Alarm";
/// <summary>
///"入库库位格式错误:"
/// </summary>
public static string InStoreError = "InStoreError";
/// <summary>
///"入库未找到库位:"
/// </summary>
public static string InStoreNoPosition = "InStoreNoPosition";
/// <summary>
///"出库格式错误:"
/// </summary>
public static string OutStoreError = "OutStoreError";
/// <summary>
///"出库未找库位:"
/// </summary>
public static string OutStoreNoPosition = "OutStoreNoPosition";
/// <summary>
///"绝对运动:"
/// </summary>
public static string AbsMove = "AbsMove";
/// <summary>
///"IO信号等待:"
/// </summary>
public static string WaitIo = "WaitIo";
/// <summary>
///"时间等待:"
/// </summary>
public static string WaitTime = "WaitTime";
/// <summary>
///"电钢目标位置:"
/// </summary>
public static string TargetPosition = "TargetPosition";
/// <summary>
/// 此设备不支持单个入库
/// </summary>
public static string CanotSingleInStore = "CanotSingleInStore";
/// <summary>
///叉子不在待机位,请先将叉子退回待机位
/// </summary>
public static string InoutNotOk = "InoutNotOk";
/// <summary>
///警告(叉子在待机位时,才能移动升降轴和旋转轴)
/// </summary>
public static string InoutWarn = "InoutWarn";
/// <summary>
///无报警,无出入库或者重置操作时,才可以回待机点
/// </summary>
public static string CanotBack = "CanotBack";
/// <summary>
///请先关闭批量上下料门
/// </summary>
public static string PCloseDoor = "PCloseDoor";
/// <summary>
///请输入正确的密码
/// </summary>
public static string PWPwd = "PWPwd";
/// <summary>
///忙碌中,无法打开门锁
/// </summary>
public static string CnotOpen = "CnotOpen";
/// <summary>
///批量入库失败:请先关闭上料机构
/// </summary>
public static string batchInError = "batchInError";
/// <summary>
///批量入库失败:叉子料盘检测有料,请检查后再入库
/// </summary>
public static string batchInError2 = "batchInError2";
/// <summary>
///取出料盘失败:无料盘可取
/// </summary>
public static string GetError = "GetError";
/// <summary>
///取出料盘失败:忙碌中,无法打开门锁
/// </summary>
public static string GetError2 = "GetError2";
/// <summary>
///锁门失败:请先关闭上料机构
/// </summary>
public static string CloseError = "CloseError";
/// <summary>
///已确认料盘已手动拿出
/// </summary>
public static string TakeTrayOut = "TakeTrayOut";
/// <summary>
///未检测到气压信号
/// </summary>
public static string NoAIr = "NoAIr";
/// <summary>
///料盘高度
/// </summary>
public static string trayHeight = "trayHeight";
/// <summary>
///负限位
/// </summary>
public static string FuLimit = "FuLimit";
/// <summary>
///正限位
/// </summary>
public static string ZhLimit = "ZhLimit";
/// <summary>
///上料轴运动停止
/// </summary>
public static string BatchStop = "BatchStop";
/// <summary>
///扫码结束
/// </summary>
public static string ScanOk = "ScanOk";
/// <summary>
///操作人员拿走料盘
/// </summary>
public static string TakeTrayGo = "TakeTrayGo";
/// <summary>
///等待送料结束
/// </summary>
public static string WaitEnd = "WaitEnd";
/// <summary>
///吸盘吸料失败
/// </summary>
public static string XiLiaoError = "XiLiaoError";
/// <summary>
///伺服OFF
/// </summary>
public static string ServoOff = "ServoOff";
/// <summary>
///伺服ON
/// </summary>
public static string servoON = "servoON";
/// <summary>
///仓门状态未知
/// </summary>
public static string NoDoorStatus = "NoDoorStatus";
/// <summary>
///批量出入库信息: 入库:
/// </summary>
public static string InstoreInfo = "InstoreInfo";
/// <summary>
///出库
/// </summary>
public static string oustore = "oustore";
/// <summary>
///门锁关闭
/// </summary>
public static string doorClose = "doorClose";
/// <summary>
///门锁打开
/// </summary>
public static string doorOpen = "doorOpen";
}
}
...@@ -104,7 +104,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -104,7 +104,7 @@ namespace OnlineStore.DeviceLibrary
{ {
isInSuddenDown = true; isInSuddenDown = true;
LogUtil.error(LOGGER, StoreName + "收到急停信号,报警急停"); LogUtil.error(LOGGER, StoreName + "收到急停信号,报警急停");
WarnMsg = StoreName + "收到急停信号,报警急停"; WarnMsg = StoreName + ResourceControl.GetString(ResourceControl.inSuddenStop, "收到急停信号,报警急停");
//报警时会关闭所有轴 //报警时会关闭所有轴
Alarm(StoreAlarmType.SuddenStop, "1", WarnMsg, StoreMoveType.None); Alarm(StoreAlarmType.SuddenStop, "1", WarnMsg, StoreMoveType.None);
...@@ -139,7 +139,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -139,7 +139,7 @@ namespace OnlineStore.DeviceLibrary
TimeSpan span = DateTime.Now - lastAirCloseTime; TimeSpan span = DateTime.Now - lastAirCloseTime;
if (span.TotalSeconds > Config.AirCheckSeconds) if (span.TotalSeconds > Config.AirCheckSeconds)
{ {
WarnMsg = "未检测到气压信号"; WarnMsg =ResourceControl.GetString(ResourceControl.NoAIr, "未检测到气压信号");
preAirValue = IO_VALUE.LOW; preAirValue = IO_VALUE.LOW;
LogUtil.info("已持续【" + FormUtil.GetSpanStr(span) + "】未检测到气压信号,报警"); LogUtil.info("已持续【" + FormUtil.GetSpanStr(span) + "】未检测到气压信号,报警");
Alarm(StoreAlarmType.NoAirCheck, "2", WarnMsg, StoreMoveType.None); Alarm(StoreAlarmType.NoAirCheck, "2", WarnMsg, StoreMoveType.None);
...@@ -555,7 +555,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -555,7 +555,7 @@ namespace OnlineStore.DeviceLibrary
//如果此时轴三还在报警,需要提示错误并等待 //如果此时轴三还在报警,需要提示错误并等待
if (ACServerManager.GetAlarmStatus(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue()) > 0) if (ACServerManager.GetAlarmStatus(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue()) > 0)
{ {
WarnMsg = "进出轴报警!复位失败,请检查!"; WarnMsg = ResourceControl.GetString(ResourceControl.InoutAlarm, "进出轴报警!复位失败,请检查!");
LogUtil.error(LOGGER, "进出轴报警!复位失败,请检查!"); LogUtil.error(LOGGER, "进出轴报警!复位失败,请检查!");
} }
//复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴 //复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
...@@ -978,7 +978,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -978,7 +978,8 @@ namespace OnlineStore.DeviceLibrary
{ {
//收到复位信号 //收到复位信号
LogUtil.info(LOGGER, "收到复位信号,自动复位"); LogUtil.info(LOGGER, "收到复位信号,自动复位");
WarnMsg = "收到复位信号,自动复位";
WarnMsg = ResourceControl.GetString(ResourceControl.AutoReset, "收到复位信号,自动复位");
Reset(); Reset();
} }
} }
...@@ -1180,14 +1181,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -1180,14 +1181,14 @@ namespace OnlineStore.DeviceLibrary
{ {
if (Config.Batch_Axis.IsSameAxis(axisInfo.DeviceName,axisInfo.GetAxisValue()) ) if (Config.Batch_Axis.IsSameAxis(axisInfo.DeviceName,axisInfo.GetAxisValue()) )
{ {
AutomaticBaiting.WarnMsg = " 运动轴" + axisInfo.Explain + "报警"; AutomaticBaiting.WarnMsg = ResourceControl.GetString(ResourceControl.MoveAxis, " 运动轴") + axisInfo.Explain + ResourceControl.GetString(ResourceControl.Alarm, "报警");
info.AlarmIoValue = alarmIo; info.AlarmIoValue = alarmIo;
Alarm(StoreAlarmType.BatchAxisAlarm, GetAlarmCodeByAxis(axisInfo).ToString(), WarnMsg, StoreMoveType.None); Alarm(StoreAlarmType.BatchAxisAlarm, GetAlarmCodeByAxis(axisInfo).ToString(), WarnMsg, StoreMoveType.None);
} }
else else
{ {
WarnMsg = StoreName + " 运动轴" + axisInfo.Explain + "报警"; WarnMsg = StoreName + ResourceControl.GetString(ResourceControl.MoveAxis, " 运动轴") + axisInfo.Explain + ResourceControl.GetString(ResourceControl.Alarm, "报警");
info.AlarmIoValue = alarmIo; info.AlarmIoValue = alarmIo;
Alarm(StoreAlarmType.AxisAlarm, GetAlarmCodeByAxis(axisInfo).ToString(), WarnMsg, StoreMoveType.None); Alarm(StoreAlarmType.AxisAlarm, GetAlarmCodeByAxis(axisInfo).ToString(), WarnMsg, StoreMoveType.None);
} }
...@@ -1623,7 +1624,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1623,7 +1624,7 @@ namespace OnlineStore.DeviceLibrary
string[] posArray = posId.Split('#'); string[] posArray = posId.Split('#');
if (posArray.Length != 2) if (posArray.Length != 2)
{ {
WarnMsg = StoreName + "出库格式错误:库位号【" + posId + "】"; WarnMsg = StoreName + ResourceControl.GetString(ResourceControl.OutStoreError, "出库格式错误:") + "【" + posId + "】";
LogUtil.error(LOGGER, "收到服务器出库命令:库位号【" + posId + "】格式错误"); LogUtil.error(LOGGER, "收到服务器出库命令:库位号【" + posId + "】格式错误");
continue; continue;
} }
...@@ -1634,7 +1635,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1634,7 +1635,7 @@ namespace OnlineStore.DeviceLibrary
if (position == null) if (position == null)
{ {
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因 //出入库没有找到服务器发送的库位,需要打印日志方便查询原因
WarnMsg = StoreName + "出库未找库位:【" + posId + "】"; WarnMsg = StoreName + ResourceControl.GetString(ResourceControl.OutStoreNoPosition, "出库未找库位:") + "【" + posId + "】";
LogUtil.error(LOGGER, "收到服务器出库命令:未找到【" + posId + "】的库位信息"); LogUtil.error(LOGGER, "收到服务器出库命令:未找到【" + posId + "】的库位信息");
continue; continue;
} }
......
...@@ -159,9 +159,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -159,9 +159,9 @@ namespace OnlineStore.DeviceLibrary
if ((!wait.IsEnd) && span.TotalMilliseconds > timeOutMs) if ((!wait.IsEnd) && span.TotalMilliseconds > timeOutMs)
{ {
ConfigIO io = Config.getWaitIO(wait.IoType); ConfigIO io = Config.getWaitIO(wait.IoType);
WarnMsg = StoreName + " 等待" + io.DisplayStr + "=" + wait.IoValue + "超时"; WarnMsg = StoreName + ResourceControl.GetString(ResourceControl.WaitSingle, " 等待信号") + io.DisplayStr + "=" + wait.IoValue + ResourceControl.GetString(ResourceControl.TimeOut, "超时!");
Alarm(StoreAlarmType.IoSingleTimeOut, io.ElectricalDefinition, WarnMsg, StoreMove.MoveType); Alarm(StoreAlarmType.IoSingleTimeOut, io.ElectricalDefinition, WarnMsg, StoreMove.MoveType);
LogUtil.error(StoreName + wait.IoType + "等待信号(" + io.DisplayStr + "=" + wait.IoValue + ") 超时", 14); LogUtil.error( StoreName + wait.IoType + ResourceControl.GetString(ResourceControl.WaitSingle, " 等待信号") + "(" + io.DisplayStr + "=" + wait.IoValue + ") " + ResourceControl.GetString(ResourceControl.TimeOut, "超时"), 14);
isOk = false; isOk = false;
break; break;
} }
...@@ -230,7 +230,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -230,7 +230,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (span.TotalSeconds > StoreMove.TimeOutSeconds) else if (span.TotalSeconds > StoreMove.TimeOutSeconds)
{ {
WarnMsg = "[" + StoreMove.MoveStep + "]等待[" + NotOkMsg + "]超时[" + Math.Round(span.TotalSeconds, 1) + "]秒"; WarnMsg = "[" + StoreMove.MoveStep + "]"+ResourceControl.GetString(ResourceControl.TimeOut, "超时" )+"[" + NotOkMsg + "][" + Math.Round(span.TotalSeconds, 1) + "]";
LogUtil.error(WarnMsg, 15); LogUtil.error(WarnMsg, 15);
Alarm(StoreAlarmType.IoSingleTimeOut, "", WarnMsg, StoreMove.MoveType); Alarm(StoreAlarmType.IoSingleTimeOut, "", WarnMsg, StoreMove.MoveType);
} }
......
...@@ -312,8 +312,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -312,8 +312,8 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
//TODO 报警 //TODO 报警
WarnMsg = "吸盘吸料失败,请复位后拿出此料盘"; WarnMsg = ResourceControl.GetString(ResourceControl.XiLiaoError,"吸盘吸料失败");
StoreManager.Store.Alarm(StoreAlarmType.BatchAlarm, "吸盘吸料失败", WarnMsg, StoreMoveType.InStore); StoreManager.Store.Alarm(StoreAlarmType.BatchAlarm, ResourceControl.GetString(ResourceControl.XiLiaoError, "吸盘吸料失败"), WarnMsg, StoreMoveType.InStore);
LogUtil.error(WarnMsg, 103); LogUtil.error(WarnMsg, 103);
} }
} }
...@@ -327,8 +327,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -327,8 +327,8 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
WarnMsg = "吸盘吸料失败,请复位后拿出此料盘"; WarnMsg = ResourceControl.GetString(ResourceControl.XiLiaoError, "吸盘吸料失败");
StoreManager.Store.Alarm(StoreAlarmType.BatchAlarm, "吸盘吸料失败", WarnMsg, StoreMoveType.InStore); StoreManager.Store.Alarm(StoreAlarmType.BatchAlarm, ResourceControl.GetString(ResourceControl.XiLiaoError, "吸盘吸料失败"), WarnMsg, StoreMoveType.InStore);
LogUtil.error(Name + "入料: 吸盘上升后未检测到吸盘压力信号,吸取料盘失败",105); LogUtil.error(Name + "入料: 吸盘上升后未检测到吸盘压力信号,吸取料盘失败",105);
} }
} }
......
...@@ -169,7 +169,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -169,7 +169,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (span.TotalSeconds > StoreMove.TimeOutSeconds) else if (span.TotalSeconds > StoreMove.TimeOutSeconds)
{ {
WarnMsg = "[" + StoreMove.MoveStep + "]等待[" + NotOkMsg + "]超时[" + Math.Round(span.TotalSeconds, 0) + "秒]"; WarnMsg = "[" + StoreMove.MoveStep + "]" + ResourceControl.GetString(ResourceControl.TimeOut, "超时") + " [" + NotOkMsg + "][" + Math.Round(span.TotalSeconds, 0) + "秒]";
LogUtil.error(WarnMsg,102); LogUtil.error(WarnMsg,102);
StoreManager.Store.Alarm(StoreAlarmType.BatchIoTimeOut, "", WarnMsg, StoreMove.MoveType); StoreManager.Store.Alarm(StoreAlarmType.BatchIoTimeOut, "", WarnMsg, StoreMove.MoveType);
} }
...@@ -408,7 +408,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -408,7 +408,7 @@ namespace OnlineStore.DeviceLibrary
string[] posArray = posId.Split('#'); string[] posArray = posId.Split('#');
if (!(posArray.Length == 2)) if (!(posArray.Length == 2))
{ {
WarnMsg = Name + "入库库位格式错误:二维码【" + message + "】库位【" + posId + "】"; WarnMsg = Name+ ResourceControl.GetString(ResourceControl.InStoreError, "入库库位格式错误:") + "【" + message + "】【" + posId + "】";
LogUtil.error("服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】"); LogUtil.error("服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
LogUtil.info("服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】"); LogUtil.info("服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
return; return;
...@@ -419,7 +419,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -419,7 +419,7 @@ namespace OnlineStore.DeviceLibrary
AutoStorePosition position = CSVPositionReader<AutoStorePosition>.GetPositon(posId); AutoStorePosition position = CSVPositionReader<AutoStorePosition>.GetPositon(posId);
if (position == null) if (position == null)
{ //出入库没有找到服务器发送的库位,需要打印日志方便查询原因 { //出入库没有找到服务器发送的库位,需要打印日志方便查询原因
WarnMsg = "入库未找到库位:二维码【" + message + "】库位【" + posId + "】 "; WarnMsg = ResourceControl.GetString(ResourceControl.InStoreNoPosition, "入库未找到库位:") + "【" + message + "】【" + posId + "】 ";
LogUtil.error("收到服务器入库命令:入库未找到库位:二维码【" + message + "】库位【" + posId + "】"); LogUtil.error("收到服务器入库命令:入库未找到库位:二维码【" + message + "】库位【" + posId + "】");
return; return;
} }
...@@ -461,11 +461,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -461,11 +461,11 @@ namespace OnlineStore.DeviceLibrary
map.Add(ParamDefine.confirmReelOut, ParamDefine.disable); map.Add(ParamDefine.confirmReelOut, ParamDefine.disable);
if (AutomaticBaiting.DoorStatus.Equals(2)) if (AutomaticBaiting.DoorStatus.Equals(2))
{ {
map.Add(ParamDefine.doorStatus, "门锁关闭"); map.Add(ParamDefine.doorStatus, ResourceControl.GetString(ResourceControl.doorClose,"门锁关闭"));
} }
else else
{ {
map.Add(ParamDefine.doorStatus, "门锁打开"); map.Add(ParamDefine.doorStatus, ResourceControl.GetString(ResourceControl.doorOpen,"门锁打开"));
} }
...@@ -505,19 +505,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -505,19 +505,19 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
return "忙碌中,无法打开门锁"; return ResourceControl.GetString(ResourceControl.CnotOpen,"忙碌中,无法打开门锁");
} }
} }
public static string doStartBatchIn() public static string doStartBatchIn()
{ {
if (!AutomaticBaiting.DoorIsClose()) if (!AutomaticBaiting.DoorIsClose())
{ {
return "批量入库失败:请先关闭上料机构"; return ResourceControl.GetString(ResourceControl.batchInError,"批量入库失败:请先关闭上料机构");
} }
if (KND.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH)) if (KND.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{ {
return "批量入库失败:叉子料盘检测有料,请检查后再入库"; return ResourceControl.GetString(ResourceControl.batchInError2,"批量入库失败:叉子料盘检测有料,请检查后再入库");
} }
AutomaticBaiting.BatchDoorClose(false); AutomaticBaiting.BatchDoorClose(false);
...@@ -535,19 +535,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -535,19 +535,19 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
return ("取出料盘失败:无料盘可取"); return (ResourceControl.GetString(ResourceControl.GetError,"取出料盘失败:无料盘可取"));
} }
} }
else else
{ {
return ("取出料盘失败:忙碌中,无法打开门锁"); return (ResourceControl.GetString(ResourceControl.GetError2,"取出料盘失败:忙碌中,无法打开门锁"));
} }
} }
public static string doCloseDoor() public static string doCloseDoor()
{ {
if (!AutomaticBaiting.DoorIsClose()) if (!AutomaticBaiting.DoorIsClose())
{ {
return ("锁门失败:请先关闭上料机构"); return (ResourceControl.GetString(ResourceControl.CloseError,"锁门失败:请先关闭上料机构"));
} }
AutomaticBaiting.BatchDoorClose(false); AutomaticBaiting.BatchDoorClose(false);
AutomaticBaiting.Reset(false); AutomaticBaiting.Reset(false);
...@@ -555,7 +555,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -555,7 +555,7 @@ namespace OnlineStore.DeviceLibrary
} }
public static bool doConfirmReelGo() public static bool doConfirmReelGo()
{ {
LogUtil.info("已确认料盘已手动拿出"); LogUtil.info(ResourceControl.GetString(ResourceControl.TakeTrayOut,"已确认料盘已手动拿出"));
AutomaticBaiting.IsWaitTragGo = false; AutomaticBaiting.IsWaitTragGo = false;
AutomaticBaiting.IsGetTrayGo = true; AutomaticBaiting.IsGetTrayGo = true;
return true; return true;
......
...@@ -99,18 +99,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -99,18 +99,6 @@ namespace OnlineStore.DeviceLibrary
IoCheckTimer.Enabled = false; IoCheckTimer.Enabled = false;
//IoCheckTimer.Elapsed += IoCheckTimer_Elapsed; //IoCheckTimer.Elapsed += IoCheckTimer_Elapsed;
} }
//public StoreRunStatus storeRunStatus
//{
// get
// {
// return storerunstatus;
// }
// set
// {
// StoreRunStatus oldStatus = storerunstatus;
// storerunstatus = value;
// }
//}
/// <summary> /// <summary>
...@@ -132,24 +120,24 @@ namespace OnlineStore.DeviceLibrary ...@@ -132,24 +120,24 @@ namespace OnlineStore.DeviceLibrary
public string GetRunStr(StoreRunStatus runStatus, bool IsStore) public string GetRunStr(StoreRunStatus runStatus, bool IsStore)
{ {
string sta = "运行中"; string sta = ResourceControl.GetString(ResourceControl.Run, "运行中");
string aa = ""; string aa = "";
switch (runStatus) switch (runStatus)
{ {
case StoreRunStatus.Busy: case StoreRunStatus.Busy:
sta = "忙碌"; sta = ResourceControl.GetString(ResourceControl.Busy, "忙碌");
break; break;
case StoreRunStatus.HomeMoving: case StoreRunStatus.HomeMoving:
sta = "原点返回"; sta = ResourceControl.GetString(ResourceControl.HomeMove, "原点返回");
break; break;
case StoreRunStatus.Reset: case StoreRunStatus.Reset:
sta = "重置"; sta = ResourceControl.GetString(ResourceControl.Reset, "重置");
break; break;
case StoreRunStatus.Runing: case StoreRunStatus.Runing:
sta = "运行中"; sta = ResourceControl.GetString(ResourceControl.Runing, "运行中");
break; break;
case StoreRunStatus.Wait: case StoreRunStatus.Wait:
sta = "等待启动"; sta = ResourceControl.GetString(ResourceControl.Wait, "等待启动");
break; break;
} }
if (runStatus > StoreRunStatus.Wait) if (runStatus > StoreRunStatus.Wait)
...@@ -158,37 +146,37 @@ namespace OnlineStore.DeviceLibrary ...@@ -158,37 +146,37 @@ namespace OnlineStore.DeviceLibrary
switch (storeStatus) switch (storeStatus)
{ {
case StoreStatus.Debugging: case StoreStatus.Debugging:
aa = "设备调试中"; aa = ResourceControl.GetString(ResourceControl.Debugging, "设备调试中");
break; break;
case StoreStatus.InStoreEnd: case StoreStatus.InStoreEnd:
aa = "料盘入仓位完成"; aa = ResourceControl.GetString(ResourceControl.InStoreEnd, "料盘入仓位完成");
break; break;
case StoreStatus.InStoreExecute: case StoreStatus.InStoreExecute:
aa = "入库执行中"; aa = ResourceControl.GetString(ResourceControl.InStoreExecute, "入库执行中");
break; break;
case StoreStatus.InTrouble: case StoreStatus.InTrouble:
aa = "故障中"; aa = ResourceControl.GetString(ResourceControl.InTrouble, "故障中");
break; break;
case StoreStatus.OutStoreBoxEnd: case StoreStatus.OutStoreBoxEnd:
aa = "料盘出仓位完成"; aa = ResourceControl.GetString(ResourceControl.OutStoreBoxEnd, "料盘出仓位完成");
break; break;
case StoreStatus.OutStoreExecute: case StoreStatus.OutStoreExecute:
aa = "出库执行中"; aa = ResourceControl.GetString(ResourceControl.OutStoreExecute, "出库执行中");
break; break;
case StoreStatus.StoreOnline: case StoreStatus.StoreOnline:
aa = "设备联机"; aa = ResourceControl.GetString(ResourceControl.StoreOnline, "设备联机");
break; break;
case StoreStatus.SuddenStop: case StoreStatus.SuddenStop:
aa = "急停中"; aa = ResourceControl.GetString(ResourceControl.SuddenStop, "急停中");
break; break;
case StoreStatus.OutMoveExecute: case StoreStatus.OutMoveExecute:
aa = "出库完成"; aa = ResourceControl.GetString(ResourceControl.OutMoveExecute, "出库完成");
break; break;
case StoreStatus.InStoreFaild: case StoreStatus.InStoreFaild:
aa = "入库失败(" + WarnMsg + ")"; aa = ResourceControl.GetString(ResourceControl.InStoreFailed, "入库失败") + "(" + WarnMsg + ")";
break; break;
case StoreStatus.OutStoreFaild: case StoreStatus.OutStoreFaild:
aa = "出库失败(" + WarnMsg + ")"; aa = ResourceControl.GetString(ResourceControl.OutStoreFailed, "出库失败") + "(" + WarnMsg + ")";
break; break;
} }
if (!aa.Equals("")) if (!aa.Equals(""))
......
...@@ -320,61 +320,63 @@ namespace OnlineStore.DeviceLibrary ...@@ -320,61 +320,63 @@ namespace OnlineStore.DeviceLibrary
{ {
if (IsHomeMove) if (IsHomeMove)
{ {
return "轴【" + AxisInfo.DisplayStr + "】原点返回"; return "【" + AxisInfo.DisplayStr + "】" + ResourceControl.GetString(ResourceControl.HomeMove, "原点返回");
} }
else else
{ {
return "轴【" + AxisInfo.DisplayStr + "】绝对位置【" + TargetPosition + "】"; return "【" + AxisInfo.DisplayStr + "】" + ResourceControl.GetString(ResourceControl.AbsMove, "绝对运动") + "【" + TargetPosition + "】";
} }
} }
else if (WaitType == (int)Wait_Type.IOMove_2) else if (WaitType == 2)
{ {
return "IO信号等待【" + IoType + "】【" + IoValue + "】"; return ResourceControl.GetString(ResourceControl.WaitIo, "IO信号等待") + "【" + IoType + "】=【" + IoValue + "】";
} }
else if (WaitType == (int)Wait_Type.Time_3) else if (WaitType == 3)
{ {
return "时间【" + TimeMSeconds + "】毫秒"; return ResourceControl.GetString(ResourceControl.WaitTime, "时间等待:") + "【" + TimeMSeconds + "】";
} }
else if (WaitType == (int)Wait_Type.StellMove_4) else if (WaitType == (int)Wait_Type.StellMove_4)
{ {
return "电钢目标位置【" + TargetPosition + "】 "; return ResourceControl.GetString(ResourceControl.TargetPosition, "电钢目标位置:") + "【" + TargetPosition + "】 ";
} }
else if (WaitType == (int)Wait_Type.ShuoKe_5) else if (WaitType == (int)Wait_Type.ShuoKe_5)
{ {
return "步进电机位置【" + TargetPosition + "】 "; return ResourceControl.GetString(ResourceControl.TargetPosition, "电钢目标位置:") + "【" + TargetPosition + "】 ";
} }
else if (WaitType == (int)Wait_Type.AxisHomeSingle_6) else if (WaitType == (int)Wait_Type.AxisHomeSingle_6)
{ {
return "轴【" + AxisInfo.DisplayStr + "】原点【" + IoValue + "】 "; return "【" + AxisInfo.DisplayStr + "】ORG:【" + IoValue + "】 ";
} }
else if (WaitType == (int)Wait_Type.WaitHeight_7) else if (WaitType == (int)Wait_Type.WaitHeight_7)
{ {
return "料盘高度【" + HeightValue + "】 "; return ResourceControl.GetString(ResourceControl.trayHeight,"料盘高度")+"【" + HeightValue + "】 ";
} }
else if (WaitType == (int)Wait_Type.AxisLimitNegativeSingle_8) else if (WaitType == (int)Wait_Type.AxisLimitNegativeSingle_8)
{ {
return "轴【" + AxisInfo.DisplayStr + "】负限位【" + IoValue + "】 "; return "【" + AxisInfo.DisplayStr + "】"+ ResourceControl.GetString(ResourceControl.FuLimit, "负限位")+"【" + IoValue + "】 ";
} }
else if (WaitType == (int)Wait_Type.AxisLimitPositiveSingle_9) else if (WaitType == (int)Wait_Type.AxisLimitPositiveSingle_9)
{ {
return "轴【" + AxisInfo.DisplayStr + "】正限位【" + IoValue + "】 "; return "【" + AxisInfo.DisplayStr + "】" + ResourceControl.GetString(ResourceControl.ZhLimit, "正限位") + "【" + IoValue + "】 ";
} }
else if (WaitType == (int)Wait_Type.BatchAxisMove_10) else if (WaitType == (int)Wait_Type.BatchAxisMove_10)
{ {
return "上料轴运动停止 "; return ResourceControl.GetString(ResourceControl.BatchStop,"上料轴运动停止 ");
}else if (WaitType == (int)Wait_Type.ScanCode_11) }else if (WaitType == (int)Wait_Type.ScanCode_11)
{ {
return "扫码结束"; return ResourceControl.GetString(ResourceControl.ScanOk, "扫码结束");
}else if(WaitType == (int)Wait_Type.TakeTrayGo_12) }
else if(WaitType == (int)Wait_Type.TakeTrayGo_12)
{ {
return "操作人员拿走料盘"; return ResourceControl.GetString(ResourceControl.TakeTrayGo, "操作人员拿走料盘");
}else if (WaitType == (int)Wait_Type.StoreRuning_13) }
else if (WaitType == (int)Wait_Type.StoreRuning_13)
{ {
return "等待送料结束"; return ResourceControl.GetString(ResourceControl.WaitEnd, "等待送料结束");
} }
else else
{ {
return "Wait位置类型:WaitType=【" + WaitType + "】"; return "WaitType=【" + WaitType + "】";
} }
} }
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OnlineStore.LoadCSVLibrary
{
class CSVResourceControl
{
public delegate string GetStrDelegate(string id, string defaultStr);
public static event GetStrDelegate GetStrEvent;
public delegate string GetStringDelegate(string id, string defaultStr, params object[] param);
public static event GetStringDelegate GetStringEvent;
public static string GetString(string id, string defaultStr)
{
string result = GetStrEvent?.Invoke(id, defaultStr);
return result;
}
public static string GetString(string id, string defaultStr, params object[] param)
{
string result = GetStringEvent?.Invoke(id, defaultStr, param);
return result;
}
}
}
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="CSVExection.cs" /> <Compile Include="CSVExection.cs" />
<Compile Include="CSVResourceControl.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" />
......
...@@ -152,7 +152,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -152,7 +152,7 @@ namespace OnlineStore.LoadCSVLibrary
public string DisplayStr public string DisplayStr
{ {
get { get {
return Explain + "(" + ProName + ")"; return CSVResourceControl.GetString(ProName, Explain) + "(" + ProName + ")";
} }
set set
{ {
...@@ -248,7 +248,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -248,7 +248,7 @@ namespace OnlineStore.LoadCSVLibrary
{ {
get get
{ {
return ElectricalDefinition + "_" + Explain + "(" + ProName+")"; return ElectricalDefinition + "_" + CSVResourceControl.GetString(ElectricalDefinition, Explain) + "(" + ProName + ")";
} }
set set
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!