Ejemplo n.º 1
0
        public UploadMgr(ControllerProgramSolution solution)
            : base()
        {
            this.solution = solution;

            this.deviceSearcher = new SerialPortDeviceSearcher(null, null);
            this.deviceSearcher.ProgressChanged       += new ProgressChangedEventHandler(deviceSearcher_ProgressChanged);
            this.deviceSearcher.DeviceSearchCompleted += new DeviceSearchCompletedEventHandler(deviceSearcher_DeviceSearchCompleted);

            this.onCompletedDelegate      = new SendOrPostCallback(this.RaiseUploadingCompletedEvent);
            this.onProgressReportDelegate = new SendOrPostCallback(this.RaiseProgressChangeEvent);
        }
Ejemplo n.º 2
0
        //private void rbInverse_CheckedChanged(object sender, EventArgs e)
        //{
        //    this.DebuggerEngine.Parameters.InverseByteOrder = this.rbInverse.Checked;
        //}

        private void bAutoScan_Click(object sender, EventArgs e)
        {
            this.progressForm              = new ProgressForm(MainForm.MainFormInstance);
            this.progressForm.FormClosing += new FormClosingEventHandler(this.progressForm_FormClosing);
            this.progressForm.Message      = "Поиск контроллера...";


            this.controllerSearcher             = new SerialPortDeviceSearcher(null, null);
            this.controllerSearcher.Pattern     = "Relkon 6";
            this.controllerSearcher.BootPattern = "boot";
            this.controllerSearcher.Request     = new byte[] { 0x00, 0xA0 };

            this.controllerSearcher.DeviceSearchCompleted += new DeviceSearchCompletedEventHandler(controllerSearcher_DeviceSearchCompleted);
            this.controllerSearcher.ProgressChanged       += new ProgressChangedEventHandler(controllerSearcher_ProgressChanged);

            this.controllerSearcher.StartSearch();
            this.progressForm.ShowDialog();
        }