Commit e66fc94e LN

aoi界面调整

1 个父辈 82021319
...@@ -165,6 +165,31 @@ namespace AccAOI ...@@ -165,6 +165,31 @@ namespace AccAOI
} }
else else
{ {
//判断有没有
//FrmAoiSetting_btnUpdateName_Text
try
{
string formName = " FrmAoiSetting";
if (!id.StartsWith(formName))
{
string[] arrays = id.Split('_');
if (arrays.Length == 3)
{
string newId = formName + "_" + arrays[1] + "_" + arrays[2];
if (ResourceMap[CurrLanguage].ContainsKey(newId.Trim()))
{
strCurLanguage = ResourceMap[CurrLanguage][id];
return strCurLanguage;
}
}
}
}
catch (Exception ex)
{
Console.WriteLine($"id={id} error :" + ex.ToString());
}
NoIdLog(id, defaultStr); NoIdLog(id, defaultStr);
} }
} }
...@@ -215,10 +240,10 @@ namespace AccAOI ...@@ -215,10 +240,10 @@ namespace AccAOI
} }
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)
{ //{
return className + spiltStr + controlName + spiltStr + propertyName; // return className + spiltStr + controlName + spiltStr + propertyName;
} //}
public static string GetIdStr(string className, string propertyName) public static string GetIdStr(string className, string propertyName)
{ {
return className + spiltStr + propertyName; return className + spiltStr + propertyName;
......
...@@ -423,7 +423,7 @@ namespace AccAOI ...@@ -423,7 +423,7 @@ namespace AccAOI
//AoiMethod methodInfo = ControlUtil.GetMethod(text); //AoiMethod methodInfo = ControlUtil.GetMethod(text);
AoiMethod methodInfo = new AoiEyemTemplateMethod(); AoiMethod methodInfo = new AoiEyemTemplateMethod();
string text = AOIResourceCulture.GetValue("模版匹配"); string text = AOIResourceCulture.GetValue("模版匹配");
string defaultName = Project.methodMap.Values.Count.ToString().PadLeft(2, '0') + "_" + text; string defaultName =( Project.methodMap.Values.Count+1).ToString().PadLeft(2, '0') + "_" + text;
FrmMethodName frmName = new FrmMethodName(defaultName, new List<string>(Project.methodMap.Keys)); FrmMethodName frmName = new FrmMethodName(defaultName, new List<string>(Project.methodMap.Keys));
frmName.Text = AOIResourceCulture.GetValue("请输入新【{0}】名称",text); frmName.Text = AOIResourceCulture.GetValue("请输入新【{0}】名称",text);
DialogResult result = frmName.ShowDialog(); DialogResult result = frmName.ShowDialog();
...@@ -670,6 +670,7 @@ namespace AccAOI ...@@ -670,6 +670,7 @@ namespace AccAOI
btnImageChange.Text = AOIResourceCulture.GetValue("显示测试图片"); btnImageChange.Text = AOIResourceCulture.GetValue("显示测试图片");
lblCurrImage.Text = AOIResourceCulture.GetValue("基准图:"); lblCurrImage.Text = AOIResourceCulture.GetValue("基准图:");
lblCurrImage.ForeColor = Color.LawnGreen; lblCurrImage.ForeColor = Color.LawnGreen;
groupImage.Text= AOIResourceCulture.GetValue("基准图:");
imageBox1.Image = BaseImg; imageBox1.Image = BaseImg;
} }
else else
...@@ -678,6 +679,7 @@ namespace AccAOI ...@@ -678,6 +679,7 @@ namespace AccAOI
imageBox1.Visible = false; imageBox1.Visible = false;
btnImageChange.Text = AOIResourceCulture.GetValue("显示基准图片"); btnImageChange.Text = AOIResourceCulture.GetValue("显示基准图片");
lblCurrImage.Text = AOIResourceCulture.GetValue("测试/效果图:"); lblCurrImage.Text = AOIResourceCulture.GetValue("测试/效果图:");
groupImage.Text = AOIResourceCulture.GetValue("测试/效果图:");
lblCurrImage.ForeColor = Color.DodgerBlue; lblCurrImage.ForeColor = Color.DodgerBlue;
} }
} }
...@@ -891,7 +893,7 @@ namespace AccAOI ...@@ -891,7 +893,7 @@ namespace AccAOI
AoiMethod OldMethod = aoiControl.GetAoiInfo(); AoiMethod OldMethod = aoiControl.GetAoiInfo();
AoiMethod methodInfo = OldMethod.GetClone(); AoiMethod methodInfo = OldMethod.GetClone();
string text = ControlUtil.GetMethodType(methodInfo); string text = ControlUtil.GetMethodType(methodInfo);
string defaultName = Project.methodMap.Values.Count.ToString().PadLeft(2, '0') + "_" + text; string defaultName = (Project.methodMap.Values.Count+1).ToString().PadLeft(2, '0') + "_" + text;
FrmMethodName frmName = new FrmMethodName(defaultName, new List<string>(Project.methodMap.Keys)); FrmMethodName frmName = new FrmMethodName(defaultName, new List<string>(Project.methodMap.Keys));
frmName.Text = AOIResourceCulture.GetValue("请输入新【{0}】名称", text); frmName.Text = AOIResourceCulture.GetValue("请输入新【{0}】名称", text);
DialogResult result = frmName.ShowDialog(); DialogResult result = frmName.ShowDialog();
......
...@@ -45,7 +45,7 @@ namespace AccAOI ...@@ -45,7 +45,7 @@ namespace AccAOI
private void ConProcess(System.Windows.Forms.Control con, string className) private void ConProcess(System.Windows.Forms.Control con, string className)
{ {
if ( con is FlatLabel || con is FlatButton || con is Label || con is Button) if (con is FlatLabel || con is FlatButton || con is Label || con is Button)
{ {
string newStr = AOIResourceCulture.GetString(AOIResourceCulture.GetTextIdStr(className, con.Name), con.Text); string newStr = AOIResourceCulture.GetString(AOIResourceCulture.GetTextIdStr(className, con.Name), con.Text);
con.Text = newStr; con.Text = newStr;
...@@ -60,6 +60,18 @@ namespace AccAOI ...@@ -60,6 +60,18 @@ namespace AccAOI
ConProcess(pancon, className); ConProcess(pancon, className);
} }
} }
else if (con is FlatPanel || con is GroupBox)
{
string newStr = AOIResourceCulture.GetString(AOIResourceCulture.GetTextIdStr(className, con.Name), con.Text);
GroupBox pan = (GroupBox)con;
foreach (System.Windows.Forms.Control pancon in pan.Controls)
{
ConProcess(pancon, className);
}
string newGroupStr = AOIResourceCulture.GetString(AOIResourceCulture.GetTextIdStr(className, con.Name), con.Text);
con.Text = newGroupStr;
con.Tag = newStr;
}
} }
public virtual void LanguagePro() public virtual void LanguagePro()
......
FrmAoiSetting_Text=AOI FrmAoiSetting_Text=AOI
FrmAoiSetting_btnUpdateName_Text=Rename FrmAoiSetting_btnUpdateName_Text=Rename
FrmAoiSetting_lblCurrImage_Text=Standard Image: FrmAoiSetting_lblCurrImage_Text=Standard Image:
FrmAoiSetting_flatButton1_Text=Get test image FrmAoiSetting_flatButton1_Text=Capture
FrmAoiSetting_flatButton2_Text=Select test image FrmAoiSetting_flatButton2_Text=Upload
FrmAoiSetting_btnImageChange_Text=Switch to test Image FrmAoiSetting_btnImageChange_Text=Switch to test Image
FrmAoiSetting_btnDel_Text=Delete FrmAoiSetting_btnDel_Text=Delete
FrmAoiSetting_btnCopy_Text=Copy FrmAoiSetting_btnCopy_Text=Copy
FrmAoiSetting_btnExcute_Text=Execute FrmAoiSetting_btnExcute_Text=Start
FrmAoiSetting_btnGetCameraImg_Text=Get standard Image FrmAoiSetting_btnGetCameraImg_Text=Capture
FrmAoiSetting_flatLabel1_Text=Cameras: FrmAoiSetting_flatLabel1_Text=Cameras:
FrmAoiSetting_btnOpenImage_Text=Select reference picture FrmAoiSetting_btnOpenImage_Text=Upload
FrmAoiSetting_btnNewAoi_Text=New FrmAoiSetting_btnNewAoi_Text=New
FrmAoiSetting_btnSavePro_Text=Save project FrmAoiSetting_btnSavePro_Text=Save project
FrmAoiSetting_btnOpenPro_Text=Open project FrmAoiSetting_btnOpenPro_Text=Open project
...@@ -82,7 +82,7 @@ AoiColorMatchControl_btnClearArea_Text=Clear ...@@ -82,7 +82,7 @@ AoiColorMatchControl_btnClearArea_Text=Clear
AoiColorMatchControl_btnImgType_Text=Original AoiColorMatchControl_btnImgType_Text=Original
AoiColorMatchControl_btnSetArea_Text=Ellipse AoiColorMatchControl_btnSetArea_Text=Ellipse
AoiColorMatchControl_panAreaImage_Text=Regional Image AoiColorMatchControl_panAreaImage_Text=Regional Image
FrmAoiSetting_btnPCBRect_Text=Set PCB Criteria Range FrmAoiSetting_btnPCBRect_Text=Range Define
AioEyemMarkControl_btnTest_Text=Apply AioEyemMarkControl_btnTest_Text=Apply
AioEyemMarkControl_flatLabel3_Text=Similarity: AioEyemMarkControl_flatLabel3_Text=Similarity:
AioEyemMarkControl_flatLabel2_Text=Mark area x AioEyemMarkControl_flatLabel2_Text=Mark area x
...@@ -117,10 +117,10 @@ Mark区域无效=Mark area is invalid. ...@@ -117,10 +117,10 @@ Mark区域无效=Mark area is invalid.
FrmMethodName_btnOk_Text=OK FrmMethodName_btnOk_Text=OK
FrmMethodName_btnCancel_Text=Cancel FrmMethodName_btnCancel_Text=Cancel
请输入新【{0}】名称=Please enter a new [{0}] name. 请输入新【{0}】名称=Please enter a new [{0}] name.
显示基准图片=Display Standard Image 显示基准图片=Tempelate
测试/效果图:=Testing/Rendering Image 测试/效果图:=Verify
显示测试图片=Switch To Test Image 显示测试图片=Verify
基准图:=Standard Image 基准图:=Tempelate
原图=Original 原图=Original
区域图像 - 效果图=Area Image - Renderings 区域图像 - 效果图=Area Image - Renderings
区域设置 - 椭圆=Locale - Ellipse 区域设置 - 椭圆=Locale - Ellipse
...@@ -146,3 +146,10 @@ FrmMethodName_btnCancel_Text=Cancel ...@@ -146,3 +146,10 @@ FrmMethodName_btnCancel_Text=Cancel
模版匹配=Template Matching 模版匹配=Template Matching
保存基准图=Save Standard Image 保存基准图=Save Standard Image
保存测试图=Save Test Image 保存测试图=Save Test Image
图像校准点1=图像校准点1
模板匹配1=模板匹配1
FrmAoiSetting_groupBox4_Text=Range of interest
FrmAoiSetting_groupImage_Text=Tempelate
FrmAoiSetting_groupBox2_Text=Verify
FrmAoiSetting_groupBox1_Text=Tempelate
FrmAoiSetting_label1_Text=label1
\ No newline at end of file \ No newline at end of file
...@@ -146,4 +146,11 @@ FrmMethodName_btnCancel_Text=取消 ...@@ -146,4 +146,11 @@ FrmMethodName_btnCancel_Text=取消
模版匹配=模版匹配 模版匹配=模版匹配
保存基准图=保存基准图 保存基准图=保存基准图
保存测试图=保存测试图 保存测试图=保存测试图
图像校准点1=图像校准点1
模板匹配1=模板匹配1
FrmAoiSetting_groupBox4_Text=ROI 参数
FrmAoiSetting_groupImage_Text=基准图
FrmAoiSetting_groupBox2_Text=测试图片
FrmAoiSetting_groupBox1_Text=基准图片
FrmAoiSetting_label1_Text=label1
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!