public MainWindow()
        {
            InitializeComponent();

            usbController = new usbDevice(0x04D8, 0x0045);
            usbController.usbEvent += new usbDevice.usbEventsHandler(usbEvent_receiver);
            usbController.findTargetDevice();
            settings = new AppSettings();
            settings = config.SetDefaultConfig();

            _kflop.initdevice(usbController, settings);

            if (UsbConnected)
            {
                usbController.setSolderingIron1TargetTemperature(380.0f);
                usbController.setSolderingIron2TargetTemperature(380.0f);        
                ConfigLoaded = true;
               
                dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
               dispatcherTimer.Interval = new TimeSpan(0, 0, 2);
                dispatcherTimer.Start();
            }


            
        }
Beispiel #2
0
        public void initdevice(usbDevice _usb, AppSettings _settings)
        {
            settings = _settings;
            usb      = _usb;
            Debug.WriteLine("Init Device");
            _Controller = new KMotion_dotNet.KM_Controller();
            //  AddHandlers();


            if (_Controller.BoardID > 0)
            {
                initdevicesettings();
                backgroundWorkerSolderJob.DoWork                    += worker_DoWork;
                backgroundWorkerSolderJob.RunWorkerCompleted        += worker_RunWorkerCompleted;
                backgroundWorkerSolderJob.WorkerSupportsCancellation = true;
            }
            else
            {
                MessageBox.Show("Kflop not detected");
            }
        }
        public MainWindow()
        {
            InitializeComponent();

            usbController           = new usbDevice(0x04D8, 0x0045);
            usbController.usbEvent += new usbDevice.usbEventsHandler(usbEvent_receiver);
            usbController.findTargetDevice();
            settings = new AppSettings();
            settings = config.SetDefaultConfig();

            _kflop.initdevice(usbController, settings);

            if (UsbConnected)
            {
                usbController.setSolderingIron1TargetTemperature(380.0f);
                usbController.setSolderingIron2TargetTemperature(380.0f);
                ConfigLoaded = true;

                dispatcherTimer.Tick    += new EventHandler(dispatcherTimer_Tick);
                dispatcherTimer.Interval = new TimeSpan(0, 0, 2);
                dispatcherTimer.Start();
            }
        }
        public void initdevice(usbDevice _usb, AppSettings _settings)
        {
            settings = _settings;
            usb = _usb;
            Debug.WriteLine("Init Device");
            _Controller = new KMotion_dotNet.KM_Controller();
          //  AddHandlers();

            
               if (_Controller.BoardID > 0)
               {
                 
                  initdevicesettings();
                  backgroundWorkerSolderJob.DoWork += worker_DoWork;
                  backgroundWorkerSolderJob.RunWorkerCompleted += worker_RunWorkerCompleted;
                  backgroundWorkerSolderJob.WorkerSupportsCancellation = true;

                 

                 
               }
               else
               {
                   MessageBox.Show("Kflop not detected");
               }
        }