123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680 |
-
- using OINA.Extender;
- using OINA.Extender.Acquisition;
- using OINA.Extender.Acquisition.Ed;
- using OINA.Extender.Acquisition.Image;
- using OINA.Extender.Data;
- using OINA.Extender.Data.Ed;
- using OINA.Extender.Data.Image;
- using OINA.Extender.MicroscopeControl;
- using OINA.Extender.Processing;
- using OINA.Extender.Processing.Ed;
- using OINA.Extender.Processing.Quant;
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.Drawing.Imaging;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading;
- using System.Windows.Forms;
- namespace OxfordExtenderWrapper
- {
-
- public class ExtenderWrapper1:MarshalByRefObject
- {
- NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
- private Thread controlThread;
- AutoResetEvent startEvent = new AutoResetEvent(false);
- AutoResetEvent endEvent = new AutoResetEvent(false);
- private oxfordCommandData currentCommand;
- #region 电镜控制、样品台
- //控制电镜
- private IMicroscopeController microscopeController = null;
- /// <summary>
- /// IImageAcquisitionController object
- /// </summary>
- private IImageAcquisitionController imageAcquisitionController = null;
- /// <summary>
- /// IImageSettings object
- /// </summary>
- private IImageAcquisitionSettings imageAcquisitionSettings = null;
- //控制器
- private IEdSpectrumAcquisitionController EdSpectrumAcquisitionController = null;
- private IEdSpectrumSettings EdSpectrumSettings = null;
- private IEdSpectrumProcessing EdSpectrumProcessing = null;
- // Use the autoIdSettings to define elements that are known or elements that you want to exclude. They also list elements that cannot be identified
- private IAutoIdSettings autoIdSettings = null;
- private ISEMQuantSettings quantSettings = null;
- //private IEdChordListAcquisitionController _edsChordListController = null;
- //private OxfordControllerState m_nState;
- private IEdChordListSettings _edsChordListSetting;
- private int XRayChannelLength = 2000;
- private int EDSColletionTimeOut = 10000;
-
- const int g_nOxfordControllerProcessTime = 4;
- const int g_nOxfordControllerEnergyRange = 20;
- private bool m_bXrayDone = false;
- //电压
- private double m_dHighVoltage;
- //放大倍数
- private double m_dMagnification;
- //工作距离
- private double m_dWorkingDistance;
- //亮度
- private double m_dBirghtness;
- //对比度
- private double m_dContrast;
- //BeamOn
- private bool m_bBeamOn;
- //FilamentOn
- private bool m_bFilamentOn;
- //样品台位置
- private double m_dStageX;
- private double m_dStageY;
- private double m_dStageZ;
- private double m_dStageR;
- private double m_dStageT;
- //构造函数
- public ExtenderWrapper1()
- {
-
- }
- public bool ConnectToEDSHardware()
- {
- try
- {
- InitMicroscopeController();
- InitImageAcquisition();
- InitXrayAcquistion();
- controlThread = new Thread(this.ControlerThread);
- controlThread.Start();
- return true;
- }
- catch (Exception e)
- {
- log.Error(e.Message);
- return false;
- }
-
- }
-
- //结束
- public void CloseExtender()
- {
- CloseMicroscopeController();
- CloseImageAcquisition();
- CloaseXrayAcquistion();
- currentCommand.commandType = OxfordCommandType.Exit;
- if (controlThread != null)
- {
- startEvent.Set();
- controlThread.Join();
- }
- controlThread = null;
- }
- private void ControlerThread()
- {
- while (true)
- {
- while (true)
- {
- if (startEvent.WaitOne(0, true))
- {
- break;
- }
-
- Application.DoEvents();
- }
- switch (currentCommand.commandType)
- {
- case OxfordCommandType.MoveStageXY:
- {
- MoveStageParam p = currentCommand.moveStagePrm;
-
- var stageDictionary = new Dictionary<Stage, double>
- {
- { Stage.StageX, (double)p.x/1000.0 },
- { Stage.StageY, (double)p.y /1000.0}
- };
- m_StageUpdated = false;
- this.microscopeController.SetStageConditions(stageDictionary);
- currentCommand.returnType = true;
- int time1 = Environment.TickCount;
- int time2;
- while (!m_StageUpdated)
- {
- Application.DoEvents();
-
- time2 = Environment.TickCount;
- if (time2 - time1 > 20000)
- {
- currentCommand.returnType = false;
- break;
- }
- }
-
-
-
- endEvent.Set();
- }
- break;
- case OxfordCommandType.ImageAquisition:
- {
- ImageAquistionParam p = currentCommand.grabImgParam;
- SetImageAcquistionSetting(p.DwellTime, p.sourceType, p.width);
- try
- {
- int lastingTime = 0;
- m_bAcquistionDone = false;
- imageAcquisitionController.BeginMultipleAcquisition();
- IEnumerable<IElectronImage> images = imageAcquisitionController.StartAcquisition(imageAcquisitionSettings);
- var time1 = Environment.TickCount;
- while (true)
- {
- if (m_bAcquistionDone)
- {
- p.ImageData = m_ImageBit;
- currentCommand.returnType = true;
- break;
- }
- Application.DoEvents();
-
- var time2 = Environment.TickCount;
- if (time2 - time1 > EDSColletionTimeOut * 6)
- {
- currentCommand.returnType = false;
- }
- }
- }
- catch (InvalidSettingsException settingsException)
- {
- var sb = new StringBuilder(@"Invalid settings have been supplied: ");
- sb.AppendLine();
- settingsException.ValidationResults.ValidationErrors.ToList().ForEach(ve => sb.AppendFormat("{0}{1}", Environment.NewLine, ve));
- NLog.LogManager.GetCurrentClassLogger().Error(sb.ToString());
- }
- catch (AcquisitionStartException startException)
- {
- string msg = string.Format(@"AcquisitionStartException: {0}", startException.Message);
- NLog.LogManager.GetCurrentClassLogger().Error(msg);
- }
- endEvent.Set();
- }
- break;
- case OxfordCommandType.XrayPointCollection:
- {
- PointXrayParam p = currentCommand.pointXrayPrm;
- m_bXrayDone = false;
- p.XrayData = new uint[XRayChannelLength];
- p.listElement = new Dictionary<string, double>();
- SetXrayAcquisitionParam(p.dMilliSecondsTime);
-
- EdSpectrumSettings.ScanSettings.AcquisitionRegion.CreatePointRegion(new System.Windows.Point(p.x * m_dImagePixelsize, p.y * m_dImagePixelsize));
- NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
-
- try
- {
- m_bXrayDone = false;
- var time1 = Environment.TickCount;
- IEdSpectrum edSpectrum = EdSpectrumAcquisitionController.StartAcquisition(EdSpectrumSettings);
-
- while (true)
- {
-
- if (m_bXrayDone)
- {
- currentCommand.returnType = true;
- break;
- }
- Application.DoEvents();
- var time2 = Environment.TickCount;
- if (time2 - time1 > EDSColletionTimeOut * 2)
- {
- EdSpectrumAcquisitionController.EndMultipleAcquisition();
- log.Warn("XrayStartAcquisition 超时!");
- currentCommand.returnType = false;
- }
- }
- }
- catch (InvalidSettingsException invalidSettingsException)
- {
- string msg = string.Format(@"Invalid Settings Exception:{0}, {1}",
- invalidSettingsException.Message,
- invalidSettingsException.ValidationResults.ValidationErrors);
- log.Error(msg);
- }
- catch (AcquisitionStartException acquisitionStartException)
- {
- string msg = string.Format(@"Acquisition Start Exception:{0}", acquisitionStartException.Message);
- log.Error(msg);
- }
-
- endEvent.Set();
- }
- break;
- case OxfordCommandType.COLLECT_XRAYPOINTS:
- {
- var p = currentCommand.XrayPrmForPoints;
-
- var PointXrayDatas = currentCommand.XrayPrmForPoints;
- currentCommand.PointXrayDataReceived = 0;
-
- m_bXrayDone = false;
-
- var dMilliSecondsTime = PointXrayDatas[0].dMilliSecondsTime;
- SetXrayAcquisitionParam(dMilliSecondsTime);
- foreach (var prm in PointXrayDatas)
- {
-
- EdSpectrumSettings.ScanSettings.AcquisitionRegion.CreatePointRegion(new System.Windows.Point(prm.x * m_dImagePixelsize, prm.y * m_dImagePixelsize));
- //log.Info("开始XrayStartAcquisition:t=" + dMilliSecondsTime.ToString() + "pos=" + "(" + prm.x.ToString() + "," + prm.y.ToString() + ")");
- try
- {
- m_bXrayDone = false;
- IEdSpectrum edSpectrum = EdSpectrumAcquisitionController.StartAcquisition(EdSpectrumSettings);
-
- }
- catch (InvalidSettingsException invalidSettingsException)
- {
- string msg = string.Format(@"Invalid Settings Exception:{0}, {1}",
- invalidSettingsException.Message,
- invalidSettingsException.ValidationResults.ValidationErrors);
- log.Error(msg);
- }
- catch (AcquisitionStartException acquisitionStartException)
- {
- string msg = string.Format(@"Acquisition Start Exception:{0}", acquisitionStartException.Message);
- log.Error(msg);
- }
- }
- var time1 = Environment.TickCount;
- while (true)
- {
- if (m_bXrayDone)
- {
- currentCommand.returnType = true;
- break;
- }
- Application.DoEvents();
-
- var time2 = Environment.TickCount;
- if (time2 - time1 > PointXrayDatas[0].dMilliSecondsTime * 5* PointXrayDatas.Count)
- {
- EdSpectrumAcquisitionController.EndMultipleAcquisition();
- log.Warn("XrayStartAcquisition 超时!");
- currentCommand.returnType = false;
- }
- }
- endEvent.Set();
- }
- break;
- case OxfordCommandType.XrayAreaCollection:
- {
- AreaXrayParam p = currentCommand.areaXrayPrm;
-
-
- m_bXrayDone = false;
- SetXrayAcquisitionParam(p.dMilliSecondsTime);
- List<Chord> Chords = new List<Chord>();
- foreach (Segment seg in p.a_listChord)
- {
- Chord chord = new Chord(seg.X, seg.Y, seg.Length);
- Chords.Add(chord);
- }
- SetAreaAcquistionRegion(Chords);
- try
- {
- int lastingTime = 0;
- IEdSpectrum edSpectrum = EdSpectrumAcquisitionController.StartAcquisition(EdSpectrumSettings);
- var time1 = Environment.TickCount;
- while (true)
- {
- if (m_bXrayDone)
- {
-
- currentCommand.returnType = true;
- break;
- }
-
- Application.DoEvents();
- var time2 = Environment.TickCount;
- if (time2 - time1 > p.dMilliSecondsTime * 10)
- {
- currentCommand.returnType = false;
-
- }
- }
- }
- catch (InvalidSettingsException invalidSettingsException)
- {
- string msg = string.Format(@"Invalid Settings Exception:{0}, {1}",
- invalidSettingsException.Message,
- invalidSettingsException.ValidationResults.ValidationErrors);
- log.Error(msg);
- }
- catch (AcquisitionStartException acquisitionStartException)
- {
- string msg = string.Format(@"Acquisition Start Exception:{0}", acquisitionStartException.Message);
- log.Error(msg);
- }
-
- endEvent.Set();
- }
- break;
- case OxfordCommandType.COLLECT_XRAYFEATURES:
- {
- var p = currentCommand.XrayPrmForFeatures;
- currentCommand.AreaXrayDataReceived = 0;
-
- m_bXrayDone = false;
- int lastingTime = 0;
- var dMilliSecondsTime = p[0].dMilliSecondsTime;
- SetXrayAcquisitionParam(p[0].dMilliSecondsTime);
- foreach (var prm in p)
- {
- List<Chord> Chords = new List<Chord>();
- foreach (Segment seg in prm.a_listChord)
- {
- Chord chord = new Chord(seg.X, seg.Y, seg.Length);
- Chords.Add(chord);
- }
- SetAreaAcquistionRegion(Chords);
- try
- {
- m_bXrayDone = false;
- IEdSpectrum edSpectrum = EdSpectrumAcquisitionController.StartAcquisition(EdSpectrumSettings);
- }
- catch (InvalidSettingsException invalidSettingsException)
- {
- string msg = string.Format(@"Invalid Settings Exception:{0}, {1}",
- invalidSettingsException.Message,
- invalidSettingsException.ValidationResults.ValidationErrors);
- log.Error(msg);
- }
- catch (AcquisitionStartException acquisitionStartException)
- {
- string msg = string.Format(@"Acquisition Start Exception:{0}", acquisitionStartException.Message);
- log.Error(msg);
- }
- }
- var time1 = Environment.TickCount;
- while (true)
- {
- if (m_bXrayDone)
- {
- currentCommand.returnType = true;
- break;
- }
- Application.DoEvents();
- var time2 = Environment.TickCount;
- if (time2 - time1 > p[0].dMilliSecondsTime * 5* p.Count)
- {
- EdSpectrumAcquisitionController.EndMultipleAcquisition();
- log.Warn("XrayStartAcquisition 超时!");
- //return false;
- currentCommand.returnType = false;
- }
- }
- endEvent.Set();
- }
- break;
-
- case OxfordCommandType.Exit:
- {
- endEvent.Set();
- log.Info("receive exit command");
- }
- break;
- }
- if (currentCommand.commandType == OxfordCommandType.Exit)
- {
- log.Info("exiting the thread");
- break;
- }
- }
- }
- public bool AquisitionImage(ref ImageAquistionParam p)
- {
- currentCommand.grabImgParam = p;
- currentCommand.commandType = OxfordCommandType.ImageAquisition;
- SetImageAcquistionSetting(p.DwellTime, p.sourceType, p.width);
- try
- {
- int lastingTime = 0;
- m_bAcquistionDone = false;
- imageAcquisitionController.BeginMultipleAcquisition();
- IEnumerable<IElectronImage> images = imageAcquisitionController.StartAcquisition(imageAcquisitionSettings);
- var time1 = Environment.TickCount;
- while (true)
- {
- if (m_bAcquistionDone)
- {
- p.ImageData = m_ImageBit;
- currentCommand.returnType = true;
- break;
- }
- Application.DoEvents();
- //Thread.Sleep(100);
- var time2 = Environment.TickCount;
- if (time2 - time1 > EDSColletionTimeOut * 6)
- {
- currentCommand.returnType = false;
- break;
- }
- }
- }
- catch (InvalidSettingsException settingsException)
- {
- var sb = new StringBuilder(@"Invalid settings have been supplied: ");
- sb.AppendLine();
- settingsException.ValidationResults.ValidationErrors.ToList().ForEach(ve => sb.AppendFormat("{0}{1}", Environment.NewLine, ve));
- NLog.LogManager.GetCurrentClassLogger().Error(sb.ToString());
- }
- catch (AcquisitionStartException startException)
- {
- string msg = string.Format(@"AcquisitionStartException: {0}", startException.Message);
- NLog.LogManager.GetCurrentClassLogger().Error(msg);
- }
- imageAcquisitionController.EndMultipleAcquisition();
- if (currentCommand.returnType == true)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- public bool MoveStageXY(float x, float y)
- {
- currentCommand.moveStagePrm = new MoveStageParam();
- currentCommand.moveStagePrm.x = x;
- currentCommand.moveStagePrm.y = y;
- currentCommand.commandType = OxfordCommandType.MoveStageXY;
- startEvent.Set();
- while (true)
- {
- if (endEvent.WaitOne(0, false))
- {
- break;
- }
- }
- if (currentCommand.returnType == true)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- public bool XrayAreaCollecting(ref AreaXrayParam p)
- {
-
- currentCommand.areaXrayPrm = p;
- currentCommand.commandType = OxfordCommandType.XrayAreaCollection;
- startEvent.Set();
- while (true)
- {
- if (endEvent.WaitOne(0, false))
- {
- break;
- }
- }
- if (currentCommand.returnType == true)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- public bool XrayPointCollecting(ref PointXrayParam p)
- {
- currentCommand.pointXrayPrm = p;
- currentCommand.commandType = OxfordCommandType.XrayPointCollection;
- startEvent.Set();
- while (true)
- {
- if (endEvent.WaitOne(0, false))
- {
- break;
- }
- Application.DoEvents();
- }
- if (currentCommand.returnType == true)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- public bool CollectXrayByPoints(ref List<PointXrayParam> a_listPoints, uint a_nXRayAQTime, bool a_bElementInfo)
- {
- foreach (var prm in a_listPoints)
- {
- prm.b_quant = a_bElementInfo;
- prm.dMilliSecondsTime = a_nXRayAQTime;
- }
- currentCommand.XrayPrmForPoints = a_listPoints;
-
- currentCommand.commandType = OxfordCommandType.COLLECT_XRAYPOINTS;
- startEvent.Set();
- while (true)
- {
- if (endEvent.WaitOne(0, false))
- {
- break;
- }
- Application.DoEvents();
- }
- if (currentCommand.returnType == true)
- {
-
- return true;
- }
- else
- {
- return false;
- }
- }
- public bool CollectXrayByFeatures(ref List<AreaXrayParam> a_listFeatures, double a_nXRayAQTime, bool a_bElementInfo)
- {
- foreach (var prm in a_listFeatures)
- {
- prm.b_quant = a_bElementInfo;
- prm.dMilliSecondsTime = a_nXRayAQTime;
- }
- currentCommand.XrayPrmForFeatures = a_listFeatures;
- currentCommand.commandType = OxfordCommandType.COLLECT_XRAYFEATURES;
- startEvent.Set();
- while (true)
- {
- if (endEvent.WaitOne(0, false))
- {
- break;
- }
- }
- if (currentCommand.returnType == true)
- {
- a_listFeatures = currentCommand.XrayPrmForFeatures;
- return true;
- }
- else
- {
- return false;
- }
- }
-
-
- internal oxfordCommandData GetCurrentCommand()
- {
- return currentCommand;
- }
- internal void SetCurrentCommand(oxfordCommandData value)
- {
- currentCommand = value;
- }
- //控制电镜初始化
- void InitMicroscopeController()
- {
- this.microscopeController = AcquireFactory.CreateMicroscopeControl();
- //this.microscopeController.ColumnChange += this.OnMicroscopeColumnChange;
- //this.microscopeController.StageChange += this.OnMicroscopeStageChange;
- this.microscopeController.ColumnConnected += this.OnMicroscopeColumnConnected;
- this.microscopeController.StageConnected += this.OnMicroscopeStageConnected;
- this.microscopeController.ChangeCompleted += this.OnMicroscopeChangeCompleted;
- ReadMicroscopeColumn();
- ReadStage();
- }
- //控制电镜释放
- void CloseMicroscopeController()
- {
- if (microscopeController != null)
- {
-
- //this.microscopeController.ColumnChange -= this.OnMicroscopeColumnChange;
- //this.microscopeController.StageChange -= this.OnMicroscopeStageChange;
- this.microscopeController.ColumnConnected -= this.OnMicroscopeColumnConnected;
- this.microscopeController.StageConnected -= this.OnMicroscopeStageConnected;
- this.microscopeController.ChangeCompleted -= this.OnMicroscopeChangeCompleted;
- microscopeController = null;
- }
-
- }
- //读取当前的电镜控制值
- private void ReadMicroscopeColumn()
- {
- var columnCapabilities = this.microscopeController.ColumnCapabilities;
- var columnConditions = this.microscopeController.ColumnConditions;
- if (columnCapabilities.Magnification.CanRead)
- {
- m_dMagnification = columnConditions.Magnification;
- }
- if (columnCapabilities.WorkingDistance.CanRead)
- {
- m_dWorkingDistance = columnConditions.WorkingDistance;
- }
- if (columnCapabilities.HighVoltage.CanRead)
- {
- m_dHighVoltage = columnConditions.HighVoltage;
- }
- if (columnCapabilities.Brightness.CanRead)
- {
- m_dBirghtness = columnConditions.Brightness;
- }
- if (columnCapabilities.Contrast.CanRead)
- {
- m_dContrast = columnConditions.Contrast;
- }
- if (columnCapabilities.BeamOn.CanRead)
- {
- m_bBeamOn = Convert.ToBoolean(columnConditions.BeamOn);
- }
- if (columnCapabilities.FilamentOn.CanRead)
- {
- m_bFilamentOn = Convert.ToBoolean(columnConditions.FilamentOn);
- }
- }
- //读取样品台位置
- private void ReadStage()
- {
- var stageCapabilities = this.microscopeController.StageCapabilities;
- var stageConditions = this.microscopeController.StageConditions;
- if (stageCapabilities.StageX.CanRead)
- {
- this.m_dStageX = stageConditions.StageX*1000.0;
- }
- if (stageCapabilities.StageY.CanRead)
- {
- this.m_dStageY = stageConditions.StageY*1000.0;
- }
- if (stageCapabilities.StageZ.CanRead)
- {
- this.m_dStageZ = stageConditions.StageZ;
- }
- if (stageCapabilities.StageT.CanRead)
- {
- this.m_dStageT = stageConditions.StageT;
- }
- if (stageCapabilities.StageR.CanRead)
- {
- this.m_dStageR = stageConditions.StageR;
- }
- }
- //电镜控制改变事件
- private void OnMicroscopeColumnChange(object sender, EventArgs e)
- {
-
- //ReadMicroscopeColumn();
- }
- //样品台控制改变事件
- private void OnMicroscopeStageChange(object sender, EventArgs e)
- {
- //ReadStage();
- }
- //列控制连接或断开时的事件
- private void OnMicroscopeColumnConnected(object sender, EventArgs e)
- {
- ReadMicroscopeColumn();
- }
- //样品台控制连接或断开时的事件
- private void OnMicroscopeStageConnected(object sender, EventArgs e)
- {
-
- ReadStage();
- }
- //样品台控制、电镜控制、外围控制的事件改变完成
- private void OnMicroscopeChangeCompleted(object sender, CompletedEventArgs e)
- {
- if (e.Control == MicroscopeControlType.Stage)
- {
- if (e.Success)
- {
- m_StageUpdated = true;
- }
- }
- else if (e.Control == MicroscopeControlType.Column)
- {
- if (e.Success)
- {
- m_CollumnUpdated = true;
- }
- }
- else if (e.Control == MicroscopeControlType.ExternalScan)
- {
- if (e.Success)
- {
- m_ExternalScanUpdated = true;
- }
- }
- ReadMicroscopeColumn();
- ReadStage();
- }
- public float GetMagnification()
- {
- return (float)m_dMagnification;
- }
- public Boolean SetMagnification(float set)
- {
- Dictionary<Column, double> columnDictionary = new Dictionary<Column, double>
- {
- { Column.Magnification, (double)set }
- };
- this.microscopeController.SetColumnConditions(columnDictionary);
- return true;
- }
- //焦距
- public float GetWorkingDistance()
- {
- return (float)m_dWorkingDistance;
- }
- public Boolean SetWorkingDistance(float set)
- {
- Dictionary<Column, double> columnDictionary = new Dictionary<Column, double>
- {
- { Column.WorkingDistance, (double)set }
- };
- this.microscopeController.SetColumnConditions(columnDictionary);
- return true;
- }
- //亮度
- public float GetBrightness()
- {
- return (float)m_dBirghtness;
- }
- public Boolean SetBrightness(float set)
- {
- Dictionary<Column, double> columnDictionary = new Dictionary<Column, double>
- {
- { Column.Brightness, (double)set }
- };
- this.microscopeController.SetColumnConditions(columnDictionary);
- return true;
- }
- //对比度
- public float GetContrast()
- {
- return (float)m_dContrast;
- }
- public Boolean SetContrast(float set)
- {
- Dictionary<Column, double> columnDictionary = new Dictionary<Column, double>
- {
- { Column.Contrast, (double)set }
- };
- this.microscopeController.SetColumnConditions(columnDictionary);
- return true;
- }
- //SEM电压
- public float GetSEMVoltage()
- {
- return (float)m_dHighVoltage;
- }
- public Boolean SetSEMVoltage(float set)
- {
- Dictionary<Column, double> columnDictionary = new Dictionary<Column, double>
- {
- { Column.HighVoltage, (double)set }
- };
- this.microscopeController.SetColumnConditions(columnDictionary);
- return true;
- }
- public bool SetSemScanExternal(bool b)
- {
- this.microscopeController.SetExternalScan(b);
- return true;
- }
-
- //样品台
- public float[] GetStagePosition()
- {
- float[] ret = new float[5];
- ret[0] = (float)m_dStageX;
- ret[1] = (float)m_dStageY;
- ret[2] = (float)m_dStageZ;
- ret[3] = (float)m_dStageT;
- ret[4] = (float)m_dStageR;
- return ret;
- }
- public Boolean SetStagePosition(float[] set)
- {
- double stageX = (double)set[0];
- double stageY = (double)set[1];
- double stageZ = (double)set[2];
- double stageT = (double)set[3];
- double stageR = (double)set[4];
-
- var stageDictionary = new Dictionary<Stage, double>
- {
- { Stage.StageX, (double)stageX/1000.0 },
- { Stage.StageY, (double)stageY/1000.0 },
- { Stage.StageZ, (double)stageZ },
- { Stage.StageT, (double)stageT },
- { Stage.StageR, (double)stageR }
- };
- this.microscopeController.SetStageConditions(stageDictionary);
- return true;
- }
- public float GetStageAtX()
- {
- return (float)m_dStageX;
- }
- public float GetStageAtY()
- {
- return (float)m_dStageY;
- }
- public float GetStageAtZ()
- {
- return (float)m_dStageZ;
- }
- public float GetStageAtT()
- {
- return (float)m_dStageT;
- }
- public float GetStageAtR()
- {
- return (float)m_dStageR;
- }
- public Boolean SetStageGotoX(float set)
- {
- double stageX = (double)set;
- var stageDictionary = new Dictionary<Stage, double>
- {
- { Stage.StageX, (double)stageX/1000.0 }
- };
- this.microscopeController.SetStageConditions(stageDictionary);
- return true;
- }
- public Boolean SetStageGotoY(float set)
- {
- double stageY = (double)set;
-
- var stageDictionary = new Dictionary<Stage, double>
- {
- { Stage.StageY, (double)stageY/1000.0 }
- };
- this.microscopeController.SetStageConditions(stageDictionary);
- return true;
- }
- public Boolean SetStageGotoZ(float set)
- {
- double stageZ = (double)set;
-
- var stageDictionary = new Dictionary<Stage, double>
- {
- { Stage.StageZ, (double)stageZ }
- };
- this.microscopeController.SetStageConditions(stageDictionary);
- return true;
- }
- public Boolean SetStageGotoT(float set)
- {
- double stageT = (double)set;
-
- var stageDictionary = new Dictionary<Stage, double>
- {
- { Stage.StageT, (double)stageT }
- };
- this.microscopeController.SetStageConditions(stageDictionary);
- return true;
- }
- public Boolean SetStageGotoR(float set)
- {
- double stageR = (double)set;
-
- var stageDictionary = new Dictionary<Stage, double>
- {
- { Stage.StageR, (double)stageR }
- };
- this.microscopeController.SetStageConditions(stageDictionary);
- return true;
- }
- private Boolean MoveStage(float x, float y)
- {
- double stageX = (double)x;
-
- double stageY = (double)y;
-
- var stageDictionary = new Dictionary<Stage, double>
- {
- { Stage.StageX, (double)stageX },
- { Stage.StageY, (double)stageY }
- };
- this.microscopeController.SetStageConditions(stageDictionary);
- return true;
- }
- #endregion
- #region 拍图
-
- //图像扫描尺寸
- public double[] ImageScanSize =
- {
- 32,
- 64,
- 128,
- 256,
- 512,
- 704,
- 768,
- 1024,
- 4096,
- 8192
- };
- private byte[] m_ImageBit = null;
- private long m_nImageWidth = 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;
- private bool m_StageUpdated;
- private bool m_CollumnUpdated;
- private bool m_ExternalScanUpdated;
- private double dImagePixelsize;
- public double GetDImagePixelsize()
- {
- return m_dImagePixelsize;
- }
- internal void SetDImagePixelsize(double value)
- {
- m_dImagePixelsize = value;
- }
- //private Bitmap m_Bitmap = null;
- void InitImageAcquisition()
- {
- imageAcquisitionController = AcquireFactory.CreateImageServer();
- imageAcquisitionSettings = AcquireFactory.CreateImageSettings();
- //imageAcquisitionSettings.
- //imageAcquisitionController.ExperimentStarted += this.OnImageExperimentStarted;
- imageAcquisitionController.ExperimentFinished += this.OnImageExperimentFinished;
- }
- void InitXrayAcquistion()
- {
- EdSpectrumSettings = AcquireFactory.CreateEdSpectrumSettings();
- EdSpectrumAcquisitionController = AcquireFactory.CreateEdSpectrumServer();
- EdSpectrumProcessing = ProcessingFactory.CreateSpectrumProcessing();
- // Use the autoIdSettings to define elements that are known or elements that you want to exclude. They also list elements that cannot be identified
- autoIdSettings = ProcessingFactory.CreateAutoIdSettings();
- quantSettings = ProcessingFactory.CreateSEMQuantSettings();
- EdSpectrumAcquisitionController.ExperimentFinished += this.OnEdSpectrumExperimentFinished;
- //EdSpectrumAcquisitionController.ExperimentStarted += this.OnEdSpectrumExperimentStarted;
- }
- //控制电镜释放
- void CloseImageAcquisition()
- {
- if (imageAcquisitionController != null)
- {
- //imageAcquisitionController.ExperimentStarted -= this.OnImageExperimentStarted;
- imageAcquisitionController.ExperimentFinished -= this.OnImageExperimentFinished;
- imageAcquisitionController = null;
- }
-
- }
- void CloaseXrayAcquistion()
- {
- if (EdSpectrumAcquisitionController != null)
- {
- EdSpectrumAcquisitionController.ExperimentFinished -= this.OnEdSpectrumExperimentFinished;
- //EdSpectrumAcquisitionController.ExperimentStarted -= this.OnEdSpectrumExperimentStarted;
- EdSpectrumAcquisitionController = null;
- }
- }
- /// <summary>
- /// OnImageExperimentStarted
- /// </summary>
- private void OnImageExperimentStarted(object sender, AcquisitionStartedEventArgs<IElectronImage[]> e)
- {
- NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
- log.Info("拍图开始事件!");
- }
- //int m_nState;
- /// <summary>
- /// OnImageExperimentFinished
- /// </summary>
- private void OnImageExperimentFinished(object sender, AcquisitionFinishedEventArgs<IElectronImage[]> e)
- {
- IElectronImage electronImage = e.Value[0];
- if (!ReadImageData(electronImage, out m_ImageBit, out m_nImageWidth, out m_nImageHeight, out m_dImagePixelsize))
- {
- NLog.LogManager.GetCurrentClassLogger().Error("图像采集完成,获取图像像素失败!");
- }
- if (m_ImageBit != null && m_ImageBit.Length == m_nImageWidth * m_nImageHeight)
- {
- m_bAcquistionDone = true;
- }
- }
- 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_nImageWidth = 0;
- a_nPixelSize = 0;
- a_pImageBits = null;
- if (a_electronImage == null)
- {
- return false;
- }
- a_nImageHeight = a_electronImage.Height;
- a_nImageWidth = a_electronImage.Width;
- a_nPixelSize = a_electronImage.PixelSize;
- int nBytesPerPixel = a_electronImage.BytesPerPixel;
- long nImageSize = a_nImageHeight * a_nImageWidth;
- long nBufferSize = nImageSize * nBytesPerPixel;
- Byte[] imageData = new Byte[nBufferSize];
- a_electronImage.GetData(imageData);
- a_pImageBits = new Byte[nImageSize];
- // default, oxford will return short image, we need to convert to byte
- if (nBytesPerPixel == 2)
- {
- int nBSEValue = 0;
- for (int i = 0; i < nImageSize; ++i)
- {
- nBSEValue = imageData[0 + i * nBytesPerPixel] + imageData[1 + i * nBytesPerPixel] * 255;
- a_pImageBits[i] = (Byte)(nBSEValue / 128.0 + 0.5);
- }
- }
- else
- {
- string msg = string.Format("image byte per pixel other than 2({0}), image convert may wrong", nBytesPerPixel);
- NLog.LogManager.GetCurrentClassLogger().Error(msg);
- int nOffset = nBytesPerPixel - 1;
- for (int i = 0; i < nImageSize; ++i)
- {
- a_pImageBits[i] = imageData[nOffset + i * nBytesPerPixel];
- }
- }
- return true;
- }
-
- //a_dDwellTime : 1~100000之间的数
- //a_sImageType : 1: SE, 2: Bse
- //a_dImageScanSize : 图像分辨率,图像的高
- public bool SetImageAcquistionSetting(double a_dDwellTime, ImageInputSources a_nImageType, double a_dImageScanSize)
- {
- IImageSettings imageSettings = imageAcquisitionSettings.ImageSettings;
- IImageCapabilities imageCapabilities = imageAcquisitionSettings.ImageCapabilities;
- IImageScanSettings scanSettings = imageAcquisitionSettings.ScanSettings;
- if (a_dDwellTime > imageCapabilities.MaximumImageDwellMicroseconds)
- {
- imageSettings.DwellTimeMicroSeconds = imageCapabilities.MaximumImageDwellMicroseconds;
- }
- if (a_dDwellTime < imageCapabilities.MinimumImageDwellMicroseconds)
- {
- imageSettings.DwellTimeMicroSeconds = imageCapabilities.MinimumImageDwellMicroseconds;
- }
- else
- {
- imageSettings.DwellTimeMicroSeconds = a_dDwellTime;
- }
- imageSettings.InputSources.ToList().ForEach(i => imageSettings.EnableInputSource(i.Key, false));
- imageSettings.EnableInputSource((ImageInputSources)a_nImageType, true);
- if (!ImageScanSize.Contains(a_dImageScanSize))
- {
- NLog.LogManager.GetCurrentClassLogger().Error("图像尺寸输入无效");
- return false;
- }
- var pixelSize = 1d / a_dImageScanSize;
- scanSettings.AcquisitionRegion.CreateFullFieldRegion(pixelSize);
-
- return true;
- }
-
- #endregion
- #region X-ray
-
-
-
- void SetXrayAcquisitionParam(double a_dMilliSecondsTime)
- {
- EdSpectrumSettings.EdSettings.AcquisitionMode = EdAcquireMode.LiveTime; // RealTime or LiveTime
- EdSpectrumSettings.EdSettings.AcquisitionTime = TimeSpan.FromMilliseconds(a_dMilliSecondsTime);
- EdSpectrumSettings.EdSettings.ProcessTime = 4;
- EdSpectrumSettings.EdSettings.EnergyRange = 20;
- EdSpectrumSettings.EdSettings.NumberOfChannels = 4096;
- // EdSpectrumSettings.ScanSettings.AcquisitionRegion.CreateFullFieldRegion(1.0 / 1024.0);
- }
-
-
- void SetAreaAcquistionRegion(List<Chord> a_nChords)
- {
- ChordList chordsList = null;
- chordsList = new ChordList(a_nChords, m_dImagePixelsize);
- EdSpectrumSettings.ScanSettings.AcquisitionRegion.CreateChordListRegion(chordsList);
- }
-
- /// <summary>
- /// Called when IEdSpectrumAcquisitionController Experiment Starting.
- /// </summary>
- /// <param name="sender">The sender.</param>
- /// <param name="e">The <see cref="AcquisitionFinishedEventArgs{IEdSpectrum}"/> instance containing the event data.</param>
- private void OnEdSpectrumExperimentStarting(object sender, AcquisitionStartingEventArgs<IEdSpectrum> e)
- {
- }
- /// <summary>
- /// Called when IEdSpectrumAcquisitionController Experiment Started.
- /// </summary>
- /// <param name="sender">The sender.</param>
- /// <param name="e">The <see cref="AcquisitionFinishedEventArgs{IEdSpectrum}"/> instance containing the event data.</param>
- private void OnEdSpectrumExperimentStarted(object sender, AcquisitionStartedEventArgs<IEdSpectrum> e)
- {
- }
- private IEdChordListSettings GetChordlistSettings()
- {
- if (_edsChordListSetting == null)
- {
- _edsChordListSetting = AcquireFactory.CreateEdChordListSettings();
- if (_edsChordListSetting != null)
- {
- _edsChordListSetting.EdSettings.AcquisitionMode = EdAcquireMode.LiveTime;
- _edsChordListSetting.EdSettings.NumberOfChannels = 1024;
- _edsChordListSetting.EdSettings.ProcessTime = g_nOxfordControllerProcessTime;
- _edsChordListSetting.EdSettings.EnergyRange = g_nOxfordControllerEnergyRange;
- _edsChordListSetting.AutoIdSettings.SetKnownElement(79, true);
- _edsChordListSetting.NumberOfProcessingThreads = 1;
- }
- else
- {
- NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
- log.Error("Create EDS chordlist setting failed.");
- }
- }
- return _edsChordListSetting;
- }
-
- struct Element
- {
- public int m_nAotomaticNo;
- public double m_dWeight;
- }
-
-
- /// <summary>
- ///
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
-
- /// <summary>
- /// Called when IEdSpectrumAcquisitionController Experiment Finished
- /// </summary>
- /// <param name="sender">sender object</param>
- /// <param name="e">The instance containing the event data.</param>
- private void OnEdSpectrumExperimentFinished(object sender, AcquisitionFinishedEventArgs<IEdSpectrum> e)
- {
- IEdSpectrumAcquisitionController edSpectrumAcquisitionController = sender as IEdSpectrumAcquisitionController;
- uint[] m_XrayData;
- NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
- IEdSpectrum edSpectrum = e.Value;
- if (!ReadXrayData(edSpectrum, out m_XrayData, XRayChannelLength))
- {
- NLog.LogManager.GetCurrentClassLogger().Error("Xray采集完成,获取xray失败!");
- }
- long nXraycount = 0;
- for (int i = 0; i < 2000; i++)
- {
- nXraycount += m_XrayData[i];
- }
- //Quantify processing
- bool bquant = false;
- if (currentCommand.commandType == OxfordCommandType.XrayPointCollection)
- {
- bquant = currentCommand.pointXrayPrm.b_quant;
- }
- else if (currentCommand.commandType == OxfordCommandType.XrayAreaCollection)
- {
- bquant = currentCommand.areaXrayPrm.b_quant;
- }
- else if (currentCommand.commandType == OxfordCommandType.COLLECT_XRAYPOINTS)
- {
- var curXrayData = currentCommand.XrayPrmForPoints[currentCommand.PointXrayDataReceived];
- bquant = curXrayData.b_quant;
- }
- else if (currentCommand.commandType == OxfordCommandType.COLLECT_XRAYFEATURES)
- {
- var curXrayData = currentCommand.XrayPrmForFeatures[currentCommand.AreaXrayDataReceived];
- bquant = curXrayData.b_quant;
- }
- var m_listElement = new Dictionary<string, double>();
- if (bquant)
- {
- EdSpectrumProcessing.IdentifyElements(e.Value, autoIdSettings);
- // While it is possible to choose other elements, Oxygen is the only supported element by stoichiometry.
- quantSettings.CombinedElement = 8;
- quantSettings.Normalised = true;
- ISEMQuantStatus quantStatus = EdSpectrumProcessing.SEMQuantifySpectrum(e.Value, quantSettings);//(a_nChannelData, OIHelper::SEMQuantSettings);
- IEnumerable<ISEMQuantResult> Results = quantStatus.Results;
- var ie = Results.GetEnumerator();
- while (ie.MoveNext())
- {
- ISEMQuantResult result = ie.Current;
- if (result.WeightPercent != 0)
- {
- m_listElement.Add(ElementProperties.GetElementSymbol(result.AtomicNumber), result.WeightPercent);
- }
- }
- }
- //------------------------
- if (m_XrayData != null && m_XrayData.Length == XRayChannelLength)
- {
- if (currentCommand.commandType == OxfordCommandType.XrayPointCollection)
- {
- currentCommand.pointXrayPrm.XrayData = m_XrayData;
- currentCommand.pointXrayPrm.listElement = m_listElement;
- m_bXrayDone = true;
- }
- else if (currentCommand.commandType == OxfordCommandType.XrayAreaCollection)
- {
- currentCommand.areaXrayPrm.XrayData = m_XrayData;
- currentCommand.areaXrayPrm.listElement = m_listElement;
- m_bXrayDone = true;
- }
- else if (currentCommand.commandType == OxfordCommandType.COLLECT_XRAYPOINTS)
- {
- var curXrayData = currentCommand.XrayPrmForPoints[currentCommand.PointXrayDataReceived];
- curXrayData.XrayData = m_XrayData;
- curXrayData.listElement = m_listElement;
- currentCommand.PointXrayDataReceived += 1;
- if (currentCommand.PointXrayDataReceived == currentCommand.XrayPrmForPoints.Count)
- {
- m_bXrayDone = true;
- }
- }
- else if (currentCommand.commandType == OxfordCommandType.COLLECT_XRAYFEATURES)
- {
- var curXrayData = currentCommand.XrayPrmForFeatures[currentCommand.AreaXrayDataReceived];
- curXrayData.XrayData = m_XrayData;
- curXrayData.listElement = m_listElement;
- currentCommand.AreaXrayDataReceived += 1;
- if (currentCommand.AreaXrayDataReceived == currentCommand.XrayPrmForFeatures.Count)
- {
- m_bXrayDone = true;
- }
- }
- }
- }
- bool ReadXrayData(IEdSpectrum a_spectrum, out uint[] a_pSpectrumData, int a_nBufferSize)
- {
- a_pSpectrumData = new uint[a_nBufferSize];
- int[] xrayData = new int[a_spectrum.NumberOfChannels];
- a_spectrum.GetChannelData(xrayData);
- double dZeroChannelValue = a_spectrum.ZeroChannelValue;
- int nChannelStart = 0;
- if (dZeroChannelValue < 0) // zero channel value should less than zero
- {
- nChannelStart = (int)(-dZeroChannelValue / a_spectrum.ChannelWidth + 0.5);
- }
- int nDataLength = (int)(a_spectrum.EnergyRange * 1000 / a_spectrum.ChannelWidth + 0.5);
- double dStep1 = 1.0 / nDataLength;
- double dStep2 = 1.0 / a_nBufferSize;
- for (int i = 0; i < nDataLength; ++i)
- {
- uint nValue = (uint)(xrayData[i + nChannelStart] > 0 ? xrayData[i + nChannelStart] : 0);
- double dBinPos = i * dStep1;
- long nLeftBin = (long)(dBinPos / dStep2);
- // calculate % into left bin
- double dLeft_Percent = (double)(nLeftBin + 1) - dBinPos / dStep2; // ((nLeftBin + 1)*dStep2 - dBinPos)/dStep2
- // calculate data into the left bin
- uint nValueToLeftBin = (uint)((double)nValue * dLeft_Percent + 0.5);
- // put data into bins
- a_pSpectrumData[nLeftBin] += nValueToLeftBin;
- if ((nLeftBin + 1) < a_nBufferSize)
- {
- a_pSpectrumData[nLeftBin + 1] += (nValue - nValueToLeftBin);
- }
- }
- return true;
- }
- /// <summary>
- /// Called when IEdSpectrum DataChanged
- /// </summary>
- /// <param name="sender">Event source</param>
- /// <param name="e">Event arguments</param>
- private void OnDataChanged(object sender, EventArgs e)
- {
- }
- public bool IsAcquiringSpectrum()
- {
- return EdSpectrumAcquisitionController.IsAcquiring;
- }
-
- public void BeginMultipleAquisition()
- {
- EdSpectrumAcquisitionController.BeginMultipleAcquisition();
- }
- public void EndMultipleAquisition()
- {
- EdSpectrumAcquisitionController.EndMultipleAcquisition();
- }
- //public void BeginAreaModeMultipleAquisition()
- //{
- // var controller = CreateChordlistController();
- // controller.BeginMultipleAcquisition();
- //}
- //public void EndAreaModeMultipleAquisition()
- //{
- // var controller = CreateChordlistController();
- // controller.EndMultipleAcquisition();
- //}
-
- public bool GetSemBeamOn()
- {
- var beamon = microscopeController.ColumnConditions.BeamOn;
- if (beamon == 1)
- {
- return true;
- }
- else
- {
- return false;
-
- }
-
- }
- public void StopXrayAquisition()
- {
- EdSpectrumAcquisitionController.StopAcquisition();
- }
- #endregion
- }
- }
|