private static void ParseNeedleElementNode(XElement parent, out PanelElement element) { double[] location = ((string)parent.Element("Location")).Split(',').Select(double.Parse).ToArray(); double[] origin = ((string)parent.Element("Origin")).Split(',').Select(double.Parse).ToArray(); element = new NeedleElement { LocationX = location[0], LocationY = location[1], Layer = (int)parent.Element("Layer"), Subject = ParseSubjectNode(parent.Element("Subject")), DaytimeImage = (string)parent.Element("DaytimeImage"), NighttimeImage = (string)parent.Element("NighttimeImage"), TransparentColor = Color24.ParseHexColor((string)parent.Element("TransparentColor")), DefinedRadius = (bool)parent.Element("DefinedRadius"), Radius = (double)parent.Element("Radius"), Color = Color24.ParseHexColor((string)parent.Element("Color")), DefinedOrigin = (bool)parent.Element("DefinedOrigin"), OriginX = origin[0], OriginY = origin[1], InitialAngle = (double)parent.Element("InitialAngle"), LastAngle = (double)parent.Element("LastAngle"), Minimum = (double)parent.Element("Minimum"), Maximum = (double)parent.Element("Maximum"), DefinedNaturalFreq = (bool)parent.Element("DefinedNaturalFreq"), NaturalFreq = (double)parent.Element("NaturalFreq"), DefinedDampingRatio = (bool)parent.Element("DefinedDampingRatio"), DampingRatio = (double)parent.Element("DampingRatio"), Backstop = (bool)parent.Element("Backstop"), Smoothed = (bool)parent.Element("Smoothed") }; }
private static void ParseTimetableElementNode(XElement parent, out PanelElement element) { double[] location = ((string)parent.Element("Location")).Split(',').Select(double.Parse).ToArray(); element = new TimetableElement { LocationX = location[0], LocationY = location[1], Layer = (int)parent.Element("Layer"), Width = (double)parent.Element("Width"), Height = (double)parent.Element("Height"), TransparentColor = Color24.ParseHexColor((string)parent.Element("TransparentColor")) }; }
private static void ParsePilotLampElementNode(XElement parent, out PanelElement element) { double[] location = ((string)parent.Element("Location")).Split(',').Select(double.Parse).ToArray(); element = new Models.Panels.PilotLampElement { LocationX = location[0], LocationY = location[1], Layer = (int)parent.Element("Layer"), Subject = ParseSubjectNode(parent.Element("Subject")), DaytimeImage = (string)parent.Element("DaytimeImage"), NighttimeImage = (string)parent.Element("NighttimeImage"), TransparentColor = Color24.ParseHexColor((string)parent.Element("TransparentColor")) }; }
private static void ParseDigitalGaugeElementNode(XElement parent, out PanelElement element) { double[] location = ((string)parent.Element("Location")).Split(',').Select(double.Parse).ToArray(); element = new DigitalGaugeElement { LocationX = location[0], LocationY = location[1], Layer = (int)parent.Element("Layer"), Subject = ParseSubjectNode(parent.Element("Subject")), Radius = (double)parent.Element("Radius"), Color = Color24.ParseHexColor((string)parent.Element("Color")), InitialAngle = (double)parent.Element("InitialAngle"), LastAngle = (double)parent.Element("LastAngle"), Minimum = (double)parent.Element("Minimum"), Maximum = (double)parent.Element("Maximum"), Step = (double)parent.Element("Step") }; }
private static void ParseLinearGaugeElementNode(XElement parent, out PanelElement element) { double[] location = ((string)parent.Element("Location")).Split(',').Select(double.Parse).ToArray(); int[] direction = ((string)parent.Element("Direction")).Split(',').Select(int.Parse).ToArray(); element = new LinearGaugeElement { LocationX = location[0], LocationY = location[1], Layer = (int)parent.Element("Layer"), Subject = ParseSubjectNode(parent.Element("Subject")), DaytimeImage = (string)parent.Element("DaytimeImage"), NighttimeImage = (string)parent.Element("NighttimeImage"), TransparentColor = Color24.ParseHexColor((string)parent.Element("TransparentColor")), Minimum = (double)parent.Element("Minimum"), Maximum = (double)parent.Element("Maximum"), DirectionX = direction[0], DirectionY = direction[1], Width = (int)parent.Element("Width") }; }
private static This ParseThisNode(XElement parent) { double[] center = ((string)parent.Element("Center")).Split(',').Select(double.Parse).ToArray(); double[] origin = ((string)parent.Element("Origin")).Split(',').Select(double.Parse).ToArray(); return(new This { Resolution = (double)parent.Element("Resolution"), Left = (double)parent.Element("Left"), Right = (double)parent.Element("Right"), Top = (double)parent.Element("Top"), Bottom = (double)parent.Element("Bottom"), DaytimeImage = (string)parent.Element("DaytimeImage"), NighttimeImage = (string)parent.Element("NighttimeImage"), TransparentColor = Color24.ParseHexColor((string)parent.Element("TransparentColor")), CenterX = center[0], CenterY = center[1], OriginX = origin[0], OriginY = origin[1] }); }