public override MicrowaveCapabilities GetCapabilities() { MicrowaveCapabilities c = new MicrowaveCapabilities(); c.MaximumFrequency = 2500000000; c.MinimumFrequency = 1700000000; c.FrequencyResolution = 1000000; c.ReceivedCarrierLevelMaximum = 100; c.SupportedBandwidth = new List <UInt64>(); c.SupportedBandwidth.Add(6000000); c.SupportedEncryption = null; c.SupportedForwardErrorCorrection = null; c.SupportedGuardIntervals = null; c.SupportedModulations = null; c.SupportedTransports = new List <Media.RFVideoStandard>(); c.SupportedTransports.Add(RFVideoStandard.NTSC); c.SupportedTransports.Add(RFVideoStandard.PAL); c.AutoTuning = new MicrowaveTuning(); c.AutoTuningRequirements = (int)MicrowaveTuning.Parameters.Frequency; c.SupportedTuningParameters = (int)MicrowaveTuning.Parameters.Frequency; c.SupportedLinkQualityParameters = (int)MicrowaveLinkQuality.Parameters.ReceivedCarrierLevel; return(c); }
/// <summary> /// Configures the control to display the capabilities needed /// </summary> /// <param name="caps"></param> public void Configure(MicrowaveCapabilities caps) { this.ChangingSelf = true; udFrequency.Minimum = caps.MinimumFrequency / (decimal)1000000.0; udFrequency.Maximum = caps.MaximumFrequency / (decimal)1000000.0; if (caps.IsSet(MicrowaveLinkQuality.Parameters.SignalToNoiseRatio)) { pbSNR.Visible = true; lblSNR.Visible = true; pbSNR.Minimum = 0; pbSNR.Maximum = (int)caps.SignalToNoiseRatioMaximum; } else { pbSNR.Visible = false; lblSNR.Visible = false; } if (caps.IsSet(MicrowaveLinkQuality.Parameters.ReceivedCarrierLevel)) { pbRSSI.Visible = true; lblRSSI.Visible = true; pbRSSI.Minimum = (int)caps.ReceivedCarrierLevelMinimum; pbRSSI.Maximum = (int)caps.ReceivedCarrierLevelMaximum; } else { pbRSSI.Visible = false; lblRSSI.Visible = false; } bool anyLEDSupported = false; foreach (KeyValuePair <MicrowaveLinkQuality.Parameters, Control> paramLED in ttBinding) { paramLED.Value.Enabled = caps.IsSet(paramLED.Key); if (caps.IsSet(paramLED.Key)) { anyLEDSupported = true; } } //if no LEDs are supported, and Encryption is not supported, then we have no use for the side bar if (anyLEDSupported && !caps.IsSet(MicrowaveTuning.Parameters.Encryption)) { pLEDs.Visible = false; } else { pLEDs.Visible = true; } ico_EncryptionActive.Visible = false; this.ChangingSelf = false; }
private void FireCapabilitiesChanged(MicrowaveCapabilities capabilities) { try { AppLogger.Message(" MicrowaveControlService2.FireCapabilitiesChanged"); clientCallback.CapabilitiesChanged(capabilities); } catch (Exception ex) { AppLogger.Dump(ex); } }
public void Configure(MicrowaveCapabilities caps) { udStartFreq.Minimum = caps.MinimumFrequency / 1000000; udStartFreq.Maximum = caps.MaximumFrequency / 1000000; udStartFreq.Value = caps.MinimumFrequency / 1000000; udStopFreq.Minimum = caps.MinimumFrequency / 1000000; udStopFreq.Maximum = caps.MaximumFrequency / 1000000; udStopFreq.Value = caps.MaximumFrequency / 1000000; this.udThreshold.Minimum = 0; this.udThreshold.Maximum = (int)(caps.ReceivedCarrierLevelMaximum); this.udThreshold.Value = (int)(0.2 * caps.ReceivedCarrierLevelMaximum); }
static void Main(string[] args) { try { Type implementation; string TCPAddress, ComPort; int TCPPort, baud; bool UsesTCP; SetupSession(args, out implementation, out TCPAddress, out TCPPort, out UsesTCP, out ComPort, out baud); using (MicrowaveReceiver rx = (MicrowaveReceiver)Activator.CreateInstance(implementation, TCPAddress, TCPPort, UsesTCP, ComPort, baud)) { if (rx.Connected) { Console.WriteLine("Ready. (type help? to see full command listing)"); Console.Write(" > "); string command = Console.ReadLine(); string[] set = command.Split(new char[] { ' ' }, 2); int stressRepeat = 1; int stressSuccess = 0; int stressFailure = 0; Stopwatch stopwatch = new Stopwatch(); UInt64 totalTime = 0; while (!set[0].Equals("quit")) { stressSuccess = 0; stressFailure = 0; totalTime = 0; for (int i = 0; i < stressRepeat; i++) { if ((set[0] == "stress") && (i > 0)) { break; } switch (set[0]) { case "help": case "help?": case "?": ShowHelp(); break; case "band?": Console.Out.WriteLine("Band: " + rx.GetBand()); break; case "freq?": try { stopwatch.Stop(); stopwatch.Reset(); stopwatch.Start(); MicrowaveTuning t = rx.GetTuning(); stopwatch.Stop(); Console.WriteLine("Current Tuning Information"); Console.WriteLine(" Frequency: " + t.Frequency + " Hz"); Console.WriteLine(" Bandwidth: " + t.ChannelBandwidth + " Hz"); Console.WriteLine(" Transport: " + t.TransportMode); Console.WriteLine(" Modulation: " + t.Modulation); Console.WriteLine(" FEC: " + t.ForwardErrorCorrection); Console.WriteLine(" Guard Int.: " + t.GuardInterval); Console.WriteLine(" Encryption: " + ((t.Encryption == null) ? "<null>" : (t.Encryption.Type + " " + t.Encryption.KeyLength + " bit"))); stressSuccess++; totalTime += (UInt64)stopwatch.ElapsedMilliseconds; } catch (Exception ex) { Console.WriteLine(ex.ToString()); stressFailure++; } break; case "str?": case "strength?": try { stopwatch.Stop(); stopwatch.Reset(); stopwatch.Start(); MicrowaveLinkQuality q = rx.GetLinkQuality(); stopwatch.Stop(); Console.WriteLine("Link Quality"); Console.WriteLine(" RCL: " + q.ReceivedCarrierLevel + " dB"); Console.WriteLine(" SNR: " + q.SignalToNoiseRatio + " dB"); Console.WriteLine(" Pre EC: " + q.BitErrorRatioPre); Console.WriteLine(" Post EC: " + q.BitErrorRatioPost); Console.WriteLine(" Tuner Lock: " + q.TunerLocked); Console.WriteLine(" Demod Lock: " + q.DemodulatorLocked); Console.WriteLine(" TS Lock: " + q.TransportStreamLocked); Console.WriteLine(" FEC Lock: " + q.FECLocked); Console.WriteLine("Decoder Lock: " + q.DecoderLocked); stressSuccess++; totalTime += (UInt64)stopwatch.ElapsedMilliseconds; } catch (Exception ex) { Console.WriteLine(ex.ToString()); stressFailure++; } break; //case "band": // MicrowaveReceiver.OperatingBand band = MicrowaveReceiver.OperatingBand.NotSet; // switch (set[1]) // { // case "S": band = MicrowaveReceiver.OperatingBand.S; // break; // case "L": band = MicrowaveReceiver.OperatingBand.L; // break; // case "C": band = MicrowaveReceiver.OperatingBand.C; // break; // case "X": band = MicrowaveReceiver.OperatingBand.X; // break; // default: band = MicrowaveReceiver.OperatingBand.NotSet; // break; // } // bool result = rx.SetBand(band); // Console.Out.WriteLine(result ? "Successful!" : "Failed!"); // break; case "freq": try { int freq = -1; if (int.TryParse(set[1], out freq)) { MicrowaveCapabilities caps = rx.GetCapabilities(); if (caps.AutoTuningRequirements != (int)MicrowaveTuning.Parameters.Frequency) { Console.WriteLine(" WARNING: not all AutoTune requirements met"); } rx.SetTuning(new MicrowaveTuning(caps.AutoTuning) { FrequencyMHz = (UInt64)freq }); Console.WriteLine("OK"); stressSuccess++; } } catch (Exception ex) { Console.WriteLine("Failure"); Console.WriteLine(ex.ToString()); stressFailure++; } break; case "test": Console.WriteLine("Test Connection: " + rx.TestConnection()); break; case "peak": Console.WriteLine("Not implemented"); break; case "stress": try { stressRepeat = int.Parse(set[1]); if (stressRepeat <= 1) { stressRepeat = 1; Console.WriteLine("Stress test mode OFF"); } else { Console.WriteLine("Commands will be executed " + stressRepeat + " times"); } } catch (Exception ex) { Console.WriteLine(ex); } break; case "stress?": if (stressRepeat <= 1) { Console.WriteLine("Stress test mode OFF"); } else { Console.WriteLine("Stress repeat = " + stressRepeat); } break; case "info?": Console.WriteLine(rx.GetDeviceInfo()); break; case "raw": Console.WriteLine(rx.RawCommand(set[1])); break; default: Console.WriteLine("-not a command-"); break; } } if (stressRepeat > 1) { Console.WriteLine(); Console.WriteLine(" -- Stress Test Results --"); Console.WriteLine(" " + stressSuccess + " / " + stressRepeat + " Succeeded"); Console.WriteLine(" " + stressFailure + " / " + stressRepeat + " Failed"); Console.WriteLine(" " + (UInt64)((double)totalTime / (double)stressSuccess) + " ms per successful operation (avg)"); } Console.Write(" > "); command = Console.ReadLine(); set = command.Split(new char[] { ' ' }); } } else { Console.Out.WriteLine("Not Connected"); Console.ReadLine(); } } } catch (Exception ex) { Console.WriteLine(""); Console.WriteLine("FAILTOWN"); Console.WriteLine(ex.ToString()); Console.WriteLine("press enter to quit"); Console.ReadLine(); } }
public void CapabilitiesChanged(MicrowaveCapabilities capabilities) { Debug.WriteLine(" MicrowaveControl2Callback.CapabilitiesChanged"); parent.Capabilities = capabilities; }
static Vislink_HDR1000() { _hardwareSupportedModes = new List <RFVideoStandard>(); _hardwareSupportedModes.Add(RFVideoStandard.SCM); _hardwareSupportedModes.Add(RFVideoStandard.DVB_T); _hardwareSupportedModes.Add(RFVideoStandard.LMST); _hardwareSupportedModes.Add(RFVideoStandard.SCM_QCD); _hardwareSupportedModes.Add(RFVideoStandard.DVB_ASI); MicrowaveCapabilities c = new MicrowaveCapabilities(); c.FrequencyResolution = 250000; c.MinimumFrequency = 4400000000; c.MaximumFrequency = 5000000000; c.ReceivedCarrierLevelMinimum = -80; c.ReceivedCarrierLevelMaximum = 0; c.SignalToNoiseRatioMaximum = 40; c.SupportedTransports = new List <RFVideoStandard>(); c.SupportedTransports.Add(RFVideoStandard.DVB_T); c.SupportedModulations = new List <RFModulationType>(); c.SupportedModulations.Add(RFModulationType.QPSK); c.SupportedModulations.Add(RFModulationType.QAM16); c.SupportedModulations.Add(RFModulationType.QAM32); c.SupportedModulations.Add(RFModulationType.QAM64); c.SupportedModulations.Add(RFModulationType.Auto); c.SupportedGuardIntervals = new List <Interval>(); c.SupportedGuardIntervals.Add(Interval._1_32); c.SupportedGuardIntervals.Add(Interval._1_16); c.SupportedGuardIntervals.Add(Interval._1_8); c.SupportedGuardIntervals.Add(Interval._1_4); c.SupportedGuardIntervals.Add(Interval._1_3); c.SupportedGuardIntervals.Add(Interval.Auto); c.SupportedBandwidth = new List <ulong>(); c.SupportedBandwidth.Add(6000000); // 6MHz c.SupportedBandwidth.Add(7000000); // 7MHz c.SupportedBandwidth.Add(8000000); // 8MHz c.SupportedBandwidth.Add(0); // auto c.SupportedForwardErrorCorrection = new List <Interval>(); c.SupportedForwardErrorCorrection.Add(Interval.Auto); c.SupportedForwardErrorCorrection.Add(Interval.Auto); //documentation says index1 is "RS only" not clear what that means c.SupportedForwardErrorCorrection.Add(Interval._1_2); c.SupportedForwardErrorCorrection.Add(Interval._2_3); c.SupportedForwardErrorCorrection.Add(Interval._3_4); c.SupportedForwardErrorCorrection.Add(Interval._5_6); c.SupportedForwardErrorCorrection.Add(Interval._7_8); c.SupportedEncryption = new EncryptionCapabilities(); c.SupportedEncryption.SupportedTypesAndKeyLengths = new Dictionary <EncryptionType, List <int> >(); c.SupportedEncryption.SupportedTypesAndKeyLengths.Add(EncryptionType.None, null); c.SupportedEncryption.SupportedTypesAndKeyLengths.Add(EncryptionType.AES_Legacy, new int[] { 128, 256 }.ToList()); // c.SupportedEncryption.SupportedTypesAndKeyLengths.Add(EncryptionType.AES_Bcrypt, new int[] { 128, 256 }.ToList()); //the BISS key lengths are derived from http://tech.ebu.ch/docs/tech/tech3292.pdf spec //48 bits are needed for the 12-character SW c.SupportedEncryption.SupportedTypesAndKeyLengths.Add(EncryptionType.BISS_1, new int[] { 48 }.ToList()); //128 bits are needed for the 16-character SW c.SupportedEncryption.SupportedTypesAndKeyLengths.Add(EncryptionType.BISS_E, new int[] { 64 }.ToList()); // c.SupportedEncryption.SupportedTypesAndKeyLengths.Add(EncryptionType.DES, new int[] { 56 }.ToList()); c.AutoTuning = new MicrowaveTuning(); c.AutoTuning.ChannelBandwidth = 0; c.AutoTuning.Encryption = null; c.AutoTuning.ForwardErrorCorrection = Interval.Auto; c.AutoTuning.Frequency = 0; c.AutoTuning.GuardInterval = Interval.Auto; c.AutoTuning.Interleaver = false; c.AutoTuning.Modulation = RFModulationType.Auto; c.AutoTuning.PacketDiversityControl = false; c.AutoTuning.SpectralInversion = true; c.AutoTuning.TransportMode = RFVideoStandard.DVB_T; c.SupportedTuningParameters = (int)(MicrowaveTuning.Parameters.Frequency | MicrowaveTuning.Parameters.ChannelBandwidth | MicrowaveTuning.Parameters.ForwardErrorCorrection | MicrowaveTuning.Parameters.GuardInterval | MicrowaveTuning.Parameters.Modulation | MicrowaveTuning.Parameters.TransportMode | MicrowaveTuning.Parameters.Encryption | MicrowaveTuning.Parameters.SpectralInversion); c.AutoTuningRequirements = (int)MicrowaveTuning.Parameters.Frequency; c.SupportedLinkQualityParameters = (int)(MicrowaveLinkQuality.Parameters.BitErrorRatioPost | MicrowaveLinkQuality.Parameters.BitErrorRatioPre | MicrowaveLinkQuality.Parameters.DecoderLocked | MicrowaveLinkQuality.Parameters.DemodulatorLocked | MicrowaveLinkQuality.Parameters.FECLocked | MicrowaveLinkQuality.Parameters.ReceivedCarrierLevel | MicrowaveLinkQuality.Parameters.SignalToNoiseRatio | MicrowaveLinkQuality.Parameters.TransportStreamLocked | MicrowaveLinkQuality.Parameters.TunerLocked); _capabilities = c; //terminator list for MicrowaveReceiver API ETX = new List <byte[]>(); ETX.Add(new byte[] { (byte)Terminator.End }); }
/// <summary> /// /// </summary> /// <param name="tcpAddress"></param> /// <param name="port"></param> /// <param name="useTCP"></param> /// <param name="comport"></param> /// <param name="baud">9600</param> public TestReciever(string tcpAddress, int port, bool useTCP, string comport, int baud) : base(tcpAddress, port, useTCP, comport, baud) { ReceiveTimeout = 10000; MicrowaveCapabilities c = new MicrowaveCapabilities(); c.FrequencyResolution = 250000; c.MinimumFrequency = 4400000000; c.MaximumFrequency = 5000000000; c.ReceivedCarrierLevelMinimum = -100; c.ReceivedCarrierLevelMaximum = 0; c.SignalToNoiseRatioMaximum = 40; c.SupportedTransports = new List <RFVideoStandard>(); c.SupportedTransports.Add(RFVideoStandard.DVB_T); c.SupportedModulations = new List <RFModulationType>(); c.SupportedModulations.Add(RFModulationType.QPSK); c.SupportedModulations.Add(RFModulationType.QAM16); c.SupportedModulations.Add(RFModulationType.QAM32); c.SupportedModulations.Add(RFModulationType.QAM64); c.SupportedModulations.Add(RFModulationType.Auto); c.SupportedGuardIntervals = new List <Interval>(); c.SupportedGuardIntervals.Add(Interval._1_32); c.SupportedGuardIntervals.Add(Interval._1_16); c.SupportedGuardIntervals.Add(Interval._1_8); c.SupportedGuardIntervals.Add(Interval._1_4); c.SupportedGuardIntervals.Add(Interval._1_3); c.SupportedGuardIntervals.Add(Interval.Auto); c.SupportedBandwidth = new List <ulong>(); c.SupportedBandwidth.Add(6000000); // 6MHz c.SupportedBandwidth.Add(7000000); // 7MHz c.SupportedBandwidth.Add(8000000); // 8MHz c.SupportedBandwidth.Add(0); // auto c.SupportedForwardErrorCorrection = new List <Interval>(); c.SupportedForwardErrorCorrection.Add(Interval.Auto); c.SupportedForwardErrorCorrection.Add(Interval.Auto); //documentation says index1 is "RS only" not clear what that means c.SupportedForwardErrorCorrection.Add(Interval._1_2); c.SupportedForwardErrorCorrection.Add(Interval._2_3); c.SupportedForwardErrorCorrection.Add(Interval._3_4); c.SupportedForwardErrorCorrection.Add(Interval._5_6); c.SupportedForwardErrorCorrection.Add(Interval._7_8); c.SupportedEncryption = new EncryptionCapabilities(); c.SupportedEncryption.SupportedTypesAndKeyLengths = new Dictionary <EncryptionType, List <int> >(); c.SupportedEncryption.SupportedTypesAndKeyLengths.Add(EncryptionType.None, null); c.SupportedEncryption.SupportedTypesAndKeyLengths.Add(EncryptionType.AES_Legacy, new int[] { 128, 256 }.ToList()); c.SupportedEncryption.SupportedTypesAndKeyLengths.Add(EncryptionType.AES_Bcrypt, new int[] { 128, 256 }.ToList()); //the BISS key lengths are derived from http://tech.ebu.ch/docs/tech/tech3292.pdf spec c.SupportedEncryption.SupportedTypesAndKeyLengths.Add(EncryptionType.BISS_1, new int[] { 48 }.ToList()); c.SupportedEncryption.SupportedTypesAndKeyLengths.Add(EncryptionType.BISS_E, new int[] { 64 }.ToList()); c.SupportedEncryption.SupportedTypesAndKeyLengths.Add(EncryptionType.DES, new int[] { 56 }.ToList()); c.AutoTuning = new MicrowaveTuning(); c.AutoTuning.ChannelBandwidth = 0; c.AutoTuning.Encryption = null; c.AutoTuning.ForwardErrorCorrection = Interval.Auto; c.AutoTuning.Frequency = 0; c.AutoTuning.GuardInterval = Interval.Auto; c.AutoTuning.Interleaver = false; c.AutoTuning.Modulation = RFModulationType.Auto; c.AutoTuning.PacketDiversityControl = false; c.AutoTuning.SpectralInversion = false; c.AutoTuning.TransportMode = RFVideoStandard.DVB_T; c.SupportedTuningParameters = (int)(MicrowaveTuning.Parameters.Frequency | MicrowaveTuning.Parameters.ChannelBandwidth | MicrowaveTuning.Parameters.ForwardErrorCorrection | MicrowaveTuning.Parameters.GuardInterval | MicrowaveTuning.Parameters.Modulation | MicrowaveTuning.Parameters.TransportMode | MicrowaveTuning.Parameters.Encryption | MicrowaveTuning.Parameters.SpectralInversion); c.AutoTuningRequirements = (int)MicrowaveTuning.Parameters.Frequency; c.SupportedLinkQualityParameters = (int)(MicrowaveLinkQuality.Parameters.BitErrorRatioPost | MicrowaveLinkQuality.Parameters.BitErrorRatioPre | MicrowaveLinkQuality.Parameters.DecoderLocked | MicrowaveLinkQuality.Parameters.DemodulatorLocked | MicrowaveLinkQuality.Parameters.FECLocked | MicrowaveLinkQuality.Parameters.ReceivedCarrierLevel | MicrowaveLinkQuality.Parameters.SignalToNoiseRatio | MicrowaveLinkQuality.Parameters.TransportStreamLocked | MicrowaveLinkQuality.Parameters.TunerLocked); _capabilities = c; MicrowaveTuning t = new MicrowaveTuning(); t.ChannelBandwidth = c.SupportedBandwidth[0]; t.Encryption = new EncryptionInfo(); t.Encryption.Type = EncryptionType.None; t.ForwardErrorCorrection = c.SupportedForwardErrorCorrection[0]; t.Frequency = c.MinimumFrequency; t.GuardInterval = c.SupportedGuardIntervals[0]; t.Interleaver = false; t.Modulation = c.SupportedModulations[0]; t.PacketDiversityControl = false; t.SpectralInversion = false; t.TransportMode = c.SupportedTransports[0]; t.ValidParameterData = (int)MicrowaveTuning.Parameters.ALL; _tuning = t; MicrowaveLinkQuality lq = new MicrowaveLinkQuality(); lq.BitErrorRatioPost = 0; lq.BitErrorRatioPre = 0.01; lq.DecoderLocked = true; lq.DemodulatorLocked = true; lq.FECLocked = true; lq.ReceivedCarrierLevel = -47; lq.SignalToNoiseRatio = 25; lq.TransportStreamLocked = true; lq.TunerLocked = true; lq.ValidParameterData = (int)MicrowaveLinkQuality.Parameters.ALL; _linkQuality = lq; }