Beispiel #1
0
        public static void GenerateStationInfo()
        {
            var result = new PumpStationInfo();

            result.Ver             = 0xDF;
            result.City_地市代码       = 11;
            result.Prov_省代号        = 11;
            result.Superior_上级单位代号 = "11111111";
            result.S_ID_加油站ID      = "11111111";
            result.POS_P_通讯终端逻辑编号  = 0;
#warning where this configuration info come from?
            result.GUN_N_油枪数 = 4;
#warning where this configuration info number come from?
            result.MZN_单个油枪 = new List <byte>()
            {
                1, 2, 3, 4
            };

            XmlSerializer mySerializer = new
                                         XmlSerializer(typeof(PumpStationInfo));
            // To write to a file, create a StreamWriter object.
            StreamWriter myWriter = new StreamWriter("Station.xml");
            mySerializer.Serialize(myWriter, result);
            myWriter.Close();
        }
Beispiel #2
0
        public static PumpStationInfo GetDefaultPumpStationInfo()
        {
            var result = new PumpStationInfo();

            result.Ver             = 0xDF;
            result.City_地市代码       = 11;
            result.Prov_省代号        = 11;
            result.Superior_上级单位代号 = "11111111";
            result.S_ID_加油站ID      = "11111111";
            result.POS_P_通讯终端逻辑编号  = 0;
#warning where this configuration info come from?
            result.GUN_N_油枪数 = 4;
#warning where this configuration info number come from?
            result.MZN_单个油枪 = new List <byte>()
            {
                1, 2, 3, 4
            };
            return(result);
        }