|
@@ -1146,6 +1146,7 @@ namespace Extender
|
|
private byte[] m_ImageBit = null;
|
|
private byte[] m_ImageBit = null;
|
|
private long m_nImageWidth = 0;
|
|
private long m_nImageWidth = 0;
|
|
private long m_nImageHeight = 0;
|
|
private long m_nImageHeight = 0;
|
|
|
|
+ private double m_dImagePixelsize = 0;//it will be initialized when we get an image from the EDS.
|
|
bool m_bAcquistionDone = false;
|
|
bool m_bAcquistionDone = false;
|
|
private Bitmap m_Bitmap = null;
|
|
private Bitmap m_Bitmap = null;
|
|
|
|
|
|
@@ -1185,7 +1186,7 @@ namespace Extender
|
|
{
|
|
{
|
|
IElectronImage electronImage = e.Value[0];
|
|
IElectronImage electronImage = e.Value[0];
|
|
|
|
|
|
- if (!ReadImageData(electronImage, out m_ImageBit, out m_nImageWidth, out m_nImageHeight))
|
|
|
|
|
|
+ if (!ReadImageData(electronImage, out m_ImageBit, out m_nImageWidth, out m_nImageHeight,out m_dImagePixelsize))
|
|
{
|
|
{
|
|
MessageBox.Show("图像采集完成,获取图像像素失败!");
|
|
MessageBox.Show("图像采集完成,获取图像像素失败!");
|
|
}
|
|
}
|
|
@@ -1197,10 +1198,11 @@ namespace Extender
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- bool ReadImageData(IElectronImage a_electronImage, out Byte[] a_pImageBits, out long a_nImageHeight, out long a_nImageWidth)
|
|
|
|
|
|
+ bool ReadImageData(IElectronImage a_electronImage, out Byte[] a_pImageBits, out long a_nImageHeight, out long a_nImageWidth,out double a_nPixelSize)
|
|
{
|
|
{
|
|
a_nImageHeight = 0;
|
|
a_nImageHeight = 0;
|
|
a_nImageWidth = 0;
|
|
a_nImageWidth = 0;
|
|
|
|
+ a_nPixelSize = 0;
|
|
a_pImageBits = null;
|
|
a_pImageBits = null;
|
|
|
|
|
|
if (a_electronImage == null)
|
|
if (a_electronImage == null)
|
|
@@ -1210,6 +1212,7 @@ namespace Extender
|
|
|
|
|
|
a_nImageHeight = a_electronImage.Height;
|
|
a_nImageHeight = a_electronImage.Height;
|
|
a_nImageWidth = a_electronImage.Width;
|
|
a_nImageWidth = a_electronImage.Width;
|
|
|
|
+ a_nPixelSize = a_electronImage.PixelSize;
|
|
|
|
|
|
int nBytesPerPixel = a_electronImage.BytesPerPixel;
|
|
int nBytesPerPixel = a_electronImage.BytesPerPixel;
|
|
long nImageSize = a_nImageHeight * a_nImageWidth;
|
|
long nImageSize = a_nImageHeight * a_nImageWidth;
|
|
@@ -1519,25 +1522,12 @@ namespace Extender
|
|
EdSpectrumSettings.EdSettings.EnergyRange = 20;
|
|
EdSpectrumSettings.EdSettings.EnergyRange = 20;
|
|
EdSpectrumSettings.EdSettings.NumberOfChannels = 4096;
|
|
EdSpectrumSettings.EdSettings.NumberOfChannels = 4096;
|
|
|
|
|
|
- EdSpectrumSettings.ScanSettings.AcquisitionRegion.CreateFullFieldRegion(1.0 / 1024.0);
|
|
|
|
|
|
+ //EdSpectrumSettings.ScanSettings.AcquisitionRegion.CreateFullFieldRegion(1.0 / 1024.0);
|
|
}
|
|
}
|
|
|
|
|
|
void SetPointAcquistionRegion(double a_nX, double a_nY)
|
|
void SetPointAcquistionRegion(double a_nX, double a_nY)
|
|
{
|
|
{
|
|
- //Chord chord = new Chord(a_nX, a_nY, 1);
|
|
|
|
- //List < Chord > chords = new List < Chord> ();
|
|
|
|
- //chords.Add(chord);
|
|
|
|
-
|
|
|
|
- //ChordList chordsList = null;
|
|
|
|
- //if (m_nImageWidth != 0)
|
|
|
|
- //{
|
|
|
|
- // chordsList = new ChordList(chords, 1 / (double)m_nImageWidth);
|
|
|
|
- //}
|
|
|
|
- //else
|
|
|
|
- //{
|
|
|
|
- // chordsList = new ChordList(chords, 1 / 1024.0);
|
|
|
|
- //}
|
|
|
|
- //EdSpectrumSettings.ScanSettings.AcquisitionRegion.CreateChordListRegion(chordsList);
|
|
|
|
|
|
+
|
|
EdSpectrumSettings.ScanSettings.AcquisitionRegion.CreatePointRegion(new System.Windows.Point(a_nX, a_nY));
|
|
EdSpectrumSettings.ScanSettings.AcquisitionRegion.CreatePointRegion(new System.Windows.Point(a_nX, a_nY));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1719,7 +1709,7 @@ namespace Extender
|
|
|
|
|
|
SetXrayAcquisitionParam(ref dMilliSecondsTime);
|
|
SetXrayAcquisitionParam(ref dMilliSecondsTime);
|
|
|
|
|
|
- SetPointAcquistionRegion(x, y);
|
|
|
|
|
|
+ SetPointAcquistionRegion(x*m_dImagePixelsize, y*m_dImagePixelsize);
|
|
NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
|
|
NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
|
|
log.Info("开始XrayStartAcquisition:t="+dMilliSecondsTime.ToString()+"pos="+"("+x.ToString()+","+y.ToString()+")");
|
|
log.Info("开始XrayStartAcquisition:t="+dMilliSecondsTime.ToString()+"pos="+"("+x.ToString()+","+y.ToString()+")");
|
|
|
|
|