|
|
@@ -53,8 +53,7 @@ namespace OTSMeasureApp
|
|
|
|
|
|
#region 全部变量
|
|
|
public OTSIncAMeasureAppForm m_MeasureAppForm;
|
|
|
- /* 接收图像数据 */
|
|
|
- //public byte[] Imagedata = new byte[m_iWidth];
|
|
|
+
|
|
|
|
|
|
static int m_iWidth = 0;
|
|
|
static int m_iHeight = 0;
|
|
|
@@ -154,16 +153,6 @@ namespace OTSMeasureApp
|
|
|
|
|
|
m_ElementPointGDIObjects = new List<CRectangleGDIObject>();
|
|
|
|
|
|
-
|
|
|
- //if (OTSCommon.Language.ReadDefaultLanguage() == "ZH")
|
|
|
- //{
|
|
|
- // contextMenuStrip1.Items[(int)MeasureStateMenuType.ChangeDiffImageShow].Text = "显示至BSE原图";
|
|
|
- //}
|
|
|
- //else
|
|
|
- //{
|
|
|
- // contextMenuStrip1.Items[(int)MeasureStateMenuType.ChangeDiffImageShow].Text = "SwitchDisplayToBSEDiagram";
|
|
|
- //}
|
|
|
-
|
|
|
//进入时首先对XRayTable进行隐藏
|
|
|
panelXray.Visible = false;
|
|
|
//国际化
|
|
|
@@ -1431,7 +1420,7 @@ namespace OTSMeasureApp
|
|
|
var expC = m_MeasureAppForm.m_ProjRstData.GetWorkingSample().GetMsrParams().GetXRayParam().GetAnalyExpCount();
|
|
|
|
|
|
IEDSController m_EDSHardwareMgr = EDSController.GetEDSController(m_iWidth, m_iHeight, expC);
|
|
|
- //SemController m_SEMHardwareMgr = SemController.GetSEMController();
|
|
|
+
|
|
|
//1.连接电镜
|
|
|
if (m_EDSHardwareMgr.Connect())
|
|
|
{
|
|
|
@@ -1462,10 +1451,8 @@ namespace OTSMeasureApp
|
|
|
string a_strElementName = "";
|
|
|
//元素Xray数据
|
|
|
uint[] a_ElementXrayData = new uint[2000];
|
|
|
- //设置分辨率
|
|
|
- //m_EDSHardwareMgr.SetResolution(m_iWidth, m_iHeight);
|
|
|
- //设置期望计数率
|
|
|
- //m_EDSHardwareMgr.SetAnalyExpCount();
|
|
|
+
|
|
|
+
|
|
|
if (GetXRayAndElements(a_Milliseconds, (int)dMouseImgX, (int)dMouseImgY, ref a_ElementXrayData, ref a_nElementNum, ref a_strElementName))
|
|
|
{
|
|
|
log.Trace("--获取单点扫描数据:元素数量:'" + a_nElementNum + "' ,元素名称:'" + a_strElementName + "'--");
|
|
|
@@ -1831,44 +1818,44 @@ namespace OTSMeasureApp
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void button1_Click(object sender, EventArgs e)
|
|
|
- {
|
|
|
- COTSSample cSample = m_MeasureAppForm.m_ProjParam.GetWorkSample();
|
|
|
- int start = cSample.GetMsrParams().GetImageProcessParam().GetBGGray().GetStart();
|
|
|
- int end = cSample.GetMsrParams().GetImageProcessParam().GetBGGray().GetEnd();
|
|
|
- Image bInput = picBox.Image;
|
|
|
- List<ColorMap> colorMapTemp = new List<ColorMap>();
|
|
|
- for (int i = start; i <= end; i++)
|
|
|
- {
|
|
|
- ColorMap colorMap = new ColorMap();
|
|
|
- string colorName = "#" + Color.FromArgb(i, i, i).Name.ToString();
|
|
|
- colorMap.OldColor = ColorTranslator.FromHtml(colorName);
|
|
|
- colorMap.NewColor = Color.Red;
|
|
|
- colorMapTemp.Add(colorMap);
|
|
|
- }
|
|
|
- Bitmap outBitmap = new Bitmap(bInput);
|
|
|
- //创建Graphics对象
|
|
|
- Graphics g = Graphics.FromImage(outBitmap);
|
|
|
- //生成的图像大小
|
|
|
- int width = bInput.Width;
|
|
|
- int height = bInput.Height;
|
|
|
- //编辑被着急图像所要显示的位置
|
|
|
- Rectangle DrawRect = new Rectangle(0, 0, 1024, 768);
|
|
|
- //编辑输出画布中着色的位置
|
|
|
- Rectangle ShowRect = new Rectangle(0, 0, 1024, 768);
|
|
|
- ImageAttributes attr = new ImageAttributes();
|
|
|
- attr.SetRemapTable(colorMapTemp.ToArray());
|
|
|
- //从输入图像中截图至临时图像中
|
|
|
- g.DrawImage(bInput, ShowRect, 0, 0, DrawRect.Width, DrawRect.Height, GraphicsUnit.Pixel, attr);
|
|
|
- picBox.Image = outBitmap;
|
|
|
- }
|
|
|
+ //private void button1_Click(object sender, EventArgs e)
|
|
|
+ //{
|
|
|
+ // COTSSample cSample = m_MeasureAppForm.m_ProjParam.GetWorkSample();
|
|
|
+ // int start = cSample.GetMsrParams().GetImageProcessParam().GetBGGray().GetStart();
|
|
|
+ // int end = cSample.GetMsrParams().GetImageProcessParam().GetBGGray().GetEnd();
|
|
|
+ // Image bInput = picBox.Image;
|
|
|
+ // List<ColorMap> colorMapTemp = new List<ColorMap>();
|
|
|
+ // for (int i = start; i <= end; i++)
|
|
|
+ // {
|
|
|
+ // ColorMap colorMap = new ColorMap();
|
|
|
+ // string colorName = "#" + Color.FromArgb(i, i, i).Name.ToString();
|
|
|
+ // colorMap.OldColor = ColorTranslator.FromHtml(colorName);
|
|
|
+ // colorMap.NewColor = Color.Red;
|
|
|
+ // colorMapTemp.Add(colorMap);
|
|
|
+ // }
|
|
|
+ // Bitmap outBitmap = new Bitmap(bInput);
|
|
|
+ // //创建Graphics对象
|
|
|
+ // Graphics g = Graphics.FromImage(outBitmap);
|
|
|
+ // //生成的图像大小
|
|
|
+ // int width = bInput.Width;
|
|
|
+ // int height = bInput.Height;
|
|
|
+ // //编辑被着急图像所要显示的位置
|
|
|
+ // Rectangle DrawRect = new Rectangle(0, 0, 1024, 768);
|
|
|
+ // //编辑输出画布中着色的位置
|
|
|
+ // Rectangle ShowRect = new Rectangle(0, 0, 1024, 768);
|
|
|
+ // ImageAttributes attr = new ImageAttributes();
|
|
|
+ // attr.SetRemapTable(colorMapTemp.ToArray());
|
|
|
+ // //从输入图像中截图至临时图像中
|
|
|
+ // g.DrawImage(bInput, ShowRect, 0, 0, DrawRect.Width, DrawRect.Height, GraphicsUnit.Pixel, attr);
|
|
|
+ // picBox.Image = outBitmap;
|
|
|
+ //}
|
|
|
|
|
|
private void OTSMeasureStatusWindow_MouseClick(object sender, MouseEventArgs e)
|
|
|
{
|
|
|
|
|
|
if (e.Button == MouseButtons.Right && e.Clicks == 1)
|
|
|
{
|
|
|
- //contextMenuStrip1.Show();
|
|
|
+
|
|
|
contextMenuStrip1.Show(PointToScreen(e.Location));
|
|
|
SetContentMenu();
|
|
|
}
|