| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- #pragma once
- #include "..\OTSControl\OTSSingleton.h"
- // Load ClientDll
- #include "..\OTSControl\Oxford\OxfordImplConst.h"
- #include "otsdataconst.h"
- #include "Element.h"
- #include "BSEImg.h"
- #include "PosXray.h"
- #include "OTSFeature.h"
- //#include "boost\type_traits\is_floating_point.hpp"
- #include "boost\noncopyable.hpp"
- #include "OxfordWrapper\OxfordController.h"
- #include <Bruker\OTSBrukerImpl_const.h>
- namespace OTSController
- {
- using namespace OTSDATA;
-
- typedef enum class __declspec(dllexport) OXFORD_PARAM
- {
- BUF_LENGTH = 1024,
- MAX_SEGMENTS = 8192,
- MAX_PIXEL_MICROSECONDS = 32000,
- RT_SPECTRUM_BUFFER_SIZE = 64000, // SpectrumBufferSize
- RT_SPECTRUM_CHANNELS = 2000, // XANA_CHANNELS = 2000,
- RT_SPECTRUM_CHANNELS_LONG = 3000 // RT_SPECTRUM_CHANNELS_LONG = 3000,
- } OXFORD_PARAM;
- class OxfordImpl : public Singleton<OxfordImpl>, public boost::noncopyable
- {
- public:
- OxfordImpl(void);
- ~OxfordImpl(void);
-
- bool Connect();
- bool DisConnect();
- bool IsConnected();
- bool GetPositionXY(double& a_dPosX, double& a_dPosY);
- bool SetPositionXY(double a_dPosX, double a_dPosY);
- bool GetWorkingDistance(double& a_dWorkingDistance);
- bool SetWorkingDistance(double a_dWorkingDistance);
- bool GetMagnification(double& a_dMagnification);
- bool SetMagnification(double a_dMagnification);
- bool GetHighVoltage(double& a_dHighVoltage);
- bool SetHighVoltage(double a_dHighVoltage);
- bool GetBeamOn(bool& a_bBeamOn);
- bool SetBeamOn(bool a_bBeamOn);
- bool GetBeamBlank(bool& a_bBeamBlank);
- bool SetBeamBlank(bool a_bBeamBlank);
- bool GetExternal(bool& a_bExternal);
- bool SetExternal(bool a_bExternal);
- bool CollectXrayData(const long a_nAcTime, long* a_pnCounts, DWORD a_nBufferSize);
- bool CollectXrayDataAtPos(const double a_dPosX, const double a_dPosY, const long a_nAcTime, long* a_pnCounts, DWORD a_nBufferSize);
-
- bool SetBeamPosition(const double a_dPosX, const double a_dPosY);
- bool SetScanSpeed(const long a_nMilliseconds);
- bool GetImageSize(long& a_nWidth, long& a_nHeight);
- bool SetImageSize(const long a_nWidth, const long a_nHeight);
- bool CollectImage(BYTE* a_pImageBits);
- bool QuantifySpectrum(unsigned char* cResult);
- // if do x-ray quantification
- BOOL GetQuantificationFlag() { return m_bDoQuantification; }
- void SetQuantificationFlag(BOOL a_bDoQuantification) { m_bDoQuantification = a_bDoQuantification; }
- // m_bDoQuantification should be set first.
- BOOL GetXRayByPoints(CPosXraysList& a_listXrayPois, DWORD a_nACTimeMS);
- BOOL GetXRayByFeatures(CPosXraysList&a_listXRayPoints, std::vector<BrukerFeature>& a_vFeatures, DWORD a_nXRayAQTime);
- protected:
- void CloseClient(void);//there's no need to call from out ,the single instance destruction method will call it automatically.
- std::shared_ptr<OxfordController> m_oxfordPtr;
- bool m_bInit; // initialize flag
- BOOL m_bDoQuantification; // if do x-ray quantification
- };
- //typedef boost::scoped_array<OxfordXrayData> featureData;
- } // namespace Controller
|