--- trunk/H7 Server/H7 ServerDlg.cpp 2007/02/01 07:39:56 35 +++ trunk/H7 Server/H7 ServerDlg.cpp 2007/02/01 09:21:43 36 @@ -111,6 +111,7 @@ DDX_Control(pDX, IDC_STOP, m_Stop); DDX_Control(pDX, IDC_PORT, m_Port); DDX_Control(pDX, IDC_RESTART, m_Restart); + DDX_Control(pDX, IDC_Start, m_StartB); } BEGIN_MESSAGE_MAP(CH7ServerDlg, CDialog) @@ -163,6 +164,9 @@ OnOK(); return false; } + m_Restart.EnableWindow(false); + m_Stop.EnableWindow(false); + m_BaudRate.EnableWindow(false); m_First = true; /**********************************************************************/ return TRUE; // return TRUE unless you set the focus to a control @@ -234,6 +238,10 @@ StartTcp(); StartSerial(); + m_Stop.EnableWindow(true); + m_Restart.EnableWindow(true); + m_BaudRate.EnableWindow(true); + m_StartB.EnableWindow(false); //UpdateClient(); } @@ -342,23 +350,15 @@ void CH7ServerDlg::UpdateClient(TcpClientClass* caller) { // Updater status vindue. - const int sleep = 10; - m_Status.SetWindowText(""); UpdateStatus( "LED3: ", caller->mLed3 ); - //Sleep(sleep); UpdateStatus( "LED4: ", caller->mLed4 ); - //Sleep(sleep); UpdateStatus( "LED5: ",caller->mLed5 ); - ///Sleep(sleep); UpdateStatus( "Switch2: ",caller->mSw2 ); - //Sleep(sleep); UpdateStatus( "Switch3: ", caller->mSw3 ); - //Sleep(sleep); UpdateStatus( "Potmeter: ", caller->mPot ); - //Sleep(sleep); UpdateStatus( "Temperatur: ", caller->mTemp ); - //Sleep(sleep); + } void CH7ServerDlg::NewLine(void) @@ -390,7 +390,6 @@ StatusWindow += tmp; m_Status.SetWindowText(StatusWindow); NewLine(); - } void CH7ServerDlg::OnBnClickedStop() @@ -402,8 +401,11 @@ OnOK(); } -void CH7ServerDlg::TcpStatus(void) +void CH7ServerDlg::OnCancel() { + TcpServer.Close(); + H7Serial.close(); + // Close server app. + CDialog::OnCancel(); } -