File: INCLUDE\MANJUST\MJ_OFUNK.H
1 //##############################################################################
2 // //
3 // MJ_OFUNK.H //
4 // //
5 // Subsystem : alte Manuelle Justage / Funktionalität //
6 // Benutzung durch andere Subsysteme erforderlich: NEIN //
7 //----------------------------------------------------------------------------//
8 // Autoren: Thomas Kullmann, Günther Reinecker //
9 // Stand : 20.08.2002 //
10 // //
11 //##############################################################################
12
13 #ifndef __MJ_OFUNK_H
14 #define __MJ_OFUNK_H
15
16 #include "utils\u_utils.h"
17
18 #include "motrstrg\motrstrg.h" // TAxisType
19 #include "detecuse\detecuse.h" // TDetector
20
21 //--||--\\--||--//--||--\\--||--//--||--\\--||--//--||--\\--||--//--||--\\--||--
22
23 //#############################################################################
24 // TAngleCtl
25 //#############################################################################
26
27 class TAngleCtl
28 {
29 //******************************************************************************
30 // Konstruktor/Destruktor
31 public:
32 TAngleCtl ( void );
33 virtual ~TAngleCtl ( void );
34
35 //******************************************************************************
36 // Sonstiges
37 public:
38 BOOL DoInit ( const int ); // initialisiert m_MotorList und wählt den angegebenen Antrieb aus
39 BOOL DoInitMotor ( const int, const BOOL ); // setzt die Bewegungsgeschwindigkeit des angegebenen Antriebs, auf MaxSpeed oder m_MotorList[<Index>]
40
41 //******************************************************************************
42 // Antriebssteuerung
43 public:
44 BOOL DoDirect ( const int, const double ); // Bewegung im Direktbetrieb
45 BOOL DoStep ( const int, const BOOL ); // Bewegung im Fahrbetrieb
46 BOOL DoDrive ( const int, const BOOL ); // Bewegung im Schrittbetrieb
47
48 BOOL DoStop ( const int ); // stoppen der Bewegung, unabhängig von der Betriebsart
49 void DoStopEverything ( const int ); // stoppen aller Antriebe, der Halbwertsbreitenmessung und der Detektormessung
50
51 //******************************************************************************
52 // Statusinformationen
53 public:
54 BOOL IsIndexValid ( const int ) const; // gültiger Index der Antriebsliste ?
55 BOOL HasOffset ( const int, BOOL& ) const; // Offset gesetzt, d.h. (Offset != 0) ?
56 BOOL IsMoving ( const int, BOOL& ) const; // Antrieb in Bewegung ?
57 BOOL IsCalibrated ( const int, BOOL& ) const; // Antriebsposition kalibriert?
58
59 //******************************************************************************
60 // GET-Methoden
61 public: // Delegate an C-Interface des Motors
62 // Antriebspositionen unabhängig von der relativen Null
63 double GetAngle ( const int, BOOL& ) const; // aktuelle Antriebsposition
64 double GetAngleMin ( const int, BOOL& ) const; // minimale Antriebsposition
65 double GetAngleMax ( const int, BOOL& ) const; // maximale Antriebsposition
66 double GetSpeed ( const int, BOOL& ) const; // Geschwindigkeit
67 double GetAngleWidth ( const int, BOOL& ) const; // Schrittweite
68
69 UINT GetDigits ( const int, BOOL& ) const; // lesen der Nachkommastellen
70 LPCSTR GetUnit ( const int, BOOL& ) const; // lesen der Einheit
71
72 int GetMotorIdx ( const EAxisType ) const; // Index des angegebenen Antriebs; ggf. -1
73 LPCSTR GetMotorName ( const int, BOOL& ) const; // Antriebsbezeichnung per standardisierter Antriebsbezeichnung
74 UINT GetMotorCount ( void ) const; // Anzahl der Antriebe in der Antriebsliste
75 int GetActualMotor ( void ) const; // Index des ausgewählten Antriebs
76
77 //******************************************************************************
78 // SET-Methoden
79 public:
80 BOOL SetSpeed ( const int, double& ); // Geschwindigkeit
81 BOOL SetAngleWidth ( const int, double& ); // Schrittweite
82 BOOL SetCorrectionState ( const int ); // CorrectionState
83
84 //*****************************************************************************
85 // Relative Null
86 public:
87 BOOL SetRelativeZero ( const int ); // setzen
88 BOOL ResetRelativeZero ( const int ); // aufheben
89
90 //*****************************************************************************
91 // Halbwertsbreitenmessung
92 public:
93 BOOL DoStartMeasure ( const HWND ); // starten
94 BOOL DoStopMeasure ( const int ); //stoppen
95
96 BOOL IsMeasuring ( void ) const; // ==> TRUE <--> Messung aktiv
97 BOOL IsMeasureReset ( void ) const; // Messung abgebrochen?
98 double GetMeasureHwb ( void ) const; // ==> HWB
99
100 BOOL MeasureStopped ( const int ); // kennzeíchnet, dass die Messung beendet ist (cm_SteeringReady wurde empfangen)
101 void UpdateDetector ( void ) const; //informiert die Makroverarbeitung, dass neue Messwerte vorliegen
102
103 //******************************************************************************
104 // Zustand für Bewegung ermitteln
105 public:
106 // können die folgenden Funktionalitäten durchgeführt werden?
107 // das Freigeben bzw. Sperren und Ausgrauen von Steuerelementen
108 BOOL CanDoDirect ( const int ) const; // Direktbetrieb möglich ?
109 BOOL CanDoStep ( const int, const BOOL ) const; // Fahrbetrieb möglich ?
110 BOOL CanDoDrive ( const int, const BOOL ) const; // Schrittbetrieb möglich ?
111
112 BOOL CanDoStop ( const int ) const; // kann Bewegung gestoppt werden ?
113
114 //*****************************************************************************
115 // Zustand zum Setzen von Parametern
116 public:
117 BOOL CanSetSpeed ( const int ) const; // setzen der Geschwindigkeit möglich ?
118 BOOL CanSetAngleWidth ( const int ) const; // setzen der Sollposition möglich ?
119
120 BOOL CanSetOffset ( const int ) const; // setzen der Relativen Null bzw. setzen des Offset für <Antrieb> möglich?
121 BOOL CanResetRelativeZero ( const int ) const; // aufheben der Relativen Null möglich ?
122
123 BOOL CanDoStartMeasure ( void ) const; // starten der Halbwertsbreitenmessung möglich ?
124 BOOL CanDoStopMeasure ( void ) const; // stoppen der Halbwertsbreitenmessung möglich ?
125
126 //*****************************************************************************
127 // private
128 private:
129 BOOL DoSelectMotor ( const int ) const; // wählt den angegebenen Antrieb aus; Methoden des C-Interfaces zur Antriebssteuerung arbeiten dann mit diesem Motor
130 BOOL Moves( const int, BOOL& ) const; // ähnlich IsMoving, jedoch ohne den Parnterantrieb zu berücksichtigen
131
132 //*****************************************************************************
133 // ATTRIBUTE
134 private:
135 TDetector *m_Sensor; // der ausgewählte Detektor
136 UINT m_MotorCount; // Anzahl der Geschwindigkeiten in m_MoveSpeed
137 double *m_MoveSpeed; // Bewegungsgeschwindigkeit des jeweiligen Antriebs
138 BOOL m_IsMeasuring; // Status der HWB-Messung
139 };
140
141 #endif //__MJ_OFUNK.H
142
143 //#############################################################################
144 // LastLine
145 //#############################################################################
146