Ejemplo 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;
        }
Ejemplo 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);
         }
     }
 }
Ejemplo n.º 3
0
        private void ProcExport(object obj)
        {
            try
            {
                RecordDisk recordDisk = DiskManager.GetInstance().GetDisk(driveName);// new RecordDisk(drive);

                FileStream fs = (FileStream)obj;

                recordDisk.Export(fs);
                fs.Close();
            }
            catch (Exception)
            {
            }
        }
Ejemplo n.º 4
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            string drive = comboBox1.Text;

            if (string.IsNullOrEmpty(drive))
            {
                gridControl1.DataSource = null;
                return;
            }
            RecordDisk recordDisk = DiskManager.GetInstance().GetDisk(drive);// new RecordDisk(drive);


            DiskChannel diskChannel = new DiskChannel(recordDisk);

            gridControl1.DataSource = diskChannel.Channels;
        }
Ejemplo n.º 5
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            driveName = comboBox1.Text;
            if (string.IsNullOrEmpty(driveName))
            {
                gridControl1.DataSource = null;
                return;
            }
            RecordDisk recordDisk = DiskManager.GetInstance().GetDisk(driveName);// new RecordDisk(drive);



            gridControl1.DataSource = recordDisk.RecordList;

            JudgeSelect();
        }
Ejemplo n.º 6
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            RecordDisk recordDisk = DiskManager.GetInstance().GetDisk(driveName);

            if (recordDisk.ExportOK)
            {
                wizardPage2.AllowNext = true;
                progressBar1.Value    = progressBar1.Maximum;
                progressBar2.Value    = progressBar2.Maximum;
                timer1.Enabled        = false;
            }
            else
            {
                progressBar1.Value = (int)(progressBar1.Maximum * recordDisk.CurrentFileRate);
                progressBar2.Value = (int)(progressBar2.Maximum * recordDisk.ExportRate);
            }
        }