Exemplo n.º 1
0
        public SelectChannel(RecordDisk disk, int channel, int index)
        {
            this.file = disk.RecordList[index-1];
            this.channel = channel;
            this.RecordIndex = index;
            this.BeginTime = file.BeginTime.ToString("yyyy-MM-dd HH:mm:ss");
            this.EndTime = file.EndTime.ToString("yyyy-MM-dd HH:mm:ss");

            int seconds = 0;
            if (file.EndTime > file.BeginTime)
            {
                seconds = (int)((file.EndTime - file.BeginTime).TotalSeconds);
                this.RecordSec = seconds;
                int h = seconds / (3600);
                int m = (seconds - h * (3600)) / 60;
                int s = seconds - h * (3600) - m * 60;

                this.TimeLength = h.ToString("00") + ":" + m.ToString("00") + ":" + s.ToString("00");

            }
            else
            {
                this.TimeLength = "---";
            }

            this.Channel = channel;
            this.ChannelName = file.Channels[channel - 1].ChannelName;
               this.ModuleID=file.RecordDevice.DeviceInfo.DevCode+":"+file.RecordDevice.DeviceInfo.ID;
               this.TimeCal = file.Channels[channel - 1].Time;
        }
Exemplo n.º 2
0
 public DiskChannel(RecordDisk disk)
 {
     for (int i = 0; i < disk.RecordList.Count; i++)
     {
         RecordFile file = disk.RecordList[i];
         for (int j = 0; j < file.Channels.Count; j++)
         {
             SelectChannel channel = new SelectChannel(disk, j + 1, i + 1);
             channels.Add(channel);
         }
     }
 }