public FiberType(string name, int startstep, int stepsize, IECSpec IECSpec = null) { if (IECSpec == null) { SpecToApply = IECSpec.Defualt(); } Name = name; StepSize = stepsize; StartStep = startstep; }
public void Refresh() { FiberTypes = new List <FiberType> { new FiberType("Default", 40, 40), new FiberType("MPO", 75, 40), new FiberType("2.5 MM", 40, 40), new FiberType("1.25 MM", 40, 40), new FiberType("E2000", 40, 40), new FiberType("OptiTap", -50, -25) }; Console.WriteLine("IECSpecs Not Null"); IECSpecs = new List <IECSpec> { IECSpec.Defualt(), new IECSpec(100, 5, 10, 0, 45, 55, 40, 50, 27, 30, 2, "APC SM RL≥45 DB"), new IECSpec(100, 5, 10, 2, 45, 55, 40, 50, 27, 30, 2, "PC SM RL≥26 DB"), new IECSpec(100, 4, 10, 0, 45, 55, 40, 50, 27, 30, 2, "PC MultiMode") }; DictionaryOfColorCodes = FileSave.GetColorCodes(); try { DictionaryOfColorCodes.Add("None", new ColorCode(new List <string>(), new List <string>(), new List <string>(), new List <string>(), "None")); } catch { } ListOfReadings = new List <Reading>(); ListOfInspections = new List <InspectionSaveData>(); DictionaryOfOptions = new Dictionary <string, string>(); MiscStorage = new Dictionary <string, int>(); try { string JsonData = GetData(); if (!string.IsNullOrWhiteSpace(JsonData)) { string[] JsonArray = JsonData.Split(new string[] { "|||" }, StringSplitOptions.None); ListOfReadings = JsonConvert.DeserializeObject <List <Reading> >(JsonArray[1]); DictionaryOfOptions = JsonConvert.DeserializeObject <Dictionary <string, string> >(JsonArray[2]); MiscStorage = JsonConvert.DeserializeObject <Dictionary <string, int> >(JsonArray[3]); ListOfInspections = JsonConvert.DeserializeObject <List <InspectionSaveData> >(JsonArray[0]); if (UsesImages) { foreach (InspectionSaveData inspection in ListOfInspections) { try { inspection.Image = FileSave.SKImageFromFile(inspection.FileSaveName); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } } } if (ListOfInspections == null) { ListOfInspections = new List <InspectionSaveData>(); } if (ListOfReadings == null) { ListOfReadings = new List <Reading>(); } if (DictionaryOfOptions == null) { DictionaryOfOptions = new Dictionary <string, string>(); } if (MiscStorage == null) { MiscStorage = new Dictionary <string, int>(); } } } catch { } }