Files
MetroGauges-Old/MetroGauges/General/XmlDataModel.cs

147 lines
3.8 KiB
C#
Raw Normal View History

2026-02-23 17:02:55 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace MetroGauges.General
{
[XmlType("车辆轮廓点")]
[Serializable]
public class XmlDataModel
{
[XmlElement("受电弓", Type = typeof(Sdg))]
[XmlElement("车顶", Type = typeof(Cd))]
[XmlElement("车顶空调", Type = typeof(Cdkt))]
[XmlElement("车肩", Type = typeof(Cj))]
[XmlElement("侧墙", Type = typeof(Cq))]
[XmlElement("信号灯", Type = typeof(Xhd))]
[XmlElement("转向架", Type = typeof(Zxj))]
[XmlElement("踏面", Type = typeof(Tm))]
[XmlElement("轮缘", Type = typeof(Ly))]
[XmlElement("构架设备最低点1", Type = typeof(Gj1))]
[XmlElement("簧下", Type = typeof(Hx))]
[XmlElement("构架设备最低点2", Type = typeof(Gj2))]
public List<Interval> parts;
}
[XmlInclude(typeof(Sdg))]
[XmlInclude(typeof(Cd))]
[XmlInclude(typeof(Cdkt))]
[XmlInclude(typeof(Xhd))]
[XmlInclude(typeof(Cj))]
[XmlInclude(typeof(Cq))]
[XmlInclude(typeof(Zxj))]
[XmlInclude(typeof(Tm))]
[XmlInclude(typeof(Ly))]
[XmlInclude(typeof(Gj1))]
[XmlInclude(typeof(Hx))]
[XmlInclude(typeof(Gj2))]
[Serializable]
public abstract class Interval
{
//[XmlElement("坐标点", Type = typeof(Point))]
//public List<Point> pts;
}
[XmlType("受电弓")]
[Serializable]
public class Sdg: Interval
{
[XmlElement("坐标点", Type = typeof(Point))]
public List<Point> pts;
}
[XmlType("车顶")]
[Serializable]
public class Cd: Interval
{
[XmlElement("坐标点", Type = typeof(Point))]
public List<Point> pts;
}
[XmlType("车顶空调")]
[Serializable]
public class Cdkt: Interval
{
[XmlElement("坐标点", Type = typeof(Point))]
public List<Point> pts;
}
[XmlType("车肩")]
[Serializable]
public class Cj: Interval
{
[XmlElement("坐标点", Type = typeof(Point))]
public List<Point> pts;
}
[XmlType("信号灯")]
[Serializable]
public class Xhd: Interval
{
[XmlElement("坐标点", Type = typeof(Point))]
public List<Point> pts;
}
[XmlType("侧墙")]
[Serializable]
public class Cq: Interval
{
[XmlElement("坐标点", Type = typeof(Point))]
public List<Point> pts;
}
[XmlType("转向架")]
[Serializable]
public class Zxj: Interval
{
[XmlElement("坐标点", Type = typeof(Point))]
public List<Point> pts;
}
[XmlType("踏面")]
[Serializable]
public class Tm: Interval
{
[XmlElement("坐标点", Type = typeof(Point))]
public List<Point> pts;
}
[XmlType("轮缘")]
[Serializable]
public class Ly: Interval
{
[XmlElement("坐标点", Type = typeof(Point))]
public List<Point> pts;
}
[XmlType("构架设备最低点1")]
[Serializable]
public class Gj1: Interval
{
[XmlElement("坐标点", Type = typeof(Point))]
public List<Point> pts;
}
[XmlType("簧下")]
[Serializable]
public class Hx: Interval
{
[XmlElement("坐标点", Type = typeof(Point))]
public List<Point> pts;
}
[XmlType("构架设备最低点2")]
[Serializable]
public class Gj2: Interval
{
[XmlElement("坐标点", Type = typeof(Point))]
public List<Point> pts;
}
[XmlType("坐标点")]
[Serializable]
public class Point
{
[XmlAttribute("点号")]
public string Id;
[XmlAttribute("X")]
public double X;
[XmlAttribute("Y")]
public double Y;
}
}