Commit 86f90bf4 LN

bug修改

1 个父辈 dee11770
......@@ -1093,7 +1093,7 @@ namespace OnlineStore.ACSingleStore
}
else
{
ConfigAppSettings.SaveValue(Setting_Init.App_AutoRun, 0);
ConfigAppSettings.SaveValue(Setting_Init.UseBuzzer, 0);
store.UseBuzzer = false;
LogUtil.info("去掉:启用蜂鸣器");
}
......
......@@ -42,7 +42,7 @@ namespace OnlineStore
LoadData();
}
}
private static char spilt = ',';
private static char spilt = ',';
private static void LoadData()
{
ResourceControl.GetChinaStringEvent += GetChinaString;
......@@ -51,12 +51,12 @@ namespace OnlineStore
ResourceControl.GetStringEvent += GetString;
CSVResourceControl.GetStrEvent += GetString;
CSVResourceControl.GetStringEvent += GetString;
// CodeLibrary.CodeResourceControl.GetLanguageEvent += CodeResourceControl_GetLanguageEvent;
// CodeLibrary.CodeResourceControl.GetLanguageEvent += CodeResourceControl_GetLanguageEvent;
//string englishPath = Application.StartupPath + @"\resource\en-US.resource";
//string chinaPath = Application.StartupPath + @"\resource\zh-CN.resource";
//Dictionary<string, string> ChinaMap = LoadDataMap(chinaPath);
//Dictionary<string, string> EnglishMap = LoadDataMap(englishPath);
string rPath= Application.StartupPath + @"\resource\language.resource";
string rPath = Application.StartupPath + @"\resource\language.resource";
ResourceMap = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> ChinaMap = new Dictionary<string, string>();
Dictionary<string, string> EnglishMap = new Dictionary<string, string>();
......@@ -82,15 +82,31 @@ namespace OnlineStore
{
eng = array[2].Replace('&', ',').Trim();
}
ChinaMap.Add(key, china);
if (ChinaMap.ContainsKey(key))
{
ChinaMap[key] = china;
}
else
{
ChinaMap.Add(key, china);
}
if (String.IsNullOrEmpty(eng).Equals(false))
{
EnglishMap.Add(key, eng);
if (EnglishMap.ContainsKey(key))
{
EnglishMap[key] = eng;
}
else
{
EnglishMap.Add(key, eng);
}
// EnglishMap.Add(key, eng);
}
}
}catch(Exception ex)
}
catch (Exception ex)
{
LogUtil.error("读取文件【"+ rPath + "】【"+ line + "】出错:" + ex.ToString());
LogUtil.error("读取文件【" + rPath + "】【" + line + "】出错:" + ex.ToString());
}
}
}
......@@ -123,7 +139,7 @@ namespace OnlineStore
EnglishMap.Add(key, englistr);
}
}
string str = key + spilt + chinastr.Replace( spilt, '&') + spilt + englistr.Replace( spilt, '&');
string str = key + spilt + chinastr.Replace(spilt, '&') + spilt + englistr.Replace(spilt, '&');
allList.Add(str);
}
if (isNeedUpE)
......@@ -148,17 +164,17 @@ namespace OnlineStore
//FileUtil.SaveListToFile(allList.ToArray(), Application.StartupPath + "\\a.txt");
}
private static Dictionary<string,string> LoadRMap()
private static Dictionary<string, string> LoadRMap()
{
string path = Application.StartupPath + @"\resource\ResourceMap.csv";
Dictionary<string, string> map = new Dictionary<string, string>();
try
{
if (!File.Exists(path))
{
{
return map;
}
string[] lines = File.ReadAllLines(path);
string[] lines = File.ReadAllLines(path);
foreach (string line in lines)
{
if (String.IsNullOrEmpty(line))
......@@ -170,18 +186,24 @@ namespace OnlineStore
{
if (array.Length >= 3)
{
map.Add(array[1].Replace('&', ',').Trim(), array[2].Replace('&', ',').Trim());
string key = array[1].Replace('&', ',').Trim();
string value = array[2].Replace('&', ',').Trim();
if (map.ContainsKey(key))
{
map[key] = value;
}
else { map.Add(key, value); }
}
}
catch (Exception ex)
{
LogUtil.error("加载 " + path + "[" + line + "] 出错:" + ex.ToString());
}
}
}
}
catch (Exception ex)
{
LogUtil.error("加载 "+ path + " 出错:" + ex.ToString());
LogUtil.error("加载 " + path + " 出错:" + ex.ToString());
}
return map;
}
......@@ -244,14 +266,14 @@ namespace OnlineStore
public static string GetChinaString(string id, params object[] param)
{
string strCurLanguage = gets(China, id);
return String.Format(strCurLanguage, param);
return String.Format(strCurLanguage, param);
}
public static string GetEnglishString(string id, params object[] param)
{
{
string strCurLanguage = gets(English, id);
return String.Format(strCurLanguage, param);
return String.Format(strCurLanguage, param);
}
private static string gets(string language,string id,string defaultStr="")
private static string gets(string language, string id, string defaultStr = "")
{
if (String.IsNullOrEmpty(defaultStr))
{
......@@ -273,21 +295,22 @@ namespace OnlineStore
{
if (ResourceMap[language].ContainsKey(id.Trim()))
{
return ResourceMap[language][id];
return ResourceMap[language][id];
}
else
{
NoIdLog(id, defaultStr);
}
}
}
}
}
catch (Exception ex)
{
NoIdLog(id, defaultStr);
}return defaultStr;
}
return defaultStr;
}
public static string GetString(string id, string defaultStr="")
public static string GetString(string id, string defaultStr = "")
{
string strCurLanguage = defaultStr;
if (string.IsNullOrEmpty(defaultStr))
......@@ -356,8 +379,8 @@ namespace OnlineStore
foreach (string key in defaultMap.Keys)
{
string value = defaultMap[key];
LogUtil.info("" + key + spilt + value +spilt +"");
LogUtil.RLog("" + key + spilt + value.Replace(spilt,'&') + spilt+"");
LogUtil.info("" + key + spilt + value + spilt + "");
LogUtil.RLog("" + key + spilt + value.Replace(spilt, '&') + spilt + "");
}
LogUtil.info("结束打印缺少的文字配置");
......@@ -394,7 +417,7 @@ namespace OnlineStore
string showMsg = ResourceCulture.GetString(msg, msg, param);
string showTitle = ResourceCulture.GetString("提示");
return MessageBox.Show( showMsg,showTitle);
return MessageBox.Show(showMsg, showTitle);
}
public static DialogResult Show(string msg, string title, MessageBoxButtons but, params object[] param)
{
......
......@@ -299,4 +299,17 @@ trayHeight,料盘高度,Reel height,
左侧门未关,左侧门未关,Left door open
右侧门未关,右侧门未关,Right door open
FrmStoreBox_chbIsDebug_Text,调试状态,debug mode
光栅被遮挡,光栅被遮挡,Grating blocked
\ No newline at end of file
光栅被遮挡,光栅被遮挡,Grating blocked
InTrouble,故障中,In trouble
OutStoreBoxEnd,料盘出仓位完成,Providing executed
OutStoreExecute,出库执行中,Providing Executing
StoreOnline,设备联机,System online
SuddenStop,急停中,Emerengy stop
OutMoveExecute,出库完成,Providing Executed
InStoreFailed,入库失败,Saving failed
OutStoreFailed,出库失败,Providing failed
WaitSingle,等待信号,Wait signal
TimeOut,超时,Time out
Run,运行中,Runing
Runing,运行中,Runing
OutStorEnd,出库完成,OutStorEnd
\ No newline at end of file
......@@ -389,5 +389,9 @@ namespace OnlineStore.DeviceLibrary
/// 批量轴已满,请取出料盘
/// </summary>
public static string OutFull = "OutFull";
/// <summary>
/// 出库完成
/// </summary>
public static string OutStorEnd = "OutStorEnd";
}
}
......@@ -864,7 +864,7 @@ namespace OnlineStore.DeviceLibrary
return;
}
if (UseBuzzer)
if (!UseBuzzer)
{
IOManager.IOMove(IO_Type.Alarm_Buzzer, IO_VALUE.LOW);
}
......@@ -1854,7 +1854,7 @@ namespace OnlineStore.DeviceLibrary
{
boxStatus.msg = CodeMsg;
boxStatus.msgEn = CodeMsgEn;
// lineOperation.msg = CodeMsg;
// lineOperation.msg = CodeMsg;
lineOperation.msg = CodeMsg;
lineOperation.msgEn = CodeMsgEn;
}
......@@ -1905,6 +1905,11 @@ namespace OnlineStore.DeviceLibrary
{
lineOperation.alarmList.Add(alarmInfo);
}
if (lineOperation.data == null)
{
lineOperation.data = new Dictionary<string, string>();
}
lineOperation.data.Add(IO_Type.TrayCheck_Door, IOManager.IOValue(IO_Type.TrayCheck_Door).ToString());
return lineOperation;
}
......
......@@ -710,10 +710,8 @@ namespace OnlineStore.DeviceLibrary
{
if (IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.LOW))
{
StoreMove.NextMoveStep(StoreMoveStep.SO_14_GoBack);
OutStoreLog("出库:SO_13 升降轴返回,轴2至P1(待机点) ,关闭舱门");
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
CloseDoorAndWait();
SO_14_GoBack();
}
else
{
......@@ -724,10 +722,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_13_CheckTray)
{
StoreMove.NextMoveStep(StoreMoveStep.SO_14_GoBack);
OutStoreLog("出库:SO_13 升降轴返回,轴2至P1(待机点) ,关闭舱门");
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
CloseDoorAndWait();
SO_14_GoBack();
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_14_GoBack)
{
......@@ -761,6 +756,21 @@ namespace OnlineStore.DeviceLibrary
}
}
private void SO_14_GoBack()
{
StoreMove.NextMoveStep(StoreMoveStep.SO_14_GoBack);
OutStoreLog("出库:SO_13 升降轴返回,轴2至P1(待机点) ,关闭舱门,更改状态为出库完成");
ACAxisMove(Config.UpDown_Axis, StoreMove.MoveParam.MoveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
CloseDoorAndWait();
//改为出库完成
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : "";
lastPosId = posId;
lastPosIdStatus = StoreStatus.OutStorEnd;
storeStatus = StoreStatus.OutStorEnd;
}
private void SO_10_DeviceToDoorPro()
{
LineMoveP moveP = StoreMove.MoveParam.MoveP;
......
......@@ -161,8 +161,8 @@ namespace OnlineStore.DeviceLibrary
case StoreStatus.InStoreFaild:
aa = ResourceControl.GetString(ResourceControl.InStoreFailed, "入库失败") + "(" + WarnObj.WarnMsg + ")";
break;
case StoreStatus.OutStoreFaild:
aa = ResourceControl.GetString(ResourceControl.OutStoreFailed, "出库失败") + "(" + WarnObj.WarnMsg + ")";
case StoreStatus.OutStorEnd:
aa = ResourceControl.GetString(ResourceControl.OutStorEnd, "出库完成") + "(" + WarnObj.WarnMsg + ")";
break;
}
if (!String.IsNullOrEmpty(aa))
......
......@@ -93,13 +93,13 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
OutStoreBoxEnd = 10,
/// <summary>
/// 12=移栽出库移栽过程中(移栽完成后变成OnLine)
///11=出库完成
/// </summary>
OutMoveExecute = 12,
OutStorEnd = 11,
/// <summary>
///11=出库失败
/// 12=移栽出库移栽过程中(移栽完成后变成OnLine)
/// </summary>
OutStoreFaild = 11,
OutMoveExecute = 12,
/// <summary>
/// 重置中(原点返回和重置都发此状态)
/// </summary>
......
SISO料仓9台
datalogic版本,增加照明DO,门打开时自动打开照明。
DIDO定义修改。
\ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!