Commit 16921313 LN

出入库时需要检测叉子是否有料

1 个父辈 a547da51
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<add key="CameraName" value="GigE:acA3800-10gc (23124327)#GigE:acA3800-10gc (23172285)" /> <add key="CameraName" value="GigE:acA3800-10gc (23124327)#GigE:acA3800-10gc (23172285)" />
<!--二维码类型列表配置,用#分割--> <!--二维码类型列表配置,用#分割-->
<add key="CodeType" value="QR Code" /> <add key="CodeType" value="QR Code" />
<add key="CodeType" value="Data Matrix ECC 200#QR Code" /> <add key="CodeType" value="Data Matrix ECC 200#QR Code#PDF417" />
<!--二维码参数文件所在路径,文件名与二维码类型名一样--> <!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<add key="CodeParamPath" value="\CodeParam\" /> <add key="CodeParamPath" value="\CodeParam\" />
<add key="InOutDefaultPosition" value="50000000" /> <add key="InOutDefaultPosition" value="50000000" />
......
...@@ -51,7 +51,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -51,7 +51,7 @@ namespace OnlineStore.AutoInOutStore
LogUtil.info("版本号[" + version + "][" + str + "][" + GetCodeNum() + "]"); LogUtil.info("版本号[" + version + "][" + str + "][" + GetCodeNum() + "]");
return str; return str;
} }
internal static string GetCodeNum(string codeName = "RC1252-AutoInOutStore") internal static string GetCodeNum(string codeName = "RC1252-AutoInOutStore-N")
{ {
byte[] byteArray = System.Text.Encoding.ASCII.GetBytes(codeName); byte[] byteArray = System.Text.Encoding.ASCII.GetBytes(codeName);
string result = ""; string result = "";
......
...@@ -11,20 +11,20 @@ using System.Reflection; ...@@ -11,20 +11,20 @@ using System.Reflection;
using System.Resources; using System.Resources;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace OnlineStore.AutoInOutStore namespace OnlineStore.AutoInOutStore
{ {
public class ResourceCulture public class ResourceCulture
{ {
public static bool ShowLog = false ; public static bool ShowLog = false;
public static string China = "zh-CN"; public static string China = "zh-CN";
public static string English = "en-US"; public static string English = "en-US";
public static string German = "ge-DE"; public static string German = "ge-DE";
public static string Japanese = "ja-JP"; public static string Japanese = "ja-JP";
private static ResourceManager rm = null; private static ResourceManager rm = null;
public static string CurrLanguage = "zh-CN"; public static string CurrLanguage = "zh-CN";
public static Dictionary<string, string> defaultMap = new Dictionary<string, string>(); public static Dictionary<string, string> defaultMap = new Dictionary<string, string>();
/// <summary> /// <summary>
/// Set current culture by name /// Set current culture by name
...@@ -45,8 +45,10 @@ namespace OnlineStore.AutoInOutStore ...@@ -45,8 +45,10 @@ namespace OnlineStore.AutoInOutStore
} }
CurrLanguage = name; CurrLanguage = name;
Thread.CurrentThread.CurrentCulture = new CultureInfo(name); Thread.CurrentThread.CurrentCulture = new CultureInfo(name);
LoadAllRes();
} }
public static void LoaAllRes() public static void LoadAllRes()
{ {
if (rm == null) if (rm == null)
{ {
...@@ -55,22 +57,24 @@ namespace OnlineStore.AutoInOutStore ...@@ -55,22 +57,24 @@ namespace OnlineStore.AutoInOutStore
//CultureInfo ci = Thread.CurrentThread.CurrentCulture; //CultureInfo ci = Thread.CurrentThread.CurrentCulture;
Dictionary<string, string> chinaMap = GetRMap(China); Dictionary<string, string> chinaMap = GetRMap(China);
Dictionary<string, string> englishMap = GetRMap(English); Dictionary<string, string> englishMap = GetRMap(English);
List<string> keyList = new List<string>(chinaMap.Keys);
keyList = (from m in keyList orderby m select m).ToList<string>();
List<string> resulList = new List<string>(); List<string> resulList = new List<string>();
foreach(string key in chinaMap.Keys) foreach (string key in keyList)
{ {
string china = chinaMap[key]; string china = chinaMap[key];
string english = ""; string english = "";
englishMap.TryGetValue(key, out english); englishMap.TryGetValue(key, out english);
if (String.IsNullOrEmpty(english)) if (String.IsNullOrEmpty(english))
{ {
english = ""; english = "";
} }
resulList.Add(key + "," + china.Replace(',', '&') + "," + english.Replace(',', '&')); resulList.Add(key + "," + china.Replace(',', '&') + "," + english.Replace(',', '&'));
} }
File.WriteAllLines("D:\\storeResource.csv", resulList.ToArray()); File.WriteAllLines("D:\\storeResource.csv", resulList.ToArray());
} }
private static Dictionary<string ,string > GetRMap(string lan) private static Dictionary<string, string> GetRMap(string lan)
{ {
Dictionary<string, string> chinaMap = new Dictionary<string, string>(); Dictionary<string, string> chinaMap = new Dictionary<string, string>();
CultureInfo ci = new CultureInfo(lan); CultureInfo ci = new CultureInfo(lan);
...@@ -98,7 +102,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -98,7 +102,7 @@ namespace OnlineStore.AutoInOutStore
return CurrLanguage; return CurrLanguage;
} }
private static Assembly assembly = Assembly.GetExecutingAssembly(); private static Assembly assembly = Assembly.GetExecutingAssembly();
public static string GetString(string id) public static string GetString(string id)
{ {
return GetString(id, id); return GetString(id, id);
...@@ -115,13 +119,13 @@ namespace OnlineStore.AutoInOutStore ...@@ -115,13 +119,13 @@ namespace OnlineStore.AutoInOutStore
} }
//CultureInfo ci = Thread.CurrentThread.CurrentCulture; //CultureInfo ci = Thread.CurrentThread.CurrentCulture;
CultureInfo ci = new CultureInfo(CurrLanguage); CultureInfo ci = new CultureInfo(CurrLanguage);
strCurLanguage = rm.GetString(id, ci).Trim(); strCurLanguage = rm.GetString(id, ci).Trim();
if (strCurLanguage.Equals("") && (!defaultStr.Equals(""))) if (strCurLanguage.Equals("") && (!defaultStr.Equals("")))
{ {
strCurLanguage = defaultStr; strCurLanguage = defaultStr;
NoIdLog(id, defaultStr); NoIdLog(id, defaultStr);
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
...@@ -175,7 +179,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -175,7 +179,7 @@ namespace OnlineStore.AutoInOutStore
{ {
return GetStringByLan(CurrLanguage, id, defaultStr, param); return GetStringByLan(CurrLanguage, id, defaultStr, param);
} }
private static void NoIdLog(string id, string defaultStr) private static void NoIdLog(string id, string defaultStr)
{ {
...@@ -195,10 +199,10 @@ namespace OnlineStore.AutoInOutStore ...@@ -195,10 +199,10 @@ namespace OnlineStore.AutoInOutStore
{ {
string value = defaultMap[key]; string value = defaultMap[key];
LogUtil.info(" 缺少文字配置[" + key + "] 默认值[" + value + "]"); LogUtil.info(" 缺少文字配置[" + key + "] 默认值[" + value + "]");
} }
LogUtil.info("结束打印缺少的文字配置"); LogUtil.info("结束打印缺少的文字配置");
} }
private static string spiltStr = "_"; private static string spiltStr = "_";
private static string Text = "Text"; private static string Text = "Text";
public static string GetIdStr(string className, string controlName, string propertyName) public static string GetIdStr(string className, string controlName, string propertyName)
{ {
...@@ -208,11 +212,11 @@ namespace OnlineStore.AutoInOutStore ...@@ -208,11 +212,11 @@ namespace OnlineStore.AutoInOutStore
{ {
return className + spiltStr + propertyName; return className + spiltStr + propertyName;
} }
public static string GetTextIdStr(string className, string controlName ) public static string GetTextIdStr(string className, string controlName)
{ {
return className + spiltStr + controlName + spiltStr + Text; return className + spiltStr + controlName + spiltStr + Text;
} }
public static string GetTextIdStr(string className ) public static string GetTextIdStr(string className)
{ {
return className + spiltStr + Text; return className + spiltStr + Text;
} }
...@@ -229,7 +233,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -229,7 +233,7 @@ namespace OnlineStore.AutoInOutStore
/// </summary> /// </summary>
public static string OpenComFail = "OpenComFail"; public static string OpenComFail = "OpenComFail";
/// <summary> /// <summary>
/// 请先启动料仓 /// 请先启动料仓
/// </summary> /// </summary>
...@@ -271,7 +275,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -271,7 +275,7 @@ namespace OnlineStore.AutoInOutStore
/// </summary> /// </summary>
public static string AutoEnd = "AutoEnd"; public static string AutoEnd = "AutoEnd";
/// <summary> /// <summary>
/// 前门未关 /// 前门未关
/// </summary> /// </summary>
...@@ -300,90 +304,90 @@ namespace OnlineStore.AutoInOutStore ...@@ -300,90 +304,90 @@ namespace OnlineStore.AutoInOutStore
/// <summary> /// <summary>
/// 此设备不支持单个入库 /// 此设备不支持单个入库
/// </summary> /// </summary>
public static string CanotSingleInStore = "CanotSingleInStore"; public static string CanotSingleInStore = "CanotSingleInStore";
/// <summary> /// <summary>
///叉子不在待机位,请先将叉子退回待机位 ///叉子不在待机位,请先将叉子退回待机位
/// </summary> /// </summary>
public static string InoutNotOk = "InoutNotOk"; public static string InoutNotOk = "InoutNotOk";
/// <summary> /// <summary>
///警告(叉子在待机位时,才能移动升降轴和旋转轴) ///警告(叉子在待机位时,才能移动升降轴和旋转轴)
/// </summary> /// </summary>
public static string InoutWarn = "InoutWarn"; public static string InoutWarn = "InoutWarn";
/// <summary> /// <summary>
///无报警,无出入库或者重置操作时,才可以回待机点 ///无报警,无出入库或者重置操作时,才可以回待机点
/// </summary> /// </summary>
public static string CanotBack = "CanotBack"; public static string CanotBack = "CanotBack";
/// <summary> /// <summary>
///请先关闭批量上下料门 ///请先关闭批量上下料门
/// </summary> /// </summary>
public static string PCloseDoor = "PCloseDoor"; public static string PCloseDoor = "PCloseDoor";
/// <summary> /// <summary>
///请输入正确的密码 ///请输入正确的密码
/// </summary> /// </summary>
public static string PWPwd = "PWPwd"; public static string PWPwd = "PWPwd";
/// <summary> /// <summary>
///忙碌中,无法打开门锁 ///忙碌中,无法打开门锁
/// </summary> /// </summary>
public static string CnotOpen = "CnotOpen"; public static string CnotOpen = "CnotOpen";
/// <summary> /// <summary>
///批量入库失败:请先关闭上料机构 ///批量入库失败:请先关闭上料机构
/// </summary> /// </summary>
public static string batchInError = "batchInError"; public static string batchInError = "batchInError";
/// <summary> /// <summary>
///批量入库失败:叉子料盘检测有料,请检查后再入库 ///批量入库失败:叉子料盘检测有料,请检查后再入库
/// </summary> /// </summary>
public static string batchInError2 = "batchInError2"; public static string batchInError2 = "batchInError2";
/// <summary> /// <summary>
///取出料盘失败:无料盘可取 ///取出料盘失败:无料盘可取
/// </summary> /// </summary>
public static string GetError = "GetError"; public static string GetError = "GetError";
/// <summary> /// <summary>
///取出料盘失败:忙碌中,无法打开门锁 ///取出料盘失败:忙碌中,无法打开门锁
/// </summary> /// </summary>
public static string GetError2 = "GetError2"; public static string GetError2 = "GetError2";
/// <summary> /// <summary>
///锁门失败:请先关闭上料机构 ///锁门失败:请先关闭上料机构
/// </summary> /// </summary>
public static string CloseError = "CloseError"; public static string CloseError = "CloseError";
/// <summary> /// <summary>
///已确认料盘已手动拿出 ///已确认料盘已手动拿出
/// </summary> /// </summary>
public static string TakeTrayOut = "TakeTrayOut"; public static string TakeTrayOut = "TakeTrayOut";
/// <summary> /// <summary>
///未检测到气压信号 ///未检测到气压信号
/// </summary> /// </summary>
public static string NoAIr = "NoAIr"; public static string NoAIr = "NoAIr";
/// <summary> /// <summary>
///料盘高度 ///料盘高度
/// </summary> /// </summary>
public static string trayHeight = "trayHeight"; public static string trayHeight = "trayHeight";
/// <summary> /// <summary>
///负限位 ///负限位
/// </summary> /// </summary>
public static string FuLimit = "FuLimit"; public static string FuLimit = "FuLimit";
/// <summary> /// <summary>
///正限位 ///正限位
/// </summary> /// </summary>
public static string ZhLimit = "ZhLimit"; public static string ZhLimit = "ZhLimit";
/// <summary> /// <summary>
///上料轴运动停止 ///上料轴运动停止
/// </summary> /// </summary>
public static string BatchStop = "BatchStop"; public static string BatchStop = "BatchStop";
/// <summary> /// <summary>
///扫码结束 ///扫码结束
/// </summary> public static string ScanOk = "ScanOk"; /// </summary> public static string ScanOk = "ScanOk";
/// <summary> /// <summary>
///操作人员拿走料盘 ///操作人员拿走料盘
/// </summary> /// </summary>
public static string TakeTrayGo = "TakeTrayGo"; public static string TakeTrayGo = "TakeTrayGo";
/// <summary> /// <summary>
///等待送料结束 ///等待送料结束
/// </summary> /// </summary>
public static string WaitEnd = "WaitEnd"; public static string WaitEnd = "WaitEnd";
/// <summary> /// <summary>
///吸盘吸料失败 ///吸盘吸料失败
/// </summary> /// </summary>
public static string XiLiaoError = "XiLiaoError"; public static string XiLiaoError = "XiLiaoError";
/// <summary> /// <summary>
///伺服OFF ///伺服OFF
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!