示例#1
0
        public void OnImageUpdate()
        {
            if (loadingSpinner.Running)
            {
                loadingSpinner.Stop();
            }

            if (!imageScreen.Enabled)
            {
                imageScreen.Enabled = true;
            }

            if (defaultScreen.Enabled)
            {
                defaultScreen.Enabled = false;
            }

            if (!QTMNetworkConnection.IsMaster &&
                !isDisabledStreamModePlaceholderActive &&
                IsImageMode())
            {
                nodeTextMessage.Enabled = true;
                defaultScreen.Enabled   = true;
            }
            else if (ImageData != null)
            {
                nodeTextMessage.Enabled = false;
                LoadImage(ImageData);
            }
        }
 public void Reset()
 {
     Dispatcher.Invoke(() =>
     {
         LoadingSpinner.Visibility = Visibility.Hidden;
         LoadingSpinner.Stop();
         Retry.IsEnabled = true;
         Retry.Text      = "Connect";
     });
 }
 public void Reset()
 {
     Dispatcher.Invoke(() =>
     {
         LoadingSpinner.Visibility = Visibility.Hidden;
         LoadingSpinner.Stop();
         Retry.IsEnabled = true;
         Retry.Text      = Loc.GetString("connlost_connect");
     });
 }
示例#4
0
 public void SetLoaderVisible(bool b)
 {
     Dispatcher.Invoke(() =>
     {
         LoadingSpinner.Visibility = b ? Visibility.Visible : Visibility.Hidden;
         if (b)
         {
             LoadingSpinner.Start();
         }
         else
         {
             LoadingSpinner.Stop();
         }
     });
 }
 private void InstanceOnGetAllDataResponse(object sender, DebugGetAllDataParser e)
 {
     Dispatcher.Invoke(() =>
     {
         LoadingSpinner.Visibility = Visibility.Hidden;
         LoadingSpinner.Stop();
         HwVer.TextDetail      = e.HardwareVersion;
         SwVer.TextDetail      = e.SoftwareVersion;
         TouchFwVer.TextDetail = e.TouchSoftwareVersion;
         BtAddr.TextDetail     = $"{Left}: {e.LeftBluetoothAddress}, {Right}: {e.RightBluetoothAddress}";
         Proximity.TextDetail  = $"{Left}: {e.LeftProximity:N}, {Right}: {e.RightProximity:N}";
         Thermo.TextDetail     = $"{Left}: {e.LeftThermistor:N} °C, {Right}: {e.RightThermistor:N} °C";
         AdcSoc.TextDetail     = $"{Left}: {e.LeftAdcSOC:N}%, {Right}: {e.RightAdcSOC:N}%";
         AdcVoltage.TextDetail = $"{Left}: {e.LeftAdcVCell:N}V, {Right}: {e.RightAdcVCell:N}V";
         AdcCurrent.TextDetail = $"{Left}: {e.LeftAdcCurrent:N}mA, {Right}: {e.RightAdcCurrent:N}mA";
         Hall.TextDetail       = $"{Left}: {e.LeftHall}, {Right}: {e.RightHall}";
     });
 }
        private void InstanceOnResetResponse(object sender, int e)
        {
            Dispatcher.Invoke(() =>
            {
                LoadingSpinner.Visibility = Visibility.Hidden;
                LoadingSpinner.Stop();
                BackButton.Visibility  = Visibility.Visible;
                FactoryReset.IsEnabled = true;
                FactoryReset.Text      = Loc.GetString("factory_confirm");

                if (e != 0)
                {
                    MessageBox.Show(string.Format(Loc.GetString("factory_error"), e),
                                    Loc.GetString("factory_error_title"), MessageBoxButton.OK, MessageBoxImage.Error);
                }

                _mainWindow.ReturnToHome();
            });
        }
示例#7
0
        private void InstanceOnResetResponse(object sender, int e)
        {
            Dispatcher.Invoke(() =>
            {
                LoadingSpinner.Visibility = Visibility.Hidden;
                LoadingSpinner.Stop();
                BackButton.Visibility  = Visibility.Visible;
                FactoryReset.IsEnabled = true;
                FactoryReset.Text      = "Confirm factory reset";

                if (e != 0)
                {
                    MessageBox.Show($"Device returned error code: {e}\n" +
                                    $"Make sure both Earbuds are turned on and reachable.\n" +
                                    $"You might need to manually reconnect your Earbuds.", "Factory reset failed",
                                    MessageBoxButton.OK, MessageBoxImage.Error);
                }

                _mainWindow.ReturnToHome();
            });
        }
        private void InstanceOnSelfTestResponse(object sender, SelfTestParser e)
        {
            Dispatcher.Invoke(() =>
            {
                LoadingSpinner.Visibility = Visibility.Hidden;
                LoadingSpinner.Stop();

                HwVer.TextDetail       = strfy(e.HardwareVersion);
                SwVer.TextDetail       = strfy(e.SoftwareVersion);
                TouchFwVer.TextDetail  = strfy(e.TouchFirmwareVersion);
                BtAddr.TextDetail      = $"Left: {strfy(e.LeftBluetoothAddress)}, Right: {strfy(e.RightBluetoothAddress)}";
                Proximity.TextDetail   = $"Left: {strfy(e.LeftProximity)}, Right: {strfy(e.RightProximity)}";
                Thermo.TextDetail      = $"Left: {strfy(e.LeftThermistor)}, Right: {strfy(e.RightThermistor)}";
                AdcSoc.TextDetail      = $"Left: {strfy(e.LeftAdcSOC)}, Right: {strfy(e.RightAdcSOC)}";
                AdcVoltage.TextDetail  = $"Left: {strfy(e.LeftAdcVCell)}, Right: {strfy(e.RightAdcVCell)}";
                AdcCurrent.TextDetail  = $"Left: {strfy(e.LeftAdcCurrent)}, Right: {strfy(e.RightAdcCurrent)}";
                Hall.TextDetail        = $"Left: {strfy(e.LeftHall)}, Right: {strfy(e.RightHall)}";
                Accelerator.TextDetail = $"Left: {strfy(e.AllLeftAccelerator)}, Right: {strfy(e.AllRightAccelerator)}";

                SelfTestResult.Text = e.AllChecks ? "All checks have passed" : "One or more checks have failed";
            });
        }