Commit 00f6e9ef 刘韬

1

1 个父辈 65126bb1
using log4net; using log4net;
using OnlineStore.Common;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using System.Windows.Forms.Layout; using System.Windows.Forms.Layout;
...@@ -17,16 +19,8 @@ namespace OnlineStore ...@@ -17,16 +19,8 @@ namespace OnlineStore
public class CodeResourceControl public class CodeResourceControl
{ {
public static readonly ILog LOG = LogManager.GetLogger("LngResource"); public static readonly ILog LOG = LogManager.GetLogger("LngResource");
//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 bool OpenResourceLog = false; public static bool OpenResourceLog = false;
public static string China = "zh-CN"; public static string China = "zh-CN";
public static string English = "en-US";
//private static Dictionary<string, string> chineseMap = new Dictionary<string, string>();
//private static Dictionary<string, string> englishMap = new Dictionary<string, string>();
private static Dictionary<string,Dictionary<string, string>> LangMap = new Dictionary<string, Dictionary<string, string>>(); private static Dictionary<string,Dictionary<string, string>> LangMap = new Dictionary<string, Dictionary<string, string>>();
...@@ -38,6 +32,111 @@ namespace OnlineStore ...@@ -38,6 +32,111 @@ namespace OnlineStore
public static event EventHandler LanguageChangeEvent; public static event EventHandler LanguageChangeEvent;
static CodeResourceControl() {
LoadData();
LoadData(true);
Task.Run(() => {
//return;
try
{
Task.Delay(10 * 1000).Wait();
var lngjson = JsonHelper.SerializeObject(LangMap);
if (SMF.UploadLangJsonData(lngjson, out SmfResult smfResult))
{
LogUtil.info("语言资源上传成功");
}
else
{
LogUtil.info("语言资源上传失败");
}
var lngdatas = SMF.DownloadLngData();
foreach (var lngdata in lngdatas)
{
var datalines = lngdata.resourceMap.ToList().Select((kv) => { return kv.Key + "\t\t" + kv.Value; }).ToArray();
string lngfilename = "server\\" + lngdata.lanCode + ".lngres";
Directory.CreateDirectory(Path.Combine(rPath, "server"));
File.WriteAllLines(Path.Combine(rPath, lngfilename), datalines);
}
LoadData(true);
//SetCurrentCulture(CurrLanguage);
LanguageChangeEvent?.Invoke(null, EventArgs.Empty);
}
catch (Exception e)
{
LogUtil.info("语言资源处理出错:" + e.ToString());
}
});
}
private static char spilt = '\t';
private static string rPath = Application.StartupPath + @"\resources\";
private static void LoadData(bool loadserverdir = false)
{
string loadpath = rPath;
if (loadserverdir)
loadpath = Path.Combine(rPath, "server");
Directory.CreateDirectory(loadpath);
string[] lngresfiles = Directory.GetFiles(loadpath, "*.lngres");
foreach (var lngresfile in lngresfiles)
{
Dictionary<string, string> lngMap;
var lngname = Path.GetFileNameWithoutExtension(lngresfile);
if (!LangMap.ContainsKey(lngname))
{
LangMap.Add(lngname, new Dictionary<string, string>());
}
lngMap = LangMap[lngname];
string[] lines = File.ReadAllLines(lngresfile);
foreach (string line in lines)
{
if (string.IsNullOrEmpty(line))
continue;
string[] array = line.Split(spilt);
if (array.Length >= 3)
{
string key = array[0].Trim();
string value = array[2];
if (lngMap.ContainsKey(key))
lngMap[key] = value;
else
lngMap.Add(key, value);
}
}
}
}
static Dictionary<string, string> LangName = new Dictionary<string, string>() {
{"zh-CN","简体中文" },
{"zh-TW","繁體中文" },
{ "en-US", "English" },
{ "ja-JP", "日本語" },
{ "fr-FR", "Français" },
{ "de-DE", "Deutsche" },
};
public static Dictionary<string, string> GetLangList()
{
Dictionary<string, string> LangList = new Dictionary<string, string>();
foreach (var v in LangName)
{
if (LangMap.ContainsKey(v.Key))
{
if (!LangList.ContainsKey(v.Key))
LangList.Add(v.Key, v.Value);
}
}
return LangList;
}
public static void LanguageChange() { public static void LanguageChange() {
LanguageChangeEvent?.Invoke(null, EventArgs.Empty); LanguageChangeEvent?.Invoke(null, EventArgs.Empty);
} }
...@@ -61,10 +160,6 @@ namespace OnlineStore ...@@ -61,10 +160,6 @@ namespace OnlineStore
{ {
return className + spiltStr + controlName + spiltStr + Text; return className + spiltStr + controlName + spiltStr + Text;
} }
public static string GetTextIdStr(string className)
{
return className + spiltStr + Text;
}
public static string GetString(object id, string defaultStr) public static string GetString(object id, string defaultStr)
{ {
return GetString(id.ToString(), defaultStr); return GetString(id.ToString(), defaultStr);
...@@ -132,12 +227,12 @@ namespace OnlineStore ...@@ -132,12 +227,12 @@ namespace OnlineStore
select a; select a;
return x.Count() == 0; return x.Count() == 0;
} }
static CodeResourceControl()
{
}
private static bool getLangRes(string lang) { private static bool getLangRes(string lang) {
if (!LangMap.ContainsKey(lang)) { if (!LangMap.ContainsKey(lang)) {
string path = Application.StartupPath + @"\resources\"+lang+".txt"; string path = Application.StartupPath + @"\resources\"+lang+ ".lngres";
if (!File.Exists(path)) if (!File.Exists(path))
{ {
return false; return false;
......
...@@ -33,6 +33,9 @@ ...@@ -33,6 +33,9 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="ConfigHelper">
<HintPath>..\..\ConfigHelper\ConfigHelper\bin\Debug\ConfigHelper.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath> <HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
...@@ -70,6 +73,7 @@ ...@@ -70,6 +73,7 @@
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Include="util\CTcpClient.cs" /> <Compile Include="util\CTcpClient.cs" />
<Compile Include="util\SMF.cs" />
<Compile Include="util\TcpServer.cs" /> <Compile Include="util\TcpServer.cs" />
<Compile Include="util\UdpServer.cs" /> <Compile Include="util\UdpServer.cs" />
</ItemGroup> </ItemGroup>
......
...@@ -125,6 +125,7 @@ namespace OnlineStore.Common ...@@ -125,6 +125,7 @@ namespace OnlineStore.Common
monitor_open_fail, monitor_open_fail,
monitor_config_load_fail, monitor_config_load_fail,
monitor_config_not_exist, monitor_config_not_exist,
AxisMoveControl_status_monitor AxisMoveControl_status_monitor,
string_full_takeout
} }
} }
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.Common
{
public class SMF
{
public static string DeviceType = "MIMO_PLUS";
static string _server = ConfigHelper.Config.Get("http_server");
static string server
{
get
{
//_server = "http://192.168.1.243/smf-core";
if (_server.EndsWith("/"))
{
return _server.Remove(_server.Length - 1, 1);
}
else
return _server;
}
}
public static bool UploadLangJsonData(string json, out SmfResult smfResult)
{
var insertindex = json.IndexOf("{");
json = json.Insert(insertindex + 1, "\"type\": \"" + DeviceType + "\",");
return UploadJsonData("/api/translation/resource", json, out smfResult);
}
public static bool UploadJsonData(string api, string json, out SmfResult smfResult)
{
smfResult = new SmfResult();
if (string.IsNullOrEmpty(server))
return false;
try
{
MyWebClient wc = new MyWebClient(10 * 1000);
wc.Headers.Add("Content-Type", "application/json;charset=UTF-8");
var resp = wc.UploadData(server + api, Encoding.UTF8.GetBytes(json));
smfResult = JsonHelper.DeserializeJsonToObject<SmfResult>(Encoding.UTF8.GetString(resp));
}
catch (Exception e)
{
LogUtil.info($"UploadJsonData:{api}" + e.ToString());
}
return smfResult.okResult;
}
public static List<SmfLangData> DownloadLngData()
{
string api = "/api/translation/resource?type=" + DeviceType;
try
{
MyWebClient wc = new MyWebClient(10 * 1000);
wc.Headers.Add("Content-Type", "application/json;charset=UTF-8");
var resp = wc.DownloadData(server + api);
var jsondata = Encoding.UTF8.GetString(resp);
return JsonConvert.DeserializeObject<List<SmfLangData>>(jsondata);
}
catch (Exception e)
{
LogUtil.info($"DownloadLngData:{api}" + e.ToString());
}
return new List<SmfLangData>();
}
}
//{"code":0,"data":"ok","msg":"ok","msgKey":"smfcore.ok","okResult":true}
public class SmfResult
{
public int code;
public string data;
public string msg;
public string msgKey;
public bool okResult;
}
public class SmfLangData
{
public string lanCode;
public Dictionary<string, string> resourceMap;
}
}
...@@ -195,7 +195,9 @@ namespace DeviceLibrary ...@@ -195,7 +195,9 @@ namespace DeviceLibrary
{ {
var cameraName = cameraNameList[ii]; var cameraName = cameraNameList[ii];
cameraTask[ii] = Task.Run(new Action(() => cameraTask[ii] = Task.Run(new Action(() =>
{ {
int retrytime = 0;
retry:
LogUtil.info($"【" + cameraName + "】开始取图片"); LogUtil.info($"【" + cameraName + "】开始取图片");
if (cameraName.Trim().Equals("")) if (cameraName.Trim().Equals(""))
{ {
...@@ -208,6 +210,15 @@ namespace DeviceLibrary ...@@ -208,6 +210,15 @@ namespace DeviceLibrary
{ {
bool nohalcon = true; bool nohalcon = true;
ho_Image = Camera._cam.CaptureOnImage(cameraName, out bmp, nohalcon); ho_Image = Camera._cam.CaptureOnImage(cameraName, out bmp, nohalcon);
if (bmp == null)
{
if (retrytime > 2)
return;
retrytime++;
LogUtil.info($"bitmap为空重试第{retrytime}次");
Task.Delay(1500).Wait();
goto retry;
}
//HalconDotNet.HOperatorSet.RotateImage() //HalconDotNet.HOperatorSet.RotateImage()
if (ho_Image == null && !nohalcon) if (ho_Image == null && !nohalcon)
{ {
......
...@@ -102,6 +102,7 @@ namespace DeviceLibrary ...@@ -102,6 +102,7 @@ namespace DeviceLibrary
Operation operation = getLineBoxStatus(); Operation operation = getLineBoxStatus();
if (!string.IsNullOrEmpty(posid)) if (!string.IsNullOrEmpty(posid))
operation.boxStatus[StoreID].data.Add(ParamDefine.posId, posid); operation.boxStatus[StoreID].data.Add(ParamDefine.posId, posid);
LogUtil.info($"SendStoreState,posid:{posid}, storeStatus:{storeStatus}");
operation.boxStatus[StoreID].status = (int)storeStatus; operation.boxStatus[StoreID].status = (int)storeStatus;
LogUtil.info(JsonHelper.SerializeObject(operation)); LogUtil.info(JsonHelper.SerializeObject(operation));
......
...@@ -171,6 +171,7 @@ namespace DeviceLibrary ...@@ -171,6 +171,7 @@ namespace DeviceLibrary
{ {
IgnoreX09 = false; IgnoreX09 = false;
MoveInfo.NextMoveStep(MoveStep.StoreTS10); MoveInfo.NextMoveStep(MoveStep.StoreTS10);
MoveInfo.log($"{storeMoveType}:X30取到料");
InOutEndProcess(StoreMoveType.OutStore, From.posid); InOutEndProcess(StoreMoveType.OutStore, From.posid);
} }
break; break;
......
...@@ -246,6 +246,7 @@ namespace DeviceLibrary ...@@ -246,6 +246,7 @@ namespace DeviceLibrary
Batch_Axis.AbsMove(StringMoveInfo, tpos, Config.Batch_P1_speed); Batch_Axis.AbsMove(StringMoveInfo, tpos, Config.Batch_P1_speed);
} else { } else {
StringMoveInfo.NextMoveStep(MoveStep.StringOut_01); StringMoveInfo.NextMoveStep(MoveStep.StringOut_01);
StringState = StringStateE.Full;
StringMoveInfo.log($"料串已满可以送出"); StringMoveInfo.log($"料串已满可以送出");
} }
break; break;
...@@ -278,10 +279,12 @@ namespace DeviceLibrary ...@@ -278,10 +279,12 @@ namespace DeviceLibrary
CylinderMove(StringMoveInfo, IO_Type.StringFix_Bottom, IO_Type.StringFix_Top, IO_VALUE.LOW); CylinderMove(StringMoveInfo, IO_Type.StringFix_Bottom, IO_Type.StringFix_Top, IO_VALUE.LOW);
break; break;
case MoveStep.StringOut_Released: case MoveStep.StringOut_Released:
Msg.add(crc.GetString(L.string_full_takeout, "料串已满请取出"), MsgLevel.warning);//0427
if (IOValue(IO_Type.StringBack_Check).Equals(IO_VALUE.LOW) && IOValue(IO_Type.StringFront_Check).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.StringBack_Check).Equals(IO_VALUE.LOW) && IOValue(IO_Type.StringFront_Check).Equals(IO_VALUE.LOW))
{ {
StringMoveInfo.NextMoveStep(MoveStep.Wait); StringMoveInfo.NextMoveStep(MoveStep.Wait);
LastStringState = StringStateE.None; LastStringState = StringStateE.None;
StringState = StringStateE.None;
StringMoveInfo.log($"料串已离开"); StringMoveInfo.log($"料串已离开");
StringMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000)); StringMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
} }
...@@ -328,7 +331,10 @@ namespace DeviceLibrary ...@@ -328,7 +331,10 @@ namespace DeviceLibrary
if (StringState == StringStateE.Empty) if (StringState == StringStateE.Empty)
state = crc.GetString(L.empty_reel, "空料串"); state = crc.GetString(L.empty_reel, "空料串");
else if (StringState == StringStateE.Full) else if (StringState == StringStateE.Full)
{
state = crc.GetString(L.full_reel, "满料串"); state = crc.GetString(L.full_reel, "满料串");
}
else if (StringState == StringStateE.HasReel) else if (StringState == StringStateE.HasReel)
state = crc.GetString(L.instore_reel, "入库料串"); state = crc.GetString(L.instore_reel, "入库料串");
else if (StringState == StringStateE.None) else if (StringState == StringStateE.None)
......
...@@ -85,7 +85,6 @@ ...@@ -85,7 +85,6 @@
this.txtASpeed = new System.Windows.Forms.TextBox(); this.txtASpeed = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.label47 = new System.Windows.Forms.Label(); this.label47 = new System.Windows.Forms.Label();
this.btnReadPosition = new System.Windows.Forms.Button();
this.btnAxisVMove = new System.Windows.Forms.Button(); this.btnAxisVMove = new System.Windows.Forms.Button();
this.label8 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label();
this.btnAxisRMove = new System.Windows.Forms.Button(); this.btnAxisRMove = new System.Windows.Forms.Button();
...@@ -173,13 +172,13 @@ ...@@ -173,13 +172,13 @@
// //
// label4 // label4
// //
this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(254, 90);
this.label4.Location = new System.Drawing.Point(267, 90);
this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label4.Name = "label4"; this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(59, 17); this.label4.Size = new System.Drawing.Size(72, 17);
this.label4.TabIndex = 18; this.label4.TabIndex = 18;
this.label4.Text = "回原状态:"; this.label4.Text = "回原状态:";
this.label4.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// lblhomeSts // lblhomeSts
// //
...@@ -194,13 +193,13 @@ ...@@ -194,13 +193,13 @@
// //
// label2 // label2
// //
this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(414, 90);
this.label2.Location = new System.Drawing.Point(433, 90);
this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label2.Name = "label2"; this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(71, 17); this.label2.Size = new System.Drawing.Size(90, 17);
this.label2.TabIndex = 11; this.label2.TabIndex = 11;
this.label2.Text = "实际加速度:"; this.label2.Text = "实际加速度:";
this.label2.TextAlign = System.Drawing.ContentAlignment.TopRight;
this.label2.Visible = false; this.label2.Visible = false;
// //
// lblAxEncAcc // lblAxEncAcc
...@@ -307,43 +306,43 @@ ...@@ -307,43 +306,43 @@
// //
// label53 // label53
// //
this.label53.AutoSize = true; this.label53.Location = new System.Drawing.Point(127, 90);
this.label53.Location = new System.Drawing.Point(134, 90);
this.label53.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label53.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label53.Name = "label53"; this.label53.Name = "label53";
this.label53.Size = new System.Drawing.Size(59, 17); this.label53.Size = new System.Drawing.Size(66, 17);
this.label53.TabIndex = 1; this.label53.TabIndex = 1;
this.label53.Text = "规划速度:"; this.label53.Text = "规划速度:";
this.label53.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// label56 // label56
// //
this.label56.AutoSize = true; this.label56.Location = new System.Drawing.Point(4, 90);
this.label56.Location = new System.Drawing.Point(10, 90);
this.label56.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label56.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label56.Name = "label56"; this.label56.Name = "label56";
this.label56.Size = new System.Drawing.Size(59, 17); this.label56.Size = new System.Drawing.Size(65, 17);
this.label56.TabIndex = 1; this.label56.TabIndex = 1;
this.label56.Text = "实际速度:"; this.label56.Text = "实际速度:";
this.label56.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// label55 // label55
// //
this.label55.AutoSize = true; this.label55.Location = new System.Drawing.Point(4, 65);
this.label55.Location = new System.Drawing.Point(10, 65);
this.label55.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label55.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label55.Name = "label55"; this.label55.Name = "label55";
this.label55.Size = new System.Drawing.Size(59, 17); this.label55.Size = new System.Drawing.Size(65, 17);
this.label55.TabIndex = 1; this.label55.TabIndex = 1;
this.label55.Text = "实际位置:"; this.label55.Text = "实际位置:";
this.label55.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// label52 // label52
// //
this.label52.AutoSize = true; this.label52.Location = new System.Drawing.Point(124, 65);
this.label52.Location = new System.Drawing.Point(134, 65);
this.label52.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label52.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label52.Name = "label52"; this.label52.Name = "label52";
this.label52.Size = new System.Drawing.Size(59, 17); this.label52.Size = new System.Drawing.Size(69, 17);
this.label52.TabIndex = 1; this.label52.TabIndex = 1;
this.label52.Text = "规划位置:"; this.label52.Text = "规划位置:";
this.label52.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// lblAxEncVel // lblAxEncVel
// //
...@@ -402,13 +401,13 @@ ...@@ -402,13 +401,13 @@
// //
// label50 // label50
// //
this.label50.AutoSize = true; this.label50.Location = new System.Drawing.Point(251, 65);
this.label50.Location = new System.Drawing.Point(267, 65);
this.label50.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label50.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label50.Name = "label50"; this.label50.Name = "label50";
this.label50.Size = new System.Drawing.Size(59, 17); this.label50.Size = new System.Drawing.Size(75, 17);
this.label50.TabIndex = 1; this.label50.TabIndex = 1;
this.label50.Text = "规划模式:"; this.label50.Text = "规划模式:";
this.label50.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// groupBox1 // groupBox1
// //
...@@ -583,7 +582,6 @@ ...@@ -583,7 +582,6 @@
this.panel1.Controls.Add(this.txtASpeed); this.panel1.Controls.Add(this.txtASpeed);
this.panel1.Controls.Add(this.label1); this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.label47); this.panel1.Controls.Add(this.label47);
this.panel1.Controls.Add(this.btnReadPosition);
this.panel1.Controls.Add(this.btnAxisVMove); this.panel1.Controls.Add(this.btnAxisVMove);
this.panel1.Controls.Add(this.label8); this.panel1.Controls.Add(this.label8);
this.panel1.Controls.Add(this.btnAxisRMove); this.panel1.Controls.Add(this.btnAxisRMove);
...@@ -605,7 +603,7 @@ ...@@ -605,7 +603,7 @@
// linkLabel1 // linkLabel1
// //
this.linkLabel1.AutoSize = true; this.linkLabel1.AutoSize = true;
this.linkLabel1.Location = new System.Drawing.Point(169, 165); this.linkLabel1.Location = new System.Drawing.Point(223, 155);
this.linkLabel1.Name = "linkLabel1"; this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(32, 17); this.linkLabel1.Size = new System.Drawing.Size(32, 17);
this.linkLabel1.TabIndex = 336; this.linkLabel1.TabIndex = 336;
...@@ -618,9 +616,9 @@ ...@@ -618,9 +616,9 @@
this.comjSpeed.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comjSpeed.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comjSpeed.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.comjSpeed.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.comjSpeed.FormattingEnabled = true; this.comjSpeed.FormattingEnabled = true;
this.comjSpeed.Location = new System.Drawing.Point(71, 207); this.comjSpeed.Location = new System.Drawing.Point(129, 207);
this.comjSpeed.Name = "comjSpeed"; this.comjSpeed.Name = "comjSpeed";
this.comjSpeed.Size = new System.Drawing.Size(95, 28); this.comjSpeed.Size = new System.Drawing.Size(109, 28);
this.comjSpeed.TabIndex = 335; this.comjSpeed.TabIndex = 335;
this.comjSpeed.Tag = "not"; this.comjSpeed.Tag = "not";
// //
...@@ -673,9 +671,9 @@ ...@@ -673,9 +671,9 @@
this.cmbAxis.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbAxis.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbAxis.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.cmbAxis.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.cmbAxis.FormattingEnabled = true; this.cmbAxis.FormattingEnabled = true;
this.cmbAxis.Location = new System.Drawing.Point(71, 6); this.cmbAxis.Location = new System.Drawing.Point(83, 6);
this.cmbAxis.Name = "cmbAxis"; this.cmbAxis.Name = "cmbAxis";
this.cmbAxis.Size = new System.Drawing.Size(227, 28); this.cmbAxis.Size = new System.Drawing.Size(215, 28);
this.cmbAxis.TabIndex = 301; this.cmbAxis.TabIndex = 301;
this.cmbAxis.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged); this.cmbAxis.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
// //
...@@ -684,7 +682,7 @@ ...@@ -684,7 +682,7 @@
this.btnDelMove.BackColor = System.Drawing.Color.White; this.btnDelMove.BackColor = System.Drawing.Color.White;
this.btnDelMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnDelMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnDelMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnDelMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDelMove.Location = new System.Drawing.Point(321, 199); this.btnDelMove.Location = new System.Drawing.Point(397, 198);
this.btnDelMove.Name = "btnDelMove"; this.btnDelMove.Name = "btnDelMove";
this.btnDelMove.Size = new System.Drawing.Size(140, 45); this.btnDelMove.Size = new System.Drawing.Size(140, 45);
this.btnDelMove.TabIndex = 332; this.btnDelMove.TabIndex = 332;
...@@ -730,7 +728,7 @@ ...@@ -730,7 +728,7 @@
this.btnAddMove.BackColor = System.Drawing.Color.White; this.btnAddMove.BackColor = System.Drawing.Color.White;
this.btnAddMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnAddMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAddMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnAddMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAddMove.Location = new System.Drawing.Point(172, 199); this.btnAddMove.Location = new System.Drawing.Point(251, 198);
this.btnAddMove.Name = "btnAddMove"; this.btnAddMove.Name = "btnAddMove";
this.btnAddMove.Size = new System.Drawing.Size(140, 45); this.btnAddMove.Size = new System.Drawing.Size(140, 45);
this.btnAddMove.TabIndex = 330; this.btnAddMove.TabIndex = 330;
...@@ -757,12 +755,12 @@ ...@@ -757,12 +755,12 @@
// //
// label1 // label1
// //
this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(22, 213);
this.label1.Location = new System.Drawing.Point(9, 213);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(68, 17); this.label1.Size = new System.Drawing.Size(101, 17);
this.label1.TabIndex = 329; this.label1.TabIndex = 329;
this.label1.Text = "点动速度:"; this.label1.Text = "点动速度:";
this.label1.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// label47 // label47
// //
...@@ -778,22 +776,6 @@ ...@@ -778,22 +776,6 @@
this.label47.Text = "目标速度:"; this.label47.Text = "目标速度:";
this.label47.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.label47.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
// //
// btnReadPosition
//
this.btnReadPosition.BackColor = System.Drawing.Color.White;
this.btnReadPosition.Cursor = System.Windows.Forms.Cursors.Default;
this.btnReadPosition.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnReadPosition.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnReadPosition.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnReadPosition.Location = new System.Drawing.Point(207, 127);
this.btnReadPosition.Name = "btnReadPosition";
this.btnReadPosition.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnReadPosition.Size = new System.Drawing.Size(91, 34);
this.btnReadPosition.TabIndex = 278;
this.btnReadPosition.Text = "读取位置";
this.btnReadPosition.UseVisualStyleBackColor = false;
this.btnReadPosition.Click += new System.EventHandler(this.btnReadPosition_Click);
//
// btnAxisVMove // btnAxisVMove
// //
this.btnAxisVMove.BackColor = System.Drawing.Color.White; this.btnAxisVMove.BackColor = System.Drawing.Color.White;
...@@ -812,13 +794,13 @@ ...@@ -812,13 +794,13 @@
// //
// label8 // label8
// //
this.label8.AutoSize = true;
this.label8.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label8.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label8.Location = new System.Drawing.Point(18, 136); this.label8.Location = new System.Drawing.Point(13, 130);
this.label8.Name = "label8"; this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(59, 17); this.label8.Size = new System.Drawing.Size(118, 17);
this.label8.TabIndex = 255; this.label8.TabIndex = 255;
this.label8.Text = "实时位置:"; this.label8.Text = "实时位置:";
this.label8.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// btnAxisRMove // btnAxisRMove
// //
...@@ -839,7 +821,7 @@ ...@@ -839,7 +821,7 @@
// lblCountPulse // lblCountPulse
// //
this.lblCountPulse.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblCountPulse.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblCountPulse.Location = new System.Drawing.Point(83, 131); this.lblCountPulse.Location = new System.Drawing.Point(137, 124);
this.lblCountPulse.Name = "lblCountPulse"; this.lblCountPulse.Name = "lblCountPulse";
this.lblCountPulse.ReadOnly = true; this.lblCountPulse.ReadOnly = true;
this.lblCountPulse.Size = new System.Drawing.Size(118, 26); this.lblCountPulse.Size = new System.Drawing.Size(118, 26);
...@@ -864,15 +846,14 @@ ...@@ -864,15 +846,14 @@
// //
// label49 // label49
// //
this.label49.AutoSize = true;
this.label49.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label49.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label49.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; this.label49.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label49.Location = new System.Drawing.Point(10, 11); this.label49.Location = new System.Drawing.Point(3, 11);
this.label49.Name = "label49"; this.label49.Name = "label49";
this.label49.Size = new System.Drawing.Size(51, 17); this.label49.Size = new System.Drawing.Size(74, 23);
this.label49.TabIndex = 233; this.label49.TabIndex = 233;
this.label49.Text = "AC伺服:"; this.label49.Text = "AC伺服:";
this.label49.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.label49.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// txtAPosition // txtAPosition
// //
...@@ -891,15 +872,14 @@ ...@@ -891,15 +872,14 @@
// //
// label46 // label46
// //
this.label46.AutoSize = true;
this.label46.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label46.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label46.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; this.label46.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label46.Location = new System.Drawing.Point(26, 93); this.label46.Location = new System.Drawing.Point(6, 93);
this.label46.Name = "label46"; this.label46.Name = "label46";
this.label46.Size = new System.Drawing.Size(35, 17); this.label46.Size = new System.Drawing.Size(71, 17);
this.label46.TabIndex = 239; this.label46.TabIndex = 239;
this.label46.Text = "地址:"; this.label46.Text = "地址:";
this.label46.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.label46.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// label48 // label48
// //
...@@ -917,20 +897,19 @@ ...@@ -917,20 +897,19 @@
// //
// label45 // label45
// //
this.label45.AutoSize = true;
this.label45.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label45.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label45.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; this.label45.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label45.Location = new System.Drawing.Point(14, 53); this.label45.Location = new System.Drawing.Point(8, 53);
this.label45.Name = "label45"; this.label45.Name = "label45";
this.label45.Size = new System.Drawing.Size(47, 17); this.label45.Size = new System.Drawing.Size(69, 20);
this.label45.TabIndex = 240; this.label45.TabIndex = 240;
this.label45.Text = "端口号:"; this.label45.Text = "端口号:";
this.label45.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.label45.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// txtAxisValue // txtAxisValue
// //
this.txtAxisValue.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.txtAxisValue.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtAxisValue.Location = new System.Drawing.Point(71, 88); this.txtAxisValue.Location = new System.Drawing.Point(83, 87);
this.txtAxisValue.MaxLength = 10; this.txtAxisValue.MaxLength = 10;
this.txtAxisValue.Name = "txtAxisValue"; this.txtAxisValue.Name = "txtAxisValue";
this.txtAxisValue.ReadOnly = true; this.txtAxisValue.ReadOnly = true;
...@@ -942,7 +921,7 @@ ...@@ -942,7 +921,7 @@
// txtAxisDeviceName // txtAxisDeviceName
// //
this.txtAxisDeviceName.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.txtAxisDeviceName.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtAxisDeviceName.Location = new System.Drawing.Point(71, 48); this.txtAxisDeviceName.Location = new System.Drawing.Point(83, 48);
this.txtAxisDeviceName.MaxLength = 10; this.txtAxisDeviceName.MaxLength = 10;
this.txtAxisDeviceName.Name = "txtAxisDeviceName"; this.txtAxisDeviceName.Name = "txtAxisDeviceName";
this.txtAxisDeviceName.ReadOnly = true; this.txtAxisDeviceName.ReadOnly = true;
...@@ -999,7 +978,6 @@ ...@@ -999,7 +978,6 @@
private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtAlarmStatus; private System.Windows.Forms.TextBox txtAlarmStatus;
private System.Windows.Forms.Button btnGetAlarm; private System.Windows.Forms.Button btnGetAlarm;
internal System.Windows.Forms.Button btnReadPosition;
private System.Windows.Forms.Label lblServerOn; private System.Windows.Forms.Label lblServerOn;
private System.Windows.Forms.Label label8; private System.Windows.Forms.Label label8;
internal System.Windows.Forms.Button btnOpenAxis; internal System.Windows.Forms.Button btnOpenAxis;
......
...@@ -28,7 +28,7 @@ namespace DeviceLibrary ...@@ -28,7 +28,7 @@ namespace DeviceLibrary
InitializeComponent(); InitializeComponent();
crc.OpenResourceLog = true; crc.OpenResourceLog = true;
crc.LanguageChangeEvent += Crc_LanguageChangeEvent; crc.LanguageChangeEvent += Crc_LanguageChangeEvent;
crc.LanguageProcess(this); crc.CurrLanguage = ConfigHelper.Config.Get("Device_Default_Language", "zh-CN");
} }
private void Crc_LanguageChangeEvent(object sender, EventArgs e) private void Crc_LanguageChangeEvent(object sender, EventArgs e)
...@@ -70,6 +70,7 @@ namespace DeviceLibrary ...@@ -70,6 +70,7 @@ namespace DeviceLibrary
groupBox1.Visible = true; groupBox1.Visible = true;
groupBox2.Visible = false; groupBox2.Visible = false;
} }
crc.LanguageProcess(this);
} }
...@@ -260,7 +261,7 @@ namespace DeviceLibrary ...@@ -260,7 +261,7 @@ namespace DeviceLibrary
btnAxisReturnHome.ForeColor = color; btnAxisReturnHome.ForeColor = color;
btnAxisStop.ForeColor = color; btnAxisStop.ForeColor = color;
btnComAlarmClear.ForeColor = color; btnComAlarmClear.ForeColor = color;
btnReadPosition.ForeColor = color; //btnReadPosition.ForeColor = color;
btnGetAlarm.ForeColor = color; btnGetAlarm.ForeColor = color;
btnAddMove.ForeColor = color; btnAddMove.ForeColor = color;
btnDelMove.ForeColor = color; btnDelMove.ForeColor = color;
......
...@@ -140,7 +140,7 @@ namespace TheMachine ...@@ -140,7 +140,7 @@ namespace TheMachine
// 简体中文ToolStripMenuItem // 简体中文ToolStripMenuItem
// //
this.简体中文ToolStripMenuItem.Name = "简体中文ToolStripMenuItem"; this.简体中文ToolStripMenuItem.Name = "简体中文ToolStripMenuItem";
this.简体中文ToolStripMenuItem.Size = new System.Drawing.Size(180, 26); this.简体中文ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.简体中文ToolStripMenuItem.Tag = "not"; this.简体中文ToolStripMenuItem.Tag = "not";
this.简体中文ToolStripMenuItem.Text = "简体中文"; this.简体中文ToolStripMenuItem.Text = "简体中文";
this.简体中文ToolStripMenuItem.Click += new System.EventHandler(this.简体中文ToolStripMenuItem_Click); this.简体中文ToolStripMenuItem.Click += new System.EventHandler(this.简体中文ToolStripMenuItem_Click);
...@@ -148,7 +148,7 @@ namespace TheMachine ...@@ -148,7 +148,7 @@ namespace TheMachine
// 日本语ToolStripMenuItem // 日本语ToolStripMenuItem
// //
this.日本语ToolStripMenuItem.Name = "日本语ToolStripMenuItem"; this.日本语ToolStripMenuItem.Name = "日本语ToolStripMenuItem";
this.日本语ToolStripMenuItem.Size = new System.Drawing.Size(180, 26); this.日本语ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.日本语ToolStripMenuItem.Tag = "not"; this.日本语ToolStripMenuItem.Tag = "not";
this.日本语ToolStripMenuItem.Text = "日本語"; this.日本语ToolStripMenuItem.Text = "日本語";
this.日本语ToolStripMenuItem.Click += new System.EventHandler(this.日本语ToolStripMenuItem_Click); this.日本语ToolStripMenuItem.Click += new System.EventHandler(this.日本语ToolStripMenuItem_Click);
...@@ -159,6 +159,7 @@ namespace TheMachine ...@@ -159,6 +159,7 @@ namespace TheMachine
this.englishToolStripMenuItem.Size = new System.Drawing.Size(180, 26); this.englishToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.englishToolStripMenuItem.Tag = "not"; this.englishToolStripMenuItem.Tag = "not";
this.englishToolStripMenuItem.Text = "English"; this.englishToolStripMenuItem.Text = "English";
this.englishToolStripMenuItem.Visible = false;
this.englishToolStripMenuItem.Click += new System.EventHandler(this.englishToolStripMenuItem_Click); this.englishToolStripMenuItem.Click += new System.EventHandler(this.englishToolStripMenuItem_Click);
// //
// 关于ToolStripMenuItem // 关于ToolStripMenuItem
...@@ -214,7 +215,7 @@ namespace TheMachine ...@@ -214,7 +215,7 @@ namespace TheMachine
this.groupBox1.Controls.Add(this.stateView); this.groupBox1.Controls.Add(this.stateView);
this.groupBox1.Location = new System.Drawing.Point(3, 4); this.groupBox1.Location = new System.Drawing.Point(3, 4);
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(611, 292); this.groupBox1.Size = new System.Drawing.Size(598, 292);
this.groupBox1.TabIndex = 1; this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "运行状态"; this.groupBox1.Text = "运行状态";
...@@ -228,15 +229,15 @@ namespace TheMachine ...@@ -228,15 +229,15 @@ namespace TheMachine
this.stateView.Location = new System.Drawing.Point(3, 25); this.stateView.Location = new System.Drawing.Point(3, 25);
this.stateView.MultiSelect = false; this.stateView.MultiSelect = false;
this.stateView.Name = "stateView"; this.stateView.Name = "stateView";
this.stateView.Size = new System.Drawing.Size(605, 264); this.stateView.Size = new System.Drawing.Size(592, 264);
this.stateView.TabIndex = 0; this.stateView.TabIndex = 0;
this.stateView.UseCompatibleStateImageBehavior = false; this.stateView.UseCompatibleStateImageBehavior = false;
// //
// btn_releasestring // btn_releasestring
// //
this.btn_releasestring.Location = new System.Drawing.Point(650, 213); this.btn_releasestring.Location = new System.Drawing.Point(607, 225);
this.btn_releasestring.Name = "btn_releasestring"; this.btn_releasestring.Name = "btn_releasestring";
this.btn_releasestring.Size = new System.Drawing.Size(201, 40); this.btn_releasestring.Size = new System.Drawing.Size(301, 40);
this.btn_releasestring.TabIndex = 272; this.btn_releasestring.TabIndex = 272;
this.btn_releasestring.Tag = "not"; this.btn_releasestring.Tag = "not";
this.btn_releasestring.Text = "安全释放料串"; this.btn_releasestring.Text = "安全释放料串";
...@@ -246,7 +247,7 @@ namespace TheMachine ...@@ -246,7 +247,7 @@ namespace TheMachine
// cb_IgnoreSafecheck // cb_IgnoreSafecheck
// //
this.cb_IgnoreSafecheck.AutoSize = true; this.cb_IgnoreSafecheck.AutoSize = true;
this.cb_IgnoreSafecheck.Location = new System.Drawing.Point(650, 35); this.cb_IgnoreSafecheck.Location = new System.Drawing.Point(607, 47);
this.cb_IgnoreSafecheck.Name = "cb_IgnoreSafecheck"; this.cb_IgnoreSafecheck.Name = "cb_IgnoreSafecheck";
this.cb_IgnoreSafecheck.Size = new System.Drawing.Size(215, 25); this.cb_IgnoreSafecheck.Size = new System.Drawing.Size(215, 25);
this.cb_IgnoreSafecheck.TabIndex = 2; this.cb_IgnoreSafecheck.TabIndex = 2;
...@@ -270,7 +271,7 @@ namespace TheMachine ...@@ -270,7 +271,7 @@ namespace TheMachine
// cb_IgnoreGratingSignal // cb_IgnoreGratingSignal
// //
this.cb_IgnoreGratingSignal.AutoSize = true; this.cb_IgnoreGratingSignal.AutoSize = true;
this.cb_IgnoreGratingSignal.Location = new System.Drawing.Point(650, 66); this.cb_IgnoreGratingSignal.Location = new System.Drawing.Point(607, 78);
this.cb_IgnoreGratingSignal.Name = "cb_IgnoreGratingSignal"; this.cb_IgnoreGratingSignal.Name = "cb_IgnoreGratingSignal";
this.cb_IgnoreGratingSignal.Size = new System.Drawing.Size(125, 25); this.cb_IgnoreGratingSignal.Size = new System.Drawing.Size(125, 25);
this.cb_IgnoreGratingSignal.TabIndex = 2; this.cb_IgnoreGratingSignal.TabIndex = 2;
...@@ -294,7 +295,7 @@ namespace TheMachine ...@@ -294,7 +295,7 @@ namespace TheMachine
// cb_EnableBuzzer // cb_EnableBuzzer
// //
this.cb_EnableBuzzer.AutoSize = true; this.cb_EnableBuzzer.AutoSize = true;
this.cb_EnableBuzzer.Location = new System.Drawing.Point(650, 4); this.cb_EnableBuzzer.Location = new System.Drawing.Point(607, 16);
this.cb_EnableBuzzer.Name = "cb_EnableBuzzer"; this.cb_EnableBuzzer.Name = "cb_EnableBuzzer";
this.cb_EnableBuzzer.Size = new System.Drawing.Size(109, 25); this.cb_EnableBuzzer.Size = new System.Drawing.Size(109, 25);
this.cb_EnableBuzzer.TabIndex = 5; this.cb_EnableBuzzer.TabIndex = 5;
...@@ -305,9 +306,9 @@ namespace TheMachine ...@@ -305,9 +306,9 @@ namespace TheMachine
// btn_IgnoreX09 // btn_IgnoreX09
// //
this.btn_IgnoreX09.BackColor = System.Drawing.Color.OrangeRed; this.btn_IgnoreX09.BackColor = System.Drawing.Color.OrangeRed;
this.btn_IgnoreX09.Location = new System.Drawing.Point(650, 143); this.btn_IgnoreX09.Location = new System.Drawing.Point(607, 155);
this.btn_IgnoreX09.Name = "btn_IgnoreX09"; this.btn_IgnoreX09.Name = "btn_IgnoreX09";
this.btn_IgnoreX09.Size = new System.Drawing.Size(201, 40); this.btn_IgnoreX09.Size = new System.Drawing.Size(301, 40);
this.btn_IgnoreX09.TabIndex = 6; this.btn_IgnoreX09.TabIndex = 6;
this.btn_IgnoreX09.Text = "忽略X30错误,并继续运行"; this.btn_IgnoreX09.Text = "忽略X30错误,并继续运行";
this.btn_IgnoreX09.UseVisualStyleBackColor = false; this.btn_IgnoreX09.UseVisualStyleBackColor = false;
...@@ -317,9 +318,9 @@ namespace TheMachine ...@@ -317,9 +318,9 @@ namespace TheMachine
// btn_PauseBuzzer // btn_PauseBuzzer
// //
this.btn_PauseBuzzer.BackColor = System.Drawing.Color.OrangeRed; this.btn_PauseBuzzer.BackColor = System.Drawing.Color.OrangeRed;
this.btn_PauseBuzzer.Location = new System.Drawing.Point(650, 97); this.btn_PauseBuzzer.Location = new System.Drawing.Point(607, 109);
this.btn_PauseBuzzer.Name = "btn_PauseBuzzer"; this.btn_PauseBuzzer.Name = "btn_PauseBuzzer";
this.btn_PauseBuzzer.Size = new System.Drawing.Size(201, 40); this.btn_PauseBuzzer.Size = new System.Drawing.Size(301, 40);
this.btn_PauseBuzzer.TabIndex = 6; this.btn_PauseBuzzer.TabIndex = 6;
this.btn_PauseBuzzer.Text = "本次暂停警报器响声"; this.btn_PauseBuzzer.Text = "本次暂停警报器响声";
this.btn_PauseBuzzer.UseVisualStyleBackColor = false; this.btn_PauseBuzzer.UseVisualStyleBackColor = false;
......
...@@ -30,6 +30,7 @@ namespace TheMachine ...@@ -30,6 +30,7 @@ namespace TheMachine
this.Text = Config.Get(Setting_Init.App_Title) +" "+ Config.Get("CID"); this.Text = Config.Get(Setting_Init.App_Title) +" "+ Config.Get("CID");
crc.GetLanguageEvent += Crc_GetLanguageEvent; crc.GetLanguageEvent += Crc_GetLanguageEvent;
crc.LanguageChangeEvent += Crc_LanguageChangeEvent; crc.LanguageChangeEvent += Crc_LanguageChangeEvent;
crc.CurrLanguage = Crc_GetLanguageEvent();
t1.Interval = 1000; t1.Interval = 1000;
t1.Tick += T1_Tick; t1.Tick += T1_Tick;
t1.Start(); t1.Start();
...@@ -448,14 +449,16 @@ namespace TheMachine ...@@ -448,14 +449,16 @@ namespace TheMachine
{ {
Camera._cam.CloseAll(); Camera._cam.CloseAll();
} }
CodeLibrary.CodeResourceControl.GetLanguageEvent += Crc_GetLanguageEvent;
CodeLibrary.FrmCodeDecode frm = new CodeLibrary.FrmCodeDecode(); CodeLibrary.FrmCodeDecode frm = new CodeLibrary.FrmCodeDecode();
frm.CurrLanguage = Crc_GetLanguageEvent();
frm.chbZxing.Checked = false; frm.chbZxing.Checked = false;
frm.ShowDialog(); frm.ShowDialog();
frm.Dispose(); frm.Dispose();
//IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.LOW); //IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.LOW);
} }
private void 关于ToolStripMenuItem_Click(object sender, EventArgs e) private void 关于ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
AboutBox1 aboutBox1 = new AboutBox1(); AboutBox1 aboutBox1 = new AboutBox1();
......
...@@ -48,7 +48,7 @@ namespace TheMachine ...@@ -48,7 +48,7 @@ namespace TheMachine
// //
this.btn_linerun.Location = new System.Drawing.Point(566, 382); this.btn_linerun.Location = new System.Drawing.Point(566, 382);
this.btn_linerun.Name = "btn_linerun"; this.btn_linerun.Name = "btn_linerun";
this.btn_linerun.Size = new System.Drawing.Size(94, 23); this.btn_linerun.Size = new System.Drawing.Size(113, 23);
this.btn_linerun.TabIndex = 2; this.btn_linerun.TabIndex = 2;
this.btn_linerun.Text = "线体正转"; this.btn_linerun.Text = "线体正转";
this.btn_linerun.UseVisualStyleBackColor = true; this.btn_linerun.UseVisualStyleBackColor = true;
...@@ -56,9 +56,9 @@ namespace TheMachine ...@@ -56,9 +56,9 @@ namespace TheMachine
// //
// btn_linerev // btn_linerev
// //
this.btn_linerev.Location = new System.Drawing.Point(666, 382); this.btn_linerev.Location = new System.Drawing.Point(685, 382);
this.btn_linerev.Name = "btn_linerev"; this.btn_linerev.Name = "btn_linerev";
this.btn_linerev.Size = new System.Drawing.Size(94, 23); this.btn_linerev.Size = new System.Drawing.Size(105, 23);
this.btn_linerev.TabIndex = 2; this.btn_linerev.TabIndex = 2;
this.btn_linerev.Text = "线体反转"; this.btn_linerev.Text = "线体反转";
this.btn_linerev.UseVisualStyleBackColor = true; this.btn_linerev.UseVisualStyleBackColor = true;
...@@ -68,7 +68,7 @@ namespace TheMachine ...@@ -68,7 +68,7 @@ namespace TheMachine
// //
this.btn_linestop.Location = new System.Drawing.Point(566, 411); this.btn_linestop.Location = new System.Drawing.Point(566, 411);
this.btn_linestop.Name = "btn_linestop"; this.btn_linestop.Name = "btn_linestop";
this.btn_linestop.Size = new System.Drawing.Size(194, 23); this.btn_linestop.Size = new System.Drawing.Size(224, 23);
this.btn_linestop.TabIndex = 2; this.btn_linestop.TabIndex = 2;
this.btn_linestop.Text = "线体停止"; this.btn_linestop.Text = "线体停止";
this.btn_linestop.UseVisualStyleBackColor = true; this.btn_linestop.UseVisualStyleBackColor = true;
...@@ -82,7 +82,7 @@ namespace TheMachine ...@@ -82,7 +82,7 @@ namespace TheMachine
this.cylinderButton5.IO_LOW = "StringPosChecker_Home"; this.cylinderButton5.IO_LOW = "StringPosChecker_Home";
this.cylinderButton5.Location = new System.Drawing.Point(566, 342); this.cylinderButton5.Location = new System.Drawing.Point(566, 342);
this.cylinderButton5.Name = "cylinderButton5"; this.cylinderButton5.Name = "cylinderButton5";
this.cylinderButton5.Size = new System.Drawing.Size(194, 23); this.cylinderButton5.Size = new System.Drawing.Size(224, 23);
this.cylinderButton5.TabIndex = 1; this.cylinderButton5.TabIndex = 1;
this.cylinderButton5.Tag = "not"; this.cylinderButton5.Tag = "not";
this.cylinderButton5.Text = "StringPosChecker_Work"; this.cylinderButton5.Text = "StringPosChecker_Work";
...@@ -96,7 +96,7 @@ namespace TheMachine ...@@ -96,7 +96,7 @@ namespace TheMachine
this.cylinderButton4.IO_LOW = "Clamping_Relax"; this.cylinderButton4.IO_LOW = "Clamping_Relax";
this.cylinderButton4.Location = new System.Drawing.Point(566, 313); this.cylinderButton4.Location = new System.Drawing.Point(566, 313);
this.cylinderButton4.Name = "cylinderButton4"; this.cylinderButton4.Name = "cylinderButton4";
this.cylinderButton4.Size = new System.Drawing.Size(194, 23); this.cylinderButton4.Size = new System.Drawing.Size(224, 23);
this.cylinderButton4.TabIndex = 1; this.cylinderButton4.TabIndex = 1;
this.cylinderButton4.Tag = "not"; this.cylinderButton4.Tag = "not";
this.cylinderButton4.Text = "Clamping_Work"; this.cylinderButton4.Text = "Clamping_Work";
...@@ -110,7 +110,7 @@ namespace TheMachine ...@@ -110,7 +110,7 @@ namespace TheMachine
this.cylinderButton3.IO_LOW = "StringDoor_Close"; this.cylinderButton3.IO_LOW = "StringDoor_Close";
this.cylinderButton3.Location = new System.Drawing.Point(566, 284); this.cylinderButton3.Location = new System.Drawing.Point(566, 284);
this.cylinderButton3.Name = "cylinderButton3"; this.cylinderButton3.Name = "cylinderButton3";
this.cylinderButton3.Size = new System.Drawing.Size(194, 23); this.cylinderButton3.Size = new System.Drawing.Size(224, 23);
this.cylinderButton3.TabIndex = 1; this.cylinderButton3.TabIndex = 1;
this.cylinderButton3.Tag = "not"; this.cylinderButton3.Tag = "not";
this.cylinderButton3.Text = "StringDoor_Open"; this.cylinderButton3.Text = "StringDoor_Open";
...@@ -124,7 +124,7 @@ namespace TheMachine ...@@ -124,7 +124,7 @@ namespace TheMachine
this.cylinderButton2.IO_LOW = "StringFix_Bottom"; this.cylinderButton2.IO_LOW = "StringFix_Bottom";
this.cylinderButton2.Location = new System.Drawing.Point(566, 255); this.cylinderButton2.Location = new System.Drawing.Point(566, 255);
this.cylinderButton2.Name = "cylinderButton2"; this.cylinderButton2.Name = "cylinderButton2";
this.cylinderButton2.Size = new System.Drawing.Size(194, 23); this.cylinderButton2.Size = new System.Drawing.Size(224, 23);
this.cylinderButton2.TabIndex = 1; this.cylinderButton2.TabIndex = 1;
this.cylinderButton2.Tag = "not"; this.cylinderButton2.Tag = "not";
this.cylinderButton2.Text = "StringFix_Top"; this.cylinderButton2.Text = "StringFix_Top";
...@@ -138,7 +138,7 @@ namespace TheMachine ...@@ -138,7 +138,7 @@ namespace TheMachine
this.cylinderButton7.IO_LOW = ""; this.cylinderButton7.IO_LOW = "";
this.cylinderButton7.Location = new System.Drawing.Point(566, 168); this.cylinderButton7.Location = new System.Drawing.Point(566, 168);
this.cylinderButton7.Name = "cylinderButton7"; this.cylinderButton7.Name = "cylinderButton7";
this.cylinderButton7.Size = new System.Drawing.Size(194, 23); this.cylinderButton7.Size = new System.Drawing.Size(224, 23);
this.cylinderButton7.TabIndex = 1; this.cylinderButton7.TabIndex = 1;
this.cylinderButton7.Tag = "not"; this.cylinderButton7.Tag = "not";
this.cylinderButton7.Text = "Device_Led"; this.cylinderButton7.Text = "Device_Led";
...@@ -152,7 +152,7 @@ namespace TheMachine ...@@ -152,7 +152,7 @@ namespace TheMachine
this.cylinderButton6.IO_LOW = ""; this.cylinderButton6.IO_LOW = "";
this.cylinderButton6.Location = new System.Drawing.Point(566, 197); this.cylinderButton6.Location = new System.Drawing.Point(566, 197);
this.cylinderButton6.Name = "cylinderButton6"; this.cylinderButton6.Name = "cylinderButton6";
this.cylinderButton6.Size = new System.Drawing.Size(194, 23); this.cylinderButton6.Size = new System.Drawing.Size(224, 23);
this.cylinderButton6.TabIndex = 1; this.cylinderButton6.TabIndex = 1;
this.cylinderButton6.Tag = "not"; this.cylinderButton6.Tag = "not";
this.cylinderButton6.Text = "Camera_Led"; this.cylinderButton6.Text = "Camera_Led";
...@@ -166,7 +166,7 @@ namespace TheMachine ...@@ -166,7 +166,7 @@ namespace TheMachine
this.cylinderButton1.IO_LOW = "NGDoor_Close"; this.cylinderButton1.IO_LOW = "NGDoor_Close";
this.cylinderButton1.Location = new System.Drawing.Point(566, 226); this.cylinderButton1.Location = new System.Drawing.Point(566, 226);
this.cylinderButton1.Name = "cylinderButton1"; this.cylinderButton1.Name = "cylinderButton1";
this.cylinderButton1.Size = new System.Drawing.Size(194, 23); this.cylinderButton1.Size = new System.Drawing.Size(224, 23);
this.cylinderButton1.TabIndex = 1; this.cylinderButton1.TabIndex = 1;
this.cylinderButton1.Tag = "not"; this.cylinderButton1.Tag = "not";
this.cylinderButton1.Text = "NGDoor_Open"; this.cylinderButton1.Text = "NGDoor_Open";
...@@ -187,7 +187,7 @@ namespace TheMachine ...@@ -187,7 +187,7 @@ namespace TheMachine
// //
this.btn_flipopen.Location = new System.Drawing.Point(566, 453); this.btn_flipopen.Location = new System.Drawing.Point(566, 453);
this.btn_flipopen.Name = "btn_flipopen"; this.btn_flipopen.Name = "btn_flipopen";
this.btn_flipopen.Size = new System.Drawing.Size(94, 23); this.btn_flipopen.Size = new System.Drawing.Size(113, 23);
this.btn_flipopen.TabIndex = 3; this.btn_flipopen.TabIndex = 3;
this.btn_flipopen.Text = "翻版托盘打开"; this.btn_flipopen.Text = "翻版托盘打开";
this.btn_flipopen.UseVisualStyleBackColor = true; this.btn_flipopen.UseVisualStyleBackColor = true;
...@@ -195,9 +195,9 @@ namespace TheMachine ...@@ -195,9 +195,9 @@ namespace TheMachine
// //
// btn_flipclose // btn_flipclose
// //
this.btn_flipclose.Location = new System.Drawing.Point(666, 453); this.btn_flipclose.Location = new System.Drawing.Point(685, 453);
this.btn_flipclose.Name = "btn_flipclose"; this.btn_flipclose.Name = "btn_flipclose";
this.btn_flipclose.Size = new System.Drawing.Size(94, 23); this.btn_flipclose.Size = new System.Drawing.Size(105, 23);
this.btn_flipclose.TabIndex = 3; this.btn_flipclose.TabIndex = 3;
this.btn_flipclose.Text = "翻版托盘合拢"; this.btn_flipclose.Text = "翻版托盘合拢";
this.btn_flipclose.UseVisualStyleBackColor = true; this.btn_flipclose.UseVisualStyleBackColor = true;
......
...@@ -145,19 +145,19 @@ namespace TheMachine ...@@ -145,19 +145,19 @@ namespace TheMachine
if (io_state.Equals(IO_VALUE.LOW)) if (io_state.Equals(IO_VALUE.LOW))
{ {
LogUtil.info($"手动点击: Set {configio_high.DeviceName}=HIGH"); LogUtil.info($"手动点击: Set {configio_high.ElectricalDefinition}{configio_high.Explain}=HIGH");
IOManager.WriteSingleDO(configio_high.DeviceName, configio_high.SlaveID, configio_high.GetIOAddr(), IO_VALUE.HIGH); IOManager.WriteSingleDO(configio_high.DeviceName, configio_high.SlaveID, configio_high.GetIOAddr(), IO_VALUE.HIGH);
if (configio_low != null) if (configio_low != null)
IOManager.WriteSingleDO(configio_low.DeviceName, configio_low.SlaveID, configio_low.GetIOAddr(), IO_VALUE.LOW); IOManager.WriteSingleDO(configio_low.DeviceName, configio_low.SlaveID, configio_low.GetIOAddr(), IO_VALUE.LOW);
} }
else if (configio_low != null) else if (configio_low != null)
{ {
LogUtil.info($"手动点击: Set {configio_high.DeviceName}=LOW"); LogUtil.info($"手动点击: Set {configio_high.ElectricalDefinition}{configio_high.Explain}=LOW");
IOManager.WriteSingleDO(configio_high.DeviceName, configio_high.SlaveID, configio_high.GetIOAddr(), IO_VALUE.LOW); IOManager.WriteSingleDO(configio_high.DeviceName, configio_high.SlaveID, configio_high.GetIOAddr(), IO_VALUE.LOW);
IOManager.WriteSingleDO(configio_low.DeviceName, configio_low.SlaveID, configio_low.GetIOAddr(), IO_VALUE.HIGH); IOManager.WriteSingleDO(configio_low.DeviceName, configio_low.SlaveID, configio_low.GetIOAddr(), IO_VALUE.HIGH);
} }
else { else {
LogUtil.info($"手动点击: Set {configio_high.DeviceName}=LOW"); LogUtil.info($"手动点击: Set {configio_high.ElectricalDefinition}{configio_high.Explain}=LOW");
IOManager.WriteSingleDO(configio_high.DeviceName, configio_high.SlaveID, configio_high.GetIOAddr(), IO_VALUE.LOW); IOManager.WriteSingleDO(configio_high.DeviceName, configio_high.SlaveID, configio_high.GetIOAddr(), IO_VALUE.LOW);
} }
} }
......
...@@ -44,6 +44,8 @@ namespace TheMachine ...@@ -44,6 +44,8 @@ namespace TheMachine
private ACStorePosition _aCStorePosition; private ACStorePosition _aCStorePosition;
public void LoadPos(ACStorePosition aCStorePosition) public void LoadPos(ACStorePosition aCStorePosition)
{ {
if (aCStorePosition == null)
return;
_aCStorePosition = aCStorePosition; _aCStorePosition = aCStorePosition;
tableLayoutPanel1.SuspendLayout(); tableLayoutPanel1.SuspendLayout();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!