优化新模板控件

master
lhiven 8 months ago
parent ce6b6f6c6f
commit 4a80c9155e

@ -63,6 +63,8 @@ namespace Rs.MotionPlat.Commom
public int AngleExtent { get; set; }
public double Score { get; set; }
public int Exposure { get; set; } = 50;
public int Gain { get; set; } = 0;
/// <summary>
/// 模板中心X
@ -85,6 +87,8 @@ namespace Rs.MotionPlat.Commom
ini.WriteValue("ModelParam", "AngleStart", AngleStart.ToString());
ini.WriteValue("ModelParam", "AngleExtent", AngleExtent.ToString());
ini.WriteValue("ModelParam", "Score", Score.ToString());
ini.WriteValue("ModelParam", "Exposure", Exposure.ToString());
ini.WriteValue("ModelParam", "Gain", Gain.ToString());
//保存原图
string dirname = Path.Combine(savePath);

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.20.24.4")]
[assembly: AssemblyVersion("2.20.24.5")]
//[assembly: AssemblyFileVersion("1.0.0.0")]

File diff suppressed because it is too large Load Diff

@ -54,11 +54,6 @@ namespace Rs.Controls
this.eFindShapeMode = eFindShapeMode;
}
public void AttachFindShapeEvent(Action<HWindow_Final, HObject> fun)
{
FindShapeEvent = fun;
}
static int i = 0;
private void Instance_GrabOkEvent(int arg1, HObject arg2)
{
@ -577,6 +572,8 @@ namespace Rs.Controls
pm.AngleStart = int.Parse(txtAngleStart.Text);
pm.AngleExtent = int.Parse(txtAngleExtent.Text);
pm.Score = double.Parse(txtScore.Text);
pm.Exposure=int.Parse(txtExposure.Text);
pm.Gain = int.Parse(txtGain.Text);
//pm.ItemName = m_itemName;
pm.SaveModel(m_savePath);
Msg.ShowInfo("Save product model success!");
@ -634,6 +631,7 @@ namespace Rs.Controls
HOperatorSet.GetImageSize(hImage, out HTuple imgWidth, out HTuple imgHeight);
HOperatorSet.GenCrossContourXld(out HObject camCenter, imgHeight / 2, imgWidth / 2, Math.Max(imgHeight, imgWidth), 0);
hWindow_Final1.DispObj(camCenter, "green");
FindShapeEvent?.Invoke(hWindow_Final1, hImage);
}
}
else
@ -713,12 +711,16 @@ namespace Rs.Controls
string angleStart = ini.ReadValue("ModelParam", "AngleStart");
string angleExtent = ini.ReadValue("ModelParam", "AngleExtent");
string score = ini.ReadValue("ModelParam", "Score");
string exposure = ini.ReadValue("ModelParam", "Exposure");
string gain = ini.ReadValue("ModelParam", "Gain");
if (!string.IsNullOrEmpty(contrast) && !string.IsNullOrEmpty(angleStart) && !string.IsNullOrEmpty(angleExtent) && !string.IsNullOrEmpty(score))
{
tbarContrast.Value = int.Parse(contrast);
txtAngleStart.Text = angleStart;
txtAngleExtent.Text = angleExtent;
txtScore.Text = score;
txtExposure.Text = exposure;
txtGain.Text = gain;
}
}
}
@ -806,5 +808,29 @@ namespace Rs.Controls
hWindow_Final1.DrawModel = false;
}
public int GetExposure()
{
if(int.TryParse(txtExposure.Text,out int value))
return value;
return -1;
}
public int GetGain()
{
if(int.TryParse((txtGain.Text),out int value))
return value;
return -1;
}
public HObject GetImage()
{
return hImage;
}
public DataGridViewRowCollection GetResultRows()
{
return this.dataGridView1.Rows;
}
}
}

Loading…
Cancel
Save