public void enableROTOR() { if (console.ROTORPort == 0) return; lock ( this ) { if ( rotor_enabled ) return; // nothing to do already enabled rotor_enabled = true; } int port_num = console.ROTORPort; Debug.WriteLine("==============ROTOR PORT OPEN: " +port_num); SIO = new SDRSerialPort(port_num); /* SIO.setCommParms(console.CATBaudRate, console.CATParity, console.CATDataBits, console.CATStopBits, console.CATHandshake); */ SIO.setCommParms(9600, // ant rotor port is always 9600 console.CATParity, console.CATDataBits, console.CATStopBits, console.CATHandshake); Initialize(); }
public void enableCAT() { lock ( this ) { if ( cat_enabled ) return; // nothing to do already enabled cat_enabled = true; } int port_num = console.CATPort; SIO = new SDRSerialPort(port_num); SIO.setCommParms(console.CATBaudRate, console.CATParity, console.CATDataBits, console.CATStopBits, console.CATHandshake); Initialize(); }
// private void SIOMonitor_Elapsed(object sender, System.Timers.ElapsedEventArgs e) // { // if(!console.MOX) // { // SIOMonitorCount++; // increments the counter when in receive // Debug.WriteLine("SIOMonitorCount: "+SIOMonitorCount.ToString()); // if(SIOMonitorCount < 12) // if the counter is less than 12 (60 seconds),reinitialize the serial port // { // Debug.WriteLine("The SIO Timer has elapsed"); // if(!SIO.PortIsOpen) // { // Debug.WriteLine("The port is closed"); // SIO.OpenPort = true; // StreamWriter sw = new StreamWriter("SIOTestLog.txt", true); // sw.WriteLine("The serial port was forced open"); // sw.WriteLine("Time: "+DateTime.Now.ToString()); // sw.Flush(); // sw.Close(); // SIOMonitor.Enabled = true; // SIOMonitorCount = 0; // Fpass = true; // disableCAT(); // enableCAT(); // } // //Initialize(); // } // else // consider the remote program on the serial port as being shut down // { // if(SIO.PortIsOpen) // { // port_status = "open"; // } // else // { // // port_status = "closed"; // } // // // SIOMonitorCount = 0; // disableCAT(); // enableCAT(); // // SIOMonitor.Stop(); // } // } // else // SIOMonitorCount = 0; // } public void enableCAT() { lock (this) { if (cat_enabled) { return; // nothing to do already enabled } cat_enabled = true; } int port_num = console.CATPort; SIO = new SDRSerialPort(port_num); SIO.setCommParms(console.CATBaudRate, console.CATParity, console.CATDataBits, console.CATStopBits); Initialize(); }
// private void SIOMonitor_Elapsed(object sender, System.Timers.ElapsedEventArgs e) // { // if(!console.MOX) // { // SIOMonitorCount++; // increments the counter when in receive // Debug.WriteLine("SIOMonitorCount: "+SIOMonitorCount.ToString()); // if(SIOMonitorCount < 12) // if the counter is less than 12 (60 seconds),reinitialize the serial port // { // Debug.WriteLine("The SIO Timer has elapsed"); // if(!SIO.PortIsOpen) // { // Debug.WriteLine("The port is closed"); // SIO.OpenPort = true; // StreamWriter sw = new StreamWriter("SIOTestLog.txt", true); // sw.WriteLine("The serial port was forced open"); // sw.WriteLine("Time: "+DateTime.Now.ToString()); // sw.Flush(); // sw.Close(); // SIOMonitor.Enabled = true; // SIOMonitorCount = 0; // Fpass = true; // disableCAT(); // enableCAT(); // } // //Initialize(); // } // else // consider the remote program on the serial port as being shut down // { // if(SIO.PortIsOpen) // { // port_status = "open"; // } // else // { // // port_status = "closed"; // } // // // SIOMonitorCount = 0; // disableCAT(); // enableCAT(); // // SIOMonitor.Stop(); // } // } // else // SIOMonitorCount = 0; // } public void enableCAT() { lock (this) { if (cat_enabled) { return; // nothing to do already enabled } cat_enabled = true; } Debug.WriteLine("==============CAT PORT OPEN"); int port_num = console.CATPort; SIO = new SDRSerialPort(port_num); SIO.setCommParms(console.CATBaudRate, console.CATParity, console.CATDataBits, console.CATStopBits, console.CATHandshake); Initialize(); }