Commit 4fe808a8 LN

1

1 个父辈 1cbf2cc2
正在显示 85 个修改的文件 包含 224 行增加65 行删除
...@@ -51,7 +51,7 @@ namespace OnlineStore.ACSingleStore ...@@ -51,7 +51,7 @@ namespace OnlineStore.ACSingleStore
{ {
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.ACSingleStore ...@@ -69,7 +69,7 @@ namespace OnlineStore.ACSingleStore
{ {
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);
......
...@@ -163,6 +163,17 @@ namespace OnlineStore.ACSingleStore ...@@ -163,6 +163,17 @@ namespace OnlineStore.ACSingleStore
groupCode.Visible = false; groupCode.Visible = false;
} }
private string WaitStart = ResourceCulture.GetString("等待启动");
private string dooropen = ResourceCulture.GetString("前门未关");
private string HasWare = ResourceCulture.GetString("叉子料盘检测有料,请检查");
private string StartAuto = ResourceCulture.GetString("开始自动出入库");
private string StopAuto = ResourceCulture.GetString("停止自动出入库");
private string AutoOut = ResourceCulture.GetString("自动出库:");
private string AutoIn = ResourceCulture.GetString("自动入库:");
public static string cannotMove = ResourceCulture.GetString("定位气缸不在下降端,不能移动进出轴");
public static string warn = ResourceCulture.GetString("警告");
private string StartCycle = ResourceCulture.GetString("开始循环出库");
private string StopCycle = ResourceCulture.GetString("停止循环出库");
private DateTime preReadModblsTime = DateTime.Now; private DateTime preReadModblsTime = DateTime.Now;
private void timer1_Tick(object sender, EventArgs e) private void timer1_Tick(object sender, EventArgs e)
{ {
...@@ -228,7 +239,7 @@ namespace OnlineStore.ACSingleStore ...@@ -228,7 +239,7 @@ namespace OnlineStore.ACSingleStore
//如果不在出入库中,且叉子上有信号,需要提示检查叉子 //如果不在出入库中,且叉子上有信号,需要提示检查叉子
if (store.storeRunStatus.Equals(StoreRunStatus.Runing) && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH)) if (store.storeRunStatus.Equals(StoreRunStatus.Runing) && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{ {
lblWarnMsg.Text = lblWarnMsg.Text + " 叉子料盘检测有料,请检查"; lblWarnMsg.Text = lblWarnMsg.Text + " "+ HasWare;
} }
if (store.TempOrHumidityIsAlarm) if (store.TempOrHumidityIsAlarm)
{ {
...@@ -238,14 +249,14 @@ namespace OnlineStore.ACSingleStore ...@@ -238,14 +249,14 @@ namespace OnlineStore.ACSingleStore
{ {
string msg = store.autoMsg; string msg = store.autoMsg;
lblMsg.Text = msg; lblMsg.Text = msg;
if (btnStartAuTo.Text.Equals("开始自动出入库")) if (btnStartAuTo.Text.Equals(StartAuto))
{ {
btnStartAuTo.Text = "停止自动出入库"; btnStartAuTo.Text = StopAuto;
} }
try try
{ {
msg = msg.Replace("自动出库:", ""); msg = msg.Replace(AutoOut, "");
msg = msg.Replace("自动入库:", ""); msg = msg.Replace(AutoIn, "");
int index = store.PositionNumList.IndexOf(msg); int index = store.PositionNumList.IndexOf(msg);
if (index >= 0 && (!msg.Equals(""))) if (index >= 0 && (!msg.Equals("")))
{ {
...@@ -257,17 +268,17 @@ namespace OnlineStore.ACSingleStore ...@@ -257,17 +268,17 @@ namespace OnlineStore.ACSingleStore
else else
{ {
// lblMsg.Text = "没有开启自动出入库"; // lblMsg.Text = "没有开启自动出入库";
if (btnStartAuTo.Text.Equals("停止自动出入库")) if (btnStartAuTo.Text.Equals(StopAuto))
{ {
btnStartAuTo.Text = "开始自动出入库"; btnStartAuTo.Text = StartAuto;
} }
} }
} }
else else
{ {
lblThisSta.Text = "等待启动"; lblThisSta.Text = WaitStart;
lblWarnMsg.Text = ""; lblWarnMsg.Text = "";
btnStartAuTo.Text = "开始自动出入库"; btnStartAuTo.Text = StartAuto;
} }
} }
...@@ -662,11 +673,6 @@ namespace OnlineStore.ACSingleStore ...@@ -662,11 +673,6 @@ namespace OnlineStore.ACSingleStore
MyMessage.Show("请先启动料仓!"); MyMessage.Show("请先启动料仓!");
} }
} }
//private void btnAxisConfig_Click(object sender, EventArgs e)
//{
// FormManager.ShowAxisConfig(store);
//}
private void 轴卡点动ToolStripMenuItem_Click(object sender, EventArgs e) private void 轴卡点动ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
...@@ -738,16 +744,6 @@ namespace OnlineStore.ACSingleStore ...@@ -738,16 +744,6 @@ namespace OnlineStore.ACSingleStore
private void 扫码测试ToolStripMenuItem_Click(object sender, EventArgs e) private void 扫码测试ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
//IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.HIGH);
//string message = "";
//List<string> codeList = CodeManager.CameraScan();
//foreach (string str in codeList)
//{
// message = message + str + "##";
//}
//LogUtil.info("扫码测试收到二维码 :" + message);
//IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.LOW);
store.dlScanSocket.StartConnect(); store.dlScanSocket.StartConnect();
store.GetCameraCode(); store.GetCameraCode();
} }
...@@ -1020,11 +1016,11 @@ namespace OnlineStore.ACSingleStore ...@@ -1020,11 +1016,11 @@ namespace OnlineStore.ACSingleStore
{ {
if (status) if (status)
{ {
btnDebug.Text = "禁用调试"; btnDebug.Text = ResourceCulture.GetString("禁用调试");
} }
else else
{ {
btnDebug.Text = "启用调试"; btnDebug.Text = ResourceCulture.GetString("启用调试");
} }
axisMoveControl1.Enabled = status; axisMoveControl1.Enabled = status;
groupInout.Enabled = status; groupInout.Enabled = status;
...@@ -1032,7 +1028,7 @@ namespace OnlineStore.ACSingleStore ...@@ -1032,7 +1028,7 @@ namespace OnlineStore.ACSingleStore
private void btnDebug_Click(object sender, EventArgs e) private void btnDebug_Click(object sender, EventArgs e)
{ {
if (btnDebug.Text.Equals("启用调试")) if (btnDebug.Text.Equals(ResourceCulture.GetString("启用调试")))
{ {
DebugStatus(true); DebugStatus(true);
} }
...@@ -1110,6 +1106,42 @@ namespace OnlineStore.ACSingleStore ...@@ -1110,6 +1106,42 @@ namespace OnlineStore.ACSingleStore
this.LanguageProcess(); this.LanguageProcess();
} }
public override void LanguagePro()
{
if (store != null)
{
axisMoveControl1.LoadData(store, store.moveAxisList.ToArray());
}
string className = this.ClassName;
CurrLanguage = ResourceCulture.CurrLanguage;
WaitStart = ResourceCulture.GetString("等待启动");
dooropen = ResourceCulture.GetString("前门未关");
HasWare = ResourceCulture.GetString("叉子料盘检测有料,请检查");
StartAuto = ResourceCulture.GetString("开始自动出入库");
StopAuto = ResourceCulture.GetString("停止自动出入库");
AutoOut = ResourceCulture.GetString("自动出库:");
AutoIn = ResourceCulture.GetString("自动入库:");
cannotMove = ResourceCulture.GetString("定位气缸不在下降端,不能移动进出轴");
warn = ResourceCulture.GetString("警告");
StartCycle = ResourceCulture.GetString("开始循环出库");
StopCycle = ResourceCulture.GetString("停止循环出库");
显示ToolStripMenuItem.Text = ResourceCulture.GetString(ResourceCulture.GetTextIdStr(className, 显示ToolStripMenuItem.Name), 显示ToolStripMenuItem.Text);
toolStripMenuItem1.Text = ResourceCulture.GetString(ResourceCulture.GetTextIdStr(className, toolStripMenuItem1.Name), toolStripMenuItem1.Text);
notifyIcon1.Text = this.Text;
if (CurrLanguage.Equals(ResourceCulture.China))
{
LogUtil.logBox = this.richTextBox1;
}
else
{
LogUtil.ClearLog();
LogUtil.logBox = null;
this.richTextBox1.Clear();
}
}
} }
} }
using OnlineStore.Common; using OnlineStore.Common;
using OnlineStore.Common; using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
...@@ -44,8 +45,8 @@ namespace OnlineStore ...@@ -44,8 +45,8 @@ namespace OnlineStore
private static void LoadData() private static void LoadData()
{ {
//ResourceControl.GetStringEvent += GetString; //ResourceControl.GetStringEvent += GetString;
//CSVResourceControl.GetStrEvent += GetString; CSVResourceControl.GetStrEvent += GetString;
//CSVResourceControl.GetStringEvent += GetString; CSVResourceControl.GetStringEvent += GetString;
CodeLibrary.CodeResourceControl.GetLanguageEvent += CodeResourceControl_GetLanguageEvent; CodeLibrary.CodeResourceControl.GetLanguageEvent += CodeResourceControl_GetLanguageEvent;
//string englishPath = Application.StartupPath + @"\resource\en-US.resource"; //string englishPath = Application.StartupPath + @"\resource\en-US.resource";
//string chinaPath = Application.StartupPath + @"\resource\zh-CN.resource"; //string chinaPath = Application.StartupPath + @"\resource\zh-CN.resource";
...@@ -60,26 +61,32 @@ namespace OnlineStore ...@@ -60,26 +61,32 @@ namespace OnlineStore
string[] lines = File.ReadAllLines(rPath); string[] lines = File.ReadAllLines(rPath);
foreach (string line in lines) foreach (string line in lines)
{ {
if (String.IsNullOrEmpty(line)) try
{
continue;
}
string[] array = line.Split(spilt);
if (array.Length >= 2)
{ {
string key = array[0].Trim(); if (String.IsNullOrEmpty(line))
string china = array[1].Replace('&', ',').Trim();
string eng = "";
if (array.Length >= 3)
{ {
eng = array[2].Replace('&', ',').Trim(); continue;
} }
ChinaMap.Add(key, china); string[] array = line.Split(spilt);
if (String.IsNullOrEmpty(eng).Equals(false)) if (array.Length >= 2)
{ {
EnglishMap.Add(key, eng); string key = array[0].Trim();
string china = array[1].Replace('&', ',').Trim();
string eng = "";
if (array.Length >= 3)
{
eng = array[2].Replace('&', ',').Trim();
}
ChinaMap.Add(key, china);
if (String.IsNullOrEmpty(eng).Equals(false))
{
EnglishMap.Add(key, eng);
}
} }
}catch(Exception ex)
{
LogUtil.error("读取文件【"+ rPath + "】【"+ line + "】出错:" + ex.ToString());
} }
} }
} }
...@@ -240,23 +247,26 @@ namespace OnlineStore ...@@ -240,23 +247,26 @@ namespace OnlineStore
} }
try try
{ {
if (!ResourceMap.ContainsKey(CurrLanguage)) if (ResourceMap != null)
{ {
if (ShowMsg) if (!ResourceMap.ContainsKey(CurrLanguage))
{ {
LogUtil.error("No Language Resources:[" + id + "], please add"); if (ShowMsg)
} {
return defaultStr; LogUtil.error("No Language Resources:[" + id + "], please add");
} }
else return defaultStr;
{
if (ResourceMap[CurrLanguage].ContainsKey(id.Trim()))
{
strCurLanguage = ResourceMap[CurrLanguage][id];
} }
else else
{ {
NoIdLog(id, defaultStr); if (ResourceMap[CurrLanguage].ContainsKey(id.Trim()))
{
strCurLanguage = ResourceMap[CurrLanguage][id];
}
else
{
NoIdLog(id, defaultStr);
}
} }
} }
return strCurLanguage; return strCurLanguage;
......
...@@ -210,3 +210,46 @@ FrmAbout_lblCodeName_Text,软件编号:52 43 2D 44 4C 2D 41 43 53 69 6E 67 6C 65 53 ...@@ -210,3 +210,46 @@ FrmAbout_lblCodeName_Text,软件编号:52 43 2D 44 4C 2D 41 43 53 69 6E 67 6C 65 53
FrmAbout_lblTime_Text,更新时间:2020-02-07 21:16,UpdateTime:2020-02-07 21:16 FrmAbout_lblTime_Text,更新时间:2020-02-07 21:16,UpdateTime:2020-02-07 21:16
FrmAbout_lblVersion_Text,版本号:1.0.7342.38298,Version:1.0.7342.38298 FrmAbout_lblVersion_Text,版本号:1.0.7342.38298,Version:1.0.7342.38298
FrmAbout_btnNext_Text,确定,Confirm FrmAbout_btnNext_Text,确定,Confirm
Middle_Axis,(轴一)旋转轴,(Axis 1) rotation axis
UpDown_Axis,(轴二)升降轴轴,(Axis 2) lifting axis
InOut_Axis,(轴三)进出轴,(Axis 3) in-out axis
Comp_Axis,(轴四)压紧轴,(Axis 4)pressure axis
启用调试,启用调试,Enable debugging
等待启动,等待启动,Wait to start
前门未关,前门未关,Front door open
叉子料盘检测有料,请检查,叉子料盘检测有料,请检查,Fork tray full& please check
开始自动出入库,开始自动出入库,Start auto storing
停止自动出入库,停止自动出入库,Stop auto storing
自动出库:,自动出库:,
自动入库:,自动入库:,
定位气缸不在下降端,不能移动进出轴,定位气缸不在下降端,不能移动进出轴,The position cylinder is not at the descent position& not move the in-out axis
警告,警告,Warning
开始循环出库,开始循环出库,Start looping out
停止循环出库,停止循环出库,Stop the loop
FrmStoreBox_显示ToolStripMenuItem_Text,显示,Show
FrmStoreBox_toolStripMenuItem1_Text,退出,Exit
X01,急停,Emergency stop
X02,复位,Reset
X03,自动,
X04,气压检测,Pressure detection
X05,料盘检测1(进料口),
X06,料盘检测2(料叉),
X07,进料口门上升端,Portal ascent position
X08,进料口门下降端,Portal descent position
X09,安全光栅,Security grating
X10,前门限位,
X11,左侧门限位,
X12,右侧门限位,
Y01,自动指示灯,Auto indicator light
Y02,故障指示灯,Error indicator light
Y03,待机指示灯,indicator light
Y04,故障蜂鸣器,
Y05,吹气SOL ON,Blowing SOL ON
Y06,料仓运转ON,SMD BOX operating ON
Y07,轴2刹车电源ON,Brake power of axis2 ON
Y08,进料口门上升SOL,Portal ascent SOL
Y09,进料口门下降SOL,Portal descent SOL
Y10,相机照明开,Camera light ON
升降轴位置调试:,升降轴位置调试:,Updown-Axis Debug Location:
是否确定退出?,是否确定退出?,
提示,提示,Remind
...@@ -210,3 +210,46 @@ FrmAbout_lblCodeName_Text,软件编号:52 43 2D 44 4C 2D 41 43 53 69 6E 67 6C 65 ...@@ -210,3 +210,46 @@ FrmAbout_lblCodeName_Text,软件编号:52 43 2D 44 4C 2D 41 43 53 69 6E 67 6C 65
FrmAbout_lblTime_Text,更新时间:2020-02-07 21:16,UpdateTime:2020-02-07 21:16 FrmAbout_lblTime_Text,更新时间:2020-02-07 21:16,UpdateTime:2020-02-07 21:16
FrmAbout_lblVersion_Text,版本号:1.0.7342.38298,Version:1.0.7342.38298 FrmAbout_lblVersion_Text,版本号:1.0.7342.38298,Version:1.0.7342.38298
FrmAbout_btnNext_Text,确定,Confirm FrmAbout_btnNext_Text,确定,Confirm
Middle_Axis,(轴一)旋转轴,(Axis 1) rotation axis
UpDown_Axis,(轴二)升降轴轴,(Axis 2) lifting axis
InOut_Axis,(轴三)进出轴,(Axis 3) in-out axis
Comp_Axis,(轴四)压紧轴,(Axis 4)pressure axis
启用调试,启用调试,Enable debugging
等待启动,等待启动,Wait to start
前门未关,前门未关,Front door open
叉子料盘检测有料,请检查,叉子料盘检测有料,请检查,Fork tray full& please check
开始自动出入库,开始自动出入库,Start auto storing
停止自动出入库,停止自动出入库,Stop auto storing
自动出库:,自动出库:,
自动入库:,自动入库:,
定位气缸不在下降端,不能移动进出轴,定位气缸不在下降端,不能移动进出轴,The position cylinder is not at the descent position& not move the in-out axis
警告,警告,Warning
开始循环出库,开始循环出库,Start looping out
停止循环出库,停止循环出库,Stop the loop
FrmStoreBox_显示ToolStripMenuItem_Text,显示,Show
FrmStoreBox_toolStripMenuItem1_Text,退出,Exit
X01,急停,Emergency stop
X02,复位,Reset
X03,自动,
X04,气压检测,Pressure detection
X05,料盘检测1(进料口),
X06,料盘检测2(料叉),
X07,进料口门上升端,Portal ascent position
X08,进料口门下降端,Portal descent position
X09,安全光栅,Security grating
X10,前门限位,
X11,左侧门限位,
X12,右侧门限位,
Y01,自动指示灯,Auto indicator light
Y02,故障指示灯,Error indicator light
Y03,待机指示灯,indicator light
Y04,故障蜂鸣器,
Y05,吹气SOL ON,Blowing SOL ON
Y06,料仓运转ON,SMD BOX operating ON
Y07,轴2刹车电源ON,Brake power of axis2 ON
Y08,进料口门上升SOL,Portal ascent SOL
Y09,进料口门下降SOL,Portal descent SOL
Y10,相机照明开,Camera light ON
升降轴位置调试:,升降轴位置调试:,Updown-Axis Debug Location:
是否确定退出?,是否确定退出?,
提示,提示,Remind
...@@ -32,18 +32,18 @@ namespace OnlineStore.ACPackingStore ...@@ -32,18 +32,18 @@ namespace OnlineStore.ACPackingStore
axisList = new List<ConfigMoveAxis>(moveAxis); axisList = new List<ConfigMoveAxis>(moveAxis);
if (axisList.Count > 0) if (axisList.Count > 0)
{ {
comboBox1.Items.Clear(); comboBox1.Items.Clear();
foreach (ConfigMoveAxis a in axisList) foreach (ConfigMoveAxis a in axisList)
{ {
comboBox1.Items.Add(a.Explain); comboBox1.Items.Add(a.DisplayStr);
} }
comboBox1.SelectedIndex = 0; comboBox1.SelectedIndex = 0;
PortName = moveAxis[0].DeviceName; PortName = moveAxis[0].DeviceName;
SlvAddr = moveAxis[0].GetAxisValue(); SlvAddr = moveAxis[0].GetAxisValue();
txtAxisDeviceName.Text = PortName; txtAxisDeviceName.Text = PortName;
txtAxisValue.Text = SlvAddr.ToString(); txtAxisValue.Text = SlvAddr.ToString();
} }
} }
private void btnOpenAxis_Click(object sender, EventArgs e) private void btnOpenAxis_Click(object sender, EventArgs e)
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OnlineStore.LoadCSVLibrary
{
public 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\ACSAStorePosition.cs" /> <Compile Include="position\ACSAStorePosition.cs" />
<Compile Include="storeConfig\ConfigItemBase.cs" /> <Compile Include="storeConfig\ConfigItemBase.cs" />
<Compile Include="storeConfig\ConfigProAttribute.cs" /> <Compile Include="storeConfig\ConfigProAttribute.cs" />
......
...@@ -149,10 +149,14 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -149,10 +149,14 @@ namespace OnlineStore.LoadCSVLibrary
/// <summary> /// <summary>
/// 下拉列表显示 /// 下拉列表显示
/// </summary> /// </summary>
/// <summary>
/// 下拉列表显示
/// </summary>
public string DisplayStr public string DisplayStr
{ {
get { get
return Explain + "(" + ProName + ")"; {
return CSVResourceControl.GetString(ProName, Explain) + "(" + ProName + ")";
} }
set set
{ {
...@@ -243,7 +247,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -243,7 +247,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!