File: SWINTRAC\M_DLG.CPP
1 //#############################################################################
2 // //
3 // M_DLG.CPP //
4 // //
5 // Subsystem : Develop; GUI-Oberflächenfenster //
6 // Benutung durch andere Subsysteme erforderlich: NEIN //
7 // Deklaration: M_DLG.H //
8 //---------------------------------------------------------------------------//
9 // letzte Bearbeitung: Thomas Kullmann, Günther Reinecker //
10 // Stand: 27.07.2002 //
11 // //
12 //#############################################################################
13
14 #include "utils\u_utils.h"
15 #include "winresrc\rc_def.h" // Ressourcen-IDs
16 #pragma hdrstop
17
18 //#include "datavisa\datavisa.h"
19 #include "workflow\workflow.h"
20
21 #include "detecuse\detecuse.h"
22 #include "motrstrg\motrstrg.h"
23
24 #include "swintrac\m_dlg.h"
25
26 //--||--\\--||--//--||--\\--||--//--||--\\--||--//--||--\\--||--//--||--\\--||--
27
28 // 11.01.2003 Kullmann+Reinecker: verschoben aus M_DLG.H
29 struct TCScanParam
30 {
31 float fStartPoint, fSpeed, fExposureTime;
32 int nNumberPoints;
33 int nMotorId;
34 int nDetectorId;
35 BOOL bFastScanActive;
36 };
37
38 // variables related to continuous scan's
39 TCScanParam CScan;
40
41 //#############################################################################
42 // TExecuteCmdDlg
43 //#############################################################################
44
45 TExecuteCmdDlg::TExecuteCmdDlg(): TModalDlg("ExecuteCmd", GetMainInstance() )
46 {
47 ExecutionId= 0;
48 };
49
50 //! neu Kullmann+Reinecker
51 BOOL TExecuteCmdDlg::Dlg_OnInit(HWND hwnd, HWND hwndCtl, LPARAM lParam)
52 {
53 //Datum: 27.07.2002 TModalDlg::Dlg_OnInit(hwnd,hwndCtl,lParam);
54 nMotor= mlGetAxis();
55 //Datum: 02.08.2002 SetDlgItemText(hwnd,cm_RotateMotor,mGetAxisName());
56 SetFocus(GetDlgItem(hwnd, id_CommandLine));
57 return TRUE;
58 };
59
60 void TExecuteCmdDlg::Dlg_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
61 {
62 //! static int i= 0;
63 HWND hwndCmd= GetDlgItem(hwnd, id_Response);
64 char cmd[MaxString + 1];
65 char *lpszToken;
66
67 switch (id)
68 {
69 case IDOK:
70 GetDlgItemText(hwnd, id_CommandLine, cmd, 34);
71 strcat(cmd, "\r");
72 if (R_OK == mExecuteCmd(cmd))
73 {
74 lpszToken= strtok(cmd, "\n\3\r");
75 while (lpszToken)
76 {
77 if (strlen(lpszToken) > 1)
78 ComboBox_AddString(hwndCmd, lpszToken);
79 lpszToken= strtok(NULL, "\n\3\r");
80 }
81 }
82 break;
83
84 //Datum: 02.08.2002
85 /*case cm_RotateMotor:
86 mlSetAxis(1+mlGetAxis());
87 SetDlgItemText(hwnd,cm_RotateMotor,(LPSTR)mGetAxisName());
88 SetFocus(GetDlgItem(hwnd,id_CommandLine));
89 break;*/
90
91 default:
92 TModalDlg::Dlg_OnCommand(hwnd, id, hwndCtl, codeNotify);
93 }
94 };
95
96 //#############################################################################
97 // TGetDataDlg
98 //#############################################################################
99
100 TGetDataDlg::TGetDataDlg(LPSTR dt, int* dr) : TModalDlg("GetData", GetMainInstance() )
101 {
102 dataref= dr;
103 strcpy(datatext, dt);
104 };
105
106 //! neu Kullmann+Reinecker
107 BOOL TGetDataDlg::Dlg_OnInit(HWND hwnd, HWND hwndCtl, LPARAM lParam)
108 {
109 char buf[30];
110
111 //Datum: 27.07.2002 TModalDlg::Dlg_OnInit(hwnd,hwndCtl,lParam);
112 itoa(*dataref, buf, 10);
113 SetDlgItemText(hwnd, id_GetDataText, datatext);
114 SetDlgItemText(hwnd, id_GetDataValue, buf);
115 return TRUE;
116 };
117
118 BOOL TGetDataDlg::CanClose(void)
119 {
120 char buf[30];
121
122 GetDlgItemText(GetHandle(), id_GetDataValue, buf, 29);
123 *dataref= atoi(buf);
124 return TRUE;
125 };
126
127 //#############################################################################
128 // LastLine
129 //#############################################################################
130
131
132
133
134
135