zoukankan      html  css  js  c++  java
  • 对象复制

    OBDItem OBDItemCopy(OBDItem source)
            {
                OBDItem item = new OBDItem();
                var members = AssemblyHelper.GetMembers(typeof(OBDItem), System.Reflection.MemberTypes.Field);
                foreach (var member in members)
                {
                    System.Reflection.FieldInfo field = (System.Reflection.FieldInfo)member;
                    Object fieldValue = field.GetValue(source);
                    field.SetValue(item, fieldValue);
                }
                return item;
            }
    public class OBDItem
    {
            public DateTime 时间;
    public string 终端编号;
            /// <summary>
            /// 单位:rpm
            /// </summary>
    public int 转速;
            public double 扭矩;
            public double 蓄电池电压;
            public double 发动机机油温度;
            public double 发动机燃油温度;
            /// <summary>
            /// 单位:℃
            /// </summary>
            public double 发动机冷却剂温度;

    public int 机油压力; 

  • 相关阅读:
    R-FCN、SSD、YOLO2、faster-rcnn和labelImg实验笔记
    yolov3的anchor机制与损失函数详解
    CV资料推荐
    测试用例设计方法总结
    测试需求分析
    bug生命周期
    linux命令一
    linux 命令二
    linux 命令三
    mysql数据库和禅道安装
  • 原文地址:https://www.cnblogs.com/94cool/p/2647035.html
Copyright © 2011-2022 走看看