//--WATKINS JOHNSON QUAD-8 (WJ8888)------------------------------------------ //--Written with C++ Builder 6.0 Enterprise //-- By Geert De Coninck, Antwerp, Belgium //-- Special thanks to: //-- Erik Salaj - WINSOFT - Kosice - Slovak Republic //-- Byron Whartnaby - DEI DATACOM - Escondido California - USA //-- Dieter Suckale - MDD GmbH, Bad Vilbel - Germany //--Written for SWL ONL4234 // Peter De Coninck, Antwerp, Belgium //--Including SYNCHRONOUS & ASYNCHRONOUS IO interface //--Windows XP "API" compatible //--Support of virtual serial ports, e.g. works with USB<->RS232 converter //--Free use and distribution without any kind of warranty: //-- //--IN NO EVENT SHALL WE ACCEPT ANY LIABILITY FOR DIRECT OR INDIRECT, SPECIAL, //--INCIDENTAL OR CONSEQUENTIAL DAMAGES RESULTING FROM THE USE OF THE PRODUCT //--------------------------------------------------------------------------- #include #pragma hdrstop #include #include #include "ntport.h" #include "Unit2.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "ComPort" #pragma link "ComSignal" #pragma link "_GClass" #pragma link "AbDBCtrls" #pragma link "AbLED" #pragma link "AbSwitch" #pragma link "hlRockerSwitch" #pragma resource "*.dfm" // byte_mask 01 #define byte_mask01_ID00 0x00 #define byte_mask01_ID01 0x01 #define byte_mask01_ID02 0x02 #define byte_mask01_ID03 0X03 #define byte_mask01_ID04 0X04 #define byte_mask01_ID05 0X05 #define byte_mask01_ID06 0X06 #define byte_mask01_ID07 0X07 #define byte_mask01_ID08 0X08 #define byte_mask01_ID09 0X09 #define byte_mask01_ID10 0X0A #define byte_mask01_ID11 0X0B #define byte_mask01_ID12 0X0C #define byte_mask01_ID13 0X0D #define byte_mask01_ID14 0X0E #define byte_mask01_ID15 0X0F #define byte_mask01_MODE 0x40 #define byte_mask01_MODAL 0X80 // byte_mask 02 #define byte_mask02_AGCDUMP 0x40 // byte_mask 05 #define byte_mask05_GAINMODE 0x01 // byte_mask 06 #define byte_mask06_AM 0x00 #define byte_mask06_FM 0x01 #define byte_mask06_BFOFIXED 0x02 #define byte_mask06_BFOVAR 0x03 #define byte_mask06_ISB 0x04 #define byte_mask06_LSB 0x05 #define byte_mask06_USB 0x06 #define byte_mask06_AMNL 0x07 #define byte_mask06_FREQXXX01 0x00 #define byte_mask06_FREQ500 0x08 #define byte_mask06_FREQ2000 0x10 #define byte_mask06_FREQ4000 0x18 #define byte_mask06_FREQ6000 0x20 #define byte_mask06_FREQXXX02 0x28 #define byte_mask06_GAINMODE 0x40 TForm2 *Form2; //--Declaration of variables --------------------------------------------------- bool read_request = false; // send frequency's decoded unsigned char send_tunedfreq10Hz=0; // tuned frequency byte binary send to WJ8888 unsigned char send_tunedfreq100Hz=0; // tuned frequency byte binary send to WJ8888 unsigned char send_tunedfreq1kHz=0; // tuned frequency byte binary send to WJ8888 unsigned char send_tunedfreq10kHz=0; // tuned frequency byte binary send to WJ8888 unsigned char send_tunedfreq100kHz=5; // tuned frequency byte binary 500kHz send to WJ8888 unsigned char send_tunedfreq1MHz=0; // tuned frequency byte binary send to WJ8888 unsigned char send_tunedfreq10MHz=0; // tuned frequency byte binary send to WJ8888 // send frequency's long send_frequency10Hz; // tuned frequency value 10^1 send to WJ8888 long send_frequency100Hz; // tuned frequency value 10^2 send to WJ8888 long send_frequency1kHz; // tuned frequency value 10^3 send to WJ8888 long send_frequency10kHz; // tuned frequency value 10^4 send to WJ8888 long send_frequency100kHz; // tuned frequency value 10^5 send to WJ8888 long send_frequency1MHz; // tuned frequency value 10^6 send to WJ8888 long send_frequency10MHz; // tuned frequency value 10^7 send to WJ8888 // read frequency's decoded unsigned char read_tunedfreq10Hz=0; // tuned frequency byte binary read from WJ8888 unsigned char read_tunedfreq100Hz=0; // tuned frequency byte binary read from WJ8888 unsigned char read_tunedfreq1kHz=0; // tuned frequency byte binary read from WJ8888 unsigned char read_tunedfreq10kHz=0; // tuned frequency byte binary read from WJ8888 unsigned char read_tunedfreq100kHz=5; // tuned frequency byte binary 500kHz read from WJ8888 unsigned char read_tunedfreq1MHz=0; // tuned frequency byte binary send read WJ8888 unsigned char read_tunedfreq10MHz=0; // tuned frequency byte binary send read WJ8888 // read frequency's long read_frequency10Hz; // tuned frequency value 10^1 read from WJ8888 long read_frequency100Hz; // tuned frequency value 10^2 read from WJ8888 long read_frequency1kHz; // tuned frequency value 10^3 read from WJ8888 long read_frequency10kHz; // tuned frequency value 10^4 read from WJ8888 long read_frequency100kHz; // tuned frequency value 10^5 read from WJ8888 long read_frequency1MHz; // tuned frequency value 10^6 read from WJ8888 long read_frequency10MHz; // tuned frequency value 10^7 read from WJ8888 // read datalength : 10 in async / 8 in sync int DataLength; // datalength of readed bytes // bytes directly read by com port unsigned char byte01=0; // data read by ComPort component unsigned char byte02=0; // data read by ComPort component unsigned char byte03=0; // data read by ComPort component unsigned char byte04=0; // data read by ComPort component unsigned char byte05=0; // data read by ComPort component unsigned char byte06=0; // data read by ComPort component unsigned char byte07=0; // data read by ComPort component unsigned char byte08=0; // data read by ComPort component unsigned char byte09=0; // data read by ComPort component unsigned char byte10=0; // data read by ComPort component // test if remainder of bufferlength = zero int modulocheck = 0; // used for mask and shifting bits left and right in a byte or word char unsigned shifting =0; char unsigned binair = 0; char unsigned mask = 0; unsigned long shifting_bfo =0; unsigned long binair_bfo = 0; unsigned long mask_bfo = 0; unsigned char command = 2; unsigned char monitor = 1; unsigned char lamptest = 3; int bit_word, bit_counter; // used for bit table TX and RX : calculation of argument float value = 0L; // calc value bfo frequency int send_bfo_frequency = 0; // value of sended bfo frequency float send_BFO = 0L; // bfo freqyency float send_BFO_factor = 0L; // bfo factor float send_total_BFO = 0L; // total BFO = 455000 Hz + BFO int send_signBFO = 0; // sign + or - of the BFO frequency int read_bfo_frequency = 0; // value of received bfo frequency float read_BFO = 0L; // bfo freqyency float read_BFO_factor = 0L; // bfo factor float read_total_BFO = 0L; // total BFO = 455000 Hz + BFO int read_signBFO = 0; // sign + or - of the BFO frequency // total frequency write and read long totalfreq_write; // total tuned frequency 10^0 send to WJ8888 long totalfreq_read; // total tuned frequency 10^0 read from WJ8888 // sended data in async format unsigned char byte_send01=0; // send data byte asynch data format unsigned char byte_send02=0; // send data byte asynch data format unsigned char byte_send03=0; // send data byte asynch data format unsigned char byte_send04=0; // send data byte asynch data format unsigned char byte_send05=0; // send data byte asynch data format unsigned char byte_send06=0; // send data byte asynch data format unsigned char byte_send07=0; // send data byte asynch data format unsigned char byte_send08=0; // send data byte asynch data format unsigned char byte_send09=0; // send data byte asynch data format unsigned char byte_send10=0; // send data byte asynch data format unsigned char copybyte_send01=0; // copy of send data byte asynch data format unsigned char copybyte_send02=0; // copy of send data byte asynch data format unsigned char copybyte_send03=0; // copy of send data byte asynch data format unsigned char copybyte_send04=0; // copy of send data byte asynch data format unsigned char copybyte_send05=0; // copy of send data byte asynch data format unsigned char copybyte_send06=0; // copy of send data byte asynch data format unsigned char copybyte_send07=0; // copy of send data byte asynch data format unsigned char copybyte_send08=0; // copy of send data byte asynch data format unsigned char copybyte_send09=0; // copy of send data byte asynch data format unsigned char copybyte_send10=0; // copy of send data byte asynch data format // received data in async format unsigned char byte_received01=0; // rcvr data byte asynch data format unsigned char byte_received02=0; // rcvr data byte asynch data format unsigned char byte_received03=0; // rcvr data byte asynch data format unsigned char byte_received04=0; // rcvr data byte asynch data format unsigned char byte_received05=0; // rcvr data byte asynch data format unsigned char byte_received06=0; // rcvr data byte asynch data format unsigned char byte_received07=0; // rcvr data byte asynch data format unsigned char byte_received08=0; // rcvr data byte asynch data format unsigned char byte_received09=0; // rcvr data byte asynch data format unsigned char byte_received10=0; // rcvr data byte asynch data format // send data in sync format unsigned char synch_byte_send01=0; // send data byte synch data format not used unsigned char synch_byte_send02=0; // send data byte synch data format not used unsigned char synch_byte_send03=0; // send data byte synch data format unsigned char synch_byte_send04=0; // send data byte synch data format unsigned char synch_byte_send05=0; // send data byte synch data format unsigned char synch_byte_send06=0; // send data byte synch data format unsigned char synch_byte_send07=0; // send data byte synch data format unsigned char synch_byte_send08=0; // send data byte synch data format unsigned char synch_byte_send09=0; // send data byte synch data format unsigned char synch_byte_send10=0; // send data byte synch data format // received data in sync format unsigned char synch_byte_received01=0; // rcvr data byte synch data format unsigned char synch_byte_received02=0; // rcvr data byte synch data format unsigned char synch_byte_received03=0; // rcvr data byte synch data format unsigned char synch_byte_received04=0; // rcvr data byte synch data format unsigned char synch_byte_received05=0; // rcvr data byte synch data format unsigned char synch_byte_received06=0; // rcvr data byte synch data format unsigned char synch_byte_received07=0; // rcvr data byte synch data format unsigned char synch_byte_received08=0; // rcvr data byte synch data format unsigned char synch_byte_received09=0; // rcvr data byte synch data format unsigned char synch_byte_received10=0; // rcvr data byte synch data format // received modes of the radio unsigned char received_gainmode; // gainmode decoded from received data unsigned char received_ifbandwith; // if bandwith decoded from received data unsigned char received_detectionmode; // detection mode decoded from received data unsigned long received_bfo; // received bfo frequency unsigned char received_rf_gain_code; // rf gain code from received data unsigned char received_agcdump; // agc dump from received data int asynch = 1; // async(1) or sync(0) mode int TXBufferCount = 0; // # bytes in TX buffer int RXBufferCount = 0; // # bytes in RX buffer int valid_RX = false; // complete RX byte in buffer char user[10] = ""; // user call code e.g. ONL4234 // booleans bool LockUp = false; // locked tuning up bool LockDwn = false; // locked tuning down bool DTR = false; // DTR signal status bool RTS = false; // RTS signal status bool act = false; // copy of ComPort->Active bool modal_byte_id = false; // copy of MODAL BYTE ID bit bool overlay_trigger=false; // overlay trigger timer, triggers every x sec a writedata //-------------------------------------------------------------------------- __fastcall TForm2::TForm2(TComponent* Owner) : TForm(Owner) { FormStyle= fsMDIForm; // init settings by startup FILE *stream; // file pointer int i=0; // read setup data long value=0; // read setup data /* opens setup file and read setup settings */ stream=fopen("SETUP.FIL","r"); fscanf(stream, "%d", &i); ComboBoxDeviceName->ItemIndex = i; fscanf(stream, "%d", &i); ComboBoxBaudRate->ItemIndex = i; fscanf(stream, "%d", &i); ComboBoxDataBits->ItemIndex = i; fscanf(stream, "%d", &i); ComboBoxStopBits->ItemIndex = i; fscanf(stream, "%d", &i); ComboBoxParity->ItemIndex = i; fscanf(stream, "%d", &i); ColorBox1->Selected = i; fscanf(stream,"%s", user); fscanf(stream, "%d", &i); asynch=i; Form2->Caption = Form2->Caption + user; fclose(stream); // set LCD background color Panel2->Color = ColorBox1->Selected; Panel3->Color = ColorBox1->Selected; /* open receiver 00 setings as default */ stream = fopen("RCVR00.FIL", "r"); /* read some data from the file */ fscanf(stream, "%d\n", &i); RadioGroup1->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup2->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup3->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup4->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup5->ItemIndex = i; fscanf(stream, "%d\n", &i); CheckBox1->Checked = i; fscanf(stream, "%ld\n", &value); send_tunedfreq10Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1MHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10MHz = value; fscanf(stream, "%ld\n", &value); // TrackBar2->Position = value; fscanf(stream, "%ld\n", &value); Label19->Caption = FloatToStr(value); TrackBar3->Position = value; fscanf(stream, "%ld\n", &value); Label20->Caption = FloatToStr(value); ProgressBar1->Position = value; fscanf(stream,"%ld\n",&value); send_signBFO = value; /* close the file */ fclose(stream); // set TX counter and RX counter to zero AddWriteBytes(0); AddReadBytes(0); // set modem status signals SetModemStatus(); // calculate total send frequency TotalSendFreq(); Label17->Caption = FloatToStr(totalfreq_write); // set trackbar of BFO frequency to correct position value = TrackBar2->Position*10; // set frequency and bfo frequency to direct tuning input fields MaskEdit1->Text = FloatToStr(value); MaskEdit2->Text = Label17->Caption; // enables / disables bit display Bitdisplayonoff1->Checked = false; // set "disabled" as default // enables / disables TX bits Label31->Enabled = Bitdisplayonoff1->Checked; Label32->Enabled = Bitdisplayonoff1->Checked; Label33->Enabled = Bitdisplayonoff1->Checked; Label34->Enabled = Bitdisplayonoff1->Checked; Label35->Enabled = Bitdisplayonoff1->Checked; Label36->Enabled = Bitdisplayonoff1->Checked; Label37->Enabled = Bitdisplayonoff1->Checked; Label38->Enabled = Bitdisplayonoff1->Checked; Label39->Enabled = Bitdisplayonoff1->Checked; Label40->Enabled = Bitdisplayonoff1->Checked; // enables / disables RX bits Label51->Enabled = Bitdisplayonoff1->Checked; Label52->Enabled = Bitdisplayonoff1->Checked; Label53->Enabled = Bitdisplayonoff1->Checked; Label54->Enabled = Bitdisplayonoff1->Checked; Label55->Enabled = Bitdisplayonoff1->Checked; Label56->Enabled = Bitdisplayonoff1->Checked; Label57->Enabled = Bitdisplayonoff1->Checked; Label58->Enabled = Bitdisplayonoff1->Checked; Label59->Enabled = Bitdisplayonoff1->Checked; Label60->Enabled = Bitdisplayonoff1->Checked; Label74->Caption = ""; // set modem status signals SetModemStatus(); if(Activation->On == true) { CheckBox2->Checked = true; CheckBox2->Enabled = true; } if( Activation->On == false) { CheckBox2->Checked = false; CheckBox2->Enabled = false; } // gives Beta Version information + disclaimer Form7= new TForm7(Application); Form7->ShowModal(); delete Form7; } //--------------------------------------------------------------------------- void __fastcall TForm2::Version2Click(TObject *Sender) { ShowMessage("WJ-8888 ASYNCHRONOUS/SYNCHRONOUS I/O INTERFACE V0.6 Beta\n (C) Copyright 2005 Peter De Coninck / Geert De Coninck\n Compiled with Borland C++ Builder V6.0 Build 10.160\n WinSoft ComPort 3.0 Component installed\n Erik Salaj http://www.winsoft.sk\n *USER ID : PETER DE CONINCK ONL4234\n Free distribution without any warranty"); StatusBar->Panels->Items[8]->Text = "Version displayed"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Exit2Click(TObject *Sender) { CloseComportValid(); // close comport in a valid way Close(); // close program } //--------------------------------------------------------------------------- void __fastcall TForm2::Button1Click(TObject *Sender) { CloseComportValid(); // close comport in a valid way Close(); // close program } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver13Click(TObject *Sender) { FILE *stream; // file pointer long value = 0L; // write setup data /* open a file for update */ stream = fopen("RCVR00.FIL", "w+"); /* write some data to the file */ fprintf(stream, "%d\n", RadioGroup1->ItemIndex); // mode fprintf(stream, "%d\n", 0); // receiver ID fprintf(stream, "%d\n", RadioGroup3->ItemIndex); // if bandwith fprintf(stream, "%d\n", RadioGroup4->ItemIndex); // gain mode fprintf(stream, "%d\n", RadioGroup5->ItemIndex); // detection mode fprintf(stream, "%d\n", CheckBox1->Checked); // agc dump value = send_tunedfreq10Hz; fprintf(stream, "%ld\n", value); // tuned freq 10^1 value = send_tunedfreq100Hz; fprintf(stream, "%ld\n", value); // tuned freq 10^2 value = send_tunedfreq1kHz; fprintf(stream, "%ld\n", value); // tuned freq 10^3 value = send_tunedfreq10kHz; fprintf(stream, "%ld\n", value); // tuned freq 10^4 value = send_tunedfreq100kHz; fprintf(stream, "%ld\n", value); // tuned freq 10^5 value = send_tunedfreq1MHz; fprintf(stream, "%ld\n", value); // tuned freq 10^6 value = send_tunedfreq10MHz; fprintf(stream, "%ld\n", value); // tuned freq 10^7 value = TrackBar2->Position; fprintf(stream, "%ld\n", value); // BFO frequency value = StrToFloat(Label19->Caption); fprintf(stream, "%ld\n", value); // Gain mode value = StrToFloat(Label20->Caption); fprintf(stream, "%ld\n", value); // Signal level value = send_signBFO; fprintf(stream, "%ld\n", value); // BFO sign bit /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data saved"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver11Click(TObject *Sender) { FILE *stream; // file pointer long value = 0L; // write setup data /* open a file for update */ stream = fopen("RCVR01.FIL", "w+"); /* write some data to the file */ fprintf(stream, "%d\n", RadioGroup1->ItemIndex); fprintf(stream, "%d\n", 1); fprintf(stream, "%d\n", RadioGroup3->ItemIndex); fprintf(stream, "%d\n", RadioGroup4->ItemIndex); fprintf(stream, "%d\n", RadioGroup5->ItemIndex); fprintf(stream, "%d\n", CheckBox1->Checked); value = send_tunedfreq10Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1MHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10MHz; fprintf(stream, "%ld\n", value); value = TrackBar2->Position; fprintf(stream, "%ld\n", value); value = StrToFloat(Label19->Caption); fprintf(stream, "%ld\n", value); value = StrToFloat(Label20->Caption); fprintf(stream, "%ld\n", value); value = send_signBFO; fprintf(stream, "%ld\n", value); // BFO sign bit /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data saved"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Sav1Click(TObject *Sender) { FILE *stream; // file pointer long value = 0L; // write setup data /* open a file for update */ stream = fopen("RCVR02.FIL", "w+"); /* write some data to the file */ fprintf(stream, "%d\n", RadioGroup1->ItemIndex); fprintf(stream, "%d\n", 2); fprintf(stream, "%d\n", RadioGroup3->ItemIndex); fprintf(stream, "%d\n", RadioGroup4->ItemIndex); fprintf(stream, "%d\n", RadioGroup5->ItemIndex); fprintf(stream, "%d\n", CheckBox1->Checked); value = send_tunedfreq10Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1MHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10MHz; fprintf(stream, "%ld\n", value); value = TrackBar2->Position; fprintf(stream, "%ld\n", value); value = StrToFloat(Label19->Caption); fprintf(stream, "%ld\n", value); value = StrToFloat(Label20->Caption); fprintf(stream, "%ld\n", value); value = send_signBFO; fprintf(stream, "%ld\n", value); // BFO sign bit /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data saved"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver31Click(TObject *Sender) { FILE *stream; // file pointer long value = 0L; // write setup data /* open a file for update */ stream = fopen("RCVR03.FIL", "w+"); /* write some data to the file */ fprintf(stream, "%d\n", RadioGroup1->ItemIndex); fprintf(stream, "%d\n", 3); fprintf(stream, "%d\n", RadioGroup3->ItemIndex); fprintf(stream, "%d\n", RadioGroup4->ItemIndex); fprintf(stream, "%d\n", RadioGroup5->ItemIndex); fprintf(stream, "%d\n", CheckBox1->Checked); value = send_tunedfreq10Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1MHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10MHz; fprintf(stream, "%ld\n", value); value = TrackBar2->Position; fprintf(stream, "%ld\n", value); value = StrToFloat(Label19->Caption); fprintf(stream, "%ld\n", value); value = StrToFloat(Label20->Caption); fprintf(stream, "%ld\n", value); value = send_signBFO; fprintf(stream, "%ld\n", value); // BFO sign bit /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data saved"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver41Click(TObject *Sender) { FILE *stream; // file pointer long value = 0L; // write setup data /* open a file for update */ stream = fopen("RCVR04.FIL", "w+"); /* write some data to the file */ fprintf(stream, "%d\n", RadioGroup1->ItemIndex); fprintf(stream, "%d\n", 4); fprintf(stream, "%d\n", RadioGroup3->ItemIndex); fprintf(stream, "%d\n", RadioGroup4->ItemIndex); fprintf(stream, "%d\n", RadioGroup5->ItemIndex); fprintf(stream, "%d\n", CheckBox1->Checked); value = send_tunedfreq10Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1MHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10MHz; fprintf(stream, "%ld\n", value); value = TrackBar2->Position; fprintf(stream, "%ld\n", value); value = StrToFloat(Label19->Caption); fprintf(stream, "%ld\n", value); value = StrToFloat(Label20->Caption); fprintf(stream, "%ld\n", value); value = send_signBFO; fprintf(stream, "%ld\n", value); // BFO sign bit /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data saved"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver51Click(TObject *Sender) { FILE *stream; // file pointer long value = 0L; // write setup data /* open a file for update */ stream = fopen("RCVR05.FIL", "w+"); /* write some data to the file */ fprintf(stream, "%d\n", RadioGroup1->ItemIndex); fprintf(stream, "%d\n", 5); fprintf(stream, "%d\n", RadioGroup3->ItemIndex); fprintf(stream, "%d\n", RadioGroup4->ItemIndex); fprintf(stream, "%d\n", RadioGroup5->ItemIndex); fprintf(stream, "%d\n", CheckBox1->Checked); value = send_tunedfreq10Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1MHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10MHz; fprintf(stream, "%ld\n", value); value = TrackBar2->Position; fprintf(stream, "%ld\n", value); value = StrToFloat(Label19->Caption); fprintf(stream, "%ld\n", value); value = StrToFloat(Label20->Caption); fprintf(stream, "%ld\n", value); value = send_signBFO; fprintf(stream, "%ld\n", value); // BFO sign bit /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data saved"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver61Click(TObject *Sender) { FILE *stream; // file pointer long value = 0L; // write setup data /* open a file for update */ stream = fopen("RCVR06.FIL", "w+"); /* write some data to the file */ fprintf(stream, "%d\n", RadioGroup1->ItemIndex); fprintf(stream, "%d\n", 6); fprintf(stream, "%d\n", RadioGroup3->ItemIndex); fprintf(stream, "%d\n", RadioGroup4->ItemIndex); fprintf(stream, "%d\n", RadioGroup5->ItemIndex); fprintf(stream, "%d\n", CheckBox1->Checked); value = send_tunedfreq10Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1MHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10MHz; fprintf(stream, "%ld\n", value); value = TrackBar2->Position; fprintf(stream, "%ld\n", value); value = StrToFloat(Label19->Caption); fprintf(stream, "%ld\n", value); value = StrToFloat(Label20->Caption); fprintf(stream, "%ld\n", value); value = send_signBFO; fprintf(stream, "%ld\n", value); // BFO sign bit /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data saved"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver71Click(TObject *Sender) { FILE *stream; // file pointer long value = 0L; // write setup data /* open a file for update */ stream = fopen("RCVR07.FIL", "w+"); /* write some data to the file */ fprintf(stream, "%d\n", RadioGroup1->ItemIndex); fprintf(stream, "%d\n", 7); fprintf(stream, "%d\n", RadioGroup3->ItemIndex); fprintf(stream, "%d\n", RadioGroup4->ItemIndex); fprintf(stream, "%d\n", RadioGroup5->ItemIndex); fprintf(stream, "%d\n", CheckBox1->Checked); value = send_tunedfreq10Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1MHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10MHz; fprintf(stream, "%ld\n", value); value = TrackBar2->Position; fprintf(stream, "%ld\n", value); value = StrToFloat(Label19->Caption); fprintf(stream, "%ld\n", value); value = StrToFloat(Label20->Caption); fprintf(stream, "%ld\n", value); value = send_signBFO; fprintf(stream, "%ld\n", value); // BFO sign bit /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data saved"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver81Click(TObject *Sender) { FILE *stream; // file pointer long value = 0L; // write setup data /* open a file for update */ stream = fopen("RCVR08.FIL", "w+"); /* write some data to the file */ fprintf(stream, "%d\n", RadioGroup1->ItemIndex); fprintf(stream, "%d\n", 8); fprintf(stream, "%d\n", RadioGroup3->ItemIndex); fprintf(stream, "%d\n", RadioGroup4->ItemIndex); fprintf(stream, "%d\n", RadioGroup5->ItemIndex); fprintf(stream, "%d\n", CheckBox1->Checked); value = send_tunedfreq10Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1MHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10MHz; fprintf(stream, "%ld\n", value); value = TrackBar2->Position; fprintf(stream, "%ld\n", value); value = StrToFloat(Label19->Caption); fprintf(stream, "%ld\n", value); value = StrToFloat(Label20->Caption); fprintf(stream, "%ld\n", value); value = send_signBFO; fprintf(stream, "%ld\n", value); // BFO sign bit /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data saved"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver91Click(TObject *Sender) { FILE *stream; // file pointer long value = 0L; // write setup data /* open a file for update */ stream = fopen("RCVR09.FIL", "w+"); /* write some data to the file */ fprintf(stream, "%d\n", RadioGroup1->ItemIndex); fprintf(stream, "%d\n", 9); fprintf(stream, "%d\n", RadioGroup3->ItemIndex); fprintf(stream, "%d\n", RadioGroup4->ItemIndex); fprintf(stream, "%d\n", RadioGroup5->ItemIndex); fprintf(stream, "%d\n", CheckBox1->Checked); value = send_tunedfreq10Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1MHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10MHz; fprintf(stream, "%ld\n", value); value = TrackBar2->Position; fprintf(stream, "%ld\n", value); value = StrToFloat(Label19->Caption); fprintf(stream, "%ld\n", value); value = StrToFloat(Label20->Caption); fprintf(stream, "%ld\n", value); value = send_signBFO; fprintf(stream, "%ld\n", value); // BFO sign bit /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data saved"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver101Click(TObject *Sender) { FILE *stream; // file pointer long value = 0L; // write setup data /* open a file for update */ stream = fopen("RCVR10.FIL", "w+"); /* write some data to the file */ fprintf(stream, "%d\n", RadioGroup1->ItemIndex); fprintf(stream, "%d\n", 10); fprintf(stream, "%d\n", RadioGroup3->ItemIndex); fprintf(stream, "%d\n", RadioGroup4->ItemIndex); fprintf(stream, "%d\n", RadioGroup5->ItemIndex); fprintf(stream, "%d\n", CheckBox1->Checked); value = send_tunedfreq10Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1MHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10MHz; fprintf(stream, "%ld\n", value); value = TrackBar2->Position; fprintf(stream, "%ld\n", value); value = StrToFloat(Label19->Caption); fprintf(stream, "%ld\n", value); value = StrToFloat(Label20->Caption); fprintf(stream, "%ld\n", value); value = send_signBFO; fprintf(stream, "%ld\n", value); // BFO sign bit /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data saved"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver111Click(TObject *Sender) { FILE *stream; // file pointer long value = 0L; // write setup data /* open a file for update */ stream = fopen("RCVR11.FIL", "w+"); /* write some data to the file */ fprintf(stream, "%d\n", RadioGroup1->ItemIndex); fprintf(stream, "%d\n", 11); fprintf(stream, "%d\n", RadioGroup3->ItemIndex); fprintf(stream, "%d\n", RadioGroup4->ItemIndex); fprintf(stream, "%d\n", RadioGroup5->ItemIndex); fprintf(stream, "%d\n", CheckBox1->Checked); value = send_tunedfreq10Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1MHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10MHz; fprintf(stream, "%ld\n", value); value = TrackBar2->Position; fprintf(stream, "%ld\n", value); value = StrToFloat(Label19->Caption); fprintf(stream, "%ld\n", value); value = StrToFloat(Label20->Caption); fprintf(stream, "%ld\n", value); value = send_signBFO; fprintf(stream, "%ld\n", value); // BFO sign bit /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data saved"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver121Click(TObject *Sender) { FILE *stream; // file pointer long value = 0L; // write setup data /* open a file for update */ stream = fopen("RCVR12.FIL", "w+"); /* write some data to the file */ fprintf(stream, "%d\n", RadioGroup1->ItemIndex); fprintf(stream, "%d\n", 12); fprintf(stream, "%d\n", RadioGroup3->ItemIndex); fprintf(stream, "%d\n", RadioGroup4->ItemIndex); fprintf(stream, "%d\n", RadioGroup5->ItemIndex); fprintf(stream, "%d\n", CheckBox1->Checked); value = send_tunedfreq10Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1MHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10MHz; fprintf(stream, "%ld\n", value); value = TrackBar2->Position; fprintf(stream, "%ld\n", value); value = StrToFloat(Label19->Caption); fprintf(stream, "%ld\n", value); value = StrToFloat(Label20->Caption); fprintf(stream, "%ld\n", value); value = send_signBFO; fprintf(stream, "%ld\n", value); // BFO sign bit /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data saved"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver131Click(TObject *Sender) { FILE *stream; // file pointer long value = 0L; // write setup data /* open a file for update */ stream = fopen("RCVR13.FIL", "w+"); /* write some data to the file */ fprintf(stream, "%d\n", RadioGroup1->ItemIndex); fprintf(stream, "%d\n", 13); fprintf(stream, "%d\n", RadioGroup3->ItemIndex); fprintf(stream, "%d\n", RadioGroup4->ItemIndex); fprintf(stream, "%d\n", RadioGroup5->ItemIndex); fprintf(stream, "%d\n", CheckBox1->Checked); value = send_tunedfreq10Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1MHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10MHz; fprintf(stream, "%ld\n", value); value = TrackBar2->Position; fprintf(stream, "%ld\n", value); value = StrToFloat(Label19->Caption); fprintf(stream, "%ld\n", value); value = StrToFloat(Label20->Caption); fprintf(stream, "%ld\n", value); value = send_signBFO; fprintf(stream, "%ld\n", value); // BFO sign bit /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data saved"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver141Click(TObject *Sender) { FILE *stream; // file pointer long value = 0L; // write setup data /* open a file for update */ stream = fopen("RCVR14.FIL", "w+"); /* write some data to the file */ fprintf(stream, "%d\n", RadioGroup1->ItemIndex); fprintf(stream, "%d\n", 14); fprintf(stream, "%d\n", RadioGroup3->ItemIndex); fprintf(stream, "%d\n", RadioGroup4->ItemIndex); fprintf(stream, "%d\n", RadioGroup5->ItemIndex); fprintf(stream, "%d\n", CheckBox1->Checked); value = send_tunedfreq10Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1MHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10MHz; fprintf(stream, "%ld\n", value); value = TrackBar2->Position; fprintf(stream, "%ld\n", value); value = StrToFloat(Label19->Caption); fprintf(stream, "%ld\n", value); value = StrToFloat(Label20->Caption); fprintf(stream, "%ld\n", value); value = send_signBFO; fprintf(stream, "%ld\n", value); // BFO sign bit /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data saved"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver151Click(TObject *Sender) { FILE *stream; // file pointer long value = 0L; // write setup data /* open a file for update */ stream = fopen("RCVR15.FIL", "w+"); /* write some data to the file */ fprintf(stream, "%d\n", RadioGroup1->ItemIndex); fprintf(stream, "%d\n", 15); fprintf(stream, "%d\n", RadioGroup3->ItemIndex); fprintf(stream, "%d\n", RadioGroup4->ItemIndex); fprintf(stream, "%d\n", RadioGroup5->ItemIndex); fprintf(stream, "%d\n", CheckBox1->Checked); value = send_tunedfreq10Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100Hz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq100kHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq1MHz; fprintf(stream, "%ld\n", value); value = send_tunedfreq10MHz; fprintf(stream, "%ld\n", value); value = TrackBar2->Position; fprintf(stream, "%ld\n", value); value = StrToFloat(Label19->Caption); fprintf(stream, "%ld\n", value); value = StrToFloat(Label20->Caption); fprintf(stream, "%ld\n", value); value = send_signBFO; fprintf(stream, "%ld\n", value); // BFO sign bit /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data saved"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Loadreceiver11Click(TObject *Sender) { FILE *stream; int i=0; long value=0L; /* open a file for update */ stream = fopen("RCVR00.FIL", "r+"); fscanf(stream, "%d\n", &i); RadioGroup1->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup2->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup3->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup4->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup5->ItemIndex = i; fscanf(stream, "%d\n", &i); CheckBox1->Checked = i; fscanf(stream, "%ld\n", &value); send_tunedfreq10Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1MHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10MHz = value; fscanf(stream, "%ld\n", &value); // TrackBar2->Position = value; fscanf(stream, "%ld\n", &value); Label19->Caption = FloatToStr(value); TrackBar3->Position = value; fscanf(stream, "%ld\n", &value); Label20->Caption = FloatToStr(value); ProgressBar1->Position = value; fscanf(stream,"%ld\n",&value); send_signBFO = value; TotalSendFreq(); Label17->Caption = FloatToStr(totalfreq_write); /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data loaded"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver12Click(TObject *Sender) { FILE *stream; int i=0; long value=0L; /* open a file for update */ stream = fopen("RCVR01.FIL", "r+"); /* read some data from the file */ fscanf(stream, "%d\n", &i); RadioGroup1->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup2->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup3->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup4->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup5->ItemIndex = i; fscanf(stream, "%d\n", &i); CheckBox1->Checked = i; fscanf(stream, "%ld\n", &value); send_tunedfreq10Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1MHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10MHz = value; fscanf(stream, "%ld\n", &value); // TrackBar2->Position = value; fscanf(stream, "%ld\n", &value); Label19->Caption = FloatToStr(value); TrackBar3->Position = value; fscanf(stream, "%ld\n", &value); Label20->Caption = FloatToStr(value); ProgressBar1->Position = value; fscanf(stream,"%ld\n",&value); send_signBFO = value; TotalSendFreq(); Label17->Caption = FloatToStr(totalfreq_write); /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data loaded"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver21Click(TObject *Sender) { FILE *stream; int i=0; long value=0L; /* open a file for update */ stream = fopen("RCVR02.FIL", "r+"); /* read some data from the file */ fscanf(stream, "%d\n", &i); RadioGroup1->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup2->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup3->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup4->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup5->ItemIndex = i; fscanf(stream, "%d\n", &i); CheckBox1->Checked = i; fscanf(stream, "%ld\n", &value); send_tunedfreq10Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1MHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10MHz = value; fscanf(stream, "%ld\n", &value); // TrackBar2->Position = value; fscanf(stream, "%ld\n", &value); Label19->Caption = FloatToStr(value); TrackBar3->Position = value; fscanf(stream, "%ld\n", &value); Label20->Caption = FloatToStr(value); ProgressBar1->Position = value; fscanf(stream,"%ld\n",&value); send_signBFO = value; TotalSendFreq(); Label17->Caption = FloatToStr(totalfreq_write); /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data loaded"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver32Click(TObject *Sender) { FILE *stream; int i=0; long value=0L; /* open a file for update */ stream = fopen("RCVR03.FIL", "r+"); /* read some data from the file */ fscanf(stream, "%d\n", &i); RadioGroup1->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup2->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup3->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup4->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup5->ItemIndex = i; fscanf(stream, "%d\n", &i); CheckBox1->Checked = i; fscanf(stream, "%ld\n", &value); send_tunedfreq10Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1MHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10MHz = value; fscanf(stream, "%ld\n", &value); // TrackBar2->Position = value; fscanf(stream, "%ld\n", &value); Label19->Caption = FloatToStr(value); TrackBar3->Position = value; fscanf(stream, "%ld\n", &value); Label20->Caption = FloatToStr(value); fscanf(stream,"%ld\n",&value); send_signBFO = value; TotalSendFreq(); Label17->Caption = FloatToStr(totalfreq_write); /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data loaded"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver42Click(TObject *Sender) { FILE *stream; int i=0; long value=0L; /* open a file for update */ stream = fopen("RCVR04.FIL", "r+"); /* read some data from the file */ fscanf(stream, "%d\n", &i); RadioGroup1->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup2->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup3->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup4->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup5->ItemIndex = i; fscanf(stream, "%d\n", &i); CheckBox1->Checked = i; fscanf(stream, "%ld\n", &value); send_tunedfreq10Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1MHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10MHz = value; fscanf(stream, "%ld\n", &value); // TrackBar2->Position = value; fscanf(stream, "%ld\n", &value); Label19->Caption = FloatToStr(value); TrackBar3->Position = value; fscanf(stream, "%ld\n", &value); Label20->Caption = FloatToStr(value); ProgressBar1->Position = value; fscanf(stream,"%ld\n",&value); send_signBFO = value; TotalSendFreq(); Label17->Caption = FloatToStr(totalfreq_write); /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data loaded"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver52Click(TObject *Sender) { FILE *stream; int i=0; long value=0L; /* open a file for update */ stream = fopen("RCVR05.FIL", "r+"); /* read some data from the file */ fscanf(stream, "%d\n", &i); RadioGroup1->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup2->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup3->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup4->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup5->ItemIndex = i; fscanf(stream, "%d\n", &i); CheckBox1->Checked = i; fscanf(stream, "%ld\n", &value); send_tunedfreq10Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1MHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10MHz = value; fscanf(stream, "%ld\n", &value); // TrackBar2->Position = value; fscanf(stream, "%ld\n", &value); Label19->Caption = FloatToStr(value); TrackBar3->Position = value; fscanf(stream, "%ld\n", &value); Label20->Caption = FloatToStr(value); ProgressBar1->Position = value; fscanf(stream,"%ld\n",&value); send_signBFO = value; TotalSendFreq(); Label17->Caption = FloatToStr(totalfreq_write); /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data loaded"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver62Click(TObject *Sender) { FILE *stream; int i=0; long value=0L; /* open a file for update */ stream = fopen("RCVR06.FIL", "r+"); /* read some data from the file */ fscanf(stream, "%d\n", &i); RadioGroup1->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup2->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup3->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup4->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup5->ItemIndex = i; fscanf(stream, "%d\n", &i); CheckBox1->Checked = i; fscanf(stream, "%ld\n", &value); send_tunedfreq10Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1MHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10MHz = value; fscanf(stream, "%ld\n", &value); // TrackBar2->Position = value; fscanf(stream, "%ld\n", &value); Label19->Caption = FloatToStr(value); TrackBar3->Position = value; fscanf(stream, "%ld\n", &value); Label20->Caption = FloatToStr(value); ProgressBar1->Position = value; fscanf(stream,"%ld\n",&value); send_signBFO = value; TotalSendFreq(); Label17->Caption = FloatToStr(totalfreq_write); /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data loaded"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver72Click(TObject *Sender) { FILE *stream; int i=0; long value=0L; /* open a file for update */ stream = fopen("RCVR07.FIL", "r+"); /* read some data from the file */ fscanf(stream, "%d\n", &i); RadioGroup1->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup2->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup3->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup4->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup5->ItemIndex = i; fscanf(stream, "%d\n", &i); CheckBox1->Checked = i; fscanf(stream, "%ld\n", &value); send_tunedfreq10Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1MHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10MHz = value; fscanf(stream, "%ld\n", &value); // TrackBar2->Position = value; fscanf(stream, "%ld\n", &value); Label19->Caption = FloatToStr(value); TrackBar3->Position = value; fscanf(stream, "%ld\n", &value); Label20->Caption = FloatToStr(value); ProgressBar1->Position = value; fscanf(stream,"%ld\n",&value); send_signBFO = value; TotalSendFreq(); Label17->Caption = FloatToStr(totalfreq_write); /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data loaded"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver82Click(TObject *Sender) { FILE *stream; int i=0; long value=0L; /* open a file for update */ stream = fopen("RCVR08.FIL", "r+"); /* read some data from the file */ fscanf(stream, "%d\n", &i); RadioGroup1->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup2->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup3->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup4->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup5->ItemIndex = i; fscanf(stream, "%d\n", &i); CheckBox1->Checked = i; fscanf(stream, "%ld\n", &value); send_tunedfreq10Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1MHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10MHz = value; fscanf(stream, "%ld\n", &value); // TrackBar2->Position = value; fscanf(stream, "%ld\n", &value); Label19->Caption = FloatToStr(value); TrackBar3->Position = value; fscanf(stream, "%ld\n", &value); Label20->Caption = FloatToStr(value); ProgressBar1->Position = value; fscanf(stream,"%ld\n",&value); send_signBFO = value; TotalSendFreq(); Label17->Caption = FloatToStr(totalfreq_write); /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data loaded"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver92Click(TObject *Sender) { FILE *stream; int i=0; long value=0L; /* open a file for update */ stream = fopen("RCVR09.FIL", "r+"); /* read some data from the file */ fscanf(stream, "%d\n", &i); RadioGroup1->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup2->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup3->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup4->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup5->ItemIndex = i; fscanf(stream, "%d\n", &i); CheckBox1->Checked = i; fscanf(stream, "%ld\n", &value); send_tunedfreq10Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1MHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10MHz = value; fscanf(stream, "%ld\n", &value); // TrackBar2->Position = value; fscanf(stream, "%ld\n", &value); Label19->Caption = FloatToStr(value); TrackBar3->Position = value; fscanf(stream, "%ld\n", &value); Label20->Caption = FloatToStr(value); ProgressBar1->Position = value; fscanf(stream,"%ld\n",&value); send_signBFO = value; TotalSendFreq(); Label17->Caption = FloatToStr(totalfreq_write); /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data loaded"; } //--------------------------------------------------------------------------- void __fastcall TForm2:: Savereceiver102Click(TObject *Sender) { FILE *stream; int i=0; long value=0L; /* open a file for update */ stream = fopen("RCVR10.FIL", "r+"); /* read some data from the file */ fscanf(stream, "%d\n", &i); RadioGroup1->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup2->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup3->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup4->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup5->ItemIndex = i; fscanf(stream, "%d\n", &i); CheckBox1->Checked = i; fscanf(stream, "%ld\n", &value); send_tunedfreq10Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1MHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10MHz = value; fscanf(stream, "%ld\n", &value); // TrackBar2->Position = value; fscanf(stream, "%ld\n", &value); Label19->Caption = FloatToStr(value); TrackBar3->Position = value; fscanf(stream, "%ld\n", &value); Label20->Caption = FloatToStr(value); ProgressBar1->Position = value; fscanf(stream,"%ld\n",&value); send_signBFO = value; TotalSendFreq(); Label17->Caption = FloatToStr(totalfreq_write); /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data loaded"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver112Click(TObject *Sender) { FILE *stream; int i=0; long value=0L; /* open a file for update */ stream = fopen("RCVR11.FIL", "r+"); /* read some data from the file */ fscanf(stream, "%d\n", &i); RadioGroup1->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup2->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup3->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup4->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup5->ItemIndex = i; fscanf(stream, "%d\n", &i); CheckBox1->Checked = i; fscanf(stream, "%ld\n", &value); send_tunedfreq10Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1MHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10MHz = value; fscanf(stream, "%ld\n", &value); // TrackBar2->Position = value; fscanf(stream, "%ld\n", &value); Label19->Caption = FloatToStr(value); TrackBar3->Position = value; fscanf(stream, "%ld\n", &value); Label20->Caption = FloatToStr(value); ProgressBar1->Position = value; fscanf(stream,"%ld\n",&value); send_signBFO = value; TotalSendFreq(); Label17->Caption = FloatToStr(totalfreq_write); /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data loaded"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver122Click(TObject *Sender) { FILE *stream; int i=0; long value=0L; /* open a file for update */ stream = fopen("RCVR12.FIL", "r+"); /* read some data from the file */ fscanf(stream, "%d\n", &i); RadioGroup1->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup2->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup3->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup4->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup5->ItemIndex = i; fscanf(stream, "%d\n", &i); CheckBox1->Checked = i; fscanf(stream, "%ld\n", &value); send_tunedfreq10Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1MHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10MHz = value; fscanf(stream, "%ld\n", &value); // TrackBar2->Position = value; fscanf(stream, "%ld\n", &value); Label19->Caption = FloatToStr(value); TrackBar3->Position = value; fscanf(stream, "%ld\n", &value); Label20->Caption = FloatToStr(value); ProgressBar1->Position = value; fscanf(stream,"%ld\n",&value); send_signBFO = value; TotalSendFreq(); Label17->Caption = FloatToStr(totalfreq_write); /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data loaded"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver132Click(TObject *Sender) { FILE *stream; int i=0; long value=0L; /* open a file for update */ stream = fopen("RCVR13.FIL", "r+"); /* read some data from the file */ fscanf(stream, "%d\n", &i); RadioGroup1->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup2->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup3->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup4->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup5->ItemIndex = i; fscanf(stream, "%d\n", &i); CheckBox1->Checked = i; fscanf(stream, "%ld\n", &value); send_tunedfreq10Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1MHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10MHz = value; fscanf(stream, "%ld\n", &value); // TrackBar2->Position = value; fscanf(stream, "%ld\n", &value); Label19->Caption = FloatToStr(value); TrackBar3->Position = value; fscanf(stream, "%ld\n", &value); Label20->Caption = FloatToStr(value); ProgressBar1->Position = value; fscanf(stream,"%ld\n",&value); send_signBFO = value; TotalSendFreq(); Label17->Caption = FloatToStr(totalfreq_write); /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data loaded"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver142Click(TObject *Sender) { FILE *stream; int i=0; long value=0L; /* open a file for update */ stream = fopen("RCVR14.FIL", "r+"); /* read some data from the file */ fscanf(stream, "%d\n", &i); RadioGroup1->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup2->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup3->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup4->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup5->ItemIndex = i; fscanf(stream, "%d\n", &i); CheckBox1->Checked = i; fscanf(stream, "%ld\n", &value); send_tunedfreq10Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1MHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10MHz = value; fscanf(stream, "%ld\n", &value); // TrackBar2->Position = value; fscanf(stream, "%ld\n", &value); Label19->Caption = FloatToStr(value); TrackBar3->Position = value; fscanf(stream, "%ld\n", &value); Label20->Caption = FloatToStr(value); ProgressBar1->Position = value; fscanf(stream,"%ld\n",&value); send_signBFO = value; TotalSendFreq(); Label17->Caption = FloatToStr(totalfreq_write); /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data loaded"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Savereceiver152Click(TObject *Sender) { FILE *stream; int i=0; long value=0L; /* open a file for update */ stream = fopen("RCVR15.FIL", "r+"); /* read some data from the file */ fscanf(stream, "%d\n", &i); RadioGroup1->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup2->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup3->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup4->ItemIndex = i; fscanf(stream, "%d\n", &i); RadioGroup5->ItemIndex = i; fscanf(stream, "%d\n", &i); CheckBox1->Checked = i; fscanf(stream, "%ld\n", &value); send_tunedfreq10Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100Hz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq100kHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq1MHz = value; fscanf(stream, "%ld\n", &value); send_tunedfreq10MHz = value; fscanf(stream, "%ld\n", &value); // TrackBar2->Position = value; fscanf(stream, "%ld\n", &value); Label19->Caption = FloatToStr(value); TrackBar3->Position = value; fscanf(stream, "%ld\n", &value); Label20->Caption = FloatToStr(value); ProgressBar1->Position = value; fscanf(stream,"%ld\n",&value); send_signBFO = value; TotalSendFreq(); Label17->Caption = FloatToStr(totalfreq_write); /* close the file */ fclose(stream); StatusBar->Panels->Items[8]->Text = "Receiver data loaded"; } //--------------------------------------------------------------------------- void __fastcall TForm2::TrackBar3Change(TObject *Sender) { long value = 0L; value = StrToFloat(TrackBar3->Position); Label19->Caption =FloatToStr(value); } //--------------------------------------------------------------------------- void __fastcall TForm2::Button2Click(TObject *Sender) { // write data timed if in async command mode if(RadioGroup1->ItemIndex==0 && asynch==1) { WriteData(); // write data } // write data timed if in async monitor mode if(RadioGroup1->ItemIndex==1 && asynch == 1) { WriteData(); // set in monitor mode } // write data timed if in sync command mode if(RadioGroup1->ItemIndex==0 && asynch==0) { WriteData(); // write data } // write TESTDATA timed if in sync command mode if(RadioGroup1->ItemIndex==1 && asynch==0 && PCPCSimulation1->Checked == true) { WriteData(); // this has to be deleted: only used for PC / PC connection } if(RadioGroup1->ItemIndex==1) { ReadData(); // read data ReceivedLCD(); // visualize received data onto LCD } SetModemStatus(); } //--------------------------------------------------------------------------- void __fastcall TForm2::RadioGroup1Click(TObject *Sender) { if (RadioGroup1->ItemIndex == 0) { Label47->Caption = "COMMAND MODE"; } if (RadioGroup1->ItemIndex == 1) { LockStop(); Label47->Caption = "MONITOR MODE"; ReceivedLCD(); } } //--------------------------------------------------------------------------- void __fastcall TForm2::Savesetup1Click(TObject *Sender) { FILE *stream; stream=fopen("SETUP.FIL","w"); fprintf(stream,"%d\n", ComboBoxDeviceName->ItemIndex); fprintf(stream,"%d\n", ComboBoxBaudRate->ItemIndex); fprintf(stream,"%d\n", ComboBoxDataBits->ItemIndex); fprintf(stream,"%d\n", ComboBoxStopBits->ItemIndex); fprintf(stream,"%d\n", ComboBoxParity->ItemIndex); fprintf(stream,"%d\n", ColorBox1->Selected); fprintf(stream,"%s\n", user); fprintf(stream,"%d\n", asynch); fclose(stream); } //--------------------------------------------------------------------------- void __fastcall TForm2::Exit1Click(TObject *Sender) { CloseComportValid(); Close(); } //--------------------------------------------------------------------------- void __fastcall TForm2::Sav2Click(TObject *Sender) { FILE *stream; int i; stream=fopen("SETUP.FIL","r"); fscanf(stream, "%d", &i); ComboBoxDeviceName->ItemIndex = i; fscanf(stream, "%d", &i); ComboBoxBaudRate->ItemIndex = i; fscanf(stream, "%d", &i); ComboBoxDataBits->ItemIndex = i; fscanf(stream, "%d", &i); ComboBoxStopBits->ItemIndex = i; fscanf(stream, "%d", &i); ComboBoxParity->ItemIndex = i; fscanf(stream, "%d", &i); ColorBox1->Selected = i; Panel2->Color = ColorBox1->Selected; fscanf(stream, "%s", user); fscanf(stream, "%d", &i); asynch=i; fclose(stream); } //--------------------------------------------------------------------------- void __fastcall TForm2::Timer2Timer(TObject *Sender) { // normal program loop byte_send01=128; // Modal ID byte // simulation of modal byte id byte_send02=0; byte_send03=0; byte_send04=0; byte_send05=0; byte_send06=0; byte_send07=0; byte_send08=0; byte_send09=0; byte_send10=0; if(RadioGroup1->ItemIndex == 0) { ComPort->ClearInput(); // clear RX buffer when in command mode } if(RadioGroup1->ItemIndex == 0) { LoopRXData1->Checked= false; HoldRXData1->Checked= true; } CalculateSendBFO(); // calculate SEND BFO frequency AsyncSendTable(); // fills the async sending table ConvertAsyncSync(); // converting async to sync table BitDisplay(); // display TX and RX bits TransferedLCD(); // actualize LCD in command mode EnableObjects(); // enable objects when in command mode DisableObjects(); // disable objects when in monitor mode LedSignals(); // control of led signals } //--------------------------------------------------------------------------- void __fastcall TForm2::ComPortAfterWrite(TObject *Sender, Pointer Buffer, int Length, bool WaitOnCompletion) { // ComPort after write AddWriteBytes(Length); } //--------------------------------------------------------------------------- void __fastcall TForm2::ComPortCTSChange(TObject *Sender) { //ComPort CTS Change SetModemStatus(); } //--------------------------------------------------------------------------- void __fastcall TForm2::ComPortDSRChange(TObject *Sender) { // ComPort DSR Change SetModemStatus(); } //--------------------------------------------------------------------------- void __fastcall TForm2::ComPortError(TCustomComPort *ComPort, EComError *E, TComAction &Action) { // ComPort Error MessageDlg("Error " + IntToStr(E->ErrorCode) + ": " + E->Message, mtError, TMsgDlgButtons() << mbOK, 0); Action = caAbort; } //--------------------------------------------------------------------------- void __fastcall TForm2::ComPortLineError(TObject *Sender, TLineErrors LineErrors) { // ComPort Line error bool Abort = false; if (LineErrors.Contains(leBreak)) { MessageDlg("Break detected", mtError, TMsgDlgButtons() << mbAbort, 0); Abort=true; } if (LineErrors.Contains(leDeviceNotSelected)) { MessageDlg("Device not selected", mtError, TMsgDlgButtons() << mbAbort, 0); Abort=true; } if (LineErrors.Contains(leFrame)) { MessageDlg("Frame error", mtError, TMsgDlgButtons() << mbAbort, 0); Abort=true; } if (LineErrors.Contains(leIO)) { MessageDlg("IO error", mtError, TMsgDlgButtons() << mbAbort, 0); Abort=true; } if (LineErrors.Contains(leMode)) { MessageDlg("Mode error", mtError, TMsgDlgButtons() << mbAbort, 0); Abort=true; } if (LineErrors.Contains(leOutOfPaper)) { MessageDlg("Out of paper", mtError, TMsgDlgButtons() << mbAbort, 0); Abort=true; } if (LineErrors.Contains(leOverrun)) { MessageDlg("Overrun error", mtError, TMsgDlgButtons() << mbAbort, 0); Abort=true; } if (LineErrors.Contains(leDeviceTimeOut)) { MessageDlg("Device timeout", mtError, TMsgDlgButtons() << mbAbort, 0); Abort=true; } if (LineErrors.Contains(leRxOverflow)) { MessageDlg("Receiver overflow", mtError, TMsgDlgButtons() << mbAbort, 0); Abort=true; } if (LineErrors.Contains(leParity)) { MessageDlg("Parity error", mtError, TMsgDlgButtons() << mbAbort, 0); Abort=true; } if (LineErrors.Contains(leTxFull)) { MessageDlg("Transmitter full", mtError, TMsgDlgButtons() << mbAbort, 0); Abort=true; } if(Abort==true) { CloseComportValid(); // close comport in a valid way Close(); // close program } } //--------------------------------------------------------------------------- void __fastcall TForm2::ComPortRing(TObject *Sender) { // ComPort Ring SetModemStatus(); } //--------------------------------------------------------------------------- void __fastcall TForm2::ComPortRLSDChange(TObject *Sender) { // ComPort RLSD Change SetModemStatus(); } //--------------------------------------------------------------------------- void TForm2::AddReadBytes(int ReadCount) { StatusBar->Panels->Items[0]->Text = "Read bytes: " + IntToStr(FReadCount+=ReadCount); } //--------------------------------------------------------------------------- void TForm2::AddWriteBytes(int WriteCount) { StatusBar->Panels->Items[1]->Text = "Write bytes: " + IntToStr(FWriteCount+=WriteCount); } //--------------------------------------------------------------------------- void TForm2::SetModemStatus(void) { if (!ComPort->Active) { StatusBar->Panels->Items[2]->Text = "CTS:"; StatusBar->Panels->Items[3]->Text = "DSR:"; StatusBar->Panels->Items[4]->Text = "Ring:"; StatusBar->Panels->Items[5]->Text = "RLSD:"; } else { TModemStatus ModemStatus = ComPort->ModemStatus; if (ModemStatus.Contains(msCTS)) StatusBar->Panels->Items[2]->Text = "CTS: On"; else StatusBar->Panels->Items[2]->Text = "CTS: Off"; if (ModemStatus.Contains(msDSR)) StatusBar->Panels->Items[3]->Text = "DSR: On"; else StatusBar->Panels->Items[3]->Text = "DSR: Off"; if (ModemStatus.Contains(msRing)) StatusBar->Panels->Items[4]->Text = "Ring: On"; else StatusBar->Panels->Items[4]->Text = "Ring: Off"; if (ModemStatus.Contains(msRLSD)) StatusBar->Panels->Items[5]->Text = "RLSD: On"; else StatusBar->Panels->Items[5]->Text = "RLSD: Off"; } if(ComPort->Active) { TXBufferCount = ComPort->OutputCount(); RXBufferCount = ComPort->InputCount(); } StatusBar->Panels->Items[6]->Text = "Buffer Counter TX: " + IntToStr(TXBufferCount); StatusBar->Panels->Items[7]->Text = "Buffer Counter RX: " + IntToStr(RXBufferCount); } //--------------------------------------------------------------------------- void __fastcall TForm2::ComSignalCTSSignal(TObject *Sender) { // Com signal CTS Signal if (ComSignalCTS->SignalValue) { PanelCTSLed->Color = ComSignalCTS->ColorOn; PanelCTSLed->Font->Color = clBlack; } else { PanelCTSLed->Color = ComSignalCTS->ColorOff; PanelCTSLed->Font->Color = clWhite; } } //--------------------------------------------------------------------------- void __fastcall TForm2::ComSignalDSRSignal(TObject *Sender) { // Com Signal DSR Signal if (ComSignalDSR->SignalValue) { PanelDSRLed->Color = ComSignalDSR->ColorOn; PanelDSRLed->Font->Color = clBlack; } else { PanelDSRLed->Color = ComSignalDSR->ColorOff; PanelDSRLed->Font->Color = clWhite; } } //--------------------------------------------------------------------------- void __fastcall TForm2::ResetTXRCcounter1Click(TObject *Sender) { FWriteCount=0; FReadCount=0; AddWriteBytes(0); AddReadBytes(0); StatusBar->Panels->Items[8]->Text = "TX/RX counters resetted"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Timer1Timer(TObject *Sender) { // timed sending and/or receiving // Receivers1->Enabled = false; // Beta versie // Receivers2->Enabled = false; // Beta versie send_frequency10Hz = 0; // clear every cycle frequency's send_frequency100Hz =0; send_frequency1kHz =0; send_frequency10kHz =0; send_frequency100kHz =0; send_frequency1MHz = 0; send_frequency10MHz = 0; if(RadioGroup1->ItemIndex==0) { Label17->Font->Color=clGreen; Label18->Font->Color=clGreen; Label19->Font->Color=clGreen; Label20->Font->Color=clGreen; } if(RadioGroup1->ItemIndex==1) { Label17->Font->Color=clRed; Label18->Font->Color=clRed; Label19->Font->Color=clRed; Label20->Font->Color=clRed; } if(CheckBox2->Checked==false && RadioGroup1->ItemIndex==1) ReceivedLCD(); // visualize data onto LCD if(CheckBox2->Checked==true) // set comport parameters { ComPort->DeviceName = ComboBoxDeviceName->Text; ComPort->BaudRate = TBaudRate(ComboBoxBaudRate->ItemIndex); ComPort->DataBits = TDataBits(ComboBoxDataBits->ItemIndex); ComPort->StopBits = TStopBits(ComboBoxStopBits->ItemIndex); ComPort->Parity = TParity(ComboBoxParity->ItemIndex); ComPort->Active = true; act = true; ComboBoxDeviceName->Enabled = !ComPort->Active; ComboBoxBaudRate->Enabled = !ComPort->Active; ComboBoxDataBits->Enabled = !ComPort->Active; ComboBoxStopBits->Enabled = !ComPort->Active; ComboBoxParity->Enabled = !ComPort->Active; // Button2->Enabled = !ComPort->Active; // Button8->Enabled = !ComPort->Active; // Button8->Caption = "CLOSE COMMUNICATION"; // write data timed if in async command mode if(RadioGroup1->ItemIndex==0 && asynch==1) { WriteData(); } // write data timed if in async monitor mode if(RadioGroup1->ItemIndex==1 && asynch == 1) { WriteData(); // set in monitor mode } // write data timed if in sync command mode if(RadioGroup1->ItemIndex==0 && asynch==0) { WriteData(); } // write TESTDATA timed if in sync command mode if(RadioGroup1->ItemIndex==1 && asynch==0 && PCPCSimulation1->Checked == true) { WriteData(); // this has to be deleted: only used for PC / PC connection } if(RadioGroup1->ItemIndex==1) { ReadData(); CalculateReadBFO(); // calculate READ BFO frequency ReceivedLCD(); // visualize received data onto LCD } } SetModemStatus(); } //--------------------------------------------------------------------------- void __fastcall TForm2::Timer3Timer(TObject *Sender) { if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = ""; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK ") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINCK") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK "; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONINC") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINCK"; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONIN") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONINC"; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CONI") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONIN"; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CON") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CONI"; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CO") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CON"; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE CO") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CO"; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE C") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE CO"; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER DE") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE C"; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER D") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER DE"; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETER") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER D"; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PETE") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETER"; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PET") Panel7->Caption = "WATKINS JOHNSON ONL4234 PETE"; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 PE") Panel7->Caption = "WATKINS JOHNSON ONL4234 PET"; if(Panel7->Caption == "WATKINS JOHNSON ONL4234 P") Panel7->Caption = "WATKINS JOHNSON ONL4234 PE"; if(Panel7->Caption == "WATKINS JOHNSON ONL4234") Panel7->Caption = "WATKINS JOHNSON ONL4234 P"; if(Panel7->Caption == "WATKINS JOHNSON ONL423") Panel7->Caption = "WATKINS JOHNSON ONL4234"; if(Panel7->Caption == "WATKINS JOHNSON ONL42") Panel7->Caption = "WATKINS JOHNSON ONL423"; if(Panel7->Caption == "WATKINS JOHNSON ONL4") Panel7->Caption = "WATKINS JOHNSON ONL42"; if(Panel7->Caption == "WATKINS JOHNSON ONL") Panel7->Caption = "WATKINS JOHNSON ONL4"; if(Panel7->Caption == "WATKINS JOHNSON ON") Panel7->Caption = "WATKINS JOHNSON ONL"; if(Panel7->Caption == "WATKINS JOHNSON O") Panel7->Caption = "WATKINS JOHNSON ON"; if(Panel7->Caption == "WATKINS JOHNSON") Panel7->Caption = "WATKINS JOHNSON O"; if(Panel7->Caption == "WATKINS JOHNSO") Panel7->Caption = "WATKINS JOHNSON"; if(Panel7->Caption == "WATKINS JOHNS") Panel7->Caption = "WATKINS JOHNSO"; if(Panel7->Caption == "WATKINS JOHN") Panel7->Caption = "WATKINS JOHNS"; if(Panel7->Caption == "WATKINS JOH") Panel7->Caption = "WATKINS JOHN"; if(Panel7->Caption == "WATKINS JO") Panel7->Caption = "WATKINS JOH"; if(Panel7->Caption == "WATKINS J") Panel7->Caption = "WATKINS JO"; if(Panel7->Caption == "WATKINS") Panel7->Caption = "WATKINS J"; if(Panel7->Caption == "WATKIN") Panel7->Caption = "WATKINS"; if(Panel7->Caption == "WATKI") Panel7->Caption = "WATKIN"; if(Panel7->Caption == "WATK") Panel7->Caption = "WATKI"; if(Panel7->Caption == "WAT") Panel7->Caption = "WATK"; if(Panel7->Caption == "WA") Panel7->Caption = "WAT"; if(Panel7->Caption == "W") Panel7->Caption = "WA"; if(Panel7->Caption == "") Panel7->Caption = "W"; } //--------------------------------------------------------------------------- void TForm2::ReadData(void) { // read data ComPort->Timeouts->ReadInterval = 1; // read asynch data from communication port if(asynch==1) { StatusBar->Panels->Items[8]->Text = "Synchronizing... "; if(ComPort->InputCount() >= 10) // respect a minimum buffer { StatusBar->Panels->Items[8]->Text = ""; DataLength = 10; modulocheck = ComPort->InputCount() % DataLength; if(modulocheck!=0) ComPort->ClearInput(); byte_received01 = 0; byte_received02 = 0; byte_received03 = 0; byte_received04 = 0; byte_received05 = 0; byte_received06 = 0; byte_received07 = 0; byte_received08 = 0; byte_received09 = 0; byte_received10 = 0; byte_received01 = byte01; byte_received02 = byte02; byte_received03 = byte03; byte_received04 = byte04; byte_received05 = byte05; byte_received06 = byte06; byte_received07 = byte07; byte_received08 = byte08; byte_received09 = byte09; byte_received10 = byte10; byte01 = ComPort->ReadChar(); byte02 = ComPort->ReadChar(); byte03 = ComPort->ReadChar(); byte04 = ComPort->ReadChar(); byte05 = ComPort->ReadChar(); byte06 = ComPort->ReadChar(); byte07 = ComPort->ReadChar(); byte08 = ComPort->ReadChar(); byte09 = ComPort->ReadChar(); byte10 = ComPort->ReadChar(); // transfer data into reveived data bytes to control contence // NO CONVERSION IS NEEDED because of ASYNC-ASYNC AddReadBytes(DataLength); } } // read synch data from communication port if(asynch==0) { if(read_request == true) { ComPort->WriteChar(synch_byte_send03); // send 8 bytes of sync data ComPort->WriteChar(synch_byte_send04); ComPort->WriteChar(synch_byte_send05); ComPort->WriteChar(synch_byte_send06); ComPort->WriteChar(synch_byte_send07); ComPort->WriteChar(synch_byte_send08); ComPort->WriteChar(synch_byte_send09); ComPort->WriteChar(synch_byte_send10); ComPort->WriteChar(monitor); // send control byte for AVR read_request = false; } StatusBar->Panels->Items[8]->Text = "Synchronizing... "; byte01 = 0; // byte 0 not used byte02 = 0; // byte 0 not used DataLength = 8; modulocheck = ComPort->InputCount() % 8; if(modulocheck!=0) ComPort->ClearInput(); if(ComPort->InputCount() >= 8) // respect a minimum buffer { StatusBar->Panels->Items[8]->Text = ""; byte_received01 = 0; byte_received02 = 0; byte_received03 = 0; byte_received04 = 0; byte_received05 = 0; byte_received06 = 0; byte_received07 = 0; byte_received08 = 0; byte_received09 = 0; byte_received10 = 0; byte03 = ComPort->ReadChar(); // read 8 databytes byte04 = ComPort->ReadChar(); byte05 = ComPort->ReadChar(); byte06 = ComPort->ReadChar(); byte07 = ComPort->ReadChar(); byte08 = ComPort->ReadChar(); byte09 = ComPort->ReadChar(); byte10 = ComPort->ReadChar(); synch_byte_received01 = byte01; // used for bit display when in sync mode synch_byte_received02 = byte02; synch_byte_received03 = byte03; synch_byte_received04 = byte04; synch_byte_received05 = byte05; synch_byte_received06 = byte06; synch_byte_received07 = byte07; synch_byte_received08 = byte08; synch_byte_received09 = byte09; synch_byte_received10 = byte10; AddReadBytes(DataLength); // convert received sync data into async data... ConvertSyncAsync(); } } } //--------------------------------------------------------------------------- void TForm2::WriteData(void) { bool datachange = false; if(asynch==1) // async mode { datachange = false; if(copybyte_send01 != byte_send01) datachange = true; if(copybyte_send02 != byte_send02) datachange = true; if(copybyte_send03 != byte_send03) datachange = true; if(copybyte_send04 != byte_send04) datachange = true; if(copybyte_send05 != byte_send05) datachange = true; if(copybyte_send06 != byte_send06) datachange = true; if(copybyte_send07 != byte_send07) datachange = true; if(copybyte_send08 != byte_send08) datachange = true; if(copybyte_send09 != byte_send09) datachange = true; if(copybyte_send10 != byte_send10) datachange = true; if(overlay_trigger==true) // if(datachange==true || overlay_trigger==true) { ComPort->SetDTR(); ComPort->WriteChar(byte_send01); // send 10 bytes of async data ComPort->WriteChar(byte_send02); ComPort->WriteChar(byte_send03); ComPort->WriteChar(byte_send04); ComPort->WriteChar(byte_send05); ComPort->WriteChar(byte_send06); ComPort->WriteChar(byte_send07); ComPort->WriteChar(byte_send08); ComPort->WriteChar(byte_send09); ComPort->WriteChar(byte_send10); ComPort->WaitForWriteCompletion(); // ComPort->ClearDTR(); copybyte_send01 = byte_send01; copybyte_send02 = byte_send02; copybyte_send03 = byte_send03; copybyte_send04 = byte_send04; copybyte_send05 = byte_send05; copybyte_send06 = byte_send06; copybyte_send07 = byte_send07; copybyte_send08 = byte_send08; copybyte_send09 = byte_send09; copybyte_send10 = byte_send10; } } if(asynch==0) // send sync data { datachange = false; if(copybyte_send03 != synch_byte_send03) datachange = true; if(copybyte_send04 != synch_byte_send04) datachange = true; if(copybyte_send05 != synch_byte_send05) datachange = true; if(copybyte_send06 != synch_byte_send06) datachange = true; if(copybyte_send07 != synch_byte_send07) datachange = true; if(copybyte_send08 != synch_byte_send08) datachange = true; if(copybyte_send09 != synch_byte_send09) datachange = true; if(copybyte_send10 != synch_byte_send10) datachange = true; if(overlay_trigger==true) // if(datachange==true || overlay_trigger==true) { ComPort->SetDTR(); ComPort->WriteChar(synch_byte_send03); // send 8 bytes of sync data ComPort->WriteChar(synch_byte_send04); ComPort->WriteChar(synch_byte_send05); ComPort->WriteChar(synch_byte_send06); ComPort->WriteChar(synch_byte_send07); ComPort->WriteChar(synch_byte_send08); ComPort->WriteChar(synch_byte_send09); ComPort->WriteChar(synch_byte_send10); ComPort->WriteChar(command); // send control byte for AVR ComPort->WaitForWriteCompletion(); // ComPort->ClearDTR(); copybyte_send03 = synch_byte_send03; copybyte_send04 = synch_byte_send04; copybyte_send05 = synch_byte_send05; copybyte_send06 = synch_byte_send06; copybyte_send07 = synch_byte_send07; copybyte_send08 = synch_byte_send08; copybyte_send09 = synch_byte_send09; copybyte_send10 = synch_byte_send10; } } } //--------------------------------------------------------------------------- void __fastcall TForm2::Button3Click(TObject *Sender) { LockUp = false; LockDwn = false; Label74->Caption = ""; UpTuning(); TotalSendFreq(); Label17->Caption = IntToStr(totalfreq_write); OutOfRangeCheck(); MaskEdit2->Text = Label17->Caption; } //--------------------------------------------------------------------------- void __fastcall TForm2::Button4Click(TObject *Sender) { LockUp = false; LockDwn = false; Label74->Caption = ""; DownTuning(); TotalSendFreq(); Label17->Caption = IntToStr(totalfreq_write); OutOfRangeCheck(); MaskEdit2->Text = Label17->Caption; } //--------------------------------------------------------------------------- void __fastcall TForm2::Button5Click(TObject *Sender) { LockUp = false; LockDwn = false; Label74->Caption = ""; send_tunedfreq10Hz = 0; send_tunedfreq100Hz = 0; send_tunedfreq1kHz = 0; send_tunedfreq10kHz = 0; send_tunedfreq100kHz = 5; send_tunedfreq1MHz = 0; send_tunedfreq10MHz = 0; TotalSendFreq(); Label17->Caption = IntToStr(totalfreq_write); OutOfRangeCheck(); MaskEdit2->Text = Label17->Caption; } //--------------------------------------------------------------------------- void __fastcall TForm2::Button6Click(TObject *Sender) { LockUp = false; LockDwn = false; Label74->Caption = ""; send_tunedfreq10Hz = 0; send_tunedfreq100Hz = 0; send_tunedfreq1kHz = 0; send_tunedfreq10kHz = 0; send_tunedfreq100kHz = 0; send_tunedfreq1MHz = 1; send_tunedfreq10MHz = 0; TotalSendFreq(); Label17->Caption = IntToStr(totalfreq_write); OutOfRangeCheck(); MaskEdit2->Text = Label17->Caption; } //--------------------------------------------------------------------------- void __fastcall TForm2::Button7Click(TObject *Sender) { LockUp = false; LockDwn = false; Label74->Caption = ""; send_tunedfreq10Hz = 0; send_tunedfreq100Hz = 0; send_tunedfreq1kHz = 0; send_tunedfreq10kHz = 0; send_tunedfreq100kHz = 0; send_tunedfreq1MHz = 0; send_tunedfreq10MHz = 1; TotalSendFreq(); Label17->Caption = IntToStr(totalfreq_write); OutOfRangeCheck(); MaskEdit2->Text = Label17->Caption; } //--------------------------------------------------------------------------- void __fastcall TForm2::CheckBox2Click(TObject *Sender) { if(CheckBox2->Checked==false) { ComPort->Active = false; act=false; SetModemStatus(); ComboBoxDeviceName->Enabled = !ComPort->Active; ComboBoxBaudRate->Enabled = !ComPort->Active; ComboBoxDataBits->Enabled = !ComPort->Active; ComboBoxStopBits->Enabled = !ComPort->Active; ComboBoxParity->Enabled = !ComPort->Active; // Button2->Enabled = false; // Button8->Enabled = !ComPort->Active; // Button8->Caption = "OPEN COMMUNICATION"; } } //--------------------------------------------------------------------------- void __fastcall TForm2::Button9Click(TObject *Sender) { LockUp = false; LockDwn = false; Label74->Caption = ""; send_tunedfreq10Hz = 0; send_tunedfreq100Hz = 0; send_tunedfreq1kHz = 9; send_tunedfreq10kHz = 9; send_tunedfreq100kHz = 4; send_tunedfreq1MHz = 0; send_tunedfreq10MHz = 3; TotalSendFreq(); Label17->Caption = IntToStr(totalfreq_write); OutOfRangeCheck(); MaskEdit2->Text = Label17->Caption; } //--------------------------------------------------------------------------- void __fastcall TForm2::WJ88881Click(TObject *Sender) { Form3 = new TForm3(Application); Form3->ShowModal(); delete Form3; StatusBar->Panels->Items[8]->Text = "Info on WJ8888 displayed"; } //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- void __fastcall TForm2::DataWordDiagram1Click(TObject *Sender) { Form4= new TForm4(Application); Form4->ShowModal(); delete Form4; StatusBar->Panels->Items[8]->Text = "Async word diagram displayed"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Monitordata1Click(TObject *Sender) { Form5 = new TForm5(Application); Form5->ShowModal(); delete Form5; } //--------------------------------------------------------------------------- void __fastcall TForm2::RadioGroup3Click(TObject *Sender) { if(RadioGroup1->ItemIndex == 0) { if(RadioGroup3->ItemIndex == 0) Label48->Caption = "IF -.- KHZ"; if(RadioGroup3->ItemIndex == 1) Label48->Caption = "IF 0.5 KHZ"; if(RadioGroup3->ItemIndex == 2) Label48->Caption = "IF 2.0 KHZ"; if(RadioGroup3->ItemIndex == 3) Label48->Caption = "IF 4.0 KHZ"; if(RadioGroup3->ItemIndex == 4) Label48->Caption = "IF 6.0 KHZ"; if(RadioGroup3->ItemIndex == 5) Label48->Caption = "IF -.- KHZ"; } } //--------------------------------------------------------------------------- void __fastcall TForm2::RadioGroup4Click(TObject *Sender) { if(RadioGroup1->ItemIndex == 0) { if(RadioGroup4->ItemIndex == 0) Label49->Caption = "GAIN HOLD AGC"; if(RadioGroup4->ItemIndex == 1) Label49->Caption = "GAIN NOT USED"; if(RadioGroup4->ItemIndex == 2) Label49->Caption = "GAIN NORM AGC"; if(RadioGroup4->ItemIndex == 3) Label49->Caption = "GAIN MANUAL"; } } //--------------------------------------------------------------------------- void __fastcall TForm2::RadioGroup5Click(TObject *Sender) { if(RadioGroup1->ItemIndex == 0) { if(RadioGroup5->ItemIndex == 0) Label61->Caption = "AM"; if(RadioGroup5->ItemIndex == 1) Label61->Caption = "FM"; if(RadioGroup5->ItemIndex == 2) Label61->Caption = "BFO FIX"; if(RadioGroup5->ItemIndex == 3) Label61->Caption = "BFO VAR"; if(RadioGroup5->ItemIndex == 4) Label61->Caption = "ISB"; if(RadioGroup5->ItemIndex == 5) Label61->Caption = "LSB"; if(RadioGroup5->ItemIndex == 6) Label61->Caption = "USB"; if(RadioGroup5->ItemIndex == 7) Label61->Caption = "AM*NL"; } } //--------------------------------------------------------------------------- void __fastcall TForm2::ColorBox1Change(TObject *Sender) { Panel2->Color = ColorBox1->Selected; Panel3->Color = ColorBox1->Selected; } //--------------------------------------------------------------------------- void __fastcall TForm2::Button10Click(TObject *Sender) { send_signBFO = 1; Label16->Caption = "+10kHz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Button11Click(TObject *Sender) { send_signBFO = -1; Label16->Caption = "-10kHz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Button12Click(TObject *Sender) { TrackBar2->Position = 0; send_signBFO = 1; } //--------------------------------------------------------------------------- void __fastcall TForm2::N0Hz1Click(TObject *Sender) { TrackBar2->Position = 0; // position of trackbar MaskEdit1->Text = IntToStr(TrackBar2->Position * 10); StatusBar->Panels->Items[8]->Text = "BFO set to 0 Hz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N100Hz1Click(TObject *Sender) { TrackBar2->Position = 10; // position of trackbar MaskEdit1->Text = IntToStr(TrackBar2->Position * 10); StatusBar->Panels->Items[8]->Text = "BFO set to 100 Hz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N200Hz1Click(TObject *Sender) { TrackBar2->Position = 20; // position of trackbar MaskEdit1->Text = IntToStr(TrackBar2->Position * 10); StatusBar->Panels->Items[8]->Text = "BFO set to 200 Hz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N300Hz1Click(TObject *Sender) { TrackBar2->Position = 30; // position of trackbar MaskEdit1->Text = IntToStr(TrackBar2->Position * 10); StatusBar->Panels->Items[8]->Text = "BFO set to 300 Hz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N400Hz1Click(TObject *Sender) { TrackBar2->Position = 40; // position of trackbar MaskEdit1->Text = IntToStr(TrackBar2->Position * 10); StatusBar->Panels->Items[8]->Text = "BFO set to 400 Hz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N500Hz1Click(TObject *Sender) { TrackBar2->Position = 50; // position of trackbar MaskEdit1->Text = IntToStr(TrackBar2->Position * 10); StatusBar->Panels->Items[8]->Text = "BFO set to 500 Hz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N1000Hz1Click(TObject *Sender) { TrackBar2->Position = 100; // position of trackbar MaskEdit1->Text = IntToStr(TrackBar2->Position * 10); StatusBar->Panels->Items[8]->Text = "BFO set to 1000 Hz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N1100Hz1Click(TObject *Sender) { TrackBar2->Position = 200; // position of trackbar MaskEdit1->Text = IntToStr(TrackBar2->Position * 10); StatusBar->Panels->Items[8]->Text = "BFO set to 2000 Hz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N3000Hz1Click(TObject *Sender) { TrackBar2->Position = 400; // position of trackbar MaskEdit1->Text = IntToStr(TrackBar2->Position * 10); StatusBar->Panels->Items[8]->Text = "BFO set to 4000 Hz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N5000Hz2Click(TObject *Sender) { TrackBar2->Position = 500; // position of trackbar MaskEdit1->Text = IntToStr(TrackBar2->Position * 10); StatusBar->Panels->Items[8]->Text = "BFO set to 5000 Hz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N5000Hz1Click(TObject *Sender) { TrackBar2->Position = 600; // position of trackbar MaskEdit1->Text = IntToStr(TrackBar2->Position * 10); StatusBar->Panels->Items[8]->Text = "BFO set to 6000 Hz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N7000Hz2Click(TObject *Sender) { TrackBar2->Position = 700; // position of trackbar MaskEdit1->Text = IntToStr(TrackBar2->Position * 10); StatusBar->Panels->Items[8]->Text = "BFO set to 7000 Hz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N7000Hz1Click(TObject *Sender) { TrackBar2->Position = 800; // position of trackbar MaskEdit1->Text = IntToStr(TrackBar2->Position * 10); StatusBar->Panels->Items[8]->Text = "BFO set to 8000 Hz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N9000Hz2Click(TObject *Sender) { TrackBar2->Position = 900; // position of trackbar MaskEdit1->Text = IntToStr(TrackBar2->Position * 10); StatusBar->Panels->Items[8]->Text = "BFO set to 9000 Hz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N9000Hz1Click(TObject *Sender) { TrackBar2->Position = 10000; // position of trackbar MaskEdit1->Text = IntToStr(TrackBar2->Position * 10); StatusBar->Panels->Items[8]->Text = "BFO set to 10000 Hz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N3000Hz2Click(TObject *Sender) { TrackBar2->Position = 300; // position of trackbar MaskEdit1->Text = IntToStr(TrackBar2->Position * 10); StatusBar->Panels->Items[8]->Text = "BFO set to 3000 Hz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N600Hz1Click(TObject *Sender) { TrackBar2->Position = 60; // position of trackbar MaskEdit1->Text = IntToStr(TrackBar2->Position * 10); StatusBar->Panels->Items[8]->Text = "BFO set to 600 Hz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N700Hz1Click(TObject *Sender) { TrackBar2->Position = 70; // position of trackbar MaskEdit1->Text = IntToStr(TrackBar2->Position * 10); StatusBar->Panels->Items[8]->Text = "BFO set to 700 Hz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N800Hz1Click(TObject *Sender) { TrackBar2->Position = 80; // position of trackbar MaskEdit1->Text = IntToStr(TrackBar2->Position * 10); StatusBar->Panels->Items[8]->Text = "BFO set to 800 Hz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N900Hz1Click(TObject *Sender) { TrackBar2->Position = 90; // position of trackbar MaskEdit1->Text = IntToStr(TrackBar2->Position * 10); StatusBar->Panels->Items[8]->Text = "BFO set to 900 Hz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N500kHz1Click(TObject *Sender) { LockStop(); send_tunedfreq10Hz = 0; send_tunedfreq100Hz = 0; send_tunedfreq1kHz = 0; send_tunedfreq10kHz = 0; send_tunedfreq100kHz = 5; send_tunedfreq1MHz = 0; send_tunedfreq10MHz = 0; TotalSendFreq(); Label17->Caption = IntToStr(totalfreq_write); OutOfRangeCheck(); MaskEdit2->Text = Label17->Caption; StatusBar->Panels->Items[8]->Text = "Set to 500kHz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N1MHz1Click(TObject *Sender) { LockStop(); send_tunedfreq10Hz = 0; send_tunedfreq100Hz = 0; send_tunedfreq1kHz = 0; send_tunedfreq10kHz = 0; send_tunedfreq100kHz = 0; send_tunedfreq1MHz = 1; send_tunedfreq10MHz = 0; TotalSendFreq(); Label17->Caption = IntToStr(totalfreq_write); OutOfRangeCheck(); MaskEdit2->Text = Label17->Caption; StatusBar->Panels->Items[8]->Text = "Set to 1 MHz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N10MHz1Click(TObject *Sender) { LockStop(); send_tunedfreq10Hz = 0; send_tunedfreq100Hz = 0; send_tunedfreq1kHz = 0; send_tunedfreq10kHz = 0; send_tunedfreq100kHz = 0; send_tunedfreq1MHz = 0; send_tunedfreq10MHz = 1; TotalSendFreq(); Label17->Caption = IntToStr(totalfreq_write); OutOfRangeCheck(); MaskEdit2->Text = Label17->Caption; StatusBar->Panels->Items[8]->Text = "Set to 10 MHz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N30499MHz1Click(TObject *Sender) { LockStop(); send_tunedfreq10Hz = 0; send_tunedfreq100Hz = 0; send_tunedfreq1kHz = 9; send_tunedfreq10kHz = 9; send_tunedfreq100kHz = 4; send_tunedfreq1MHz = 0; send_tunedfreq10MHz = 3; TotalSendFreq(); Label17->Caption = IntToStr(totalfreq_write); OutOfRangeCheck(); MaskEdit2->Text = Label17->Caption; StatusBar->Panels->Items[8]->Text = "Set to 30.499 MHz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::MaskEdit1Enter(TObject *Sender) { float value; value = TrackBar2->Position * 10; MaskEdit1->Text = FloatToStr(value); } //--------------------------------------------------------------------------- void __fastcall TForm2::MaskEdit2Enter(TObject *Sender) { LockUp = false; LockDwn = false; Label74->Caption = ""; MaskEdit2->Text = Label17->Caption; } //--------------------------------------------------------------------------- void __fastcall TForm2::MaskEdit2Change(TObject *Sender) { float value; float valcalc; send_tunedfreq10Hz = 0; send_tunedfreq100Hz = 0; send_tunedfreq1kHz = 0; send_tunedfreq10kHz = 0; send_tunedfreq100kHz = 0; send_tunedfreq1MHz = 0; send_tunedfreq10MHz = 0; send_frequency10Hz = 0; send_frequency100Hz = 0; send_frequency1kHz = 0; send_frequency10kHz = 0; send_frequency100kHz = 0; send_frequency1MHz = 0; send_frequency10MHz = 0; // masked frequency input value = StrToFloatDef(MaskEdit2->Text,0); // 10 MHz decimal value send_tunedfreq10MHz = value / 10000000; // 1 MHz decimal value valcalc = value - (send_tunedfreq10MHz*10000000); send_tunedfreq1MHz = valcalc / 1000000; // 100 kHz decimal value valcalc = value - (send_tunedfreq10MHz*10000000) - (send_tunedfreq1MHz*1000000); send_tunedfreq100kHz = valcalc / 100000; // 10 kHz decimal value valcalc = value - (send_tunedfreq10MHz*10000000) - (send_tunedfreq1MHz*1000000) - (send_tunedfreq100kHz*100000); send_tunedfreq10kHz = valcalc / 10000; // 1 kHz decimal value valcalc = value - (send_tunedfreq10MHz*10000000) - (send_tunedfreq1MHz*1000000) - (send_tunedfreq100kHz*100000) - (send_tunedfreq10kHz*10000); send_tunedfreq1kHz = valcalc / 1000; // 100 Hz decimal value valcalc = value - (send_tunedfreq10MHz*10000000) - (send_tunedfreq1MHz*1000000) - (send_tunedfreq100kHz*100000) - (send_tunedfreq10kHz*10000) - (send_tunedfreq1kHz*1000); send_tunedfreq100Hz = valcalc / 100; // 10 Hz decimal value valcalc = value - (send_tunedfreq10MHz*10000000) - (send_tunedfreq1MHz*1000000) - (send_tunedfreq100kHz*100000) - (send_tunedfreq10kHz*10000) - (send_tunedfreq1kHz*1000) - (send_tunedfreq100Hz*100); send_tunedfreq10Hz = valcalc / 10; // calculate the frequency's TotalSendFreq(); Label17->Caption = FloatToStr(totalfreq_write); OutOfRangeCheck(); } //--------------------------------------------------------------------------- void __fastcall TForm2::Bitdisplayonoff1Click(TObject *Sender) { Bitdisplayonoff1->Checked = !Bitdisplayonoff1->Checked; Label31->Enabled = Bitdisplayonoff1->Checked; Label32->Enabled = Bitdisplayonoff1->Checked; Label33->Enabled = Bitdisplayonoff1->Checked; Label34->Enabled = Bitdisplayonoff1->Checked; Label35->Enabled = Bitdisplayonoff1->Checked; Label36->Enabled = Bitdisplayonoff1->Checked; Label37->Enabled = Bitdisplayonoff1->Checked; Label38->Enabled = Bitdisplayonoff1->Checked; Label39->Enabled = Bitdisplayonoff1->Checked; Label40->Enabled = Bitdisplayonoff1->Checked; Label51->Enabled = Bitdisplayonoff1->Checked; Label52->Enabled = Bitdisplayonoff1->Checked; Label53->Enabled = Bitdisplayonoff1->Checked; Label54->Enabled = Bitdisplayonoff1->Checked; Label55->Enabled = Bitdisplayonoff1->Checked; Label56->Enabled = Bitdisplayonoff1->Checked; Label57->Enabled = Bitdisplayonoff1->Checked; Label58->Enabled = Bitdisplayonoff1->Checked; Label59->Enabled = Bitdisplayonoff1->Checked; Label60->Enabled = Bitdisplayonoff1->Checked; StatusBar->Panels->Items[8]->Text = "Bit display ON/OFF"; } //--------------------------------------------------------------------------- void __fastcall TForm2::AsynchronousSynchronousIO1Click(TObject *Sender) { int set = false; if(asynch==1 && set == false) { asynch = 0; set = true; } if(asynch==0 && set == false) { asynch = 1; set = true; } ComPort->ClearInput(); ComPort->ClearOutput(); StatusBar->Panels->Items[8]->Text = "IO Interface selected"; } //--------------------------------------------------------------------------- void __fastcall TForm2::SynchronousDataWordDiagram1Click(TObject *Sender) { Form6= new TForm6(Application); Form6->ShowModal(); delete Form6; StatusBar->Panels->Items[8]->Text = "Sync word diagram displayed"; } //--------------------------------------------------------------------------- void __fastcall TForm2::TrackBar2Change(TObject *Sender) { MaskEdit1->Text = TrackBar2->Position * 10; } //--------------------------------------------------------------------------- void __fastcall TForm2::MaskEdit1Exit(TObject *Sender) { float value; value = StrToFloatDef(MaskEdit1->Text,TrackBar2->Position*10); value = value / 10; TrackBar2->Position = value; } //--------------------------------------------------------------------------- void __fastcall TForm2::Button13Click(TObject *Sender) { LockUp = true; LockDwn = false; Label74->Caption = "LCKUP"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Button14Click(TObject *Sender) { LockUp = false; LockDwn = true; Label74->Caption = "LCKDWN"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Button15Click(TObject *Sender) { LockStop(); } //--------------------------------------------------------------------------- void __fastcall TForm2::Image1Click(TObject *Sender) { Form3 = new TForm3(Application); Form3->ShowModal(); delete Form3; } //--------------------------------------------------------------------------- void __fastcall TForm2::Button16Click(TObject *Sender) { MaskEdit3->Text = MaskEdit3->Text + "1"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Button17Click(TObject *Sender) { MaskEdit3->Text = MaskEdit3->Text + "2"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Button18Click(TObject *Sender) { MaskEdit3->Text = MaskEdit3->Text + "3"; } //------------------------------ --------------------------------------------- void __fastcall TForm2::Button19Click(TObject *Sender) { MaskEdit3->Text = MaskEdit3->Text + "4"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Button20Click(TObject *Sender) { MaskEdit3->Text = MaskEdit3->Text + "5"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Button21Click(TObject *Sender) { MaskEdit3->Text = MaskEdit3->Text + "6"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Button22Click(TObject *Sender) { MaskEdit3->Text = MaskEdit3->Text + "7"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Button23Click(TObject *Sender) { MaskEdit3->Text = MaskEdit3->Text + "8"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Button24Click(TObject *Sender) { MaskEdit3->Text = MaskEdit3->Text + "9"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Button26Click(TObject *Sender) { MaskEdit3->Text = MaskEdit3->Text + "0"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Button25Click(TObject *Sender) { // clear data when input is fault MaskEdit3->Text = ""; } //--------------------------------------------------------------------------- void __fastcall TForm2::Button27Click(TObject *Sender) { // enters keypad value to send frequency float value; float valcalc; send_tunedfreq10Hz = 0; send_tunedfreq100Hz = 0; send_tunedfreq1kHz = 0; send_tunedfreq10kHz = 0; send_tunedfreq100kHz = 0; send_tunedfreq1MHz = 0; send_tunedfreq10MHz = 0; send_frequency10Hz = 0; send_frequency100Hz = 0; send_frequency1kHz = 0; send_frequency10kHz = 0; send_frequency100kHz = 0; send_frequency1MHz = 0; send_frequency10MHz = 0; LockUp = false; LockDwn = false; Label74->Caption = ""; // masked frequency input value = StrToFloatDef(MaskEdit3->Text,0); // 10 MHz decimal value send_tunedfreq10MHz = value / 10000000; // 1 MHz decimal value valcalc = value - (send_tunedfreq10MHz*10000000); send_tunedfreq1MHz = valcalc / 1000000; // 100 kHz decimal value valcalc = value - (send_tunedfreq10MHz*10000000) - (send_tunedfreq1MHz*1000000); send_tunedfreq100kHz = valcalc / 100000; // 10 kHz decimal value valcalc = value - (send_tunedfreq10MHz*10000000) - (send_tunedfreq1MHz*1000000) - (send_tunedfreq100kHz*100000); send_tunedfreq10kHz = valcalc / 10000; // 1 kHz decimal value valcalc = value - (send_tunedfreq10MHz*10000000) - (send_tunedfreq1MHz*1000000) - (send_tunedfreq100kHz*100000) - (send_tunedfreq10kHz*10000); send_tunedfreq1kHz = valcalc / 1000; // 100 Hz decimal value valcalc = value - (send_tunedfreq10MHz*10000000) - (send_tunedfreq1MHz*1000000) - (send_tunedfreq100kHz*100000) - (send_tunedfreq10kHz*10000) - (send_tunedfreq1kHz*1000); send_tunedfreq100Hz = valcalc / 100; // 10 Hz decimal value valcalc = value - (send_tunedfreq10MHz*10000000) - (send_tunedfreq1MHz*1000000) - (send_tunedfreq100kHz*100000) - (send_tunedfreq10kHz*10000) - (send_tunedfreq1kHz*1000) - (send_tunedfreq100Hz*100); send_tunedfreq10Hz = valcalc / 10; TotalSendFreq(); Label17->Caption = FloatToStr(totalfreq_write); OutOfRangeCheck(); } //--------------------------------------------------------------------------- void __fastcall TForm2::Disclaimer1Click(TObject *Sender) { ShowMessage("\t\t\t DISCLAIMER\n WJ-8888 IS SUPPLIED -AS IS- WITHOUT WARRANTY\n OF ANY KIND. WE DISCLAIMS ALL WARRANTIES, EXPRESSED\n OR IMPLIED, INCLUDING, WITHOUT LIMITATION,\n THE WARRANTIES FOR ANY PURPOSE.\n WE ASSUMES NO LIABILITY FOR DAMAGES, DIRECT\nOR CONSEQUENTIAL, WHICH MAY RESULT FROM THE USE OF WJ-8888."); StatusBar->Panels->Items[8]->Text = "Disclaimer displayed"; } //--------------------------------------------------------------------------- void __fastcall TForm2::AbortTXBuffer1Click(TObject *Sender) { if(act == true) { ComPort->AbortOutput(); StatusBar->Panels->Items[8]->Text = "TX Buffer Aborted"; } if(act == false) { StatusBar->Panels->Items[8]->Text = "COM: Device Not Open!"; ShowMessage("COM: Device Not Open!"); } } //--------------------------------------------------------------------------- void __fastcall TForm2::AbortRXBuffer1Click(TObject *Sender) { if(act == true) { ComPort->AbortInput(); StatusBar->Panels->Items[8]->Text = "RX Buffer Aborted"; } if(act == false) { StatusBar->Panels->Items[8]->Text = "COM: Device Not Open!"; ShowMessage("COM: Device Not Open!"); } } //--------------------------------------------------------------------------- void __fastcall TForm2::ClearTXBuffer1Click(TObject *Sender) { if(act == true) { ComPort->ClearOutput(); StatusBar->Panels->Items[8]->Text = "TX Buffer Cleared"; } if(act == false) { StatusBar->Panels->Items[8]->Text = "COM: Device Not Open!"; ShowMessage("COM: Device Not Open!"); } } //--------------------------------------------------------------------------- void __fastcall TForm2::ClearTXBuffer2Click(TObject *Sender) { if(act == true) { ComPort->ClearInput(); StatusBar->Panels->Items[8]->Text = "RX Buffer Cleared"; } if(act == false) { StatusBar->Panels->Items[8]->Text = "COM: Device Not Open!"; ShowMessage("COM: Device Not Open!"); } } //--------------------------------------------------------------------------- void __fastcall TForm2::PurgeTXBuffer1Click(TObject *Sender) { if(act == true) { ComPort->PurgeOutput(); StatusBar->Panels->Items[8]->Text = "TX Buffer Purged"; } if(act == false) { StatusBar->Panels->Items[8]->Text = "COM: Device Not Open!"; ShowMessage("COM: Device Not Open!"); } } //--------------------------------------------------------------------------- void __fastcall TForm2::PurgeRXBuffer1Click(TObject *Sender) { if(act == true) { ComPort->PurgeInput(); StatusBar->Panels->Items[8]->Text = "RX Buffer Purged"; } if(act == false) { StatusBar->Panels->Items[8]->Text = "COM: Device Not Open!"; ShowMessage("COM: Device Not Open!"); } } //--------------------------------------------------------------------------- void __fastcall TForm2::FlushTXBuffer1Click(TObject *Sender) { if(act == true) { ComPort->Flush(); StatusBar->Panels->Items[8]->Text = "TX Buffer Flushed"; } if(act == false) { StatusBar->Panels->Items[8]->Text = "COM: Device Not Open!"; ShowMessage("COM: Device Not Open!"); } } //--------------------------------------------------------------------------- void __fastcall TForm2::ResetCommunicationDriver1Click(TObject *Sender) { if(act==true) { ComPort->ResetDevice(); StatusBar->Panels->Items[8]->Text = "COM: Device Resetted"; } if(act==false) { StatusBar->Panels->Items[8]->Text = "COM: Device Not Open!"; ShowMessage("COM: Device Not Open!"); } } //--------------------------------------------------------------------------- void __fastcall TForm2::ForceDTRON1Click(TObject *Sender) { if(ComPort->Active == true || (act==true && ForceDTRON1->Checked == true)) { ComPort->SetDTR(); DTR = true; ForceDTRON1->Checked = true; ForceDTROFF1->Checked = false; SetModemStatus(); StatusBar->Panels->Items[8]->Text = "DTR Forced ON"; } if(act == false) { StatusBar->Panels->Items[8]->Text = "COM: Device Not Open!"; ShowMessage("COM: Device Not Open!"); } } //--------------------------------------------------------------------------- void __fastcall TForm2::ForceRTSON1Click(TObject *Sender) { if(ComPort->Active == true || (act==true && ForceRTSON1->Checked == true)) { ComPort->SetRTS(); RTS = true; ForceRTSON1->Checked = true; ForceRTSOFF1->Checked = false; SetModemStatus(); StatusBar->Panels->Items[8]->Text = "RTS Forced ON"; } if(act == false) { StatusBar->Panels->Items[8]->Text = "COM: Device Not Open!"; ShowMessage("COM: Device Not Open!"); } } //--------------------------------------------------------------------------- void __fastcall TForm2::ForceDTROFF1Click(TObject *Sender) { if(ComPort->Active == true || (act==true && ForceDTROFF1->Checked == true)) { ComPort->ClearDTR(); DTR = false; ForceDTRON1->Checked = false; ForceDTROFF1->Checked = true; SetModemStatus(); StatusBar->Panels->Items[8]->Text = "DTR Forced OFF"; } if(act == false) { StatusBar->Panels->Items[8]->Text = "COM: Device Not Open!"; ShowMessage("COM: Device Not Open!"); } } //--------------------------------------------------------------------------- void __fastcall TForm2::ReleaseForcedSignals1Click(TObject *Sender) { ForceDTRON1->Checked = false; ForceDTROFF1->Checked = false; ForceRTSON1->Checked = false; ForceRTSOFF1->Checked = false; StatusBar->Panels->Items[8]->Text = "Forced Signals Released"; } //--------------------------------------------------------------------------- void __fastcall TForm2::ForceRTSOFF1Click(TObject *Sender) { if(ComPort->Active == true || (act==true && ForceRTSON1->Checked == true)) { if(RTS == true) { ComPort->ClearRTS(); RTS = false; ForceRTSON1->Checked = false; ForceRTSOFF1->Checked = true; SetModemStatus(); StatusBar->Panels->Items[8]->Text = "RTS Forced OFF"; } } if(act == false) { StatusBar->Panels->Items[8]->Text = "COM: Device Not Open!"; ShowMessage("COM: Device Not Open!"); } } //--------------------------------------------------------------------------- void TForm2::ConvertSyncAsync(void) { // conversion from received sync to received async data... byte_received01 = 0; // not used // byte 02 byte_received02 = synch_byte_received03; // byte 02 no conversion needed // byte 03 mask = synch_byte_received04 & 0x0E; binair = mask >> 1; byte_received03 = binair; // byte 03 10^4 mask = synch_byte_received04 & 0xF0; binair = mask >> 1; byte_received03 = byte_received03 + binair; // byte 03 10^5 // byte 04 mask = synch_byte_received05 & 0x0C; binair = mask >> 2; byte_received04 = binair; // byte 04 10^2 mask = synch_byte_received05 & 0xF0; binair = mask >> 2; byte_received04 = byte_received04 + binair; // byte 04 10^3 mask = synch_byte_received04 & 0x01; binair = mask << 6; byte_received04 = byte_received04 + binair; // byte 04 bit 7 10^4 // byte 05 mask = synch_byte_received06 & 0x08; binair = mask >> 3; byte_received05 = binair; // byte 05 gain mode bit 1 mask = synch_byte_received06 & 0xF0; binair = mask >> 3; byte_received05 = byte_received05 + binair; // byte 05 10^1 mask = synch_byte_received05 & 0x03; binair = mask << 5; byte_received05 = byte_received05 + binair; // byte 05 10^2 // byte 06 mask = synch_byte_received07 & 0x70; binair = mask >> 4; byte_received06 = binair; // byte 06 det mode mask = synch_byte_received07 & 0x80; binair = mask >> 7; binair = binair << 3; byte_received06 = byte_received06 + binair; // byte 06 if bw mask = synch_byte_received06 & 0x03; binair = mask << 4; byte_received06 = byte_received06 + binair; // byte 06 if bw mask = synch_byte_received06 & 0x04; binair = mask << 4; byte_received06 = byte_received06 + binair; // byte 06 gain mode bit 7 // byte 07 byte_received07 = byte08 >> 5; mask = byte07 & 0x07; binair = mask << 3; byte_received07 = byte_received07 + binair; // byte 07 BFO freq // byte 08 mask = byte09 & 0x40; binair = mask >> 6; byte_received08 = binair; // byte 08 rf gain binair = byte08 << 2; mask = binair & 0x7C; byte_received08 = byte_received08 + mask; // byte 08 bfo freq // byte 09 binair = byte09 << 1; mask = binair & 0x7E; byte_received09 = mask; // byte 09 rf gain // byte 10 byte_received10 = byte10 & 0x7F; // byte 10 received } //--------------------------------------------------------------------------- void TForm2::AsyncSendTable(void) { // byte_send 01 // RECEIVER ID xxxx0000 if (RadioGroup2->ItemIndex == 0) { byte_send01=byte_send01 + byte_mask01_ID00; } if (RadioGroup2->ItemIndex == 1) { byte_send01=byte_send01 + byte_mask01_ID01; } if (RadioGroup2->ItemIndex == 2) { byte_send01=byte_send01 + byte_mask01_ID02; } if (RadioGroup2->ItemIndex == 3) { byte_send01=byte_send01 + byte_mask01_ID03; } if (RadioGroup2->ItemIndex == 4) { byte_send01=byte_send01 + byte_mask01_ID04; } if (RadioGroup2->ItemIndex == 5) { byte_send01=byte_send01 + byte_mask01_ID05; } if (RadioGroup2->ItemIndex == 6) { byte_send01=byte_send01 + byte_mask01_ID06; } if (RadioGroup2->ItemIndex == 7) { byte_send01=byte_send01 + byte_mask01_ID07; } if (RadioGroup2->ItemIndex == 8) { byte_send01=byte_send01 + byte_mask01_ID08; } if (RadioGroup2->ItemIndex == 9) { byte_send01=byte_send01 + byte_mask01_ID09; } if (RadioGroup2->ItemIndex == 10) { byte_send01=byte_send01 + byte_mask01_ID10; } if (RadioGroup2->ItemIndex == 11) { byte_send01=byte_send01 + byte_mask01_ID11; } if (RadioGroup2->ItemIndex == 12) { byte_send01=byte_send01 + byte_mask01_ID12; } if (RadioGroup2->ItemIndex == 13) { byte_send01=byte_send01 + byte_mask01_ID13; } if (RadioGroup2->ItemIndex == 14) { byte_send01=byte_send01 + byte_mask01_ID14; } if (RadioGroup2->ItemIndex == 15) { byte_send01=byte_send01 + byte_mask01_ID15; } // MODE x0xxxxxx if (RadioGroup1->ItemIndex == 0) { byte_send01=byte_send01 + byte_mask01_MODE; } // byte_send 02 // AGC DUMP x0xxxxxx if (CheckBox1->Checked == true) { byte_send02=byte_send02 + byte_mask02_AGCDUMP; } // TUNED FREQUENCY 10^6 xxxx0000 shifting = send_tunedfreq1MHz; shifting = shifting & 0x0F; byte_send02=byte_send02 + shifting; // TUNED FREQUENCY 10^7 xx00xxxx shifting = send_tunedfreq10MHz << 4; shifting = shifting & 0x30; byte_send02=byte_send02 + shifting; // byte_send 03 // TUNED FREQUENCY 10^4 xxxxx000 shifting = send_tunedfreq10kHz >> 1 ; shifting = shifting & 0x07; byte_send03=byte_send03 + shifting; // TUNED FREQUENCY 10^5 x0000xxx shifting = send_tunedfreq100kHz << 3 ; shifting = shifting & 0x78; byte_send03=byte_send03 + shifting; // byte_send 04 // TUNED FREQUENCY 10^2 xxxxxx00 shifting = send_tunedfreq100Hz >> 2; mask = shifting & 0x03; shifting = mask; byte_send04=byte_send04 + shifting; // TUNED FREQUENCY 10^3 xx0000xx shifting = send_tunedfreq1kHz; mask = shifting & 0x0F; shifting = mask << 2; byte_send04=byte_send04+shifting; // TUNED FREQUENCY 10^4 x0xxxxxx shifting = send_tunedfreq10kHz << 6; shifting = shifting & 0x40; byte_send04=byte_send04 + shifting; // byte_send 05 // GAIN MODE xxxxxxx0 if (RadioGroup4->ItemIndex == 2) { byte_send05=byte_send05 + byte_mask05_GAINMODE; } if (RadioGroup4->ItemIndex == 3) { byte_send05=byte_send05 + byte_mask05_GAINMODE; } // TUNED FREQUENCY 10^1 xxx0000x shifting = send_tunedfreq10Hz << 1; shifting = shifting & 0x1E; byte_send05=byte_send05 + shifting; // TUNED FREQUENCY 10^2 x00xxxxx shifting = send_tunedfreq100Hz << 5; shifting = shifting & 0x60; byte_send05=byte_send05 + shifting; // byte_send 06 // DETECTION MODE xxxxx000 if (RadioGroup5->ItemIndex == 0) { byte_send06=byte_send06 + byte_mask06_AM; } if (RadioGroup5->ItemIndex == 1) { byte_send06=byte_send06 + byte_mask06_FM; } if (RadioGroup5->ItemIndex == 2) { byte_send06=byte_send06 + byte_mask06_BFOFIXED; } if (RadioGroup5->ItemIndex == 3) { byte_send06=byte_send06 + byte_mask06_BFOVAR; } if (RadioGroup5->ItemIndex == 4) { byte_send06=byte_send06 + byte_mask06_ISB; } if (RadioGroup5->ItemIndex == 5) { byte_send06=byte_send06 + byte_mask06_LSB; } if (RadioGroup5->ItemIndex == 6) { byte_send06=byte_send06 + byte_mask06_USB; } if (RadioGroup5->ItemIndex == 7) { byte_send06=byte_send06 + byte_mask06_AMNL; } // IF BANDWIDTH xx000xxx if (RadioGroup3->ItemIndex == 0) { byte_send06=byte_send06 + byte_mask06_FREQXXX01; } if (RadioGroup3->ItemIndex == 1) { byte_send06=byte_send06 + byte_mask06_FREQ500; } if (RadioGroup3->ItemIndex == 2) { byte_send06=byte_send06 + byte_mask06_FREQ2000; } if (RadioGroup3->ItemIndex == 3) { byte_send06=byte_send06 + byte_mask06_FREQ4000; } if (RadioGroup3->ItemIndex == 4) { byte_send06=byte_send06 + byte_mask06_FREQ6000; } if (RadioGroup3->ItemIndex == 5) { byte_send06=byte_send06 + byte_mask06_FREQXXX02; } // GAIN MODE x0xxxxxx if (RadioGroup4->ItemIndex == 1) { byte_send06=byte_send06 + byte_mask06_GAINMODE; } if (RadioGroup4->ItemIndex == 3) { byte_send06=byte_send06 + byte_mask06_GAINMODE; } // byte_send 07 // BFO xxx00000 send_bfo_frequency = TrackBar2->Position; shifting = send_bfo_frequency >> 5; binair = shifting & 0x1F; byte_send07+=shifting; // byte_send 07 // BFO sign xx0xxxxx if(send_signBFO==1) shifting = 1; if(send_signBFO==-1) shifting= 0; shifting = shifting << 5; binair = shifting & 0x20; byte_send07+=binair; // byte_send 08 // GAIN CODE 2^6 xxxxxxx0 shifting=TrackBar3->Position; mask = shifting & 0x40; shifting = mask >> 6; byte_send08=shifting; // if(TrackBar3->Position==127) // { // byte_send08+=0x01; // } // BFO Frequency x00000xx send_bfo_frequency = TrackBar2->Position; shifting = send_bfo_frequency << 2; binair = shifting & 0x7C; byte_send08+=binair; // byte_send 09 // GAIN CODE 2^0 - 2^5 x000000x byte_send09=TrackBar3->Position; byte_send09=byte_send09 << 1; byte_send09=byte_send09 & 0x7E; // byte_send 10 // SIGNAL LEVEL xxxxxxxx byte_send10=0; // signal level only in monitor mode } //--------------------------------------------------------------------------- void TForm2::ConvertAsyncSync(void) { // conversion from send async to send sync data... synch_byte_send01 = 0; synch_byte_send02 = 0; synch_byte_send03 = 0; synch_byte_send04 = 0; synch_byte_send05 = 0; synch_byte_send06 = 0; synch_byte_send07 = 0; synch_byte_send08 = 0; synch_byte_send09 = 0; synch_byte_send10 = 0; // SYNCHRONOUS BYTE 01 and 02 NOT USED synch_byte_send01 = 0; synch_byte_send02 = 0; // SYNCHRONOUS BYTE 03 synch_byte_send03 = byte_send02; // SYNCHRONOUS BYTE 04 // 10^4 shifting = byte_send04 >> 6; mask = shifting & 0x01; shifting = mask; synch_byte_send04 = shifting; mask = byte_send03 & 0x07; shifting = mask << 1; synch_byte_send04 = synch_byte_send04 + shifting; // 10^5 mask = byte_send03 & 0x78; shifting = mask << 1; synch_byte_send04 = synch_byte_send04 + shifting; // SYNCHRONOUS BYTE 05 DATA WORD FORMAT ok // 10^2 shifting = byte_send05 >> 5; mask = shifting & 0x03; shifting = mask; synch_byte_send05 = shifting; mask = byte_send04 & 0x03; shifting = mask << 2; synch_byte_send05 = synch_byte_send05 + shifting; // 10^3 mask = byte_send04 & 0x3C; shifting = mask << 2; synch_byte_send05 = synch_byte_send05 + shifting; // SYNCHRONOUS BYTE 06 DATA WORD FORMAT ok // IF BANDWITH shifting = byte_send06 & 0x30; mask = shifting >> 4; shifting = mask; synch_byte_send06 = shifting; mask = byte_send06 & 0x40; shifting = mask >> 4; synch_byte_send06 = synch_byte_send06 + shifting; mask = byte_send05 & 0x01; shifting = mask << 3; synch_byte_send06 = synch_byte_send06 + shifting; // 10^1 mask = byte_send05 & 0x1E; shifting = mask << 3; synch_byte_send06 = synch_byte_send06 + shifting; // SYNCHRONOUS BYTE 07 DATA WORD FORMAT ok // BFO FREQUENCY shifting = byte_send07 >> 3; mask = shifting & 0x07; shifting = mask; synch_byte_send07 = shifting; // DETECTION MODE mask = byte_send06 & 0x07; shifting = mask << 4; synch_byte_send07 = synch_byte_send07 + shifting; // IF BANDWITH mask = byte_send06 & 0x08; shifting = mask << 4; synch_byte_send07 = synch_byte_send07 + shifting; // SYNCHRONOUS BYTE 08 DATA WORD FORMAT ok shifting = byte_send08 >> 2; synch_byte_send08 = shifting; mask = byte_send07 & 0x07; shifting = mask << 5; synch_byte_send08 = synch_byte_send08 + shifting; // SYNCHRONOUS BYTE 09 DATA WORD FORMAT ok synch_byte_send09 = TrackBar3->Position; // SYNCHRONOUS BYTE 10 NOT USED IN SYNCHRONOUS DATA WORD FORMAT ok synch_byte_send10 = 0; } //--------------------------------------------------------------------------- void TForm2::TotalReadFreq(void) { totalfreq_read=0; read_frequency10Hz = read_tunedfreq10Hz * 10; read_frequency100Hz = read_tunedfreq100Hz * 100; read_frequency1kHz = read_tunedfreq1kHz * 1000; read_frequency10kHz = read_tunedfreq10kHz * 10000; read_frequency100kHz = read_tunedfreq100kHz * 100000; read_frequency1MHz = read_tunedfreq1MHz * 1000000; read_frequency10MHz = read_tunedfreq10MHz * 10000000; totalfreq_read = read_frequency10Hz+read_frequency100Hz+read_frequency1kHz+read_frequency10kHz+read_frequency100kHz+read_frequency1MHz+read_frequency10MHz; } //--------------------------------------------------------------------------- void TForm2::TotalSendFreq(void) { send_frequency10Hz = send_tunedfreq10Hz * 10; send_frequency100Hz = send_tunedfreq100Hz * 100; send_frequency1kHz = send_tunedfreq1kHz * 1000; send_frequency10kHz = send_tunedfreq10kHz * 10000; send_frequency100kHz = send_tunedfreq100kHz * 100000; send_frequency1MHz = send_tunedfreq1MHz * 1000000; send_frequency10MHz = send_tunedfreq10MHz * 10000000; totalfreq_write = send_frequency10Hz+send_frequency100Hz+send_frequency1kHz+send_frequency10kHz+send_frequency100kHz+send_frequency1MHz+send_frequency10MHz; } //--------------------------------------------------------------------------- void TForm2::TransferedLCD(void) { // decoding controlling contence of transfered data (async format) // this will visualize the data to LCD DATA // note : LCD is always decoded from async datatable // if in sync mode the data is first converted to async // special info labels if(asynch==1 ) { Label73->Caption = "ASYNC"; } if(asynch==0) { Label73->Caption = "SYNC"; } if(RadioGroup1->ItemIndex==0) { Label75->Caption = "HOLD RX"; } if(RadioGroup1->ItemIndex==1 && LoopRXData1->Checked == true) { Label75->Caption = "LOOP RX"; } if(RadioGroup1->ItemIndex==1 && HoldRXData1->Checked == true) { Label75->Caption = "HOLD RX"; } if(PCPCSimulation1->Checked==true) { Label76->Caption = "PC/PC"; } if(PCPCSimulation1->Checked==false) { Label76->Caption = "PC/Q8"; } if(RadioGroup1->ItemIndex == 0) { if(send_signBFO==1) Panel3->Caption = "+"; if(send_signBFO==-1) Panel3->Caption = "-"; Panel3->Caption = Panel3->Caption+FloatToStr(value*10)+"HZ"; } if(RadioGroup1->ItemIndex == 0) // LCD matrix tuned frequency and bfo frequency { TotalSendFreq(); Label17->Caption = IntToStr(totalfreq_write); Label18->Caption = FloatToStr(send_total_BFO); Label19->Caption = TrackBar3->Position; } if(RadioGroup1->ItemIndex == 0) { if(RadioGroup2->ItemIndex==0) Label62->Caption = "RCVR ID 00"; if(RadioGroup2->ItemIndex==1) Label62->Caption = "RCVR ID 01"; if(RadioGroup2->ItemIndex==2) Label62->Caption = "RCVR ID 02"; if(RadioGroup2->ItemIndex==3) Label62->Caption = "RCVR ID 03"; if(RadioGroup2->ItemIndex==4) Label62->Caption = "RCVR ID 04"; if(RadioGroup2->ItemIndex==5) Label62->Caption = "RCVR ID 05"; if(RadioGroup2->ItemIndex==6) Label62->Caption = "RCVR ID 06"; if(RadioGroup2->ItemIndex==7) Label62->Caption = "RCVR ID 07"; if(RadioGroup2->ItemIndex==8) Label62->Caption = "RCVR ID 08"; if(RadioGroup2->ItemIndex==9) Label62->Caption = "RCVR ID 09"; if(RadioGroup2->ItemIndex==10) Label62->Caption = "RCVR ID 10"; if(RadioGroup2->ItemIndex==11) Label62->Caption = "RCVR ID 11"; if(RadioGroup2->ItemIndex==12) Label62->Caption = "RCVR ID 12"; if(RadioGroup2->ItemIndex==13) Label62->Caption = "RCVR ID 13"; if(RadioGroup2->ItemIndex==14) Label62->Caption = "RCVR ID 14"; if(RadioGroup2->ItemIndex==15) Label62->Caption = "RCVR ID 15"; if(CheckBox1->Checked==true) Label63->Caption = "AGC YES"; if(CheckBox1->Checked==false) Label63->Caption = "AGC NO"; if(RadioGroup3->ItemIndex == 0) Label48->Caption = "IF -.- KHZ"; if(RadioGroup3->ItemIndex == 1) Label48->Caption = "IF 0.5 KHZ"; if(RadioGroup3->ItemIndex == 2) Label48->Caption = "IF 2.0 KHZ"; if(RadioGroup3->ItemIndex == 3) Label48->Caption = "IF 4.0 KHZ"; if(RadioGroup3->ItemIndex == 4) Label48->Caption = "IF 6.0 KHZ"; if(RadioGroup3->ItemIndex == 5) Label48->Caption = "IF -.- KHZ"; if(RadioGroup4->ItemIndex == 0) Label49->Caption = "GAIN HOLD AGC"; if(RadioGroup4->ItemIndex == 1) Label49->Caption = "GAIN NOT USED"; if(RadioGroup4->ItemIndex == 2) Label49->Caption = "GAIN NORM AGC"; if(RadioGroup4->ItemIndex == 3) Label49->Caption = "GAIN MANUAL"; if(RadioGroup5->ItemIndex == 0) Label61->Caption = "AM"; if(RadioGroup5->ItemIndex == 1) Label61->Caption = "FM"; if(RadioGroup5->ItemIndex == 2) Label61->Caption = "BFO FIX"; if(RadioGroup5->ItemIndex == 3) Label61->Caption = "BFO VAR"; if(RadioGroup5->ItemIndex == 4) Label61->Caption = "ISB"; if(RadioGroup5->ItemIndex == 5) Label61->Caption = "LSB"; if(RadioGroup5->ItemIndex == 6) Label61->Caption = "USB"; if(RadioGroup5->ItemIndex == 7) Label61->Caption = "AM-NL"; } } //--------------------------------------------------------------------------- void TForm2::ReceivedLCD(void) { // decoding controlling contence of received data (async format) // this will visualize the data to LCD DATA // note : LCD is always decoded from async datatable // if in sync mode the data is first converted to async // sets received radio parameters as unknown Label48->Caption = "IF ?.? KHZ"; Label49->Caption = "GAIN ???"; Label61->Caption = "DET ???"; Label62->Caption = "RCVR ID ??"; Label63->Caption = "AGC ???"; Panel3->Caption = "NOT VALID"; Label17->Caption = "NOT VALID"; Label18->Caption = "NOT VALID"; Label19->Caption = "NOT VALID"; Label20->Caption = "NOT VALID"; // detect the modal byte id bit in sync or async if(asynch==1) // MODAL BYTE ID BIT IN ASYNC MODE { modal_byte_id = byte_received01 & 0x80; // bit 08 of byte 01 in async mode } if(asynch==0) // SYNC MODE { modal_byte_id = true; // not available in sync mode } if(Label64->Caption == "//////") Label64->Caption = ""; // makes a scanner indicator if modal byte bit is 1 if(CheckBox2->Checked==true && modal_byte_id==true) { Label64->Caption = Label64->Caption+ "/"; } valid_RX = false; if(asynch==1) { valid_RX = byte_received01 & 0x80; // MODAL BYTE BIT = 1 VALID RX DATA async valid_RX = true; } if(asynch==0) { valid_RX = true; // MODAL BYTE BIT = 1 VALID RX DATA sync } if(valid_RX) // valid_RX { // RCVR ID binair = byte_received01 & 0x0F; if(binair < 10) Label62->Caption = "RCVR ID 0"+IntToStr(binair); else Label62->Caption = "RCVR ID "+IntToStr(binair); if(RadioGroup1->ItemIndex==1 && LoopRXData1->Checked == true) RadioGroup2->ItemIndex = binair; // AGC DUMP binair = byte_received02 & byte_mask02_AGCDUMP; received_agcdump = binair; if(binair !=0) { Label63->Caption = "AGC YES"; if(RadioGroup1->ItemIndex==1 && LoopRXData1->Checked == true) CheckBox1->Checked = true; } else { Label63->Caption = "AGC NO"; if(RadioGroup1->ItemIndex==1 && LoopRXData1->Checked == true) CheckBox1->Checked = false; } // send_send_tunedfreq 10^7 10MHz read_tunedfreq10MHz=0; binair = byte_received02 & 0x30; //xx00xxxx shifting = binair >> 4; read_tunedfreq10MHz = shifting; // send_tunedfreq 10^6 1MHz read_tunedfreq1MHz=0; binair = byte_received02 & 0x0F; //xxxx0000 shifting = binair; read_tunedfreq1MHz = shifting; // send_tunedfreq 10^5 100kHz read_tunedfreq100kHz=0; binair = byte_received03 & 0x78; //x0000xxx shifting = binair >> 3; read_tunedfreq100kHz = shifting; // send_tunedfreq 10^4 10kHz read_tunedfreq10kHz=0; binair = byte_received04 & 0x40; //x0xxxxxx shifting = binair >> 6; read_tunedfreq10kHz = shifting; binair = byte_received03 & 0x07; //xxxxx000 shifting = binair << 1; read_tunedfreq10kHz = read_tunedfreq10kHz + shifting; // send_tunedfreq 10^3 1kHz read_tunedfreq1kHz=0; binair = byte_received04 & 0x3C; //xx0000xx shifting = binair >> 2; read_tunedfreq1kHz = shifting; // send_tunedfreq 10^2 100Hz read_tunedfreq100Hz=0; binair = byte_received05 & 0x60; //x00xxxxx shifting = binair >> 5; read_tunedfreq100Hz = shifting; binair = byte_received04 & 0x03; //xxxxxx00 shifting = binair << 2; read_tunedfreq100Hz = read_tunedfreq100Hz + shifting; // send_tunedfreq 10^1 10Hz read_tunedfreq10Hz = 0; binair = byte_received05 & 0x1E; shifting = binair >> 1; //xxx0000x read_tunedfreq10Hz = shifting; // GAIN MODE binair = byte_received06 & 0x40; //x0xxxxxx shifting = binair >> 6; received_gainmode = shifting; binair = byte_received05 & 0x01; //xxxxxxx0 shifting = binair << 1; received_gainmode = received_gainmode + shifting; if(RadioGroup1->ItemIndex==1 && LoopRXData1->Checked == true) RadioGroup4->ItemIndex = received_gainmode; if(received_gainmode==0) Label49->Caption = "GAIN HOLD AGC"; if(received_gainmode==1) Label49->Caption = "GAIN NOT USED"; if(received_gainmode==2) Label49->Caption = "GAIN NORM AGC"; if(received_gainmode==3) Label49->Caption = "GAIN MANUAL"; // IF BANDWITH binair = byte_received06 & 0x38; //xx000xxx shifting = binair >> 3; received_ifbandwith = shifting; if(RadioGroup1->ItemIndex==1 && LoopRXData1->Checked == true) RadioGroup3->ItemIndex = received_ifbandwith; if(received_ifbandwith==0) Label48->Caption = "IF -.- kHz"; if(received_ifbandwith==1) Label48->Caption = "IF 0.5 kHz"; if(received_ifbandwith==2) Label48->Caption = "IF 2.0 kHz"; if(received_ifbandwith==3) Label48->Caption = "IF 4.0 kHz"; if(received_ifbandwith==4) Label48->Caption = "IF 6.0 kHz"; if(received_ifbandwith==5) Label48->Caption = "IF -.- kHz"; // DETECTION MODE binair = byte_received06 & 0x07; //xxxxx000 shifting = binair; received_detectionmode = shifting; if(RadioGroup1->ItemIndex==1 && LoopRXData1->Checked == true) RadioGroup5->ItemIndex = received_detectionmode; if(received_detectionmode==0) Label61->Caption = "AM"; if(received_detectionmode==1) Label61->Caption = "FM"; if(received_detectionmode==2) Label61->Caption = "BFO FIX"; if(received_detectionmode==3) Label61->Caption = "BFO VAR"; if(received_detectionmode==4) Label61->Caption = "ISB"; if(received_detectionmode==5) Label61->Caption = "LSB"; if(received_detectionmode==6) Label61->Caption = "USB"; if(received_detectionmode==7) Label61->Caption = "AM-NL"; // received BFO frequency binair_bfo = byte_received08 & 0x7C; //x00000xx shifting_bfo = binair_bfo >> 2; received_bfo = shifting_bfo; binair_bfo = byte_received07 & 0x1F; //xxx00000 shifting_bfo = binair_bfo << 5; received_bfo = received_bfo + shifting_bfo; binair = byte_received07 & 0x20; //xx0xxxxx shifting = binair >> 5; read_signBFO = shifting; // sign bit if(read_signBFO == 0) read_signBFO = -1; // negative sign if(RadioGroup1->ItemIndex==1 && LoopRXData1->Checked == true) TrackBar2->Position = received_bfo; // received rf gain code received_rf_gain_code=0; binair = byte_received09 & 0X7E; // x000000x shifting = binair >> 1; received_rf_gain_code = shifting; binair = byte_received08 & 0x01; // xxxxxxx0 shifting = binair << 6; received_rf_gain_code = received_rf_gain_code + shifting; if(RadioGroup1->ItemIndex==1 && LoopRXData1->Checked == true) TrackBar3->Position = received_rf_gain_code; if(RadioGroup1->ItemIndex == 1) { if(read_signBFO==1) Panel3->Caption = "+"; if(read_signBFO==-1) Panel3->Caption = "-"; Panel3->Caption = Panel3->Caption+FloatToStr(read_BFO)+"HZ"; } TotalReadFreq(); Label17->Caption = FloatToStr(totalfreq_read); Label18->Caption = FloatToStr(read_total_BFO); Label19->Caption = FloatToStr(received_rf_gain_code); Label20->Caption = IntToStr(byte_received10); ProgressBar1->Position = byte_received10; } // CopyReceivedData1->Checked == false; } //--------------------------------------------------------------------------- void TForm2::CalculateReadBFO(void) { read_total_BFO=0; if(RadioGroup1->ItemIndex == 1) { value = received_bfo; read_BFO = value * 10; read_total_BFO = (read_BFO*read_signBFO) + 455000; // add signed 455kHz signal } } //--------------------------------------------------------------------------- void TForm2::CalculateSendBFO(void) { if(RadioGroup1->ItemIndex == 0) { value = TrackBar2->Position; // position of trackbar send_BFO = value / 1000; send_BFO = send_BFO * send_signBFO; // calculate sign of BFO frequency send_BFO_factor = (9.5 + 36 + send_BFO) / 100; // decode with 9.5 & 36 MHz signal send_total_BFO = send_BFO_factor * 1000000; // 455000 Hz + BFO frequency Hz } } //--------------------------------------------------------------------------- void TForm2::EnableObjects(void) { if(RadioGroup1->ItemIndex == 0) { // enable objects when in command mode Button3->Enabled = true; Button4->Enabled = true; Button5->Enabled = true; Button6->Enabled = true; Button7->Enabled = true; Button9->Enabled = true; Button10->Enabled = true; Button11->Enabled = true; Button12->Enabled = true; Button13->Enabled = true; Button14->Enabled = true; Button15->Enabled = true; Button16->Enabled = true; Button17->Enabled = true; Button18->Enabled = true; Button19->Enabled = true; Button20->Enabled = true; Button21->Enabled = true; Button22->Enabled = true; Button23->Enabled = true; Button24->Enabled = true; Button25->Enabled = true; Button26->Enabled = true; Button27->Enabled = true; FREQPresets1->Enabled = true; BFOPresets1->Enabled = true; Receivers1->Enabled = true; // not in Beta Receivers2->Enabled = true; // not in Beta RadioGroup3->Enabled = true; RadioGroup4->Enabled = true; RadioGroup5->Enabled = true; RadioGroup6->Enabled = true; MaskEdit1->Enabled = true; MaskEdit2->Enabled = true; CheckBox1->Enabled = true; ProgressBar1->Enabled = false; ProgressBar1->Enabled = true; Label3->Enabled = true; Label4->Enabled = true; Label50->Enabled = true; Label65->Enabled = true; Label66->Enabled = true; Label67->Enabled = true; Label68->Enabled = true; TrackBar2->Enabled = true; TrackBar3->Enabled = true; Panel6->Enabled = false; LoopRXData1->Enabled = false; } } //--------------------------------------------------------------------------- void TForm2::DisableObjects(void) { if(RadioGroup1->ItemIndex == 1) { // disable objects when in monitor mode Button3->Enabled = false; Button4->Enabled = false; Button5->Enabled = false; Button6->Enabled = false; Button7->Enabled = false; Button9->Enabled = false; Button10->Enabled = false; Button11->Enabled = false; Button12->Enabled = false; Button13->Enabled = false; Button14->Enabled = false; Button15->Enabled = false; Button16->Enabled = false; Button17->Enabled = false; Button18->Enabled = false; Button19->Enabled = false; Button20->Enabled = false; Button21->Enabled = false; Button22->Enabled = false; Button23->Enabled = false; Button24->Enabled = false; Button25->Enabled = false; Button26->Enabled = false; Button27->Enabled = false; FREQPresets1->Enabled = false; BFOPresets1->Enabled = false; // Receivers1->Enabled = false; Receivers2->Enabled = false; RadioGroup3->Enabled = false; RadioGroup4->Enabled = false; RadioGroup5->Enabled = false; RadioGroup6->Enabled = false; ProgressBar1->Enabled = true; ProgressBar1->Visible = true; MaskEdit1->Enabled = false; MaskEdit2->Enabled = false; CheckBox1->Enabled = false; Label3->Enabled = false; Label4->Enabled = false; Label50->Enabled = false; Label65->Enabled = false; Label66->Enabled = false; Label67->Enabled = false; Label68->Enabled = false; TrackBar2->Enabled = false; TrackBar3->Enabled = false; Panel6->Enabled = true; LoopRXData1->Enabled = true; } } //--------------------------------------------------------------------------- void TForm2::LedSignals(void) { Panel9->Color = clGreen; Panel11->Color = clGreen; Panel13->Color = clGreen; Panel15->Color = clGreen; Panel17->Color = clGreen; Panel19->Color = clGreen; Panel21->Color = clGreen; Panel23->Color = clGreen; Panel25->Color = clGreen; Panel27->Color = clGreen; Panel29->Color = clGreen; Panel31->Color = clGreen; Panel33->Color = clGreen; Panel35->Color = clGreen; Panel37->Color = clGreen; Panel39->Color = clGreen; Panel41->Color = clGreen; Panel43->Color = clGreen; Panel45->Color = clGreen; Panel8->Color = clMaroon; Panel10->Color = clMaroon; Panel12->Color = clMaroon; Panel14->Color = clMaroon; Panel16->Color = clMaroon; Panel18->Color = clMaroon; Panel20->Color = clMaroon; Panel22->Color = clMaroon; Panel24->Color = clMaroon; Panel26->Color = clMaroon; Panel28->Color = clMaroon; Panel30->Color = clMaroon; Panel32->Color = clMaroon; Panel34->Color = clMaroon; Panel36->Color = clMaroon; Panel38->Color = clMaroon; Panel40->Color = clMaroon; Panel42->Color = clMaroon; Panel44->Color = clMaroon; if(received_ifbandwith==0) Panel8->Color = clRed; if(received_ifbandwith==1) Panel10->Color = clRed; if(received_ifbandwith==2) Panel12->Color = clRed; if(received_ifbandwith==3) Panel14->Color = clRed; if(received_ifbandwith==4) Panel16->Color = clRed; if(received_ifbandwith==5) Panel18->Color = clRed; if(received_gainmode==0) Panel20->Color = clRed; if(received_gainmode==1) Panel22->Color = clRed; if(received_gainmode==2) Panel24->Color = clRed; if(received_gainmode==3) Panel26->Color = clRed; if(received_detectionmode==0) Panel28->Color = clRed; if(received_detectionmode==1) Panel30->Color = clRed; if(received_detectionmode==2) Panel32->Color = clRed; if(received_detectionmode==3) Panel34->Color = clRed; if(received_detectionmode==4) Panel36->Color = clRed; if(received_detectionmode==5) Panel38->Color = clRed; if(received_detectionmode==6) Panel40->Color = clRed; if(received_detectionmode==7) Panel42->Color = clRed; if(received_agcdump!=0) Panel44->Color = clRed; if(RadioGroup3->ItemIndex == 0) Panel9->Color = clLime; if(RadioGroup3->ItemIndex == 1) Panel11->Color = clLime; if(RadioGroup3->ItemIndex == 2) Panel13->Color = clLime; if(RadioGroup3->ItemIndex == 3) Panel15->Color = clLime; if(RadioGroup3->ItemIndex == 4) Panel17->Color = clLime; if(RadioGroup3->ItemIndex == 5) Panel19->Color = clLime; if(RadioGroup4->ItemIndex == 0) Panel21->Color = clLime; if(RadioGroup4->ItemIndex == 1) Panel23->Color = clLime; if(RadioGroup4->ItemIndex == 2) Panel25->Color = clLime; if(RadioGroup4->ItemIndex == 3) Panel27->Color = clLime; if(RadioGroup5->ItemIndex == 0) Panel29->Color = clLime; if(RadioGroup5->ItemIndex == 1) Panel31->Color = clLime; if(RadioGroup5->ItemIndex == 2) Panel33->Color = clLime; if(RadioGroup5->ItemIndex == 3) Panel35->Color = clLime; if(RadioGroup5->ItemIndex == 4) Panel37->Color = clLime; if(RadioGroup5->ItemIndex == 5) Panel39->Color = clLime; if(RadioGroup5->ItemIndex == 6) Panel41->Color = clLime; if(RadioGroup5->ItemIndex == 7) Panel43->Color = clLime; if(CheckBox1->Checked) Panel45->Color = clLime; // DTR signals normal function if (DTR==true && ForceDTRON1->Checked == false) { PanelDTRLed->Color = clYellow; PanelDTRLed->Font->Color = clBlack; } if(DTR==false && ForceDTROFF1->Checked == false) { PanelDTRLed->Color = clOlive; PanelDTRLed->Font->Color = clWhite; } // RTS signals normal function if (RTS==true && ForceRTSON1->Checked==false) { PanelRTSLed->Color = clYellow; PanelRTSLed->Font->Color = clBlack; } if(RTS==false && ForceRTSOFF1->Checked==false) { PanelRTSLed->Color = clOlive; PanelRTSLed->Font->Color = clWhite; } // DTR signals forced function if (DTR==true && ForceDTRON1->Checked == true) { PanelDTRLed->Color = clPurple; PanelDTRLed->Font->Color = clBlack; } if(DTR==false && ForceDTROFF1->Checked == true) { PanelDTRLed->Color = clTeal; PanelDTRLed->Font->Color = clWhite; } // RTS signals normal function if (RTS==true && ForceRTSON1->Checked==true) { PanelRTSLed->Color = clPurple; PanelRTSLed->Font->Color = clBlack; } if(RTS==false && ForceRTSOFF1->Checked==true) { PanelRTSLed->Color = clTeal; PanelRTSLed->Font->Color = clWhite; } // MODAL ID BYTE BIT if (modal_byte_id==true) { PanelModID->Color = clYellow; PanelModID->Font->Color = clBlack; } if(modal_byte_id==false) { PanelModID->Color = clGray; PanelModID->Font->Color = clWhite; } } //--------------------------------------------------------------------------- void TForm2::UpTuning(void) { if(RadioGroup6->ItemIndex==0 && totalfreq_write < 30500000) send_tunedfreq10Hz+=1; if(RadioGroup6->ItemIndex==1 && totalfreq_write < 30500000) send_tunedfreq100Hz+=1; if(RadioGroup6->ItemIndex==2 && totalfreq_write < 30500000) send_tunedfreq1kHz+=1; if(RadioGroup6->ItemIndex==3 && totalfreq_write < 30500000) send_tunedfreq10kHz+=1; if(RadioGroup6->ItemIndex==4 && totalfreq_write < 30500000) send_tunedfreq100kHz+=1; if(RadioGroup6->ItemIndex==5 && totalfreq_write < 30500000) send_tunedfreq1MHz+=1; if(send_tunedfreq10MHz < 3 && RadioGroup6->ItemIndex==6 && totalfreq_write < 30500000) send_tunedfreq10MHz+=1; // --tuning with steps 10 Hz----- if(send_tunedfreq10Hz > 15 && RadioGroup6->ItemIndex==0 && totalfreq_write < 30500000) { send_tunedfreq100Hz+=1; send_tunedfreq10Hz=6; } if(send_tunedfreq100Hz > 15 && RadioGroup6->ItemIndex==0 && totalfreq_write < 30500000) { send_tunedfreq1kHz+=1; send_tunedfreq100Hz=6; } if(send_tunedfreq1kHz > 15 && RadioGroup6->ItemIndex==0 && totalfreq_write < 30500000) { send_tunedfreq10kHz+=1; send_tunedfreq1kHz=6; } if(send_tunedfreq10kHz > 15 && RadioGroup6->ItemIndex==0 && totalfreq_write < 30500000) { send_tunedfreq100kHz+=1; send_tunedfreq10kHz=6; } if(send_tunedfreq100kHz > 15 && RadioGroup6->ItemIndex==0 && totalfreq_write < 30500000) { send_tunedfreq1MHz+=1; send_tunedfreq100kHz=6; } // --tuning with steps 100 Hz---- if(send_tunedfreq100Hz > 15 && RadioGroup6->ItemIndex==1 && totalfreq_write < 30500000) { send_tunedfreq1kHz+=1; send_tunedfreq100Hz=6; } if(send_tunedfreq1kHz > 15 && RadioGroup6->ItemIndex==1 && totalfreq_write < 30500000) { send_tunedfreq10kHz+=1; send_tunedfreq1kHz=6; } if(send_tunedfreq10kHz > 15 && RadioGroup6->ItemIndex==1 && totalfreq_write < 30500000) { send_tunedfreq100kHz+=1; send_tunedfreq10kHz=6; } if(send_tunedfreq100kHz > 15 && RadioGroup6->ItemIndex==1 && totalfreq_write < 30500000) { send_tunedfreq1MHz+=1; send_tunedfreq100kHz=6; } if(send_tunedfreq1MHz > 15 && RadioGroup6->ItemIndex==1 && totalfreq_write < 30500000) { send_tunedfreq10MHz+=1; send_tunedfreq1MHz=6; } // --tuning with steps 1 kHz---- if(send_tunedfreq1kHz > 15 && RadioGroup6->ItemIndex==2 && totalfreq_write < 30500000) { send_tunedfreq10kHz+=1; send_tunedfreq1kHz=6; } if(send_tunedfreq10kHz > 15 && RadioGroup6->ItemIndex==2 && totalfreq_write < 30500000) { send_tunedfreq100kHz+=1; send_tunedfreq10kHz=6; } if(send_tunedfreq100kHz > 15 && RadioGroup6->ItemIndex==2 && totalfreq_write < 30500000) { send_tunedfreq1MHz+=1; send_tunedfreq100kHz=6; } if(send_tunedfreq1MHz > 15 && RadioGroup6->ItemIndex==2 && totalfreq_write < 30500000) { send_tunedfreq10MHz+=1; send_tunedfreq1MHz=6; } // --tuning with steps 10 kHz---- if(send_tunedfreq10kHz > 15 && RadioGroup6->ItemIndex==3 && totalfreq_write < 30500000) { send_tunedfreq100kHz+=1; send_tunedfreq10kHz=6; } if(send_tunedfreq100kHz > 15 && RadioGroup6->ItemIndex==3 && totalfreq_write < 30500000) { send_tunedfreq1MHz+=1; send_tunedfreq100kHz=6; } if(send_tunedfreq10MHz > 15 && RadioGroup6->ItemIndex==3 && totalfreq_write < 30500000) { send_tunedfreq10MHz+=1; send_tunedfreq1MHz=6; } // --tuning with steps 100 kHz---- if(send_tunedfreq100kHz > 15 && RadioGroup6->ItemIndex==4 && totalfreq_write < 30500000) { send_tunedfreq1MHz+=1; send_tunedfreq100kHz=6; } if(send_tunedfreq1MHz > 15 && RadioGroup6->ItemIndex==4 && totalfreq_write < 30500000) { send_tunedfreq10MHz+=1; send_tunedfreq1MHz=6; } // --tuning with steps 1 MHz---- if(send_tunedfreq1MHz > 15 && RadioGroup6->ItemIndex==5 && totalfreq_write < 30500000) { send_tunedfreq10MHz+=1; send_tunedfreq1MHz=6; } } //--------------------------------------------------------------------------- void TForm2::DownTuning(void) { int stat = false; // tuning with 10 Hz steps if(send_tunedfreq10Hz > 00 && RadioGroup6->ItemIndex==0 && stat == false) { send_tunedfreq10Hz-=1; stat = true; } if(send_tunedfreq10Hz == 00 && send_tunedfreq100Hz > 0 && RadioGroup6->ItemIndex==0 && stat == false) { send_tunedfreq100Hz-=1; send_tunedfreq10Hz=9; stat = true; } if(send_tunedfreq10Hz == 00 && send_tunedfreq100Hz == 0 && send_tunedfreq1kHz > 0 && RadioGroup6->ItemIndex==0 && stat == false) { send_tunedfreq1kHz-=1; send_tunedfreq100Hz=9; send_tunedfreq10Hz=9; stat = true; } if(send_tunedfreq10Hz == 00 && send_tunedfreq100Hz == 0 && send_tunedfreq1kHz == 0 && send_tunedfreq10kHz > 0 && RadioGroup6->ItemIndex==0 && stat == false) { send_tunedfreq10kHz-=1; send_tunedfreq1kHz=9; send_tunedfreq100Hz=9; send_tunedfreq10Hz=9; stat = true; } if(send_tunedfreq10Hz == 00 && send_tunedfreq100Hz == 0 && send_tunedfreq1kHz == 0 && send_tunedfreq10kHz == 0 && send_tunedfreq100kHz > 5 && RadioGroup6->ItemIndex==0 && stat == false) { send_tunedfreq100kHz-=1; send_tunedfreq10kHz=9; send_tunedfreq1kHz=9; send_tunedfreq100Hz=9; send_tunedfreq10Hz=9; stat = true; } if(send_tunedfreq10Hz == 00 && send_tunedfreq100Hz == 0 && send_tunedfreq1kHz == 0 && send_tunedfreq10kHz == 0 && send_tunedfreq100kHz == 0 && send_tunedfreq1MHz > 0 && RadioGroup6->ItemIndex==0 && stat == false) { send_tunedfreq1MHz-=1; send_tunedfreq100kHz=9; send_tunedfreq10kHz=9; send_tunedfreq1kHz=9; send_tunedfreq100Hz=9; send_tunedfreq10Hz=9; stat = true; } if(send_tunedfreq10Hz == 0 && send_tunedfreq100Hz == 0 && send_tunedfreq1kHz == 0 && send_tunedfreq10kHz == 0 && send_tunedfreq100kHz == 0 && send_tunedfreq1MHz == 0 && send_tunedfreq10MHz > 0 && RadioGroup6->ItemIndex==0 && stat == false) { send_tunedfreq10MHz-=1; send_tunedfreq1MHz=9; send_tunedfreq100kHz=9; send_tunedfreq10kHz=9; send_tunedfreq1kHz=9; send_tunedfreq100Hz=9; send_tunedfreq10Hz=9; stat = true; } if(send_tunedfreq10Hz == 0 && send_tunedfreq100Hz == 0 && send_tunedfreq1kHz == 0 && send_tunedfreq10kHz == 0 && send_tunedfreq100kHz <= 5 && send_tunedfreq1MHz > 0 && RadioGroup6->ItemIndex==0 && stat == false) { // speciaal controle ivm met min 500kHz value send_tunedfreq100kHz-=1; send_tunedfreq10kHz=9; send_tunedfreq1kHz=9; send_tunedfreq100Hz=9; send_tunedfreq10Hz=9; stat = true; } if(send_tunedfreq10Hz == 0 && send_tunedfreq100Hz == 0 && send_tunedfreq1kHz == 0 && send_tunedfreq10kHz == 0 && send_tunedfreq100kHz <= 5 && send_tunedfreq1MHz == 0 && send_tunedfreq10MHz > 0 && RadioGroup6->ItemIndex==0 && stat == false) { // speciaal controle ivm met min 500kHz value send_tunedfreq100kHz-=1; send_tunedfreq10kHz=9; send_tunedfreq1kHz=9; send_tunedfreq100Hz=9; send_tunedfreq10Hz=9; stat = true; } // tuning with 100 Hz steps if(send_tunedfreq100Hz > 0 && RadioGroup6->ItemIndex==1 && stat == false) { send_tunedfreq100Hz-=1; stat = true; } if(send_tunedfreq100Hz == 0 && send_tunedfreq1kHz > 0 && RadioGroup6->ItemIndex==1 && stat == false) { send_tunedfreq1kHz-=1; send_tunedfreq100Hz=9; stat = true; } if(send_tunedfreq100Hz == 0 && send_tunedfreq1kHz == 0 && send_tunedfreq10kHz > 0 && RadioGroup6->ItemIndex==1 && stat == false) { send_tunedfreq10kHz-=1; send_tunedfreq1kHz=9; send_tunedfreq100Hz=9; stat = true; } if(send_tunedfreq100Hz == 0 && send_tunedfreq1kHz == 0 && send_tunedfreq10kHz == 0 && send_tunedfreq100kHz > 5 && RadioGroup6->ItemIndex==1 && stat == false) { send_tunedfreq100kHz-=1; send_tunedfreq10kHz=9; send_tunedfreq1kHz=9; send_tunedfreq100Hz=9; stat = true; } if(send_tunedfreq100Hz == 0 && send_tunedfreq1kHz == 0 && send_tunedfreq10kHz == 0 && send_tunedfreq100kHz == 0 && send_tunedfreq1MHz > 0 && RadioGroup6->ItemIndex==1 && stat == false) { send_tunedfreq1MHz-=1; send_tunedfreq100kHz=9; send_tunedfreq10kHz=9; send_tunedfreq1kHz=9; send_tunedfreq100Hz=9; stat = true; } if(send_tunedfreq100Hz == 0 && send_tunedfreq1kHz == 0 && send_tunedfreq10kHz == 0 && send_tunedfreq100kHz == 0 && send_tunedfreq1MHz == 0 && send_tunedfreq10MHz > 0 && RadioGroup6->ItemIndex==1 && stat == false) { send_tunedfreq10MHz-=1; send_tunedfreq1MHz=9; send_tunedfreq100kHz=9; send_tunedfreq10kHz=9; send_tunedfreq1kHz=9; send_tunedfreq100Hz=9; stat = true; } if(send_tunedfreq100Hz == 0 && send_tunedfreq1kHz == 0 && send_tunedfreq10kHz == 0 && send_tunedfreq100kHz <= 5 && send_tunedfreq1MHz > 0 && RadioGroup6->ItemIndex==1 && stat == false) { // speciaal controle ivm met min 500kHz value send_tunedfreq100kHz-=1; send_tunedfreq10kHz=9; send_tunedfreq1kHz=9; send_tunedfreq100Hz=9; stat = true; } if(send_tunedfreq100Hz == 0 && send_tunedfreq1kHz == 0 && send_tunedfreq10kHz == 0 && send_tunedfreq100kHz <= 5 && send_tunedfreq1MHz == 0 && send_tunedfreq10MHz > 0 && RadioGroup6->ItemIndex==1 && stat == false) { // speciaal controle ivm met min 500kHz value send_tunedfreq100kHz-=1; send_tunedfreq10kHz=9; send_tunedfreq1kHz=9; send_tunedfreq100Hz=9; stat = true; } // tuning with 1000 Hz steps if(send_tunedfreq1kHz > 0 && RadioGroup6->ItemIndex==2 && stat == false) { send_tunedfreq1kHz-=1; stat = true; } if(send_tunedfreq1kHz == 0 && send_tunedfreq100Hz == 10 && RadioGroup6->ItemIndex==2 && stat == false) { send_tunedfreq100Hz-=10; stat = true; } if(send_tunedfreq1kHz == 0 && send_tunedfreq10kHz > 0 && RadioGroup6->ItemIndex==2 && stat == false) { send_tunedfreq10kHz-=1; send_tunedfreq1kHz=9; stat = true; } if(send_tunedfreq1kHz == 0 && send_tunedfreq10kHz == 0 && send_tunedfreq100kHz > 5 && RadioGroup6->ItemIndex==2 && stat == false) { send_tunedfreq100kHz-=1; send_tunedfreq10kHz=9; send_tunedfreq1kHz=9; stat = true; } if(send_tunedfreq1kHz == 0 && send_tunedfreq10kHz == 0 && send_tunedfreq100kHz == 0 && send_tunedfreq1MHz > 0 && RadioGroup6->ItemIndex==2 && stat == false) { send_tunedfreq1MHz-=1; send_tunedfreq100kHz=9; send_tunedfreq10kHz=9; send_tunedfreq1kHz=9; stat = true; } if(send_tunedfreq1kHz == 0 && send_tunedfreq10kHz == 0 && send_tunedfreq100kHz == 0 && send_tunedfreq1MHz == 0 && send_tunedfreq10MHz > 0 && RadioGroup6->ItemIndex==2 && stat == false) { send_tunedfreq10MHz-=1; send_tunedfreq1MHz=9; send_tunedfreq100kHz=9; send_tunedfreq10kHz=9; send_tunedfreq1kHz=9; stat = true; } if(send_tunedfreq1kHz == 0 && send_tunedfreq10kHz == 0 && send_tunedfreq100kHz <= 5 && send_tunedfreq1MHz > 0 && RadioGroup6->ItemIndex==2 && stat == false) { // speciaal controle ivm met min 500kHz value send_tunedfreq100kHz-=1; send_tunedfreq10kHz=9; send_tunedfreq1kHz=9; stat = true; } if(send_tunedfreq1kHz == 0 && send_tunedfreq10kHz == 0 && send_tunedfreq100kHz <= 5 && send_tunedfreq1MHz == 0 && send_tunedfreq10MHz > 0 && RadioGroup6->ItemIndex==2 && stat == false) { // speciaal controle ivm met min 500kHz value send_tunedfreq100kHz-=1; send_tunedfreq10kHz=9; send_tunedfreq1kHz=9; stat = true; } // tuning with 10000 Hz steps if(send_tunedfreq10kHz > 0 && RadioGroup6->ItemIndex==3 && stat == false) { send_tunedfreq10kHz-=1; stat = true; } if(send_tunedfreq10kHz == 0 && send_tunedfreq100kHz > 5 && RadioGroup6->ItemIndex==3 && stat == false) { send_tunedfreq100kHz-=1; send_tunedfreq10kHz=9; stat = true; } if(send_tunedfreq10kHz == 0 && send_tunedfreq100kHz == 0 && send_tunedfreq1MHz > 0 && RadioGroup6->ItemIndex==3 && stat == false) { send_tunedfreq1MHz-=1; send_tunedfreq100kHz=9; send_tunedfreq10kHz=9; stat = true; } if(send_tunedfreq10kHz == 0 && send_tunedfreq100kHz == 0 && send_tunedfreq1MHz == 0 && send_tunedfreq10MHz > 0 && RadioGroup6->ItemIndex==3 && stat == false) { send_tunedfreq10MHz-=1; send_tunedfreq1MHz=9; send_tunedfreq100kHz=9; send_tunedfreq10kHz=9; stat = true; } if(send_tunedfreq10kHz == 0 && send_tunedfreq100kHz <= 5 && send_tunedfreq1MHz > 0 && RadioGroup6->ItemIndex==3 && stat == false) { // speciaal controle ivm met min 500kHz value send_tunedfreq100kHz-=1; send_tunedfreq10kHz=9; stat = true; } if(send_tunedfreq10kHz == 0 && send_tunedfreq100kHz <= 5 && send_tunedfreq1MHz == 0 && send_tunedfreq10MHz > 0 && RadioGroup6->ItemIndex==3 && stat == false) { // speciaal controle ivm met min 500kHz value send_tunedfreq100kHz-=1; send_tunedfreq10kHz=9; stat = true; } // tuning with 100 kHz steps if(send_tunedfreq100kHz > 5 && RadioGroup6->ItemIndex==4 && stat == false) { send_tunedfreq100kHz-=1; stat = true; } if(send_tunedfreq100kHz > 5 && RadioGroup6->ItemIndex==4 && stat == false) { send_tunedfreq100kHz-=1; stat = true; } if(send_tunedfreq100kHz == 0 && send_tunedfreq1MHz > 0 && RadioGroup6->ItemIndex==4 && stat == false) { send_tunedfreq1MHz-=1; send_tunedfreq100kHz=9; stat = true; } if(send_tunedfreq100kHz == 0 && send_tunedfreq1MHz == 0 && send_tunedfreq10MHz > 0 && RadioGroup6->ItemIndex==4 && stat == false) { send_tunedfreq10MHz-=1; send_tunedfreq1MHz=9; send_tunedfreq100kHz=9; stat = true; } if(send_tunedfreq100kHz <= 5 && send_tunedfreq1MHz > 0 && RadioGroup6->ItemIndex==4 && stat == false) { // speciaal controle ivm met min 500kHz value send_tunedfreq100kHz-=1; stat = true; } if(send_tunedfreq100kHz <= 5 && send_tunedfreq1MHz == 0 && send_tunedfreq10MHz > 0 && RadioGroup6->ItemIndex==4 && stat == false) { // speciaal controle ivm met min 500kHz value send_tunedfreq100kHz-=1; stat = true; } // tuning with 1MHz steps if(send_tunedfreq1MHz > 0 && RadioGroup6->ItemIndex==5 && stat == false) { send_tunedfreq1MHz-=1; stat = true; } if(send_tunedfreq1MHz == 0 && send_tunedfreq10MHz > 0 && RadioGroup6->ItemIndex==5 && stat == false) { send_tunedfreq10MHz-=1; send_tunedfreq1MHz=9; stat = true; } // tuning with 10MHz steps if(send_tunedfreq10MHz > 0 && RadioGroup6->ItemIndex==6 && stat == false) { send_tunedfreq10MHz-=1; stat = true; } // tuning with 100Hz steps // when up tuned to min. 100Hz with 10Hz, the 100Hz resolution is still zero // e.g. send_tunedfreq10Hz = 10 and send_tunedfreq100Hz = 0 yields 100Hz if(send_tunedfreq100Hz == 0 && send_tunedfreq10Hz >= 10 && RadioGroup6->ItemIndex==1 && stat == false) { send_tunedfreq10Hz-=10; stat = true; } // tuning with 1kHz steps // when up tuned to min. 1kHz with 100Hz, the 1kHz resolution is still zero // e.g. send_tunedfreq100Hz = 10 and send_tunedfreq1kHz = 0 yields 1 kHz if(send_tunedfreq1kHz == 0 && send_tunedfreq1kHz >= 10 && RadioGroup6->ItemIndex==2 && stat == false) { send_tunedfreq100Hz-=10; stat = true; } // tuning with 10kHz steps // when up tuned to min. 10kHz with 1kHz, the 10kHz resolution is still zero // e.g. send_tunedfreq1kHz = 10 and send_tunedfreq10kHz = 0 yields 10 kHz if(send_tunedfreq10kHz == 0 && send_tunedfreq1kHz >= 10 && RadioGroup6->ItemIndex==3 && stat == false) { send_tunedfreq1kHz-=10; stat = true; } // tuning with 100kHz steps // when up tuned to min. 100kHz with 1OkHz, the 100kHz resolution is still zero // e.g. send_tunedfreq10kHz = 10 and send_tunedfreq100kHz = 0 yields 100 kHz if(send_tunedfreq100kHz >= 5 && send_tunedfreq10kHz >= 10 && RadioGroup6->ItemIndex==4 && stat == false) { send_tunedfreq10kHz-=10; stat = true; } // tuning with 1MHz steps // when up tuned to min. 1MHz with 1OOkHz, the 1 MHz resolution is still zero // e.g. send_tunedfreq100kHz = 10 and send_tunedfreq1MHz = 0 yields 1 MHz if(send_tunedfreq1MHz == 0 && send_tunedfreq100kHz >= 10 && RadioGroup6->ItemIndex==5 && stat == false) { send_tunedfreq100kHz-=10; stat = true; } // tuning with 10MHz steps // when up tuned to min. 10MHz with 1MHz, the 10 MHz resolution is still zero // e.g. send_tunedfreq1MHz = 10 and send_tunedfreq10MHz = 0 yields 10 MHz if(send_tunedfreq10MHz == 0 && send_tunedfreq1MHz >= 10 && RadioGroup6->ItemIndex==6 && stat == false) { send_tunedfreq1MHz-=10; stat = true; } } //--------------------------------------------------------------------------- void TForm2::LockStop(void) { LockUp=false; LockDwn=false; Label74->Caption = ""; } //--------------------------------------------------------------------------- void TForm2::CloseComportValid(void) { if(ComPort->Active == true) { ComPort->ClearDTR(); ComPort->ClearRTS(); DTR = false; RTS = false; ForceDTRON1->Checked = false; ForceDTROFF1->Checked = false; ForceRTSON1->Checked = false; ForceRTSOFF1->Checked = false; } ComPort->Active = false; act=false; } //--------------------------------------------------------------------------- void TForm2::OutOfRangeCheck(void) { Label46->Caption = ""; if(totalfreq_write>30499000) { Label46->Caption = "OVERTUNED FREQUENCY"; } if(totalfreq_write <500000) { Label46->Caption = "UNDERTUNED FREQUENCY"; } } //--------------------------------------------------------------------------- void TForm2::BitDisplay(void) { if(Bitdisplayonoff1->Checked == true) { // DISPLAY TX BITS if(asynch==1) bit_word = byte_send01; // display async format if(asynch==0) bit_word = synch_byte_send01; // display sync format Label31->Caption=""; for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { binair = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; Label31->Caption = Label31->Caption + IntToStr(binair); } if(asynch==1) bit_word = byte_send02; // display async format if(asynch==0) bit_word = synch_byte_send02; // display sync format Label32->Caption=""; for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { binair = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; Label32->Caption = Label32->Caption + IntToStr(binair); } if(asynch==1) bit_word = byte_send03; // display async format if(asynch==0) bit_word = synch_byte_send03; // display sync format Label33->Caption=""; for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { binair = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; Label33->Caption = Label33->Caption + IntToStr(binair); } if(asynch==1) bit_word = byte_send04; // display async format if(asynch==0) bit_word = synch_byte_send04; // display sync format Label34->Caption=""; for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { binair = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; Label34->Caption = Label34->Caption + IntToStr(binair); } if(asynch==1) bit_word = byte_send05; // display async format if(asynch==0) bit_word = synch_byte_send05; // display sync format Label35->Caption=""; for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { binair = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; Label35->Caption = Label35->Caption + IntToStr(binair); } if(asynch==1) bit_word = byte_send06; // display async format if(asynch==0) bit_word = synch_byte_send06; // display sync format Label36->Caption=""; for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { binair = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; Label36->Caption = Label36->Caption + IntToStr(binair); } if(asynch==1) bit_word = byte_send07; // display async format if(asynch==0) bit_word = synch_byte_send07; // display sync format Label37->Caption=""; for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { binair = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; Label37->Caption = Label37->Caption + IntToStr(binair); } if(asynch==1) bit_word = byte_send08; // display async format if(asynch==0) bit_word = synch_byte_send08; // display sync format Label38->Caption=""; for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { binair = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; Label38->Caption = Label38->Caption + IntToStr(binair); } if(asynch==1) bit_word = byte_send09; // display async format if(asynch==0) bit_word = synch_byte_send09; // display sync format Label39->Caption=""; for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { binair = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; Label39->Caption = Label39->Caption + IntToStr(binair); } if(asynch==1) bit_word = byte_send10; // display async format if(asynch==0) bit_word = synch_byte_send10; // display sync format Label40->Caption=""; for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { binair = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; Label40->Caption = Label40->Caption + IntToStr(binair); } // display received bytes in binary format if(RadioGroup1->ItemIndex==1) { if(asynch==1) bit_word = byte_received01; // display async format if(asynch==0) bit_word = synch_byte_received01; // display sync format Label51->Caption=""; for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { binair = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; Label51->Caption = Label51->Caption + IntToStr(binair); } if(asynch==1) bit_word = byte_received02; // display async format if(asynch==0) bit_word = synch_byte_received02; // display sync format Label52->Caption=""; for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { binair = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; Label52->Caption = Label52->Caption + IntToStr(binair); } if(asynch==1) bit_word = byte_received03; // display async format if(asynch==0) bit_word = synch_byte_received03; // display sync format Label53->Caption=""; for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { binair = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; Label53->Caption = Label53->Caption + IntToStr(binair); } if(asynch==1) bit_word = byte_received04; // display async format if(asynch==0) bit_word = synch_byte_received04; // display sync format Label54->Caption=""; for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { binair = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; Label54->Caption = Label54->Caption + IntToStr(binair); } if(asynch==1) bit_word = byte_received05; // display async format if(asynch==0) bit_word = synch_byte_received05; // display sync format Label55->Caption=""; for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { binair = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; Label55->Caption = Label55->Caption + IntToStr(binair); } if(asynch==1) bit_word = byte_received06; // display async format if(asynch==0) bit_word = synch_byte_received06; // display async format Label56->Caption=""; for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { binair = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; Label56->Caption = Label56->Caption + IntToStr(binair); } if(asynch==1) bit_word = byte_received07; // display async format if(asynch==0) bit_word = synch_byte_received07; // display sync format Label57->Caption=""; for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { binair = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; Label57->Caption = Label57->Caption + IntToStr(binair); } if(asynch==1) bit_word = byte_received08; // display async format if(asynch==0) bit_word = synch_byte_received08; // display sync format Label58->Caption=""; for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { binair = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; Label58->Caption = Label58->Caption + IntToStr(binair); } if(asynch==1) bit_word = byte_received09; // display async format if(asynch==0) bit_word = synch_byte_received09; // display sync format Label59->Caption=""; for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { binair = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; Label59->Caption = Label59->Caption + IntToStr(binair); } if(asynch==1) bit_word = byte_received10; // display async format if(asynch==0) bit_word = synch_byte_received10; // display sync format Label60->Caption=""; for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { binair = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; Label60->Caption = Label60->Caption + IntToStr(binair); } } } // correct description of the TX and RX bytes in case of sync/async if(asynch==1) { Label21->Caption = "Byte 01 :"; Label22->Caption = "Byte 02 :"; } if(asynch==0) { Label21->Caption = "NoData :"; // when sync there the first two bytes are not used Label22->Caption = "NoData :"; // when sync there the first two bytes are not used } } //--------------------------------------------------------------------------- void __fastcall TForm2::PCPCSimulation1Click(TObject *Sender) { PCPCSimulation1->Checked = !PCPCSimulation1->Checked; StatusBar->Panels->Items[8]->Text = "Simulation selection"; } //--------------------------------------------------------------------------- void __fastcall TForm2::LoopRXData1Click(TObject *Sender) { LoopRXData1->Checked = !LoopRXData1->Checked; HoldRXData1->Checked = !LoopRXData1->Checked; StatusBar->Panels->Items[8]->Text = "Loop RX selected"; } //--------------------------------------------------------------------------- void __fastcall TForm2::HoldRXData1Click(TObject *Sender) { HoldRXData1->Checked = !HoldRXData1->Checked; LoopRXData1->Checked = !HoldRXData1->Checked; StatusBar->Panels->Items[8]->Text = "Hold RX selected"; } //--------------------------------------------------------------------------- void __fastcall TForm2::Timer4Timer(TObject *Sender) { // locked tuning up and down if(LockUp==true) { // locked up tuning UpTuning(); // timed tuning up TotalSendFreq(); // calculate total freq } if(LockDwn==true) { // locked down tuning DownTuning(); // timed tuning down TotalSendFreq(); // calculate total freq } if(LockUp || LockDwn) { OutOfRangeCheck(); } } //--------------------------------------------------------------------------- void __fastcall TForm2::Timer5Timer(TObject *Sender) { overlay_trigger = true; Timer6->Enabled = true; Timer5->Enabled = false; } //--------------------------------------------------------------------------- void __fastcall TForm2::Timer6Timer(TObject *Sender) { overlay_trigger = false; Timer5->Enabled = true; Timer6->Enabled = false; } //--------------------------------------------------------------------------- void __fastcall TForm2::CommandMode1Click(TObject *Sender) { RadioGroup1->ItemIndex = 0; CheckBox2->Checked = true; StatusBar->Panels->Items[8]->Text = "Set to command"; Activation->On=true; } //--------------------------------------------------------------------------- void __fastcall TForm2::MonitorMode1Click(TObject *Sender) { RadioGroup1->ItemIndex = 1; CheckBox2->Checked = true; StatusBar->Panels->Items[8]->Text = "Set to monitor"; Activation->On=true; } //--------------------------------------------------------------------------- void __fastcall TForm2::Synchronize1Click(TObject *Sender) { ComPort->ClearInput(); ComPort->ClearOutput(); StatusBar->Panels->Items[8]->Text = "Synchronized..."; } //--------------------------------------------------------------------------- void __fastcall TForm2::Data1Click(TObject *Sender) { Form5= new TForm5(Application); Form5->ShowModal(); delete Form5; } //--------------------------------------------------------------------------- void __fastcall TForm2::ActivationClick(TObject *Sender) { ComPort->DeviceName = ComboBoxDeviceName->Text; ComPort->BaudRate = TBaudRate(ComboBoxBaudRate->ItemIndex); ComPort->DataBits = TDataBits(ComboBoxDataBits->ItemIndex); ComPort->StopBits = TStopBits(ComboBoxStopBits->ItemIndex); ComPort->Parity = TParity(ComboBoxParity->ItemIndex); ComPort->Active = !ComPort->Active; act = !act; if(DTR==true) { DTR = false; ForceDTRON1->Checked = false; ForceDTROFF1->Checked = false; } if(RTS==true) { RTS = false; ForceRTSON1->Checked = false; ForceRTSOFF1->Checked = false; } if(Activation->On == true) { CheckBox2->Checked = true; CheckBox2->Enabled = true; } if( Activation->On == false) { CheckBox2->Checked = false; CheckBox2->Enabled = false; } // if (ComPort->Active) // Activation->Caption = "CLOSE COMMUNICATION"; // else // Button8->Caption = "OPEN COMMUNICATION"; // Button2->Enabled = ComPort->Active; ComboBoxDeviceName->Enabled = !ComPort->Active; ComboBoxBaudRate->Enabled = !ComPort->Active; ComboBoxDataBits->Enabled = !ComPort->Active; ComboBoxStopBits->Enabled = !ComPort->Active; ComboBoxParity->Enabled = !ComPort->Active; SetModemStatus(); } //--------------------------------------------------------------------------- void __fastcall TForm2::N15MHz1Click(TObject *Sender) { LockStop(); send_tunedfreq10Hz = 0; send_tunedfreq100Hz = 0; send_tunedfreq1kHz = 0; send_tunedfreq10kHz = 0; send_tunedfreq100kHz = 5; send_tunedfreq1MHz = 1; send_tunedfreq10MHz = 0; TotalSendFreq(); Label17->Caption = IntToStr(totalfreq_write); OutOfRangeCheck(); MaskEdit2->Text = Label17->Caption; StatusBar->Panels->Items[8]->Text = "Set to 1.5 MHz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N2MHz1Click(TObject *Sender) { LockStop(); send_tunedfreq10Hz = 0; send_tunedfreq100Hz = 0; send_tunedfreq1kHz = 0; send_tunedfreq10kHz = 0; send_tunedfreq100kHz = 0; send_tunedfreq1MHz = 2; send_tunedfreq10MHz = 0; TotalSendFreq(); Label17->Caption = IntToStr(totalfreq_write); OutOfRangeCheck(); MaskEdit2->Text = Label17->Caption; StatusBar->Panels->Items[8]->Text = "Set to 2 MHz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N5MHz1Click(TObject *Sender) { LockStop(); send_tunedfreq10Hz = 0; send_tunedfreq100Hz = 0; send_tunedfreq1kHz = 0; send_tunedfreq10kHz = 0; send_tunedfreq100kHz = 0; send_tunedfreq1MHz = 5; send_tunedfreq10MHz = 0; TotalSendFreq(); Label17->Caption = IntToStr(totalfreq_write); OutOfRangeCheck(); MaskEdit2->Text = Label17->Caption; StatusBar->Panels->Items[8]->Text = "Set to 5 MHz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N20MHz1Click(TObject *Sender) { LockStop(); send_tunedfreq10Hz = 0; send_tunedfreq100Hz = 0; send_tunedfreq1kHz = 0; send_tunedfreq10kHz = 0; send_tunedfreq100kHz = 0; send_tunedfreq1MHz = 0; send_tunedfreq10MHz = 2; TotalSendFreq(); Label17->Caption = IntToStr(totalfreq_write); OutOfRangeCheck(); MaskEdit2->Text = Label17->Caption; StatusBar->Panels->Items[8]->Text = "Set to 20 MHz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::N30MHz1Click(TObject *Sender) { LockStop(); send_tunedfreq10Hz = 0; send_tunedfreq100Hz = 0; send_tunedfreq1kHz = 0; send_tunedfreq10kHz = 0; send_tunedfreq100kHz = 0; send_tunedfreq1MHz = 0; send_tunedfreq10MHz = 3; TotalSendFreq(); Label17->Caption = IntToStr(totalfreq_write); OutOfRangeCheck(); MaskEdit2->Text = Label17->Caption; StatusBar->Panels->Items[8]->Text = "Set to 30 MHz"; } //--------------------------------------------------------------------------- void __fastcall TForm2::PerformLAMPTESTClick(TObject *Sender) { Form2->Cursor = crHourGlass; Timer8->Enabled = true; StatusBar->Panels->Items[8]->Text = "Lamp test"; RadioGroup1->ItemIndex = -1; // unselect command or monitor mode Setup1->Enabled=false; QUAD81->Enabled=false; CheckBox2->Checked = true; Activation->On=true; ComPort->DeviceName = ComboBoxDeviceName->Text; ComPort->BaudRate = TBaudRate(ComboBoxBaudRate->ItemIndex); ComPort->DataBits = TDataBits(ComboBoxDataBits->ItemIndex); ComPort->StopBits = TStopBits(ComboBoxStopBits->ItemIndex); ComPort->Parity = TParity(ComboBoxParity->ItemIndex); ComPort->Active = true; act = true; ComboBoxDeviceName->Enabled = !ComPort->Active; ComboBoxBaudRate->Enabled = !ComPort->Active; ComboBoxDataBits->Enabled = !ComPort->Active; ComboBoxStopBits->Enabled = !ComPort->Active; ComboBoxParity->Enabled = !ComPort->Active; ComPort->WriteChar(0); ComPort->WriteChar(0); ComPort->WriteChar(0); ComPort->WriteChar(0); ComPort->WriteChar(0); ComPort->WriteChar(0); ComPort->WriteChar(0); ComPort->WriteChar(0); ComPort->WriteChar(lamptest); PerformLAMPTEST->Enabled=true; Form2->Cursor = crDefault; } //--------------------------------------------------------------------------- void __fastcall TForm2::Timer7Timer(TObject *Sender) { // triggers a read request every x seconds read_request = true; } //--------------------------------------------------------------------------- void __fastcall TForm2::Timer8Timer(TObject *Sender) { // timer to allow only every 8 seconds a LAMPTEST // disables the setup and quad 8 pulldownmenu's Setup1->Enabled=true; QUAD81->Enabled=true; Timer8->Enabled = true; } //--------------------------------------------------------------------------- void __fastcall TForm2::TTLDataBlockWaveAnalyzer1Click(TObject *Sender) { Form8 = new TForm8(Application); Form8->Show(); } //--------------------------------------------------------------------------- void __fastcall TForm2::Timer9Timer(TObject *Sender) { FILE *ttl; FILE *mon; int bin =0; ttl = fopen("BLOCK.TTL", "w+"); if(asynch==0) // if(asynch==0 && RadioGroup1->ItemIndex==1) { mon = fopen("MON.TTL","w+"); fprintf(mon,"%d\n", totalfreq_write); fprintf(mon,"%d\n", send_bfo_frequency*send_signBFO); fprintf(mon,"%d\n", RadioGroup3->ItemIndex); fprintf(mon,"%d\n", RadioGroup4->ItemIndex); fprintf(mon,"%d\n", RadioGroup5->ItemIndex); fprintf(mon,"%d\n",CheckBox1->Checked); fprintf(mon,"%d\n",TrackBar3->Position); fprintf(mon,"%d\n",ProgressBar1->Position); fclose(mon); } // fseek(stream, 0L, SEEK_SET); if(asynch==0 && RadioGroup1->ItemIndex==0) bit_word = synch_byte_send03; // display sync format if(asynch==0 && RadioGroup1->ItemIndex==1) bit_word = synch_byte_received03; // display sync format for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { bin = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; fprintf(ttl, "%d\n",bin); } if(asynch==0 && RadioGroup1->ItemIndex==0) bit_word = synch_byte_send04; // display sync format if(asynch==0 && RadioGroup1->ItemIndex==1) bit_word = synch_byte_received04; // display sync format for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { bin = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; fprintf(ttl, "%d\n",bin); } if(asynch==0 && RadioGroup1->ItemIndex==0) bit_word = synch_byte_send05; // display sync format if(asynch==0 && RadioGroup1->ItemIndex==1) bit_word = synch_byte_received05; // display sync format for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { bin = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; fprintf(ttl, "%d\n",bin); } if(asynch==0 && RadioGroup1->ItemIndex==0) bit_word = synch_byte_send06; // display sync format if(asynch==0 && RadioGroup1->ItemIndex==1) bit_word = synch_byte_received06; // display sync format for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { bin = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; fprintf(ttl, "%d\n",bin); } if(asynch==0 && RadioGroup1->ItemIndex==0) bit_word = synch_byte_send07; // display sync format if(asynch==0 && RadioGroup1->ItemIndex==1) bit_word = synch_byte_received07; // display sync format for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { bin = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; fprintf(ttl, "%d\n",bin); } if(asynch==0 && RadioGroup1->ItemIndex==0) bit_word = synch_byte_send08; // display sync format if(asynch==0 && RadioGroup1->ItemIndex==1) bit_word = synch_byte_received08; // display sync format for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { bin = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; fprintf(ttl, "%d\n",bin); } if(asynch==0 && RadioGroup1->ItemIndex==0) bit_word = synch_byte_send09; // display sync format if(asynch==0 && RadioGroup1->ItemIndex==1) bit_word = synch_byte_received09; // display sync format for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { bin = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; fprintf(ttl, "%d\n",bin); } if(asynch==0 && RadioGroup1->ItemIndex==0) bit_word = synch_byte_send10; // display sync format if(asynch==0 && RadioGroup1->ItemIndex==1) bit_word = synch_byte_received10; // display sync format for( bit_counter = 7; bit_counter > -1; bit_counter-- ) { bin = (bit_word & 1 << bit_counter) > 0 ? 1 : 0; fprintf(ttl, "%d\n",bin); } fprintf(ttl,"%d\n",RadioGroup1->ItemIndex); fclose(ttl); } //--------------------------------------------------------------------------- void __fastcall TForm2::MONITOR1Click(TObject *Sender) { Form9 = new TForm9(Application); Form9->Show(); } //--------------------------------------------------------------------------- void __fastcall TForm2::ComPortRxFlag(TObject *Sender) { Button2->Caption="Hallo"; } //---------------------------------------------------------------------------