File: INCLUDE\INTERNLS\L_LAYER.H
1 #ifndef _L_LAYER_H
2 #define _L_LAYER_H
3
4 #include "utils\u_values.h"
5
6 //Datum: 03.02.2003 #define W_ImageWindow 250
7 //Datum: 03.02.2003 #define W_OffLineWindow 256
8
9 //Datum: 03.02.2003 #define I_Position 280
10 //Datum: 03.02.2003 #define I_Intensity 281
11 //Datum: 03.02.2003 #define I_Report 282
12
13 // Voreinstellungen
14 //Datum: 03.02.2003 #define CONTROL 0x02
15 //Datum: 03.02.2003 #define NOCONTROL 0xFD
16 //Datum: 03.02.2003 #define ECHO 0x04
17 //Datum: 03.02.2003 #define NOECHO 0xFB
18 //Datum: 03.02.2003 #define MAXERROR 10
19
20 /*#if defined (Build_Library)
21 #define _CURVECLASS __declspec(dllexport)
22 #elif defined(Use_Library)
23 #define _CURVECLASS __declspec(dllimport)
24 #else
25 #define _CURVECLASS
26 #endif*/
27
28 //*** Return-Codes
29 /* Benutzt in m_main.cpp */
30 #define R_Stopped 200
31
32 /* Benutzt in m_main.cpp */
33 #define R_NoWindow 203
34
35 /* Benutzt in m_main.cpp */
36 #define TimerIdSteering 398
37
38 /* NICHT BENUTZT */
39 //! #define R_Started 201
40
41 /* NICHT BENUTZT */
42 //! #define R_InvalidFile 204
43
44 /* NICHT BENUTZT */
45 //! #define R_MeasStop 207
46
47 /* NICHT BENUTZT */
48 //! #define R_NoCommunication 208
49
50 /* NICHT BENUTZT */
51 //! #define R_NoMemory 209
52
53 /* NICHT BENUTZT */
54 //! #define R_NoMfSelected 210
55
56 /* NICHT BENUTZT */
57 //! #define R_Restarted 211
58
59 /* NICHT BENUTZT */
60 //! #define R_Interrupted 212
61
62 /* NICHT BENUTZT */
63 //! #define R_DataValid 213
64
65 /* NICHT BENUTZT */
66 //! #define O_Common 0x0004
67
68 // Identifikation der Timer
69 /* NICHT BENUTZT */
70 //! #define MotorTimerIdStart 200
71
72 /* NICHT BENUTZT */
73 //! #define GenericTimerIdStart 300
74
75 /* Benutzt in m_main.cpp */
76 enum EWorkPlace {
77 HRM= 1, RTK, ScanTable, PDI_Diffractometer, Diff2, Diff3, Expert
78 };
79
80 #define MainWindow_Style WS_CLIPCHILDREN | WS_OVERLAPPED | WS_CAPTION | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_SYSMENU
81 #define ClientWindow_Style WS_CHILD | WS_CLIPCHILDREN | WS_VSCROLL | WS_HSCROLL
82
83 //DATUM: 31.08.2002
84 /*struct T_Font {
85 short nFontType;
86 LOGFONT lf;
87 TEXTMETRIC tm;
88 };*/
89
90 //##############################################################################
91 // Verwaltung der SPLIB.DLL
92 //##############################################################################
93
94 void _CURVECLASS WINAPI AboutTheMaker ( void );
95 LPCSTR _CURVECLASS WINAPI spGetVersion ( void );
96 HINSTANCE _CURVECLASS WINAPI spGetInstance ( void );
97 //Datum: 03.02.2003 LPSTR WINAPI UnitStr ( TUnitType );
98 //Datum: 03.02.2003 int WINAPI GetBufferLine ( LPSTR, LPSTR, int );
99 //Datum: 16.08.2002 maxi, maxl, maxf, maxd, mini, minl, minf, mind verschoben nach U_VALUES.H
100
101 //##############################################################################
102 // TBasicMain
103 //##############################################################################
104
105 enum EPartIds {piAll, piIndicator, piStaticInfo, piStatus, piInfo};
106
107 // die von anderen Subsystemen benutzen Informationen über das Hauptprogramm
108 // Zugriff erfolgt über das unten folgende C-Interface
109 class _CURVECLASS TBasicMain {
110 public:
111 TBasicMain();
112
113 //******************************************************************************
114 // Verwaltung von absoluten Dateinamen für alle benutzen Dateien
115 //******************************************************************************
116 void SetExeFilename(char* FileName);
117
118 //auslesen von szDirectory
119 LPCSTR GetDirectory ( void ) const {
120 return szDirectory;
121 }
122
123 //auslesen von szName
124 LPCSTR GetName ( void ) const {
125 return szName;
126 }
127
128 //vollstaendiger Name der Hardware-INI
129 LPCSTR GetHWFile ( void ) const {
130 return szHWFile;
131 }
132
133 //vollstaendiger Name der Conf.-INI
134 LPCSTR GetCFile ( void ) const {
135 return szCFileName;
136 }
137
138 //vollstaendiger Name der Hilfedatei
139 LPCSTR GetHelpFile ( void ) const {
140 return szHelpFile;
141 }
142
143 //auslesen von szPTopoDirectory
144 LPCSTR GetPTopoDirectory ( void ) const {
145 return szPTopoDirectory;
146 }
147
148 //auslesen von szPDiffDirectory
149 LPCSTR GetPDiffDirectory ( void ) const {
150 return szPDiffDirectory;
151 }
152
153 //klier 25.02.2003
154 //auslesen von szPTopoBackupDirectory
155 LPCSTR GetPTopoBackupDirectory ( void ) const {
156 return szPTopoBackupDirectory;
157 }
158
159 //klier 25.02.2003
160 //auslesen von szPDiffBackupDirectory
161 LPCSTR GetPDiffBackupDirectory ( void ) const {
162 return szPDiffBackupDirectory;
163 }
164
165 //auslesen von szPTopoName
166 LPCSTR GetPTopoName ( void ) const {
167 return szPTopoName;
168 }
169
170 //auslesen von szPName
171 LPCSTR GetPDiffName ( void ) const {
172 return szPDiffName;
173 }
174
175 //vollstaendiger Name der Protokoll-Topographie-Datei
176 LPCSTR GetPTopoFile ( void ) const {
177 return szPTopoFileName;
178 }
179
180 //vollstaendiger Name der Protokoll-Diffraktometrie-Datei
181 LPCSTR GetPDiffFile ( void ) const {
182 return szPDiffFileName;
183 }
184
185 //vollst. Name der "TestDev.dat"
186 LPCSTR GetTestDevFile ( void ) const {
187 return szTestDevFile;
188 }
189
190 //klier 16.03.2003
191 //verändern von szPTopoBackupDirectory
192 BOOL SetPTopoBackupDirectory ( LPCSTR );
193
194 //klier 16.03.2003
195 //verändern von szPDiffBackupDirectory
196 BOOL SetPDiffBackupDirectory ( LPCSTR );
197
198 //klier 16.03.2003
199 //verändert Name der Protokoll-Topographie-Datei
200 BOOL SetPTopoFile ( LPCSTR FileName );
201
202 //klier 16.03.2003
203 //verändert Name der Protokoll-Diffraktometrie-Datei
204 BOOL SetPDiffFile ( LPCSTR FileName );
205
206 //vollst. Name der mak-Datei; <macroname> sollte auf ".mak" enden (z.B. "scan.mak" oder "standard.mak")
207 LPCSTR GetMacroFile ( LPCSTR macroname );
208
209 private:
210 //zerlegt den kompletten Dateinamen in seine Bestandteile
211 void SplitFileName ( LPCSTR DirFileName);
212
213 //klier 16.03.2003
214 //Testet ob die Protokollverzeichnisse existieren, wenn nicht werden sie erstellt
215 BOOL CreatePDirectory( LPSTR PDirectory );
216
217 // ATTRIBUT(E)
218 protected:
219 //Laufwerk+Verzeichnis, aus dem aktuelle Anwendung gestartet wurde
220 char szDirectory[_MAX_PATH];
221
222 //Dateiname (ohne Laufwerk+Verzeichnis+Dateierweiterung) der aktuellen Anwendung
223 char szName[_MAX_FNAME];
224
225 //klier 25.02.2003
226 //Laufwerksbuchstabe der aktuellen Anwendung
227 char szDrive[_MAX_DRIVE];
228
229 //Dateiname (mit Laufwerk+Verzeichnis) der aktuellen INI-Datei
230 char szCFileName[_MAX_PATH];
231
232 //vollstaendiger Name der Hilfedatei
233 char szHelpFile[_MAX_PATH];
234
235 //Laufwerk+Verzeichnis, in dem die aktuelle Topographie-Protokolldatei liegt
236 char szPTopoDirectory[_MAX_PATH];
237
238 //Laufwerk+Verzeichnis, in dem die aktuelle Diffraktometrie-Protokolldatei liegt
239 char szPDiffDirectory[_MAX_PATH];
240
241 //klier 25.02.2003
242 //Laufwerk+Verzeichnis, in dem die Backups der aktuelle Topographie-Protokolldatei liegen
243 char szPTopoBackupDirectory[_MAX_PATH];
244
245 //klier 25.02.2003
246 //Laufwerk+Verzeichnis, in dem die Backups der aktuelle Diffraktometrie-Protokolldatei liegen
247 char szPDiffBackupDirectory[_MAX_PATH];
248
249 //Dateiname (ohne Laufwerk+Verzeichnis+Dateierweiterung) der aktuellen Topographie-Protokolldatei
250 char szPTopoName[_MAX_FNAME];
251
252 //Dateiname (ohne Laufwerk+Verzeichnis+Dateierweiterung) der aktuellen Diffraktometrie-Protokolldatei
253 char szPDiffName[_MAX_FNAME];
254
255 //Dateiname (ohne Laufwerk+Verzeichnis) der aktuellen Topographie-Protokolldatei
256 char szPTopoFileName[_MAX_PATH];
257
258 //Dateiname (ohne Laufwerk+Verzeichnis) der aktuellen Diffraktometrie-Protokolldatei
259 char szPDiffFileName[_MAX_PATH];
260
261 //Dateiname (mit Laufwerk+Verzeichnis) der Hardwareinitialisierungsdatei
262 char szHWFile[_MAX_PATH];
263
264 //Dateiname (mit Laufwerk+Verzeichnis) der TestDefDatei
265 char szTestDevFile[_MAX_PATH];
266
267 //Dateiname (mit Laufwerk+Verzeichnis) der aktuellen Macrodatei
268 char szMacroFileName[_MAX_PATH];
269
270 //Hilfsvariablen für die Bestandteile eines Dateinamens
271 char Drive[_MAX_DRIVE], Dir[_MAX_DIR], Name[_MAX_FNAME], Ext[_MAX_EXT], Path[_MAX_PATH];
272
273 public:
274 //******************************************************************************
275 // Verwaltung weiterer gemeinsam genutzer Teile
276 //******************************************************************************
277
278 HINSTANCE GetMainInstance( void ) const {
279 return m_MainInstance;
280 };
281 void SetMainInstance( HINSTANCE aMainInstance ) {
282 m_MainInstance= aMainInstance;
283 };
284
285 HWND GetFrameHandle( void ) const {
286 return m_WndFrame;
287 };
288
289 HWND GetScanHandle( void ) const {
290 return m_WndScan;
291 };
292 void SetScanWindow( HWND aWindow ) {
293 m_WndScan= aWindow;
294 }
295
296 HWND GetClientHandle( void ) const {
297 return m_WndClient;
298 };
299
300 UINT GetWakeUpMsg( void ) const {
301 return m_WakeUpMsg;
302 };
303 void SetWakeUpMsg(UINT aWakeUpMsg) {
304 m_WakeUpMsg= aWakeUpMsg;
305 }
306
307 BOOL CreateIniDefaults( void ) const {
308 return m_CreateIniDefaults;
309 };
310
311 protected:
312 void SetFrameHandle( HWND aFrameHandle ) {
313 m_WndFrame= aFrameHandle;
314 };
315 void SetClientHandle( HWND aClientHandle ) {
316 m_WndClient= aClientHandle;
317 };
318 void SetCreateIniDefaults( BOOL aCreateIniDefaults) {
319 m_CreateIniDefaults= aCreateIniDefaults;
320 };
321 // in TMain überschreiben um Werte aus MeasurementParameter zurückzugeben
322 virtual LPCSTR GetTarget( void ) = 0;
323 virtual LPSTR GetReflection( LPSTR sRef ) = 0;
324
325 // ATTRIBUT(E)
326 protected:
327 HINSTANCE m_MainInstance;
328 HWND m_WndFrame; // Handle zum Hauptfenster
329 HWND m_WndClient; // der dunkel hinterlegte Bereich, wo die MDI-Fenster reinkommen
330 HWND m_WndScan; // Handle des LineScan-Fensters
331 UINT m_WakeUpMsg; // Botschaft für's "Aufwachen" von Steering
332 BOOL m_CreateIniDefaults;
333
334 public:
335 //******************************************************************************
336 // Verwaltung von absoluten Dateinamen für alle benutzen Dateien
337 //******************************************************************************
338 void SetStatusBarText( UINT aPart= piAll, LPCSTR aText= "" );
339
340 HWND GetStatusBarHandle( void ) {
341 return m_WndStatusBar;
342 };
343
344 protected:
345 void SetStatusBarHandle( HWND aStatusBarHandle ) {
346 m_WndStatusBar= aStatusBarHandle;
347 };
348
349 // ATTRIBUT(E)
350 protected:
351 HWND m_WndStatusBar; // Handle der Statuszeile
352 };
353
354 void _CURVECLASS WINAPI InitBasicMain(TBasicMain *aBasicMain);
355
356 //******************************************************************************
357 // Verwaltung von absoluten Dateinamen für alle benutzen Dateien
358 //******************************************************************************
359
360 // Beschreibung siehe TBasicMain
361 LPCSTR _CURVECLASS WINAPI GetDirectory ( void );
362 LPCSTR _CURVECLASS WINAPI GetName ( void );
363 LPCSTR _CURVECLASS WINAPI GetHWFile ( void );
364 LPCSTR _CURVECLASS WINAPI GetCFile ( void );
365 LPCSTR _CURVECLASS WINAPI GetHelpFile ( void );
366 LPCSTR _CURVECLASS WINAPI GetPTopoName ( void );
367 LPCSTR _CURVECLASS WINAPI GetPTopoFile ( void );
368 LPCSTR _CURVECLASS WINAPI GetPTopoDirectory ( void );
369 LPCSTR _CURVECLASS WINAPI GetPTopoBackupDirectory ( void );
370 BOOL _CURVECLASS WINAPI SetPTopoBackupDirectory ( LPCSTR );
371 BOOL _CURVECLASS WINAPI SetPTopoFile ( LPCSTR FileName );
372 LPCSTR _CURVECLASS WINAPI GetPDiffName ( void );
373 LPCSTR _CURVECLASS WINAPI GetPDiffFile ( void );
374 LPCSTR _CURVECLASS WINAPI GetPDiffDirectory ( void );
375 LPCSTR _CURVECLASS WINAPI GetPDiffBackupDirectory ( void );
376 BOOL _CURVECLASS WINAPI SetPDiffBackupDirectory ( LPCSTR );
377 BOOL _CURVECLASS WINAPI SetPDiffFile ( LPCSTR FileName );
378 LPCSTR _CURVECLASS WINAPI GetTestDevFile ( void );
379 LPCSTR _CURVECLASS WINAPI GetMacroFile ( LPCSTR macroname );
380
381 //******************************************************************************
382 // Verwaltung weiterer gemeinsam genutzer Teile
383 //******************************************************************************
384
385 // Beschreibung siehe TBasicMain
386 HINSTANCE _CURVECLASS WINAPI GetMainInstance( void ); // Instanz der XControl.EXE
387 HWND _CURVECLASS WINAPI GetFrameHandle( void );
388 HWND _CURVECLASS WINAPI GetScanHandle( void );
389 HWND _CURVECLASS WINAPI GetClientHandle( void );
390 UINT _CURVECLASS WINAPI GetWakeUpMsg( void );
391 BOOL _CURVECLASS WINAPI CreateIniDefaults( void );
392
393 //******************************************************************************
394 // Info's in Statuszeile ausgeben
395 //******************************************************************************
396
397 // Beschreibung siehe TBasicMain
398 HWND _CURVECLASS WINAPI GetStatusBarHandle( void );
399 void _CURVECLASS WINAPI SetStatusBarText( UINT aPart= piAll, LPCSTR aText= "" );
400
401 // zukünftig bitte durch SetStatusBarText ersetzen
402 void _CURVECLASS WINAPI SetInfo( LPCSTR );
403 void _CURVECLASS WINAPI SetStaticInfo( LPCSTR );
404 void _CURVECLASS WINAPI SetStatus( LPCSTR );
405
406 //##############################################################################
407 // Rest
408 //##############################################################################
409
410 // Dateiöffnung- und -schließdialog
411 BOOL _CURVECLASS WINAPI FileOpenDialog( LPCSTR, LPSTR, LPSTR, LPCSTR );
412 BOOL _CURVECLASS WINAPI FileOpenDialog( LPCSTR, LPSTR, LPSTR, LPCSTR, DWORD& ); // WIEVOR, jedoch mit zusätzlichem FilterIndex (Auswahl des Dateityps)
413 BOOL _CURVECLASS WINAPI FileSaveDialog( LPCSTR, LPSTR, LPSTR, LPCSTR);
414 BOOL _CURVECLASS WINAPI FileSaveDialog( LPCSTR, LPSTR, LPSTR, LPCSTR, DWORD& ); // WIEVOR, jedoch mit zusätzlichem FilterIndex (Auswahl des Dateityps)
415
416 // Dateizugriff (Textdateien); stattdessen bitte TTxtRead verwenden!!!
417 #define R_Overflow 218
418 #define R_EndOfFile 219
419 int _CURVECLASS WINAPI GetFileLine( int, LPSTR, int );
420 BOOL _CURVECLASS WINAPI SetFPOnData( HFILE hfile );
421 BOOL _CURVECLASS WINAPI PathCanWrite(LPSTR); // ==> kann angegebener Path beschrieben werden?
422
423 // Funktionen zum Warten
424 void _CURVECLASS WINAPI InitializeDelay();
425 void _CURVECLASS WINAPI DelayTime( int );
426 void _CURVECLASS WINAPI Delay( long );
427
428 // wartet die angebene Tick-Count - währenddessen werden Windowsbotschaften weiter verarbeitet
429 // (System steht also nicht völlig)
430 // ACHTUNG, wenn während des Vorganges ein Wartemauszeiger angezeigt wird, muss er nach diesem Aufruf erneuert werden - ansonsten verschwindet er wenn der Anwender die Maus bewegt (dem Programm stehen ja Ressourcen zur Verfügung)!!!
431 void _CURVECLASS WINAPI ProcessMessages( UINT32 );
432
433 #endif // ifdef _L_LAYER_H
434