private void cmdScan_Click(object sender, EventArgs e)
        {
            if (cmdScan.Text == "Stop Dump")
            {
                Logger.Instance.Write("Stop dump requested");
                workerDump.CancelAsync();
                resetEvent.WaitOne(new TimeSpan(0, 0, 45));
                cmdScan.Text         = "Start Dump";
                lblScanning.Visible  = false;
                pbarProgress.Visible = false;
                pbarProgress.Enabled = false;


                if (last_dump_parameters != null)
                {
                    string val = ScriptRunner.run_after_finish(last_dump_parameters.FileName, get_active_tuner_idx(), after_recording_complete_script_path.Text);
                }


                ChangeControlStatus(true);


                return;
            }

            if (!checkData())
            {
                return;
            }



            DateTime st_time = DateTime.ParseExact(start_hour_textbox.Text, "HH:mm", CultureInfo.InvariantCulture);
            int      hour    = st_time.Hour;
            int      minute  = st_time.Minute;
            int      second  = 0;

            int current_second = -1;
            int current_minute = -1;
            int current_hour   = -1;

            DumpParameters dp = getDumpParameters();

            restart_times.Clear();

            while (!(current_hour == hour && current_minute == minute && current_second == second))
            {
                st_time        = st_time.AddSeconds(dp.DataCollectionTimeout);
                current_hour   = st_time.Hour;
                current_minute = st_time.Minute;
                current_second = st_time.Second;

                restart_times.Add(st_time.ToString("HHmmss"));
                // Logger.Instance.Write(string.Format("restart time: {0}",calc_time.ToString()));
            }

            Logger.Instance.Write("Dump started");

            cmdScan.Text = "Stop Dump";

            start_dump();
        }