Esempio n. 1
0
        public FirmwareWindow(lr4 lx4Device, string CurrentFwVersion)
        {
            InitializeComponent();

            lbCurrentVersion.Text = CurrentFwVersion;

            FwMsgBox.AppendText("Messages...\n");
            UpdateIsRunning = false;
            FwUpdater       = new FirmwareUpdate(lx4Device, FwMsgBox);

            cbReleases.Items.Add("Searching...");
            cbReleases.SelectedIndex = 0;
            LrfFirmware = new ReleaseCatalog();
            cbReleases.Items.Clear();
            if (LrfFirmware.Catalog.Length == 0)
            {
                cbReleases.Items.Add("Error connecting");
                cbReleases.SelectedIndex = 0;
            }
            else
            {
                for (int i = 0; i < LrfFirmware.Catalog.Length; i++)
                {
                    string s = LrfFirmware.Catalog[i].Product + " : "
                               + LrfFirmware.Catalog[i].FirmwareVersion + "    ("
                               + LrfFirmware.Catalog[i].ReleaseDate + ")";
                    cbReleases.Items.Add(s);
                }
                cbReleases.SelectedIndex = cbReleases.Items.Count - 1;
            }
        }
        public MainWindow()
        {
            InitializeComponent();
            Aim = new Aimer(canvasAim);

            lx4Device = lr4.Enumerate(SupportedDevices).FirstOrDefault();
            if (lx4Device != null)
            {
                lx4Device.Inserted     += Lx4Inserted;
                lx4Device.DataRecieved += Lx4DataRecieved;
                lx4Device.Removed      += Lx4Removed;
                lx4Device.StartListen();

                //lx4Device.StopListen();
                //lx4Device.Dispose();
            }
            rsAimX.Changed += AimingChanged;
            rsAimY.Changed += AimingChanged;
        }
 public FirmwareUpdate(lr4 lx4Device, TextBox MsgBox)
 {
     this.lx4Device = lx4Device;
     this.MsgBox    = MsgBox;
 }