Example #1
0
        /*
         * private void LedsAllBlack()
         * {
         *  var array = new byte[7];
         *  array[0] = 0xb8;
         *  array[1] = 0;
         *  array[2] = 0;
         *  array[3] = 0;
         *  array[4] = 0;
         *  array[5] = 0;
         *  array[6] = 0;
         *  //todo
         *  var bip = new BacklitPanelBIP(Settings.Default.BIPLedStrength, null, null);
         *  bip.SendLEDData(array);
         * }
         */
        /*
         * private void PrintBitStrings(byte[] array)
         * {
         *  TextBoxBits.Text = "";
         *  for (int i = 0; i < array.Length; i++)
         *  {
         *      var str = Convert.ToString(array[i], 2).PadLeft(8, '0');
         *      TextBoxBits.Text = TextBoxBits.Text + "  " + str;
         *  }
         * }
         *
         * private void TextBoxBIP_OnKeyDown(object sender, KeyEventArgs e)
         * {
         *  if (e.Key == Key.Enter)
         *  {
         *      Send();
         *
         *  }
         * }
         *
         * private void ButtonClearBIP_OnClick(object sender, RoutedEventArgs e)
         * {
         *  TextBox0BIP.Text = "0x0";
         *  TextBox1BIP.Text = "0x0";
         *  TextBox2BIP.Text = "0x0";
         *  TextBox3BIP.Text = "0x0";
         *  TextBox4BIP.Text = "0x0";
         *  TextBox5BIP.Text = "0x0";
         *  LedsAllBlack();
         * }
         */

        private void ShowGraphicConfiguration()
        {
            try
            {
                if (!_loaded)
                {
                    return;
                }
                HideAllConfigurationExistsImages();
                var bipPositions = CommonClassLibraryJD.EnumEx.GetValues <BIPLedPositionEnum>();
                foreach (var position in bipPositions)
                {
                    SetLEDImage(position, _backlitPanelBIP.GetColor(position));
                    SetConfigExistsImageVisibility(_backlitPanelBIP.HasConfiguration(position), position);
                }
            }
            catch (Exception ex)
            {
                Common.ShowErrorMessageBox(2066, ex);
            }
        }
Example #2
0
        private void ShowGraphicConfiguration()
        {
            try
            {
                if (!UserControlLoaded)
                {
                    return;
                }
                HideAllConfigurationExistsImages();
                var bipPositions = ClassLibraryCommon.EnumEx.GetValues <BIPLedPositionEnum>();
                foreach (var position in bipPositions)
                {
                    SetLEDImage(position, _backlitPanelBIP.GetColor(position));
                    SetConfigExistsImageVisibility(_backlitPanelBIP.HasConfiguration(position), position);
                }

                TextBoxBrightnessControl.Text = _backlitPanelBIP.BrightnessBinding != null ? _backlitPanelBIP.BrightnessBinding.ControlId : string.Empty;
            }
            catch (Exception ex)
            {
                Common.ShowErrorMessageBox(ex);
            }
        }