static T24 ParsingT24(string sBit) { T24 stt = new T24(); stt.type = Convert.ToUInt16(bin2int(sBit.Substring(0, 6))); stt.repeat = Convert.ToUInt16(bin2int(sBit.Substring(6, 2))); stt.mmsi = Convert.ToUInt32(bin2int(sBit.Substring(8, 30))); stt.partno = Convert.ToUInt16(bin2int(sBit.Substring(38, 2))); if (stt.partno == 0) { stt.vessel_a = str6bit(sBit.Substring(40, 120)); } else { stt.shiptype_b = Convert.ToUInt16(bin2int(sBit.Substring(40, 8))); stt.vendorid_b = str6bit(sBit.Substring(48, 18)); stt.model_b = Convert.ToUInt16(bin2int(sBit.Substring(66, 4))); stt.serial_b = Convert.ToUInt32(bin2int(sBit.Substring(70, 20))); stt.callsign_b = str6bit(sBit.Substring(90, 42)); stt.bow_b = Convert.ToUInt16(bin2int(sBit.Substring(132, 9))); stt.stern_b = Convert.ToUInt16(bin2int(sBit.Substring(141, 9))); stt.port_b = Convert.ToUInt16(bin2int(sBit.Substring(150, 6))); stt.starboard_b = Convert.ToUInt16(bin2int(sBit.Substring(156, 6))); stt.m_mmsi_b = Convert.ToUInt32(bin2int(sBit.Substring(132, 30))); } #if DISP_DEBUG Console.WriteLine("tip: {0}", stt.type); Console.WriteLine("rep: {0}", stt.repeat); Console.WriteLine("mss: {0}", stt.mmsi); Console.WriteLine("pno: {0}", stt.partno); if (stt.partno == 0) { Console.WriteLine("mon: {0}", stt.vessel_a); } else { Console.WriteLine("shp: {0}", stt.shiptype_b); Console.WriteLine("ven: {0}", stt.vendorid_b); Console.WriteLine("mod: {0}", stt.model_b); Console.WriteLine("ser: {0}", stt.serial_b); Console.WriteLine("cal: {0}", stt.callsign_b); Console.WriteLine("bow: {0}", stt.bow_b); Console.WriteLine("ste: {0}", stt.stern_b); Console.WriteLine("por: {0}", stt.port_b); Console.WriteLine("sta: {0}", stt.starboard_b); Console.WriteLine("mmm: {0}", stt.m_mmsi_b); } #endif return(stt); }
private void StageRev(int page) { WagoIO.Instance.SetListTC(lst, page); T1.StageRev("АВАРИЯ^НОСИТЕЛЯ", new SolidColorBrush(Colors.Red), new SolidColorBrush(Colors.Silver)); T2.StageRev("", new SolidColorBrush(Colors.Red), new SolidColorBrush(Colors.Silver)); T3.StageRev("Р по^ПАДАЕТ", new SolidColorBrush(Colors.Red), new SolidColorBrush(Colors.Silver)); T4.StageRev("СРАБОТАЛ^ТД", new SolidColorBrush(Colors.Red), new SolidColorBrush(Colors.Silver)); T5.StageRev("", new SolidColorBrush(Colors.Red), new SolidColorBrush(Colors.Silver)); T6.StageRev("ОТКАЗ^БВС", new SolidColorBrush(Colors.Red), new SolidColorBrush(Colors.Silver)); T7.StageRev("Pса^ПАДАЕТ", new SolidColorBrush(Colors.Red), new SolidColorBrush(Colors.Silver)); T8.StageRev("РАЗГЕРМ^СА", new SolidColorBrush(Colors.Red), new SolidColorBrush(Colors.Silver)); T9.StageRev("РАЗГЕРМ^КЖО", new SolidColorBrush(Colors.Red), new SolidColorBrush(Colors.Silver)); T10.StageRev("Р400^мм рт ст", new SolidColorBrush(Colors.Red), new SolidColorBrush(Colors.Silver)); T11.StageRev("СОСТАВ^ВОЗДУХА", new SolidColorBrush(Colors.Red), new SolidColorBrush(Colors.Silver)); T12.StageRev("РАЗГЕРМ^КНР", new SolidColorBrush(Colors.Red), new SolidColorBrush(Colors.Silver)); T13.StageRev("PАЗГЕРМ^ПОДГОТ", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T14.StageRev("РАЗДЕЛЕН^по ГЦ", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T15.StageRev("ОТКРЫТ^КСД БО", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T16.StageRev("АВАРИЯ^ЦВМ", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T17.StageRev("ПРОГР^РАЗДЕЛЕН", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T18.StageRev("ТД^ПОДКЛ", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T19.StageRev("ПРИЗНАК^СПУСК", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T20.StageRev("СГ^РАЗАРР", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T21.StageRev("РАБОТА^ДПО", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T22.StageRev("СПУСК^ПО ГЦ", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T23.StageRev("ВЫБОР^ДПО", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T24.StageRev("РАБОТА^СКД", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); Block1 = "TC-1"; Block2 = "TC-2"; Block3 = "TC-3"; Block4 = "TC-4"; if (page == 2) { T1.StageRev("БС", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T2.StageRev("БСР", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T3.StageRev("закрутка^СА", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T4.StageRev("ВЫЗОВ НА^СВЯЗЬ", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T5.StageRev("разреш^РРСТ", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T6.StageRev("U мало", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T7.StageRev("ввод^ЗСП", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T8.StageRev("отказ^очист СА", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T9.StageRev("ПОСАДКА", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T10.StageRev("РБ^подкл", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T11.StageRev("отказ^очист БО", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T12.StageRev("останов^КС-020", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T13.StageRev("БВC^готов", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T14.StageRev("ОСК", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T15.StageRev("ГСО", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T16.StageRev("2 СЕКЦИЯ^НАДДУВА", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T17.StageRev("2 СЕКЦИЯ^КДУ", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T18.StageRev("СА-БО^люк откр", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T19.StageRev("РО АК", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T20.StageRev("ввод^ОСП", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T21.StageRev("подача^O2", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T22.StageRev("РУД", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T23.StageRev("УКВ^передача", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T24.StageRev("МЕХАН^СОЕДИН", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); Block1 = "TC-5"; Block2 = "TC-6"; Block3 = "TC-7"; Block4 = "TC-8"; } }
static bool Do24(T24 t) { Nullable<T24> n = new Nullable<T24>(t); return Ensure(n.HasValue && n.Value == t); }