PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
PlusBrachyStepper.h
Go to the documentation of this file.
1 /*=Plus=header=begin======================================================
2  Program: Plus
3  Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved.
4  See License.txt for details.
5 =========================================================Plus=header=end*/
6 
7 #ifndef _BRACHYSTEPPER_H_
8 #define _BRACHYSTEPPER_H_
9 
10 #include "PlusConfigure.h"
11 #include "vtkPlusDataCollectionExport.h"
12 
17 class vtkPlusDataCollectionExport PlusBrachyStepper
18 {
19 public:
22  {
27  CIVCO_STEPPER
28  };
29 
32  {
33  m_BrachyStepperType = UNDEFINED_STEPPER;
34  m_PositionRequestNumber = 0;
35  };
36  virtual ~PlusBrachyStepper() {};
37 
39  virtual PlusStatus Connect() = 0;
40 
42  virtual PlusStatus Disconnect() = 0;
43 
45  virtual PlusStatus GetEncoderValues(double& PPosition,
46  double& GPosition, double& RPosition, unsigned long& PositionRequestNumber) = 0;
47 
49  virtual PlusStatus GetDeviceModelInfo(std::string& version, std::string& model, std::string& serial) = 0;
50 
52  virtual PlusStatus ResetStepper() = 0;
53 
55  virtual PlusStatus SetBaudRate(unsigned long BaudRate) = 0;
56 
58  virtual PlusStatus SetCOMPort(unsigned long COMPort) = 0;
59 
61  virtual PlusStatus IsStepperAlive() = 0;
62 
64  virtual PlusStatus InitializeStepper(std::string& CalibMsg) = 0;
65 
67  void SetBrachyStepperType(BRACHY_STEPPER_TYPE type) { m_BrachyStepperType = type; }
68  BRACHY_STEPPER_TYPE GetBrachyStepperType() const { return m_BrachyStepperType; }
69 
71  static std::string GetBrachyStepperTypeInString(BRACHY_STEPPER_TYPE stepperType)
72  {
73  std::string strStepperType;
74 
75  switch (stepperType)
76  {
77  case BURDETTE_MEDICAL_SYSTEMS_DIGITAL_STEPPER:
78  strStepperType = "Burdette Medical Systems Digital Stepper";
79  break;
80 
81  case BURDETTE_MEDICAL_SYSTEMS_DIGITAL_MOTORIZED_STEPPER:
82  strStepperType = "Burdette Medical Systems Digital Motorized Stepper";
83  break;
84 
85  case CMS_ACCUSEED_DS300:
86  strStepperType = "CMS Accuseed DS300";
87  break;
88 
89  case CIVCO_STEPPER:
90  strStepperType = "CIVCO";
91  break;
92  default:
93  LOG_ERROR("Unable to recognize stepper type: " << stepperType);
94  strStepperType.clear();
95  }
96 
97  return strStepperType;
98  }
99 
100 protected:
101 
104 
106  unsigned long m_PositionRequestNumber;
107 
108 };
109 
110 #endif
igsioStatus PlusStatus
Definition: PlusCommon.h:40
BRACHY_STEPPER_TYPE GetBrachyStepperType() const
static std::string GetBrachyStepperTypeInString(BRACHY_STEPPER_TYPE stepperType)
unsigned long m_PositionRequestNumber
BRACHY_STEPPER_TYPE m_BrachyStepperType
long __stdcall SetBaudRate(long baudrate)
void SetBrachyStepperType(BRACHY_STEPPER_TYPE type)
virtual ~PlusBrachyStepper()