[ Pobierz całość w formacie PDF ]
.";}}elseMessageBox(NULL, "Niewłaściwa nazwa portu lub port jest"" aktywny.", "Błąd", MB_OK);}//--------------------------------------------------------------------void __fastcall TForm1::OpenClick(TObject *Sender){CheckFileSave();if (OpenDialog1->Execute()){RichEdit1->Lines->LoadFromFile(OpenDialog1->FileName);RichEdit1->Modified = FALSE;RichEdit1->ReadOnly =OpenDialog1->Options.Contains(ofReadOnly);}}//--------------------------------------------------------------------void __fastcall TForm1::SaveAs1Click(TObject *Sender){if (SaveDialog1->Execute()) // dane będą zapisywane w// formacie Rich!{RichEdit1->Lines->SaveToFile(SaveDialog1->FileName);RichEdit1->Modified = FALSE;}}//--------------------------------------------------------------------void __fastcall TForm1::TimerOnTimer(TObject *Sender){if (WaitCommEvent(hCommDev, &fdwEvtMask, NULL) > 0)// sprawdza czy{ // nadszedł znakBeep();Edit2->Text = " Transfer danych.";GetCommMask(hCommDev, &fdwEvtMask);SetCommMask(hCommDev, EV_TXEMPTY);Timer1->Enabled = FALSE;CheckComm->Enabled = FALSE;}}//--------------------------------------------------------------------void __fastcall TForm1::ReceiveFileSaveClick(TObject *Sender){if (SaveDialog1->Execute()){RichEdit2->Lines->SaveToFile(SaveDialog1->FileName);RichEdit2->Modified = FALSE;}}//--------------------------------------------------------------------void __fastcall TForm1::NewClick(TObject *Sender){CheckFileSave();RichEdit1->Lines->Clear();RichEdit1->Modified = FALSE;}//--------------------------------------------------------------------void __fastcall TForm1::CheckCommClick(TObject *Sender){if (Application->MessageBox(" Łącze będzie monitorowane do czasu"" odebrania znaku." , "Uwaga!",MB_OKCANCEL) != IDOK){CheckComm->Enabled = FALSE;Timer1->Enabled = FALSE;Abort();}else{Timer1->Enabled = TRUE;Edit2->Text = "Łącze jest monitorowane.";}/*if (MessageDlg(" Łącze będzie monitorowane do czasu odebrania"" znaku.", mtConfirmation,TMsgDlgButtons() << mbYes << mbNo, 0) == mrYes){Timer1->Enabled = TRUE;Edit2->Text = "Łącze jest monitorowane.";}else{CheckComm->Enabled = FALSE;Timer1->Enabled = FALSE;Abort();}*/}//--------------------------------------------------------------------Opisany program testowałem, łącząc się z pewnym w pełni zautomatyzowanym urządzeniem pomiarowym [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • drakonia.opx.pl
  • Linki