Medical Imaging Interaction Toolkit  2018.4.99-bd7b41ba
Medical Imaging Interaction Toolkit
mitkQuantelLaser.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 
14 #ifndef MITKQUANTELLASER_H_HEADER_INCLUDED
15 #define MITKQUANTELLASER_H_HEADER_INCLUDED
16 
17 #include "itkObject.h"
18 #include "mitkCommon.h"
19 
20 #include <chrono>
21 #include <thread>
22 #include <mutex>
23 
24 #include <usModule.h>
25 #include <usModuleResource.h>
26 #include <usGetModuleContext.h>
27 #include <usModuleContext.h>
28 #include <usModuleResourceStream.h>
29 
31 #include "MitkPhotoacousticsHardwareExports.h"
32 
33 namespace mitk {
34 
35  class MITKPHOTOACOUSTICSHARDWARE_EXPORT QuantelLaser : public itk::LightObject
36  {
37  public:
38  mitkClassMacroItkParent(QuantelLaser, itk::LightObject);
39  itkFactorylessNewMacro(Self);
40 
41  enum LaserState { UNCONNECTED, STATE0, STATE1, STATE2, STATE3, STATE4, STATE5, STATE6, STATE7 };
42 
48  virtual bool OpenConnection(std::string configurationFile);
49 
55  virtual bool CloseConnection();
56 
57  virtual std::string SendAndReceiveLine(const std::string* input, std::string* answer);
58 
59  virtual void StayAlive();
60  virtual bool StartFlashing();
61  virtual bool StopFlashing();
62 
63  virtual bool StartQswitching();
64  virtual bool StopQswitching();
65  virtual bool IsEmitting();
66  virtual bool IsFlashing();
67 
68  virtual LaserState GetState();
69 
76 
77  private:
78  LaserState m_State;
79  protected:
80 
81  QuantelLaser();
82  virtual ~QuantelLaser();
83 
84  bool m_KeepAlive = false;
85  bool m_FlashlampRunning = false;
86  bool m_ShutterOpen = false;
87  bool m_LaserEmission = false;
88  void LoadResorceFile(std::string filename, std::string* lines);
89 
90  std::string m_DeviceName;
91  PortNumber m_PortNumber;
92  BaudRate m_BaudRate;
93  DataBits m_DataBits;
94  Parity m_Parity;
95  StopBits m_StopBits;
96  HardwareHandshake m_HardwareHandshake;
97 
99  mitk::SerialCommunication::Pointer m_SerialCommunication;
102  };
103 } // namespace mitk
104 
105 #endif /* MITKQUANTELLASER_H_HEADER_INCLUDED */
mitk::SerialCommunication::HardwareHandshake HardwareHandshake
Hardware handshake mode of the serial connection.
std::string m_DeviceName
Device Name.
DataCollection - Class to facilitate loading/accessing structured data.
mitk::SerialCommunication::Pointer m_SerialCommunication
serial communication interface
HardwareHandshake m_HardwareHandshake
use hardware handshake for serial port connection
std::mutex m_SerialCommunicationMutex
mutex for coordinated access of serial communication interface
mitk::SerialCommunication::DataBits DataBits
Number of data bits used in the serial connection.
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:49
DataBits m_DataBits
Number of Data Bits per token.
PortNumber m_PortNumber
COM Port Number.
BaudRate m_BaudRate
COM Port Baud Rate.
mitk::SerialCommunication::StopBits StopBits
Number of stop bits used in the serial connection.
mitk::SerialCommunication::PortNumber PortNumber
Port number of the serial connection.
StopBits m_StopBits
number of stop bits per token
std::string m_XmlPumpLaserConfiguration
mitk::SerialCommunication::Parity Parity
Parity mode used in the serial connection.
std::thread m_StayAliveMessageThread
Parity m_Parity
Parity mode for communication.
mitk::SerialCommunication::BaudRate BaudRate
Baud rate of the serial connection.