Exemple #1
0
        public device Clone()
        {
            device copy = new device();

            copy.id            = this.id;
            copy.code          = this.code;
            copy.kks           = this.kks;
            copy.name          = this.name;
            copy.type          = this.type;
            copy.state         = this.state;
            copy.running_state = this.running_state;
            copy.placed        = this.placed;
            copy.raw_id        = this.raw_id;
            copy.ip            = this.ip;

            return(copy);
        }
Exemple #2
0
        public static void SetDeivInfo(DevInfo devinfo, device item)
        {
            devinfo.Abutment_Id    = item.id;
            devinfo.Code           = item.code;
            devinfo.Abutment_Type  = (Abutment_DevTypes)item.type;
            devinfo.Status         = (Abutment_Status)item.state;
            devinfo.RunStatus      = (Abutment_RunStatus)item.running_state;
            devinfo.Placed         = item.placed;
            devinfo.Abutment_DevID = item.raw_id;
            devinfo.IP             = item.ip;
            devinfo.Manufactor     = "霍尼韦尔";

            devinfo.ModifyTime      = DateTime.Now;
            devinfo.ModifyTimeStamp = TimeConvert.ToStamp(devinfo.ModifyTime);

            //devinfo.ParentId = area.Id;
            devinfo.KKS  = item.kks;
            devinfo.Name = item.name;
        }
Exemple #3
0
        public static void SetDevice(device item, DevInfo devinfo)
        {
            item.id   = devinfo.Abutment_Id ?? 0;
            item.code = devinfo.Code;
            item.type = (int)devinfo.Abutment_Type;
            if (item.type == 0)
            {
                item.type = GetDeviceType(devinfo);
            }
            item.state         = (int)devinfo.Status;
            item.running_state = (int)devinfo.RunStatus;
            item.placed        = devinfo.Placed;
            item.raw_id        = devinfo.Abutment_DevID;
            item.ip            = devinfo.IP;
            //devinfo.Manufactor = "霍尼韦尔";

            //devinfo.ModifyTime = DateTime.Now;
            //devinfo.ModifyTimeStamp = TimeConvert.DateTimeToTimeStamp(devinfo.ModifyTime);

            //devinfo.ParentId = area.Id;
            item.kks  = devinfo.KKS;
            item.name = devinfo.Name;
            item.pid  = devinfo.ParentId ?? 0;

            if (devinfo.DevDetail is Dev_CameraInfo)
            {
                Dev_CameraInfo camera = devinfo.DevDetail as Dev_CameraInfo;
                item.uri = camera.RtspUrl;

                if (string.IsNullOrEmpty(item.uri))
                {
                    item.uri = "rtsp://*****:*****@192.168.1.56/h264/ch1/main/av_stream";
                }

                item.ip = camera.Ip;
            }
        }