13/PowerRecord.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Text;

namespace Lon
{
    //掉电记录
    public class PowRecord
    {
        public DateTime RecTime { get; set; }   //时间
        public string KMPostName { get; set; }  //公里标

        //List<int> voltList;              //掉电开始后的后采样值,按顺序用","分割采样数据,每100ms一个数据,共9个
        //public List<int> VoltList { get { return voltList; } }
        string[] voltList;
        public string[] VoltList { get { return voltList; } }

        public PowRecord(DateTime time, int kmpost, string valueText)
        {
            try
            {
                this.RecTime = time;
                this.KMPostName = GetKMPost(kmpost);
                voltList = valueText.Split(new char[] { ',' });

                //this.voltList = new List<int>();

                //string[] voltStrings = valueText.Split(new char[] { ',' });

                //foreach (string item in voltStrings)
                //{
                //    voltList.Add(int.Parse(item));
                //}
            }
            catch
            { }
        }


        public static string GetKMPost(int value)
        {
            string text = string.Format("{0:0.000}", KMPostConvert(value));

            ////公里标: D23为符号位,D22为方向,D21-D0为公里标
            //int iNum = value & 0x800000;
            //value = value & 0x3FFFFF;
            //if (value > 0)
            //{
            //    if (iNum > 0) value = -value;
            //    text = string.Format("{0:0.000}", value / 1000.0F);
            //}

            return text;
        }

        public static float KMPostConvert(int value)
        {
            float kmValue = 0;

            //公里标: D23为符号位,D22为方向,D21-D0为公里标
后面还有 14 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。