111 |
DDX_Control(pDX, IDC_STOP, m_Stop); |
DDX_Control(pDX, IDC_STOP, m_Stop); |
112 |
DDX_Control(pDX, IDC_PORT, m_Port); |
DDX_Control(pDX, IDC_PORT, m_Port); |
113 |
DDX_Control(pDX, IDC_RESTART, m_Restart); |
DDX_Control(pDX, IDC_RESTART, m_Restart); |
114 |
|
DDX_Control(pDX, IDC_Start, m_StartB); |
115 |
} |
} |
116 |
|
|
117 |
BEGIN_MESSAGE_MAP(CH7ServerDlg, CDialog) |
BEGIN_MESSAGE_MAP(CH7ServerDlg, CDialog) |
164 |
OnOK(); |
OnOK(); |
165 |
return false; |
return false; |
166 |
} |
} |
167 |
|
m_Restart.EnableWindow(false); |
168 |
|
m_Stop.EnableWindow(false); |
169 |
|
m_BaudRate.EnableWindow(false); |
170 |
m_First = true; |
m_First = true; |
171 |
/**********************************************************************/ |
/**********************************************************************/ |
172 |
return TRUE; // return TRUE unless you set the focus to a control |
return TRUE; // return TRUE unless you set the focus to a control |
238 |
|
|
239 |
StartTcp(); |
StartTcp(); |
240 |
StartSerial(); |
StartSerial(); |
241 |
|
m_Stop.EnableWindow(true); |
242 |
|
m_Restart.EnableWindow(true); |
243 |
|
m_BaudRate.EnableWindow(true); |
244 |
|
m_StartB.EnableWindow(false); |
245 |
//UpdateClient(); |
//UpdateClient(); |
246 |
} |
} |
247 |
|
|
350 |
void CH7ServerDlg::UpdateClient(TcpClientClass* caller) |
void CH7ServerDlg::UpdateClient(TcpClientClass* caller) |
351 |
{ |
{ |
352 |
// Updater status vindue. |
// Updater status vindue. |
|
const int sleep = 10; |
|
|
|
|
353 |
m_Status.SetWindowText(""); |
m_Status.SetWindowText(""); |
354 |
UpdateStatus( "LED3: ", caller->mLed3 ); |
UpdateStatus( "LED3: ", caller->mLed3 ); |
|
//Sleep(sleep); |
|
355 |
UpdateStatus( "LED4: ", caller->mLed4 ); |
UpdateStatus( "LED4: ", caller->mLed4 ); |
|
//Sleep(sleep); |
|
356 |
UpdateStatus( "LED5: ",caller->mLed5 ); |
UpdateStatus( "LED5: ",caller->mLed5 ); |
|
///Sleep(sleep); |
|
357 |
UpdateStatus( "Switch2: ",caller->mSw2 ); |
UpdateStatus( "Switch2: ",caller->mSw2 ); |
|
//Sleep(sleep); |
|
358 |
UpdateStatus( "Switch3: ", caller->mSw3 ); |
UpdateStatus( "Switch3: ", caller->mSw3 ); |
|
//Sleep(sleep); |
|
359 |
UpdateStatus( "Potmeter: ", caller->mPot ); |
UpdateStatus( "Potmeter: ", caller->mPot ); |
|
//Sleep(sleep); |
|
360 |
UpdateStatus( "Temperatur: ", caller->mTemp ); |
UpdateStatus( "Temperatur: ", caller->mTemp ); |
361 |
//Sleep(sleep); |
|
362 |
} |
} |
363 |
|
|
364 |
void CH7ServerDlg::NewLine(void) |
void CH7ServerDlg::NewLine(void) |
390 |
StatusWindow += tmp; |
StatusWindow += tmp; |
391 |
m_Status.SetWindowText(StatusWindow); |
m_Status.SetWindowText(StatusWindow); |
392 |
NewLine(); |
NewLine(); |
|
|
|
393 |
} |
} |
394 |
|
|
395 |
void CH7ServerDlg::OnBnClickedStop() |
void CH7ServerDlg::OnBnClickedStop() |
401 |
OnOK(); |
OnOK(); |
402 |
} |
} |
403 |
|
|
404 |
void CH7ServerDlg::TcpStatus(void) |
void CH7ServerDlg::OnCancel() |
405 |
{ |
{ |
406 |
|
TcpServer.Close(); |
407 |
|
H7Serial.close(); |
408 |
|
// Close server app. |
409 |
|
|
410 |
|
CDialog::OnCancel(); |
411 |
} |
} |
|
|
|