public void Test1() { JTNE_0x02_0x07_Platform jTNE_0X02_0X07_Platform = new JTNE_0x02_0x07_Platform(); jTNE_0X02_0X07_Platform.AlarmBatteryFlag = 5533; jTNE_0X02_0X07_Platform.AlarmLevel = 0x11; jTNE_0X02_0X07_Platform.AlarmBatteryOthers = new List <uint> { 1000, 1001, 1002 }; jTNE_0X02_0X07_Platform.AlarmEls = new List <uint> { 2000, 2001, 2002 }; jTNE_0X02_0X07_Platform.AlarmEngines = new List <uint> { 3000, 3001, 3002 }; jTNE_0X02_0X07_Platform.AlarmOthers = new List <uint> { 4000, 4001, 4002 }; var hex = JTNESerializer_Platform.Serialize(jTNE_0X02_0X07_Platform).ToHexString(); Assert.Equal("07110000159D03000003E8000003E9000003EA03000007D0000007D1000007D20300000BB800000BB900000BBA0300000FA000000FA100000FA2", hex); }
public void Test1() { JTNE_0x02_0x02_Platform jTNE_0X02_0X02_Platform = new JTNE_0x02_0x02_Platform(); jTNE_0X02_0X02_Platform.Electricals = new List <Metadata.Electrical>(); Metadata.Electrical electrical1 = new Metadata.Electrical(); electrical1.ElControlTemp = 0x01; electrical1.ElCurrent = 100; electrical1.ElNo = 0x01; electrical1.ElSpeed = 65; electrical1.ElStatus = 0x02; electrical1.ElTemp = 0x03; electrical1.ElTorque = 55; electrical1.ElVoltage = 236; Metadata.Electrical electrical2 = new Metadata.Electrical(); electrical2.ElControlTemp = 0x02; electrical2.ElCurrent = 101; electrical2.ElNo = 0x02; electrical2.ElSpeed = 66; electrical2.ElStatus = 0x03; electrical2.ElTemp = 0x05; electrical2.ElTorque = 566; electrical2.ElVoltage = 2136; jTNE_0X02_0X02_Platform.Electricals.Add(electrical1); jTNE_0X02_0X02_Platform.Electricals.Add(electrical2); var hex = JTNESerializer_Platform.Serialize(jTNE_0X02_0X02_Platform).ToHexString(); Assert.Equal("0202010201004100370300EC0064020302004202360508580065", hex); }
public void Test1() { JTNE_0x04_Platform jTNE_0X04_Platform = new JTNE_0x04_Platform(); jTNE_0X04_Platform.LogoutTime = DateTime.Parse("2019-01-22 23:55:56"); jTNE_0X04_Platform.LogoutNum = 4444; var hex = JTNESerializer_Platform.Serialize(jTNE_0X04_Platform).ToHexString(); Assert.Equal("130116173738115C", hex); }
public void Test1() { JTNE_0x02_0x05_Platform jTNE_0X02_0X05_Platform = new JTNE_0x02_0x05_Platform(); jTNE_0X02_0X05_Platform.Lat = 1233355; jTNE_0X02_0X05_Platform.Lng = 3255555; jTNE_0X02_0X05_Platform.PositioStatus = 0x01; var hex = JTNESerializer_Platform.Serialize(jTNE_0X02_0X05_Platform).ToHexString(); Assert.Equal("05010031AD030012D1CB", hex); }
public void Test1() { JTNE_0x02_0x04_Platform jTNE_0X02_0X04_Platform = new JTNE_0x02_0x04_Platform(); jTNE_0X02_0X04_Platform.EngineStatus = 0x01; jTNE_0X02_0X04_Platform.FuelRate = 102; jTNE_0X02_0X04_Platform.Revs = 203; var hex = JTNESerializer_Platform.Serialize(jTNE_0X02_0X04_Platform).ToHexString(); Assert.Equal("040100CB0066", hex); }
public void Test1() { JTNE_0x05_Platform jTNE_0X05_Platform = new JTNE_0x05_Platform(); jTNE_0X05_Platform.LoginTime = DateTime.Parse("2019-01-22 23:55:56"); jTNE_0X05_Platform.LoginNum = 6666; jTNE_0X05_Platform.PlatformUserName = "******"; jTNE_0X05_Platform.PlatformPassword = "******"; jTNE_0X05_Platform.EncryptMethod = 0x00; var hex = JTNESerializer_Platform.Serialize(jTNE_0X05_Platform).ToHexString(); Assert.Equal("1301161737381A0A536D616C6C43686935313800313233343536373839303132333435363738390000", hex); }
public void Test1() { JTNEPackage_Platform jTNEPackage_Platform = new JTNEPackage_Platform(); jTNEPackage_Platform.AskId = JTNEAskId.CMD.ToByteValue(); jTNEPackage_Platform.MsgId = JTNEMsgId_Platform.platformlogout.ToByteValue(); jTNEPackage_Platform.VIN = "123456789"; JTNE_0x06_Platform jTNE_0X06_Platform = new JTNE_0x06_Platform(); jTNE_0X06_Platform.LogoutTime = DateTime.Parse("2019-01-23 23:55:56"); jTNE_0X06_Platform.LogoutNum = 1; jTNEPackage_Platform.Bodies = jTNE_0X06_Platform; var hex = JTNESerializer_Platform.Serialize(jTNEPackage_Platform).ToHexString(); Assert.Equal("232306FE31323334353637383900000000000000000100081301171737380001DC", hex); }
public void Test1() { JTNEPackage_Platform jTNEPackage_Platform = new JTNEPackage_Platform(); jTNEPackage_Platform.AskId = JTNEAskId.CMD.ToByteValue(); jTNEPackage_Platform.MsgId = JTNEMsgId_Platform.platformlogin.ToByteValue(); jTNEPackage_Platform.VIN = "123456789"; JTNE_0x05_Platform jTNE_0X05_Platform = new JTNE_0x05_Platform(); jTNE_0X05_Platform.LoginTime = DateTime.Parse("2019-01-23 23:55:56"); jTNE_0X05_Platform.LoginNum = 6666; jTNE_0X05_Platform.PlatformUserName = "******"; jTNE_0X05_Platform.PlatformPassword = "******"; jTNEPackage_Platform.Bodies = jTNE_0X05_Platform; var hex = JTNESerializer_Platform.Serialize(jTNEPackage_Platform).ToHexString(); Assert.Equal("232305FE31323334353637383900000000000000000100291301171737381A0A536D616C6C43686935313800313233343536373839303132333435363738390001FF", hex); }
public void Test1() { JTNE_0x01_Platform jTNE_0X01_Platform = new JTNE_0x01_Platform(); jTNE_0X01_Platform.PDATime = DateTime.Parse("2019-01-22 23:55:56"); jTNE_0X01_Platform.LoginNum = 1; jTNE_0X01_Platform.BatteryLength = 0x04; jTNE_0X01_Platform.SIM = "12345678998765432100"; jTNE_0X01_Platform.BatteryNos = new List <string>() { "1234", "4567", "9870" }; var hex = JTNESerializer_Platform.Serialize(jTNE_0X01_Platform).ToHexString(); Assert.Equal("130116173738000131323334353637383939383736353433323130300304313233343435363739383730", hex); }
public void Test1() { JTNE_0x02_0x01_Platform jTNE_0X02_0X01_Platform = new JTNE_0x02_0x01_Platform(); jTNE_0X02_0X01_Platform.CarStatus = 0x04; jTNE_0X02_0X01_Platform.ChargeStatus = 0x05; jTNE_0X02_0X01_Platform.DCStatus = 0x06; jTNE_0X02_0X01_Platform.OperationMode = 0x07; jTNE_0X02_0X01_Platform.Resistance = 123; jTNE_0X02_0X01_Platform.SOC = 0x03; jTNE_0X02_0X01_Platform.Speed = 58; jTNE_0X02_0X01_Platform.Stall = 0x02; jTNE_0X02_0X01_Platform.TotalDis = 6666; jTNE_0X02_0X01_Platform.TotalTemp = 99; jTNE_0X02_0X01_Platform.TotalVoltage = 100; var hex = JTNESerializer_Platform.Serialize(jTNE_0X02_0X01_Platform).ToHexString(); Assert.Equal("01040507003A00001A0A00640063030602007B", hex); }
public void Test1() { JTNE_0x02_0x06_Platform jTNE_0X02_0X06_Platform = new JTNE_0x02_0x06_Platform(); jTNE_0X02_0X06_Platform.MaxTempBatteryAssemblyNo = 0x12; jTNE_0X02_0X06_Platform.MaxTempProbeBatteryNo = 0x32; jTNE_0X02_0X06_Platform.MaxTempProbeBatteryValue = 0x42; jTNE_0X02_0X06_Platform.MaxVoltageBatteryAssemblyNo = 0x11; jTNE_0X02_0X06_Platform.MaxVoltageSingleBatteryNo = 0x15; jTNE_0X02_0X06_Platform.MaxVoltageSingleBatteryValue = 123; jTNE_0X02_0X06_Platform.MinTempBatteryAssemblyNo = 0x32; jTNE_0X02_0X06_Platform.MinTempProbeBatteryNo = 0x11; jTNE_0X02_0X06_Platform.MinTempProbeBatteryValue = 0x06; jTNE_0X02_0X06_Platform.MinVoltageBatteryAssemblyNo = 0x07; jTNE_0X02_0X06_Platform.MinVoltageSingleBatteryNo = 0x09; jTNE_0X02_0X06_Platform.MinVoltageSingleBatteryValue = 0x08; var hex = JTNESerializer_Platform.Serialize(jTNE_0X02_0X06_Platform).ToHexString(); Assert.Equal("061115007B07090008321242113206", hex); }
public void Test1() { JTNE_0x02_0x03_Platform jTNE_0X02_0X03_Platform = new JTNE_0x02_0x03_Platform(); jTNE_0X02_0X03_Platform.DCStatus = 0x02; jTNE_0X02_0X03_Platform.FuelBatteryCurrent = 111; jTNE_0X02_0X03_Platform.FuelBatteryVoltage = 2222; jTNE_0X02_0X03_Platform.FuelConsumptionRate = 3222; jTNE_0X02_0X03_Platform.HydrogenSystemMaxConcentrations = 6666; jTNE_0X02_0X03_Platform.HydrogenSystemMaxConcentrationsNo = 0x56; jTNE_0X02_0X03_Platform.HydrogenSystemMaxPressure = 3336; jTNE_0X02_0X03_Platform.HydrogenSystemMaxPressureNo = 0x65; jTNE_0X02_0X03_Platform.HydrogenSystemMaxTemp = 3355; jTNE_0X02_0X03_Platform.HydrogenSystemMaxTempNo = 0x22; jTNE_0X02_0X03_Platform.Temperatures = new byte[] { 0x01, 0x02, 0x03 }; var hex = JTNESerializer_Platform.Serialize(jTNE_0X02_0X03_Platform).ToHexString(); Assert.Equal("0308AE006F0C9600030102030D1B221A0A560D086502", hex); }
public void Test1() { JTNEPackage_Platform jTNEPackage_Platform = new JTNEPackage_Platform(); jTNEPackage_Platform.AskId = JTNEAskId.CMD.ToByteValue(); jTNEPackage_Platform.MsgId = JTNEMsgId_Platform.login.ToByteValue(); jTNEPackage_Platform.VIN = "123456789"; JTNE_0x01_Platform jTNE_0X01_Platform = new JTNE_0x01_Platform(); jTNE_0X01_Platform.PDATime = DateTime.Parse("2019-01-22 23:55:56"); jTNE_0X01_Platform.LoginNum = 1; jTNE_0X01_Platform.BatteryLength = 0x04; jTNE_0X01_Platform.SIM = "12345678998765432100"; jTNE_0X01_Platform.BatteryNos = new List <string>() { "1234", "4567", "9870" }; jTNEPackage_Platform.Bodies = jTNE_0X01_Platform; var hex = JTNESerializer_Platform.Serialize(jTNEPackage_Platform).ToHexString(); Assert.Equal("232301FE313233343536373839000000000000000001002A130116173738000131323334353637383939383736353433323130300304313233343435363739383730FD", hex); }
public void Test1() { JTNEGlobalConfigs.Instance.Register_JTNE0x02CustomBody_Platform(0xA1, typeof(JTNE_0x02_0xA1_Platform)); JTNEGlobalConfigs.Instance.Register_JTNE0x02CustomBody_Platform(0xA2, typeof(JTNE_0x02_0xA2_Platform)); JTNE_0x02_Platform jTNE_0X02_Platform = new JTNE_0x02_Platform(); jTNE_0X02_Platform.CusotmSerializeObjectValues = new Dictionary <byte, JTNE_0x02_CustomBody_Platform>(); JTNE_0x02_0xA1_Platform jTNE_0X02_0XA1_Platform = new JTNE_0x02_0xA1_Platform(); jTNE_0X02_0XA1_Platform.UserName = "******"; jTNE_0X02_0XA1_Platform.Age = 18; jTNE_0X02_Platform.CusotmSerializeObjectValues.Add(0xA1, jTNE_0X02_0XA1_Platform); JTNE_0x02_0xA2_Platform jTNE_0X02_0XA2_Platform = new JTNE_0x02_0xA2_Platform(); jTNE_0X02_0XA2_Platform.CompanyName = "小池有限公司"; jTNE_0X02_Platform.CusotmSerializeObjectValues.Add(0xA2, jTNE_0X02_0XA2_Platform); var hex = JTNESerializer_Platform.Serialize(jTNE_0X02_Platform).ToHexString(); Assert.Equal("A1000E536D616C6C436869000000000012A20014E5B08FE6B1A0E69C89E99990E585ACE58FB80000", hex); }
public void Test1() { JTNEGlobalConfigs.Instance.Register_JTNE0x02CustomBody_Platform(0xA1, typeof(JTNE_0x02_0xA1_Platform)); JTNEGlobalConfigs.Instance.Register_JTNE0x02CustomBody_Platform(0xA2, typeof(JTNE_0x02_0xA2_Platform)); JTNE_0x02_Platform jTNE_0X02_Platform = new JTNE_0x02_Platform(); jTNE_0X02_Platform.Values = new Dictionary <byte, JTNE_0x02_Body_Platform>(); jTNE_0X02_Platform.CusotmSerializeObjectValues = new Dictionary <byte, JTNE_0x02_CustomBody_Platform>(); JTNE_0x02_0x01_Platform jTNE_0X02_0X01_Platform = new JTNE_0x02_0x01_Platform(); jTNE_0X02_0X01_Platform.CarStatus = 0x04; jTNE_0X02_0X01_Platform.ChargeStatus = 0x05; jTNE_0X02_0X01_Platform.DCStatus = 0x06; jTNE_0X02_0X01_Platform.OperationMode = 0x07; jTNE_0X02_0X01_Platform.Resistance = 123; jTNE_0X02_0X01_Platform.SOC = 0x03; jTNE_0X02_0X01_Platform.Speed = 58; jTNE_0X02_0X01_Platform.Stall = 0x02; jTNE_0X02_0X01_Platform.TotalDis = 6666; jTNE_0X02_0X01_Platform.TotalTemp = 99; jTNE_0X02_0X01_Platform.TotalVoltage = 100; jTNE_0X02_Platform.Values.Add(JTNE_0x02_Body_Platform.JTNE_0x02_0x01_Platform, jTNE_0X02_0X01_Platform); JTNE_0x02_0x02_Platform jTNE_0X02_0X02_Platform = new JTNE_0x02_0x02_Platform(); jTNE_0X02_0X02_Platform.Electricals = new List <Metadata.Electrical>(); Metadata.Electrical electrical1 = new Metadata.Electrical(); electrical1.ElControlTemp = 0x01; electrical1.ElCurrent = 100; electrical1.ElNo = 0x01; electrical1.ElSpeed = 65; electrical1.ElStatus = 0x02; electrical1.ElTemp = 0x03; electrical1.ElTorque = 55; electrical1.ElVoltage = 236; Metadata.Electrical electrical2 = new Metadata.Electrical(); electrical2.ElControlTemp = 0x02; electrical2.ElCurrent = 101; electrical2.ElNo = 0x02; electrical2.ElSpeed = 66; electrical2.ElStatus = 0x03; electrical2.ElTemp = 0x05; electrical2.ElTorque = 566; electrical2.ElVoltage = 2136; jTNE_0X02_0X02_Platform.Electricals.Add(electrical1); jTNE_0X02_0X02_Platform.Electricals.Add(electrical2); jTNE_0X02_Platform.Values.Add(JTNE_0x02_Body_Platform.JTNE_0x02_0x02_Platform, jTNE_0X02_0X02_Platform); JTNE_0x02_0x03_Platform jTNE_0X02_0X03_Platform = new JTNE_0x02_0x03_Platform(); jTNE_0X02_0X03_Platform.DCStatus = 0x02; jTNE_0X02_0X03_Platform.FuelBatteryCurrent = 111; jTNE_0X02_0X03_Platform.FuelBatteryVoltage = 2222; jTNE_0X02_0X03_Platform.FuelConsumptionRate = 3222; jTNE_0X02_0X03_Platform.HydrogenSystemMaxConcentrations = 6666; jTNE_0X02_0X03_Platform.HydrogenSystemMaxConcentrationsNo = 0x56; jTNE_0X02_0X03_Platform.HydrogenSystemMaxPressure = 3336; jTNE_0X02_0X03_Platform.HydrogenSystemMaxPressureNo = 0x65; jTNE_0X02_0X03_Platform.HydrogenSystemMaxTemp = 3355; jTNE_0X02_0X03_Platform.HydrogenSystemMaxTempNo = 0x22; jTNE_0X02_0X03_Platform.Temperatures = new byte[] { 0x01, 0x02, 0x03 }; jTNE_0X02_Platform.Values.Add(JTNE_0x02_Body_Platform.JTNE_0x02_0x03_Platform, jTNE_0X02_0X03_Platform); JTNE_0x02_0xA1_Platform jTNE_0X02_0XA1_Platform = new JTNE_0x02_0xA1_Platform(); jTNE_0X02_0XA1_Platform.UserName = "******"; jTNE_0X02_0XA1_Platform.Age = 18; jTNE_0X02_Platform.CusotmSerializeObjectValues.Add(0xA1, jTNE_0X02_0XA1_Platform); JTNE_0x02_0xA2_Platform jTNE_0X02_0XA2_Platform = new JTNE_0x02_0xA2_Platform(); jTNE_0X02_0XA2_Platform.CompanyName = "小池有限公司"; jTNE_0X02_Platform.CusotmSerializeObjectValues.Add(0xA2, jTNE_0X02_0XA2_Platform); var hex = JTNESerializer_Platform.Serialize(jTNE_0X02_Platform).ToHexString(); Assert.Equal("01040507003A00001A0A00640063030602007B0202010201004100370300EC00640203020042023605085800650308AE006F0C9600030102030D1B221A0A560D086502A1000E536D616C6C436869000000000012A20014E5B08FE6B1A0E69C89E99990E585ACE58FB80000", hex); }
public void Test1() { JTNEPackage_Platform jTNEPackage_Platform = new JTNEPackage_Platform(); jTNEPackage_Platform.AskId = JTNEAskId.Success.ToByteValue(); jTNEPackage_Platform.MsgId = JTNEMsgId_Platform.uploadim.ToByteValue(); jTNEPackage_Platform.VIN = "123456789"; JTNE_0x02_Platform jTNE_0X02_Platform = new JTNE_0x02_Platform(); jTNE_0X02_Platform.Values = new Dictionary <byte, JTNE_0x02_Body_Platform>(); JTNE_0x02_0x01_Platform jTNE_0X02_0X01_Platform = new JTNE_0x02_0x01_Platform(); jTNE_0X02_0X01_Platform.CarStatus = 0x04; jTNE_0X02_0X01_Platform.ChargeStatus = 0x05; jTNE_0X02_0X01_Platform.DCStatus = 0x06; jTNE_0X02_0X01_Platform.OperationMode = 0x07; jTNE_0X02_0X01_Platform.Resistance = 123; jTNE_0X02_0X01_Platform.SOC = 0x03; jTNE_0X02_0X01_Platform.Speed = 58; jTNE_0X02_0X01_Platform.Stall = 0x02; jTNE_0X02_0X01_Platform.TotalDis = 6666; jTNE_0X02_0X01_Platform.TotalTemp = 99; jTNE_0X02_0X01_Platform.TotalVoltage = 100; jTNE_0X02_Platform.Values.Add(JTNE_0x02_Body_Platform.JTNE_0x02_0x01_Platform, jTNE_0X02_0X01_Platform); JTNE_0x02_0x02_Platform jTNE_0X02_0X02_Platform = new JTNE_0x02_0x02_Platform(); jTNE_0X02_0X02_Platform.Electricals = new List <Metadata.Electrical>(); Metadata.Electrical electrical1 = new Metadata.Electrical(); electrical1.ElControlTemp = 0x01; electrical1.ElCurrent = 100; electrical1.ElNo = 0x01; electrical1.ElSpeed = 65; electrical1.ElStatus = 0x02; electrical1.ElTemp = 0x03; electrical1.ElTorque = 55; electrical1.ElVoltage = 236; Metadata.Electrical electrical2 = new Metadata.Electrical(); electrical2.ElControlTemp = 0x02; electrical2.ElCurrent = 101; electrical2.ElNo = 0x02; electrical2.ElSpeed = 66; electrical2.ElStatus = 0x03; electrical2.ElTemp = 0x05; electrical2.ElTorque = 566; electrical2.ElVoltage = 2136; jTNE_0X02_0X02_Platform.Electricals.Add(electrical1); jTNE_0X02_0X02_Platform.Electricals.Add(electrical2); jTNE_0X02_Platform.Values.Add(JTNE_0x02_Body_Platform.JTNE_0x02_0x02_Platform, jTNE_0X02_0X02_Platform); JTNE_0x02_0x03_Platform jTNE_0X02_0X03_Platform = new JTNE_0x02_0x03_Platform(); jTNE_0X02_0X03_Platform.DCStatus = 0x02; jTNE_0X02_0X03_Platform.FuelBatteryCurrent = 111; jTNE_0X02_0X03_Platform.FuelBatteryVoltage = 2222; jTNE_0X02_0X03_Platform.FuelConsumptionRate = 3222; jTNE_0X02_0X03_Platform.HydrogenSystemMaxConcentrations = 6666; jTNE_0X02_0X03_Platform.HydrogenSystemMaxConcentrationsNo = 0x56; jTNE_0X02_0X03_Platform.HydrogenSystemMaxPressure = 3336; jTNE_0X02_0X03_Platform.HydrogenSystemMaxPressureNo = 0x65; jTNE_0X02_0X03_Platform.HydrogenSystemMaxTemp = 3355; jTNE_0X02_0X03_Platform.HydrogenSystemMaxTempNo = 0x22; jTNE_0X02_0X03_Platform.Temperatures = new byte[] { 0x01, 0x02, 0x03 }; jTNE_0X02_Platform.Values.Add(JTNE_0x02_Body_Platform.JTNE_0x02_0x03_Platform, jTNE_0X02_0X03_Platform); JTNE_0x02_0x04_Platform jTNE_0X02_0X04_Platform = new JTNE_0x02_0x04_Platform(); jTNE_0X02_0X04_Platform.EngineStatus = 0x01; jTNE_0X02_0X04_Platform.FuelRate = 102; jTNE_0X02_0X04_Platform.Revs = 203; jTNE_0X02_Platform.Values.Add(JTNE_0x02_Body_Platform.JTNE_0x02_0x04_Platform, jTNE_0X02_0X04_Platform); JTNE_0x02_0x05_Platform jTNE_0X02_0X05_Platform = new JTNE_0x02_0x05_Platform(); jTNE_0X02_0X05_Platform.Lat = 1233355; jTNE_0X02_0X05_Platform.Lng = 3255555; jTNE_0X02_0X05_Platform.PositioStatus = 0x01; jTNE_0X02_Platform.Values.Add(JTNE_0x02_Body_Platform.JTNE_0x02_0x05_Platform, jTNE_0X02_0X05_Platform); JTNE_0x02_0x06_Platform jTNE_0X02_0X06_Platform = new JTNE_0x02_0x06_Platform(); jTNE_0X02_0X06_Platform.MaxTempBatteryAssemblyNo = 0x12; jTNE_0X02_0X06_Platform.MaxTempProbeBatteryNo = 0x32; jTNE_0X02_0X06_Platform.MaxTempProbeBatteryValue = 0x42; jTNE_0X02_0X06_Platform.MaxVoltageBatteryAssemblyNo = 0x11; jTNE_0X02_0X06_Platform.MaxVoltageSingleBatteryNo = 0x15; jTNE_0X02_0X06_Platform.MaxVoltageSingleBatteryValue = 123; jTNE_0X02_0X06_Platform.MinTempBatteryAssemblyNo = 0x32; jTNE_0X02_0X06_Platform.MinTempProbeBatteryNo = 0x11; jTNE_0X02_0X06_Platform.MinTempProbeBatteryValue = 0x06; jTNE_0X02_0X06_Platform.MinVoltageBatteryAssemblyNo = 0x07; jTNE_0X02_0X06_Platform.MinVoltageSingleBatteryNo = 0x09; jTNE_0X02_0X06_Platform.MinVoltageSingleBatteryValue = 0x08; jTNE_0X02_Platform.Values.Add(JTNE_0x02_Body_Platform.JTNE_0x02_0x06_Platform, jTNE_0X02_0X06_Platform); JTNE_0x02_0x07_Platform jTNE_0X02_0X07_Platform = new JTNE_0x02_0x07_Platform(); jTNE_0X02_0X07_Platform.AlarmBatteryFlag = 5533; jTNE_0X02_0X07_Platform.AlarmLevel = 0x11; jTNE_0X02_0X07_Platform.AlarmBatteryOthers = new List <uint> { 1000, 1001, 1002 }; jTNE_0X02_0X07_Platform.AlarmEls = new List <uint> { 2000, 2001, 2002 }; jTNE_0X02_0X07_Platform.AlarmEngines = new List <uint> { 3000, 3001, 3002 }; jTNE_0X02_0X07_Platform.AlarmOthers = new List <uint> { 4000, 4001, 4002 }; jTNE_0X02_Platform.Values.Add(JTNE_0x02_Body_Platform.JTNE_0x02_0x07_Platform, jTNE_0X02_0X07_Platform); jTNEPackage_Platform.Bodies = jTNE_0X02_Platform; var hex = JTNESerializer_Platform.Serialize(jTNEPackage_Platform).ToHexString(); Assert.Equal("23230201313233343536373839000000000000000001009C01040507003A00001A0A00640063030602007B0202010201004100370300EC00640203020042023605085800650308AE006F0C9600030102030D1B221A0A560D086502040100CB006605010031AD030012D1CB061115007B0709000832124211320607110000159D03000003E8000003E9000003EA03000007D0000007D1000007D20300000BB800000BB900000BBA0300000FA000000FA100000FA2BD", hex); }
public void Test1() { JTNE_0x03_Platform jTNE_0X03_Platform = new JTNE_0x03_Platform(); JTNE_0x02_Platform jTNE_0X02_Platform = new JTNE_0x02_Platform(); jTNE_0X02_Platform.Values = new Dictionary <byte, JTNE_0x02_Body_Platform>(); JTNE_0x02_0x01_Platform jTNE_0X02_0X01_Platform = new JTNE_0x02_0x01_Platform(); jTNE_0X02_0X01_Platform.CarStatus = 0x04; jTNE_0X02_0X01_Platform.ChargeStatus = 0x05; jTNE_0X02_0X01_Platform.DCStatus = 0x06; jTNE_0X02_0X01_Platform.OperationMode = 0x07; jTNE_0X02_0X01_Platform.Resistance = 123; jTNE_0X02_0X01_Platform.SOC = 0x03; jTNE_0X02_0X01_Platform.Speed = 58; jTNE_0X02_0X01_Platform.Stall = 0x02; jTNE_0X02_0X01_Platform.TotalDis = 6666; jTNE_0X02_0X01_Platform.TotalTemp = 99; jTNE_0X02_0X01_Platform.TotalVoltage = 100; jTNE_0X02_Platform.Values.Add(JTNE_0x02_Body_Platform.JTNE_0x02_0x01_Platform, jTNE_0X02_0X01_Platform); JTNE_0x02_0x02_Platform jTNE_0X02_0X02_Platform = new JTNE_0x02_0x02_Platform(); jTNE_0X02_0X02_Platform.Electricals = new List <Metadata.Electrical>(); Metadata.Electrical electrical1 = new Metadata.Electrical(); electrical1.ElControlTemp = 0x01; electrical1.ElCurrent = 100; electrical1.ElNo = 0x01; electrical1.ElSpeed = 65; electrical1.ElStatus = 0x02; electrical1.ElTemp = 0x03; electrical1.ElTorque = 55; electrical1.ElVoltage = 236; Metadata.Electrical electrical2 = new Metadata.Electrical(); electrical2.ElControlTemp = 0x02; electrical2.ElCurrent = 101; electrical2.ElNo = 0x02; electrical2.ElSpeed = 66; electrical2.ElStatus = 0x03; electrical2.ElTemp = 0x05; electrical2.ElTorque = 566; electrical2.ElVoltage = 2136; jTNE_0X02_0X02_Platform.Electricals.Add(electrical1); jTNE_0X02_0X02_Platform.Electricals.Add(electrical2); jTNE_0X02_Platform.Values.Add(JTNE_0x02_Body_Platform.JTNE_0x02_0x02_Platform, jTNE_0X02_0X02_Platform); JTNE_0x02_0x03_Platform jTNE_0X02_0X03_Platform = new JTNE_0x02_0x03_Platform(); jTNE_0X02_0X03_Platform.DCStatus = 0x02; jTNE_0X02_0X03_Platform.FuelBatteryCurrent = 111; jTNE_0X02_0X03_Platform.FuelBatteryVoltage = 2222; jTNE_0X02_0X03_Platform.FuelConsumptionRate = 3222; jTNE_0X02_0X03_Platform.HydrogenSystemMaxConcentrations = 6666; jTNE_0X02_0X03_Platform.HydrogenSystemMaxConcentrationsNo = 0x56; jTNE_0X02_0X03_Platform.HydrogenSystemMaxPressure = 3336; jTNE_0X02_0X03_Platform.HydrogenSystemMaxPressureNo = 0x65; jTNE_0X02_0X03_Platform.HydrogenSystemMaxTemp = 3355; jTNE_0X02_0X03_Platform.HydrogenSystemMaxTempNo = 0x22; jTNE_0X02_0X03_Platform.Temperatures = new byte[] { 0x01, 0x02, 0x03 }; jTNE_0X02_Platform.Values.Add(JTNE_0x02_Body_Platform.JTNE_0x02_0x03_Platform, jTNE_0X02_0X03_Platform); jTNE_0X03_Platform.Supplement = jTNE_0X02_Platform; var hex = JTNESerializer_Platform.Serialize(jTNE_0X03_Platform).ToHexString(); //01 04 05 07 00 3A 00 00 1A 0A 00 64 00 63 03 06 02 00 7B 02 03 -21 //02 02 01 02 01 00 41 00 37 03 00 EC 00 64 02 03 02 00 42 02 36 05 08 58 00 65 -26 //03 08 AE 00 6F 0C 96 00 03 01 02 03 0D 1B 22 1A 0A 56 0D 08 65 02 Assert.Equal("01040507003A00001A0A00640063030602007B0202010201004100370300EC00640203020042023605085800650308AE006F0C9600030102030D1B221A0A560D086502", hex); }