示例#1
0
        public void LoadDeviceStatus()
        {
            var nameStr = new StringBuilder();
            // var DeviceName = string.Empty;
            var name = SDKApi.EagleControl_GetDeviceName(DeviceId, nameStr);

            DeviceName = nameStr.ToString();
            var sys    = new eagle_system_status();
            var volume = new eagle_disk_total_volume();
            int ret    = SDKApi.EagleControl_GetSystemStatus(DeviceId, out sys);         //获取系统状态 温度‘磁盘数及剩余容量

            ret         = SDKApi.EagleControl_GetDeviceDiskVolume(DeviceId, ref volume); //磁盘总容量
            Temperature = string.Format("{0}℃", sys.fpga_tempture);
            int  freevolume  = 0;
            uint totalvolume = 0;

            for (int i = 0; i < sys.disk_num; i++)
            {
                freevolume  += sys.remained_volume[i];
                totalvolume += volume.total_volume[i];
            }
            FreeVolume  = string.Format("{0}GB可用", freevolume);
            TotalVolume = string.Format("{0}GB", totalvolume);
            DiskPercent = 100.0 - (int)(freevolume * 100.0 / totalvolume);
            //设置相机Check
            for (int i = 1; i < 5; i++)
            {
                ret = SDKApi.EagleControl_CheckChannel(DeviceId, i, i == 1 ? true : false);
            }
        }