Exemplo n.º 1
0
        public SubControlMobileStoreFrontOptionPanel(PanelMode paPanelMode)
        {
            clMetaDataBlockCollection = null;
            clPanelMode = paPanelMode;

            SC_PanelMetaData = null;
        }
Exemplo n.º 2
0
 public Panel(PanelType type, PanelMode mode, PanelLoad load)
 {
     this.m_manager    = UIManager.Instance;
     this.panelType    = type;
     this.panelMode    = mode;
     this.panelLoad    = load;
     this.name         = this.GetType().ToString();
     this.m_panelState = PanelState.None;
 }
Exemplo n.º 3
0
        public CommandPanel(string[] args, PanelMode mode = PanelMode.CONSOLE)
        {
            this.mode = mode;

            if (mode.Equals(PanelMode.GUI))
            {
                Environment.FailFast("Sorry, we still don't have support for GUI mode.");
            }

            this.args = args;
        }
Exemplo n.º 4
0
        public GraphPanel()
        {
            InitializeComponent();

            points.Add(new Vertex(100, 150));
            points.Add(new Vertex(200, 120));
            points.Add(new Vertex(300, 90));
            points.Add(new Vertex(400, 160));
            points.Add(new Vertex(500, 290));

            this.MouseDown += PanelMouseDown;
            PanelMode       = PanelMode.DrawEdge;
        }
Exemplo n.º 5
0
    public void ActivatePanel(PanelController panelToActivate, PanelMode panelMode)
    {
        switch (panelMode)
        {
        case PanelMode.SINGLE:
            ActivatePanel(panelToActivate);
            break;

        case PanelMode.MULTIPLE:
            panelToActivate.Panel.SetActive(true);
            break;
        }
    }
Exemplo n.º 6
0
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (listBox1.SelectedIndex)
            {
            case 1:
                theMode = PanelMode.Groovy;
                break;

            case 0:
                theMode = PanelMode.Tabby;
                break;
            }
        }
Exemplo n.º 7
0
        public void Resize(PanelMode mode)
        {
            var icon = resizeButton.transform.GetChild(0);

            CurrentPanelMode = mode;
            switch (mode)
            {
            case PanelMode.Collapsed:
                TweenToolbar(collapsedPosition, scaleEffectDuration);
                CollapseButton.GetComponent <Button> ().interactable = false;
                resizeButton.GetComponent <Button> ().interactable   = true;
                RotateTarget(icon.gameObject, new Vector3(0f, 0f, 0f), 0.3f);
                break;

            case PanelMode.Open:
                TweenToolbar(openedPosition, scaleEffectDuration);
                elementLayout.constraint      = GridLayoutGroup.Constraint.FixedRowCount;
                elementLayout.constraintCount = 1;

                RotateTarget(icon.gameObject, new Vector3(0f, 0f, 0f), 0.3f);
                CollapseButton.GetComponent <Button> ().interactable = true;
                break;

            case PanelMode.Expanded:
                TweenToolbar(expandedPosition, scaleEffectDuration);

                // TODO: Make this work aspect ratios other than 16:9 and 16:10
                // var layoutTransform = elementLayout.GetComponent<RectTransform> ();
                elementLayout.constraint = GridLayoutGroup.Constraint.FixedColumnCount;
                //Debug.LogFormat ("size delta x: {0}, cellSize.x: {1}", layoutTransform.sizeDelta.x, elementLayout.cellSize.x);
                elementLayout.constraintCount = Mathf.FloorToInt(Screen.width / elementLayout.cellSize.x);

                CollapseButton.GetComponent <Button> ().interactable = true;

                RotateTarget(icon.gameObject, new Vector3(0f, 0f, 180f), 0.3f);
                break;
            }
        }
Exemplo n.º 8
0
 private void SwitchButtons(PanelMode panelMode, Color backColor, Color labelColor)
 {
     SetButtonStyle(btnEconomyMode, panelMode, backColor, labelColor);
     SetButtonStyle(btnNormalMode, panelMode, backColor, labelColor);
     SetButtonStyle(btnSportMode, panelMode, backColor, labelColor);
     SetButtonStyle(simpleButton1, panelMode, backColor, labelColor);
 }
Exemplo n.º 9
0
        private void SwitchRealtimePanelMode(PanelMode panelMode)
        {
            m_appSettings.Panelmode = panelMode;
            Color backColor = Color.FromArgb(232, 232, 232);
            Color foreColor = Color.Black;
            Color labelColor = Color.Black;
            switch (panelMode)
            {
                case PanelMode.Day:
                    // set colorscheme to day, brighter colors
                    backColor = Color.Transparent;//Color.FromArgb(232, 232, 232);
                    foreColor = Color.Black;
                    labelColor = Color.Black;
                    simpleButton1.Text = "Night";
                    break;
                case PanelMode.Night:
                    // set colorscheme to day, darker colors
                    backColor = Color.Black;
                    foreColor = Color.FromArgb(234, 77, 0);
                    labelColor = Color.FromArgb(0, 192, 0);
                    simpleButton1.Text = "Day";
                    break;
            }
            SetTabControlView(xtraTabControl1, panelMode, backColor, labelColor);
            SwitchButtons(panelMode, backColor, labelColor);

            SetColorForMeasurement(measurementAirmassRequest, backColor, foreColor, labelColor);
            SetColorForMeasurement(measurementBoost, backColor, foreColor, labelColor);
            SetColorForMeasurement(measurementCalculatedPower, backColor, foreColor, labelColor);
            SetColorForMeasurement(measurementCalculatedTorque, backColor, foreColor, labelColor);
            SetColorForMeasurement(measurementDutyCycleBCV, backColor, foreColor, labelColor);
            //SetColorForMeasurement(measurementEGT, backColor, foreColor);
            SetColorForMeasurement(measurementIgnitionAdvance, backColor, foreColor, labelColor);
            SetColorForMeasurement(measurementIgnitionOffset, backColor, foreColor, labelColor);
            SetColorForMeasurement(measurementPedalPosition, backColor, foreColor, labelColor);
            SetColorForMeasurement(measurementSpeed, backColor, foreColor, labelColor);

            foreach (Control c in panelBottom.Controls)
            {
                if (c is Owf.Controls.DigitalDisplayControl)
                {
                    Owf.Controls.DigitalDisplayControl ctrl = (Owf.Controls.DigitalDisplayControl)c;
                    ctrl.DigitColor = foreColor;
                    ctrl.BackColor = backColor;
                }
                else if (c is DevExpress.XtraEditors.LabelControl)
                {
                    DevExpress.XtraEditors.LabelControl lbl = (DevExpress.XtraEditors.LabelControl)c;
                    lbl.BackColor = backColor;
                    if (panelMode == PanelMode.Night)
                    {
                        lbl.ForeColor = labelColor;
                    }
                    else
                    {
                        if (lbl.Name == "labelControl9")
                        {
                            lbl.ForeColor = Color.DarkGreen;
                        }
                        else if (lbl.Name == "labelControl10")
                        {
                            lbl.ForeColor = Color.DarkBlue;
                        }
                        else if (lbl.Name == "labelControl12")
                        {
                            lbl.ForeColor = Color.Maroon;
                        }
                        else
                        {
                            lbl.ForeColor = labelColor;
                        }
                    }
                }
            }
            foreach (Control c in dockRealtime.Controls)
            {
                c.BackColor = backColor;
                c.ForeColor = foreColor;
            }
            if (backColor == Color.Black)
            {
                toolStrip2.BackColor = backColor;
                toolStrip2.GripStyle = ToolStripGripStyle.Hidden;
            }
            else
            {
                toolStrip2.GripStyle = ToolStripGripStyle.Visible;
                toolStrip2.BackColor = Color.Empty;
            }
            gridRealtime.BackColor = backColor;
            gridRealtime.ForeColor = foreColor;
            tableLayoutPanel1.BackColor = backColor;
            tableLayoutPanel1.ForeColor = foreColor;
            linearGauge1.BackColor = backColor;
            linearGauge1.ForeColor = foreColor;
            linearGauge1.TextColor = foreColor;
            linearGauge1.TickColor = foreColor;
            linearGauge2.BackColor = backColor;
            linearGauge2.ForeColor = foreColor;
            linearGauge2.TextColor = foreColor;
            linearGauge2.TickColor = foreColor;
            if (backColor == Color.Black)
            {
                linearGauge1.BevelLineColor = backColor;
                linearGauge2.BevelLineColor = backColor;
            }
            else
            {
                linearGauge1.BevelLineColor = Color.DimGray;
                linearGauge2.BevelLineColor = Color.DimGray;
            }
            SetViewRealtime(panelMode);
            System.Windows.Forms.Application.DoEvents();
        }
Exemplo n.º 10
0
 private void SetTabPageView(DevExpress.XtraTab.XtraTabPage page, PanelMode panelMode, Color nightColor)
 {
     if (panelMode == PanelMode.Day)
     {
         page.BackColor = Color.Empty;
         page.Appearance.Header.BackColor = Color.Empty;
         page.Appearance.Header.BackColor2 = Color.Empty;
         page.Appearance.Header.BorderColor = Color.Empty;
         page.Appearance.PageClient.BackColor = Color.Empty;
         page.Appearance.PageClient.BackColor2 = Color.Empty;
         page.Appearance.PageClient.BorderColor = Color.Empty;
     }
     else
     {
         page.BackColor = nightColor;
         page.Appearance.Header.BackColor = nightColor;
         page.Appearance.Header.BackColor2 = nightColor;
         page.Appearance.Header.BorderColor = nightColor;
         page.Appearance.PageClient.BackColor = nightColor;
         page.Appearance.PageClient.BackColor2 = nightColor;
         page.Appearance.PageClient.BorderColor = nightColor;
     }
 }
Exemplo n.º 11
0
 private void SetViewRealtime(PanelMode panelMode)
 {
     if (panelMode == PanelMode.Night)
     {
         ViewRealtime.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
         ViewRealtime.Appearance.Empty.BackColor = Color.Black;
         ViewRealtime.Appearance.Empty.BackColor2 = Color.Black;
         ViewRealtime.Appearance.Empty.ForeColor = Color.FromArgb(0, 192, 0);
         ViewRealtime.Appearance.FocusedCell.BackColor = Color.Black;
         ViewRealtime.Appearance.FocusedCell.BackColor2 = Color.Black;
         ViewRealtime.Appearance.FocusedCell.ForeColor = Color.FromArgb(0, 192, 0);
         ViewRealtime.Appearance.FocusedRow.BackColor = Color.Black;
         ViewRealtime.Appearance.FocusedRow.BackColor2 = Color.Black;
         ViewRealtime.Appearance.FocusedRow.ForeColor = Color.FromArgb(0, 192, 0);
         ViewRealtime.Appearance.Row.BackColor = Color.Black;
         ViewRealtime.Appearance.Row.BackColor2 = Color.Black;
         ViewRealtime.Appearance.Row.ForeColor = Color.FromArgb(0, 192, 0);
         ViewRealtime.Appearance.SelectedRow.BackColor = Color.Black;
         ViewRealtime.Appearance.SelectedRow.BackColor2 = Color.Black;
         ViewRealtime.Appearance.SelectedRow.ForeColor = Color.FromArgb(0, 192, 0);
         ViewRealtime.OptionsView.ShowColumnHeaders = false;
         ViewRealtime.OptionsView.ShowHorzLines = false;
         ViewRealtime.OptionsView.ShowVertLines = false;
         ViewRealtime.OptionsBehavior.Editable = false;
     }
     else
     {
         ViewRealtime.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Default;
         ViewRealtime.Appearance.Empty.BackColor = Color.Empty;
         ViewRealtime.Appearance.Empty.BackColor2 = Color.Empty;
         ViewRealtime.Appearance.Empty.ForeColor = Color.Empty;
         ViewRealtime.Appearance.FocusedCell.BackColor = Color.Empty;
         ViewRealtime.Appearance.FocusedCell.BackColor2 = Color.Empty;
         ViewRealtime.Appearance.FocusedCell.ForeColor = Color.Empty;
         ViewRealtime.Appearance.FocusedRow.BackColor = Color.Empty;
         ViewRealtime.Appearance.FocusedRow.BackColor2 = Color.Empty;
         ViewRealtime.Appearance.FocusedRow.ForeColor = Color.Empty;
         ViewRealtime.Appearance.Row.BackColor = Color.Empty;
         ViewRealtime.Appearance.Row.BackColor2 = Color.Empty;
         ViewRealtime.Appearance.Row.ForeColor = Color.Empty;
         ViewRealtime.Appearance.SelectedRow.BackColor = Color.Empty;
         ViewRealtime.Appearance.SelectedRow.BackColor2 = Color.Empty;
         ViewRealtime.Appearance.SelectedRow.ForeColor = Color.Empty;
         ViewRealtime.OptionsView.ShowColumnHeaders = true;
         //ViewRealtime.OptionsView.ShowHorzLines = true;
         ViewRealtime.OptionsView.ShowHorizontalLines = DevExpress.Utils.DefaultBoolean.True;
         //ViewRealtime.OptionsView.ShowVertLines = true;
         ViewRealtime.OptionsView.ShowVerticalLines = DevExpress.Utils.DefaultBoolean.True;
         ViewRealtime.OptionsBehavior.Editable = false;
     }
 }
Exemplo n.º 12
0
        private void SetButtonStyle(DevExpress.XtraEditors.SimpleButton btn, PanelMode panelMode, Color backColor, Color labelColor)
        {
            if (panelMode == PanelMode.Day)
            {
                btn.LookAndFeel.UseDefaultLookAndFeel = true;
                btn.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Default;
                btn.Appearance.BorderColor = Color.Empty;
                btn.Appearance.BackColor = Color.Empty;
                btn.Appearance.BackColor2 = Color.Empty;
                btn.BackColor = Color.Empty;
                btn.ForeColor = Color.Empty;
            }
            else
            {
                btn.LookAndFeel.UseDefaultLookAndFeel = false;

                btn.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
                btn.Appearance.BorderColor = backColor;
                btn.Appearance.BackColor = backColor;
                btn.Appearance.BackColor2 = backColor;
                btn.BackColor = backColor;
                btn.ForeColor = labelColor;

            }
        }
Exemplo n.º 13
0
        private void SetTabControlView(DevExpress.XtraTab.XtraTabControl tabcontrol, PanelMode panelMode, Color nightColor, Color labelColor)
        {
            //logger.Debug("Switching tab control!");
            if (panelMode == PanelMode.Day)
            {
                tabcontrol.LookAndFeel.UseDefaultLookAndFeel = true;
                tabcontrol.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Skin;
                tabcontrol.LookAndFeel.SkinName = defaultLookAndFeel1.LookAndFeel.SkinName;

                tabcontrol.HeaderAutoFill = DevExpress.Utils.DefaultBoolean.True;
                tabcontrol.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Default;
                tabcontrol.BorderStylePage = DevExpress.XtraEditors.Controls.BorderStyles.Default;
                tabcontrol.Appearance.BackColor = Color.Empty;
                tabcontrol.Appearance.BackColor2 = Color.Empty;
                tabcontrol.Appearance.BorderColor = Color.Empty;
                tabcontrol.Appearance.ForeColor = Color.Empty;
                tabcontrol.AppearancePage.Header.BorderColor = Color.Empty;
                tabcontrol.AppearancePage.Header.BackColor = Color.Empty;
                tabcontrol.AppearancePage.Header.BackColor2 = Color.Empty;
                tabcontrol.AppearancePage.Header.ForeColor = Color.Empty;
                tabcontrol.AppearancePage.HeaderActive.BorderColor = Color.Empty;
                tabcontrol.AppearancePage.HeaderActive.BackColor = Color.Empty;
                tabcontrol.AppearancePage.HeaderActive.BackColor2 = Color.Empty;
                tabcontrol.AppearancePage.HeaderActive.ForeColor = Color.Empty;
                tabcontrol.AppearancePage.HeaderDisabled.BorderColor = Color.Empty;
                tabcontrol.AppearancePage.HeaderDisabled.BackColor = Color.Empty;
                tabcontrol.AppearancePage.HeaderDisabled.BackColor2 = Color.Empty;
                tabcontrol.AppearancePage.HeaderDisabled.ForeColor = Color.Empty;
                tabcontrol.AppearancePage.HeaderHotTracked.BorderColor = Color.Empty;
                tabcontrol.AppearancePage.HeaderHotTracked.BackColor = Color.Empty;
                tabcontrol.AppearancePage.HeaderHotTracked.BackColor2 = Color.Empty;
                tabcontrol.AppearancePage.HeaderHotTracked.ForeColor = Color.Empty;
                tabcontrol.AppearancePage.PageClient.BackColor = Color.Empty;
                tabcontrol.AppearancePage.PageClient.BackColor2 = Color.Empty;
                tabcontrol.AppearancePage.PageClient.ForeColor = Color.Empty;

            }
            else
            {
                tabcontrol.LookAndFeel.UseDefaultLookAndFeel = false;
                tabcontrol.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Flat;
                //tabcontrol.LookAndFeel.SkinName = "Dark Side";

                tabcontrol.HeaderAutoFill = DevExpress.Utils.DefaultBoolean.True;
                tabcontrol.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
                tabcontrol.BorderStylePage = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
                tabcontrol.Appearance.BackColor = nightColor;
                tabcontrol.Appearance.BackColor2 = nightColor;
                tabcontrol.Appearance.BorderColor = nightColor;
                tabcontrol.BackColor = nightColor;
                tabcontrol.Appearance.ForeColor = labelColor;
                tabcontrol.AppearancePage.Header.BorderColor = Color.OrangeRed;
                tabcontrol.AppearancePage.Header.BackColor = nightColor;
                tabcontrol.AppearancePage.Header.BackColor2 = nightColor;
                tabcontrol.AppearancePage.Header.ForeColor = Color.FromArgb(48, 148, 48);
                tabcontrol.AppearancePage.HeaderActive.BorderColor = Color.OrangeRed;
                tabcontrol.AppearancePage.HeaderActive.BackColor = nightColor;
                tabcontrol.AppearancePage.HeaderActive.BackColor2 = nightColor;
                tabcontrol.AppearancePage.HeaderActive.ForeColor = Color.FromArgb(0, 192, 0);
                tabcontrol.AppearancePage.HeaderDisabled.BorderColor = Color.OrangeRed;
                tabcontrol.AppearancePage.HeaderDisabled.BackColor = nightColor;
                tabcontrol.AppearancePage.HeaderDisabled.BackColor2 = nightColor;
                tabcontrol.AppearancePage.HeaderDisabled.ForeColor = Color.FromArgb(0, 192, 0);
                tabcontrol.AppearancePage.HeaderHotTracked.BorderColor = Color.OrangeRed;
                tabcontrol.AppearancePage.HeaderHotTracked.BackColor = nightColor;
                tabcontrol.AppearancePage.HeaderHotTracked.BackColor2 = nightColor;
                tabcontrol.AppearancePage.HeaderHotTracked.ForeColor = Color.FromArgb(0, 192, 0);

                tabcontrol.AppearancePage.PageClient.BackColor = nightColor;
                tabcontrol.AppearancePage.PageClient.BackColor2 = nightColor;
                tabcontrol.AppearancePage.PageClient.ForeColor = Color.FromArgb(0, 192, 0);
            }
            foreach (DevExpress.XtraTab.XtraTabPage page in tabcontrol.TabPages)
            {
                //logger.Debug("Switching tab page: " + page.Name);
                SetTabPageView(page, panelMode, nightColor);
            }
        }
Exemplo n.º 14
0
        public void Save(TextBlock block)
        {
            block.SetAttribute(nameof(PanelMode), PanelMode.ToString());
            if (ListMode != ContentBrowser.ListModeEnum.List)
            {
                block.SetAttribute(nameof(ListMode), ListMode.ToString());
            }
            if (TileImageSize != TileImageSizeDefault)
            {
                block.SetAttribute(nameof(TileImageSize), TileImageSize.ToString());
            }
            if (ListImageSize != ListImageSizeDefault)
            {
                block.SetAttribute(nameof(ListImageSize), ListImageSize.ToString());
            }
            if (ListColumnWidth != ListColumnWidthDefault)
            {
                block.SetAttribute(nameof(ListColumnWidth), ListColumnWidth.ToString());
            }
            if (!Breadcrumb)
            {
                block.SetAttribute(nameof(Breadcrumb), Breadcrumb.ToString());
            }
            if (DisplayPropertiesSortFilesBy)
            {
                if (SortFilesBy != ContentBrowser.SortByItems.Name)
                {
                    block.SetAttribute(nameof(SortFilesBy), SortFilesBy.ToString());
                }
                if (!SortFilesByAscending)
                {
                    block.SetAttribute(nameof(SortFilesByAscending), SortFilesByAscending.ToString());
                }
            }
            if (owner.Mode == ContentBrowser.ModeEnum.Resources)
            {
                if (!FilteringModeButton)
                {
                    block.SetAttribute(nameof(FilteringModeButton), FilteringModeButton.ToString());
                }
            }
            if (owner.Mode == ContentBrowser.ModeEnum.Objects)
            {
                if (!MembersButton)
                {
                    block.SetAttribute(nameof(MembersButton), MembersButton.ToString());
                }
            }
            if (DisplayPropertiesOpenButton)
            {
                if (!OpenButton)
                {
                    block.SetAttribute(nameof(OpenButton), OpenButton.ToString());
                }
            }
            if (DisplayPropertiesEditorSettingsButtons)
            {
                if (!EditorButton)
                {
                    block.SetAttribute(nameof(EditorButton), EditorButton.ToString());
                }
                if (!SettingsButton)
                {
                    block.SetAttribute(nameof(SettingsButton), SettingsButton.ToString());
                }
            }
            if (!ButtonsForEditing)
            {
                block.SetAttribute(nameof(ButtonsForEditing), ButtonsForEditing.ToString());
            }
            if (owner.Mode == ContentBrowser.ModeEnum.Objects)
            {
                if (!SearchButton)
                {
                    block.SetAttribute(nameof(SearchButton), SearchButton.ToString());
                }
            }

            //!!!!
            if (!SearchBar)
            {
                block.SetAttribute(nameof(SearchBar), SearchBar.ToString());
            }

            block.SetAttribute(nameof(SplitterPosition), SplitterPosition.ToString());
        }
Exemplo n.º 15
0
        public AppSettings()
        {
            // laad alle waarden uit het register
            RegistryKey SoftwareKey = Registry.CurrentUser.CreateSubKey("Software");
            RegistryKey ManufacturerKey = SoftwareKey.CreateSubKey("MattiasC");

            using (RegistryKey Settings = ManufacturerKey.CreateSubKey("T8SuitePro"))
            {
                if (Settings != null)
                {
                    string[] vals = Settings.GetValueNames();
                    foreach (string a in vals)
                    {
                        try
                        {
                            if (a == "MeasureAFRInLambda")
                            {
                                m_MeasureAFRInLambda = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "MapDetectionActive")
                            {
                                m_MapDetectionActive = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "ViewInHex")
                            {
                                m_viewinhex = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "DebugMode")
                            {
                                m_debugmode = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "LastFilename")
                            {
                                m_lastfilename = Settings.GetValue(a).ToString();
                            }
                            else if (a == "AutoExtractSymbols")
                            {
                                m_AutoExtractSymbols = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "WriteECUBatchfile")
                            {
                                m_write_ecubatchfile = Settings.GetValue(a).ToString();
                            }
                            else if (a == "TargetECUReadFile")
                            {
                                m_TargetECUReadFile = Settings.GetValue(a).ToString();
                            }
                            else if (a == "AutoChecksum")
                            {
                                m_AutoChecksum = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "ShowAddressesInHex")
                            {
                                m_ShowAddressesInHex = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }

                            else if (a == "HideSymbolTable")
                            {
                                m_HideSymbolTable = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "ShowGraphs")
                            {
                                m_ShowGraphs = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AutoSizeNewWindows")
                            {
                                m_AutoSizeNewWindows = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AutoSizeColumnsInWindows")
                            {
                                m_AutoSizeColumnsInWindows = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "Skinname")
                            {
                                m_skinname = Settings.GetValue(a).ToString();
                            }
                            else if (a == "PanelMode")
                            {
                                _panelmode = (PanelMode)Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "Showpopupmap")
                            {
                                m_Showpopupmap = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }

                            else if (a == "ReadECUBatchfile")
                            {
                                m_read_ecubatchfile = Settings.GetValue(a).ToString();
                            }
                            else if (a == "ShowRedWhite")
                            {
                                m_ShowRedWhite = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "DisableMapviewerColors")
                            {
                                m_DisableMapviewerColors = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AutoDockSameFile")
                            {
                                m_AutoDockSameFile = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AutoDockSameSymbol")
                            {
                                m_AutoDockSameSymbol = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "ShowViewerInWindows")
                            {
                                m_ShowViewerInWindows = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "NewPanelsFloating")
                            {
                                m_NewPanelsFloating = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "ShowMapPreviewPopup")
                            {
                                m_ShowMapPreviewPopup = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AutoLoadLastFile")
                            {
                                m_AutoLoadLastFile = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "FancyDocking")
                            {
                                m_FancyDocking = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "DefaultViewType")
                            {
                                m_DefaultViewType = (ViewType)Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "DefaultViewSize")
                            {
                                m_DefaultViewSize = (ViewSize)Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "SynchronizeMapviewers")
                            {
                                m_SynchronizeMapviewers = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AllowAskForPartnumber")
                            {
                                m_AllowAskForPartnumber = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "ShowTablesUpsideDown")
                            {
                                m_ShowTablesUpsideDown = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "ShowMenu")
                            {
                                m_ShowMenu = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "RequestProjectNotes")
                            {
                                m_RequestProjectNotes = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "ProjectFolder")
                            {
                                m_ProjectFolder = Settings.GetValue(a).ToString();
                            }
                            else if (a == "LastOpenedType")
                            {
                                m_LastOpenedType = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "LastProjectname")
                            {
                                m_lastprojectname = Settings.GetValue(a).ToString();
                            }
                            else if (a == "OnlyPBus")
                            {
                                m_OnlyPBus = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "InterpolateLogWorksTimescale")
                            {
                                m_InterpolateLogWorksTimescale = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "ResetRealtimeSymbolOnTabPageSwitch")
                            {
                                m_ResetRealtimeSymbolOnTabPageSwitch = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "UseDigitalWidebandLambda")
                            {
                                m_UseDigitalWidebandLambda = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "UseNewMapViewer")
                            {
                                m_UseNewMapViewer = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "Adapter")
                            {
                                m_Adapter = Settings.GetValue(a).ToString();
                            }
                            else if (a == "AdapterType")
                            {
                                m_AdapterType = Settings.GetValue(a).ToString();
                            }
                            else if (a == "thermochannelname")
                            {
                                _thermochannelname = Settings.GetValue(a).ToString();
                            }
                            else if (a == "adc1channelname")
                            {
                                _adc1channelname = Settings.GetValue(a).ToString();
                            }
                            else if (a == "adc2channelname")
                            {
                                _adc2channelname = Settings.GetValue(a).ToString();
                            }
                            else if (a == "adc3channelname")
                            {
                                _adc3channelname = Settings.GetValue(a).ToString();
                            }
                            else if (a == "adc4channelname")
                            {
                                _adc4channelname = Settings.GetValue(a).ToString();
                            }
                            else if (a == "adc5channelname")
                            {
                                _adc5channelname = Settings.GetValue(a).ToString();
                            }
                            else if (a == "usethermo")
                            {
                                _usethermo = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "useadc1")
                            {
                                _useadc1 = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "useadc2")
                            {
                                _useadc2 = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "useadc3")
                            {
                                _useadc3 = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "useadc4")
                            {
                                _useadc4 = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "useadc5")
                            {
                                _useadc5 = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc1highvalue")
                            {
                                _adc1highvalue = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc2highvalue")
                            {
                                _adc2highvalue = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc3highvalue")
                            {
                                _adc3highvalue = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc4highvalue")
                            {
                                _adc4highvalue = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc5highvalue")
                            {
                                _adc5highvalue = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc1lowvalue")
                            {
                                _adc1lowvalue = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc2lowvalue")
                            {
                                _adc2lowvalue = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc3lowvalue")
                            {
                                _adc3lowvalue = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc4lowvalue")
                            {
                                _adc4lowvalue = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc5lowvalue")
                            {
                                _adc5lowvalue = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc1lowvoltage")
                            {
                                _adc1lowvoltage = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc2lowvoltage")
                            {
                                _adc2lowvoltage = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc3lowvoltage")
                            {
                                _adc3lowvoltage = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc4lowvoltage")
                            {
                                _adc4lowvoltage = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc5lowvoltage")
                            {
                                _adc5lowvoltage = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc1highvoltage")
                            {
                                _adc1highvoltage = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc2highvoltage")
                            {
                                _adc2highvoltage = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc3highvoltage")
                            {
                                _adc3highvoltage = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc4highvoltage")
                            {
                                _adc4highvoltage = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc5highvoltage")
                            {
                                _adc5highvoltage = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "WidebandLowVoltage")
                            {
                                m_WidebandLowVoltage = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "WidebandHighVoltage")
                            {
                                m_WidebandHighVoltage = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "WidebandLowAFR")
                            {
                                m_WidebandLowAFR = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "WidebandHighAFR")
                            {
                                m_WidebandHighAFR = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "Baudrate")
                            {
                                _Baudrate = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "LastXAxisFromMatrix")
                            {
                                _LastXAxisFromMatrix = Settings.GetValue(a).ToString();
                            }
                            else if (a == "LastYAxisFromMatrix")
                            {
                                _LastYAxisFromMatrix = Settings.GetValue(a).ToString();
                            }
                            else if (a == "LastZAxisFromMatrix")
                            {
                                _LastZAxisFromMatrix = Settings.GetValue(a).ToString();
                            }
                            else if (a == "notification1Active")
                            {
                                _notification1Active = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "notification2Active")
                            {
                                _notification2Active = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "notification3Active")
                            {
                                _notification3Active = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "notification1condition")
                            {
                                _notification1condition = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "notification2condition")
                            {
                                _notification2condition = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "notification3condition")
                            {
                                _notification3condition = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "notification1sound")
                            {
                                _notification1sound = Settings.GetValue(a).ToString();
                            }
                            else if (a == "notification2sound")
                            {
                                _notification2sound = Settings.GetValue(a).ToString();
                            }
                            else if (a == "notification3sound")
                            {
                                _notification3sound = Settings.GetValue(a).ToString();
                            }
                            else if (a == "notification1symbol")
                            {
                                _notification1symbol = Settings.GetValue(a).ToString();
                            }
                            else if (a == "notification2symbol")
                            {
                                _notification2symbol = Settings.GetValue(a).ToString();
                            }
                            else if (a == "notification3symbol")
                            {
                                _notification3symbol = Settings.GetValue(a).ToString();
                            }
                            else if (a == "notification1value")
                            {
                                _notification1value = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "notification2value")
                            {
                                _notification2value = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "notification3value")
                            {
                                _notification3value = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "WbPort")
                            {
                                _WbPort = Settings.GetValue(a).ToString();
                            }
                            else if (a == "WidebandDevice")
                            {
                                m_WidebandDevice = Settings.GetValue(a).ToString();
                            }
                            else if (a == "WifiPort")
                            {
                                _WifiPort = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                        }
                        catch (Exception E)
                        {
                            logger.Debug("error retrieving registry settings: " + E.Message);
                        }

                    }
                }
            }
        }
Exemplo n.º 16
0
        public void SetPanelMode(PanelMode mode)
        {
            if (CurrentPanel != null)
            {
                CurrentPanel.Visible = false;
                //currentPanel.Remove(); //this doesn't work, so we just leave all the invisible panels.  This is a memory leak.
                CurrentPanel = null;
            }
            switch (mode)
            {
            case PanelMode.Material:

                MaterialPanel         = new MaterialPanel(UI.Root, UserMaterials[CurrentModel], ResourceCache);
                MaterialPanel.Visible = true;

                MaterialPanel.ControlBar.OnPrevious = (args => this.PreviousPanelMode());
                MaterialPanel.ControlBar.OnNext     = (args => this.NextPanelMode());
                MaterialPanel.ControlBar.OnCube     = (args => this.SelectModel("Cube"));
                MaterialPanel.ControlBar.OnSuzanne  = (args => this.SelectModel("Suzanne"));
                MaterialPanel.ControlBar.OnTeapot   = (args => this.SelectModel("Teapot"));
                CurrentPanel   = MaterialPanel;
                this.PanelMode = mode;
                break;

            case PanelMode.Node:

                NodePanel = new NodePanel(UI.Root, UserNodes[CurrentModel], ResourceCache);
                NodePanel.ControlBar.OnPrevious        = (args => this.PreviousPanelMode());
                NodePanel.ControlBar.OnNext            = (args => this.NextPanelMode());
                NodePanel.ControlBar.OnCube            = (args => this.SelectModel("Cube"));
                NodePanel.ControlBar.OnSuzanne         = (args => this.SelectModel("Suzanne"));
                NodePanel.ControlBar.OnTeapot          = (args => this.SelectModel("Teapot"));
                NodePanel.PositionField.OnTextFinished = (args =>
                {
                    UserNodes[CurrentModel].Position = args.Value;
                    CameraNode.UpdatePosition();
                });
                NodePanel.RotationField.OnTextFinished = (args =>
                {
                    UserNodes[CurrentModel].Rotation = new Quaternion(Vector3.Zero, 1.0f);
                    UserNodes[CurrentModel].Rotate(args.Value, TransformSpace.World);
                    CameraNode.UpdatePosition();
                });
                NodePanel.ScaleSlider.SliderChanged += (args) => {
                    UserNodes[CurrentModel].Scale = new Vector3(args.Value, args.Value, args.Value);
                };

                CurrentPanel   = this.NodePanel;
                this.PanelMode = mode;
                break;

            default:
                this.PanelMode = mode;
                break;
            }
            if (Platform == Platforms.Android)
            {
                CurrentPanel.SetAlignment(HorizontalAlignment.Center, VerticalAlignment.Top);
                Renderer.SetViewport(0, new Viewport(Context, scene, Camera, new IntRect(0, CurrentPanel.Height, Graphics.Width, Graphics.Height), null));
            }
            else
            {
                Renderer.SetViewport(0, new Viewport(Context, scene, Camera, new IntRect(0, 0, Graphics.Width, Graphics.Height - CurrentPanel.Height), null));
            }
        }
Exemplo n.º 17
0
        public AppSettings(SuiteRegistry suiteRegistry)
        {
            _suiteRegistry = suiteRegistry;
            // laad alle waarden uit het register
            RegistryKey SoftwareKey = Registry.CurrentUser.CreateSubKey("Software");
            RegistryKey ManufacturerKey = SoftwareKey.CreateSubKey("MattiasC");

            using (RegistryKey Settings = ManufacturerKey.CreateSubKey(_suiteRegistry.getRegistryPath()))
            {
                if (Settings != null)
                {
                    string[] vals = Settings.GetValueNames();
                    foreach (string a in vals)
                    {
                        try
                        {
                            if (a == "MeasureAFRInLambda")
                            {
                                m_MeasureAFRInLambda = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "MapDetectionActive")
                            {
                                m_MapDetectionActive = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "ViewInHex")
                            {
                                m_viewinhex = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "DebugMode")
                            {
                                m_debugmode = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AdminMode")
                            {
                                m_adminmode = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "LastFilename")
                            {
                                m_lastfilename = Settings.GetValue(a).ToString();
                            }
                            else if (a == "AutoExtractSymbols")
                            {
                                m_AutoExtractSymbols = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "LastOpenedType")
                            {
                                m_LastOpenedType = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "PanelMode")
                            {
                                _panelmode = (PanelMode)Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "StandardFill")
                            {
                                m_StandardFill = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "thermochannelname")
                            {
                                _thermochannelname = Settings.GetValue(a).ToString();
                            }
                            else if (a == "adc1channelname")
                            {
                                _adc1channelname = Settings.GetValue(a).ToString();
                            }
                            else if (a == "adc2channelname")
                            {
                                _adc2channelname = Settings.GetValue(a).ToString();
                            }
                            else if (a == "adc3channelname")
                            {
                                _adc3channelname = Settings.GetValue(a).ToString();
                            }
                            else if (a == "adc4channelname")
                            {
                                _adc4channelname = Settings.GetValue(a).ToString();
                            }
                            else if (a == "adc5channelname")
                            {
                                _adc5channelname = Settings.GetValue(a).ToString();
                            }
                            else if (a == "usethermo")
                            {
                                _usethermo = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "useadc1")
                            {
                                _useadc1 = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "useadc2")
                            {
                                _useadc2 = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "useadc3")
                            {
                                _useadc3 = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "useadc4")
                            {
                                _useadc4 = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "useadc5")
                            {
                                _useadc5 = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc1highvalue")
                            {
                                _adc1highvalue = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc2highvalue")
                            {
                                _adc2highvalue = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc3highvalue")
                            {
                                _adc3highvalue = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc4highvalue")
                            {
                                _adc4highvalue = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc5highvalue")
                            {
                                _adc5highvalue = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc1lowvalue")
                            {
                                _adc1lowvalue = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc2lowvalue")
                            {
                                _adc2lowvalue = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc3lowvalue")
                            {
                                _adc3lowvalue = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc4lowvalue")
                            {
                                _adc4lowvalue = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc5lowvalue")
                            {
                                _adc5lowvalue = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc1lowvoltage")
                            {
                                _adc1lowvoltage = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc2lowvoltage")
                            {
                                _adc2lowvoltage = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc3lowvoltage")
                            {
                                _adc3lowvoltage = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc4lowvoltage")
                            {
                                _adc4lowvoltage = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc5lowvoltage")
                            {
                                _adc5lowvoltage = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc1highvoltage")
                            {
                                _adc1highvoltage = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc2highvoltage")
                            {
                                _adc2highvoltage = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc3highvoltage")
                            {
                                _adc3highvoltage = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc4highvoltage")
                            {
                                _adc4highvoltage = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "adc5highvoltage")
                            {
                                _adc5highvoltage = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "WidebandLowVoltage")
                            {
                                m_WidebandLowVoltage = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "WidebandHighVoltage")
                            {
                                m_WidebandHighVoltage = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "WidebandLowAFR")
                            {
                                m_WidebandLowAFR = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "WidebandHighAFR")
                            {
                                m_WidebandHighAFR = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "LastProjectname")
                            {
                                m_lastprojectname = Settings.GetValue(a).ToString();
                            }
                            else if (a == "WriteECUBatchfile")
                            {
                                m_write_ecubatchfile = Settings.GetValue(a).ToString();
                            }
                            else if (a == "ProjectFolder")
                            {
                                m_ProjectFolder = Settings.GetValue(a).ToString();
                            }
                            else if (a == "TargetECUReadFile")
                            {
                                m_TargetECUReadFile = Settings.GetValue(a).ToString();
                            }
                            else if (a == "AutoChecksum")
                            {
                                m_AutoChecksum = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "RequestProjectNotes")
                            {
                                m_RequestProjectNotes = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "ShowAddressesInHex")
                            {
                                m_ShowAddressesInHex = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "HideSymbolTable")
                            {
                                m_HideSymbolTable = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "ShowGraphs")
                            {
                                m_ShowGraphs = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AutoSizeNewWindows")
                            {
                                m_AutoSizeNewWindows = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AutoSizeColumnsInWindows")
                            {
                                m_AutoSizeColumnsInWindows = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "Skinname")
                            {
                                m_skinname = Settings.GetValue(a).ToString();
                            }
                            else if (a == "Showpopupmap")
                            {
                                m_Showpopupmap = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }

                            else if (a == "ReadECUBatchfile")
                            {
                                m_read_ecubatchfile = Settings.GetValue(a).ToString();
                            }
                            else if (a == "ShowRedWhite")
                            {
                                m_ShowRedWhite = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "DisableMapviewerColors")
                            {
                                m_DisableMapviewerColors = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AutoDockSameFile")
                            {
                                m_AutoDockSameFile = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AutoDockSameSymbol")
                            {
                                m_AutoDockSameSymbol = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "ShowViewerInWindows")
                            {
                                m_ShowViewerInWindows = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "NewPanelsFloating")
                            {
                                m_NewPanelsFloating = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "ShowMapPreviewPopup")
                            {
                                m_ShowMapPreviewPopup = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AlwaysRecreateRepositoryItems")
                            {
                                m_AlwaysRecreateRepositoryItems = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AutoLoadLastFile")
                            {
                                m_AutoLoadLastFile = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "FancyDocking")
                            {
                                m_FancyDocking = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "DefaultViewType")
                            {
                                m_DefaultViewType = (SuiteViewType)Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "DefaultViewSize")
                            {
                                m_DefaultViewSize = (ViewSize)Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "SynchronizeMapviewers")
                            {
                                m_SynchronizeMapviewers = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AllowAskForPartnumber")
                            {
                                m_AllowAskForPartnumber = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "ShowTablesUpsideDown")
                            {
                                m_ShowTablesUpsideDown = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "MeasureAFRInLambda")
                            {
                                m_MeasureAFRInLambda = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "WriteTimestampInBinary")
                            {
                                m_WriteTimestampInBinary = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "ShowMenu")
                            {
                                m_ShowMenu = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "RequestProjectNotes")
                            {
                                m_RequestProjectNotes = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "ProjectFolder")
                            {
                                m_ProjectFolder = Settings.GetValue(a).ToString();
                            }
                            else if (a == "LastProjectname")
                            {
                                m_lastprojectname = Settings.GetValue(a).ToString();
                            }
                            else if (a == "AutoFixFooter")
                            {
                                m_AutoFixFooter = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "EnableCanLog")
                            {
                                m_EnableCanLog = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "OnlyPBus")
                            {
                                m_OnlyPBus = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "DisableCanCheck")
                            {
                                m_DisableCanCheck = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "InterpolateLogWorksTimescale")
                            {
                                m_InterpolateLogWorksTimescale = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AutoUpdateSRAMViewers")
                            {
                                m_AutoUpdateSRAMViewers = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "UseAdditionalCanbusFrames")
                            {
                                m_UseAdditionalCanbusFrames = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "ResetRealtimeSymbolOnTabPageSwitch")
                            {
                                m_ResetRealtimeSymbolOnTabPageSwitch = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "UseWidebandLambda")
                            {
                                m_UseWidebandLambda = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "UseDigitalWidebandLambda")
                            {
                                m_UseDigitalWidebandLambda = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "WideBandSymbol")
                            {
                                m_WideBandSymbol = Settings.GetValue(a).ToString();
                            }
                            else if (a == "AutoCreateAFRMaps")
                            {
                                m_AutoCreateAFRMaps = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "UseNewMapViewer")
                            {
                                m_UseNewMapViewer = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "Skinname")
                            {
                                m_skinname = Settings.GetValue(a).ToString();
                            }
                            else if (a == "RealtimeFont")
                            {
                                //m_RealtimeFont = new Font(Settings.GetValue(a).ToString(), 10F);
                                TypeConverter tc = TypeDescriptor.GetConverter(typeof(Font));
                                //string fontString = tc.ConvertToString(font);
                                //logger.Debug("Font as string: {0}", fontString);

                                m_RealtimeFont = (Font)tc.ConvertFromString(Settings.GetValue(a).ToString());

                            }
                            else if (a == "ApplicationLanguage")
                            {
                                m_ApplicationLanguage = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AutoUpdateInterval")
                            {
                                m_AutoUpdateInterval = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }

                            else if (a == "PlayCellProcessedSound")
                            {
                                m_PlayCellProcessedSound = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AllowIdleAutoTune")
                            {
                                m_AllowIdleAutoTune = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AcceptableTargetErrorPercentage")
                            {
                                m_AcceptableTargetErrorPercentage = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AreaCorrectionPercentage")
                            {
                                m_AreaCorrectionPercentage = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AutoUpdateFuelMap")
                            {
                                m_AutoUpdateFuelMap = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AutoTuneFuelMap")
                            {
                                m_AutoTuneFuelMap = Settings.GetValue(a).ToString();
                            }
                            else if (a == "CellStableTime_ms")
                            {
                                m_CellStableTime_ms = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "CorrectionPercentage")
                            {
                                m_CorrectionPercentage = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "DiscardClosedThrottleMeasurements")
                            {
                                m_DiscardClosedThrottleMeasurements = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "DiscardFuelcutMeasurements")
                            {
                                m_DiscardFuelcutMeasurements = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "DisableClosedLoopOnStartAutotune")
                            {
                                m_DisableClosedLoopOnStartAutotune = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "EnrichmentFilter")
                            {
                                m_EnrichmentFilter = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "FuelCutDecayTime_ms")
                            {
                                m_FuelCutDecayTime_ms = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "MaximumAdjustmentPerCyclePercentage")
                            {
                                m_MaximumAdjustmentPerCyclePercentage = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "MaximumAFRDeviance")
                            {
                                m_MaximumAFRDeviance = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "MinimumAFRMeasurements")
                            {
                                m_MinimumAFRMeasurements = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "autoLoggingEnabled")
                            {
                                m_autoLoggingEnabled = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "autoLogStartSign")
                            {
                                m_autoLogStartSign = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "autoLogStopSign")
                            {
                                m_autoLogStopSign = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "autoLogStartValue")
                            {
                                m_autoLogStartValue = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "autoLogStopValue")
                            {
                                m_autoLogStopValue = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "autoLogTriggerStartSymbol")
                            {
                                m_autoLogTriggerStartSymbol = Settings.GetValue(a).ToString();
                            }
                            else if (a == "autoLogTriggerStopSymbol")
                            {
                                m_autoLogTriggerStopSymbol = Settings.GetValue(a).ToString();
                            }
                            else if (a == "Baudrate")
                            {
                                _Baudrate = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "LastXAxisFromMatrix")
                            {
                                _LastXAxisFromMatrix = Settings.GetValue(a).ToString();
                            }
                            else if (a == "LastYAxisFromMatrix")
                            {
                                _LastYAxisFromMatrix = Settings.GetValue(a).ToString();
                            }
                            else if (a == "LastZAxisFromMatrix")
                            {
                                _LastZAxisFromMatrix = Settings.GetValue(a).ToString();
                            }
                            else if (a == "notification1Active")
                            {
                                _notification1Active = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "notification2Active")
                            {
                                _notification2Active = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "notification3Active")
                            {
                                _notification3Active = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "notification1condition")
                            {
                                _notification1condition = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "notification2condition")
                            {
                                _notification2condition = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "notification3condition")
                            {
                                _notification3condition = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "notification1sound")
                            {
                                _notification1sound = Settings.GetValue(a).ToString();
                            }
                            else if (a == "notification2sound")
                            {
                                _notification2sound = Settings.GetValue(a).ToString();
                            }
                            else if (a == "notification3sound")
                            {
                                _notification3sound = Settings.GetValue(a).ToString();
                            }
                            else if (a == "notification1symbol")
                            {
                                _notification1symbol = Settings.GetValue(a).ToString();
                            }
                            else if (a == "notification2symbol")
                            {
                                _notification2symbol = Settings.GetValue(a).ToString();
                            }
                            else if (a == "notification3symbol")
                            {
                                _notification3symbol = Settings.GetValue(a).ToString();
                            }
                            else if (a == "notification1value")
                            {
                                _notification1value = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "notification2value")
                            {
                                _notification2value = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "notification3value")
                            {
                                _notification3value = ConvertToDouble(Settings.GetValue(a).ToString());
                            }
                            else if (a == "WbPort")
                            {
                                _WbPort = Settings.GetValue(a).ToString();
                            }
                            else if (a == "WidebandDevice")
                            {
                                m_WidebandDevice = Settings.GetValue(a).ToString();
                            }
                            else if (a == "Adapter")
                            {
                                m_Adapter = Settings.GetValue(a).ToString();
                            }
                            else if (a == "AdapterType")
                            {
                                m_AdapterType = Settings.GetValue(a).ToString();
                            }
                            else if (a == "WifiPort")
                            {
                                _WifiPort = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                        }
                        catch (Exception E)
                        {
                            logger.Debug("error retrieving registry settings: " + E.Message);
                        }

                    }
                }
            }
        }
Exemplo n.º 18
0
 public Panel(DwarfGUI gui, GUIComponent parent) :
     base(gui, parent)
 {
     Mode = PanelMode.Fancy;
 }
Exemplo n.º 19
0
        public static void SetMode(ScriptAndResultsEditorControl scriptEditorControl, PanelMode panelMode)
        {
            var metadataHolder = FindParent(scriptEditorControl);

            if (metadataHolder == null)
            {
                return;
            }

            var logoPanel = Find(metadataHolder);

            if (logoPanel != null)
            {
                logoPanel.UpdateMode(panelMode);
            }
        }
Exemplo n.º 20
0
        public void UpdateMode(PanelMode panelMode)
        {
            #region Remove all controls from the _tableLayoutPanel

            _tableLayoutPanel.Controls.Remove(_columnCounterLabel);
            _tableLayoutPanel.Controls.Remove(_rowCounterLabel);
            _tableLayoutPanel.Controls.Remove(_lineMiddlePanel);
            _tableLayoutPanel.Controls.Remove(_executionModeLabel);
            _tableLayoutPanel.Controls.Remove(_pictureBox);

            #endregion

            #region Set all controls inside the TableLayoutPanel

            switch (panelMode)
            {
            case PanelMode.Undefined:
                _columnCounterLabel.Text    = "";
                _columnCounterLabel.Visible = false;
                _rowCounterLabel.Text       = "";
                _rowCounterLabel.Visible    = false;
                _lineMiddlePanel.Visible    = false;
                _executionModeLabel.Text    = "";
                _executionModeLabel.Visible = false;
                _pictureBox.Image           = Properties.Resources.ASQA_Logo_64x64;
                _tableLayoutPanel.Controls.Add(_pictureBox, 1, 0);
                _tableLayoutPanel.SetColumnSpan(_pictureBox, 2);
                _tableLayoutPanel.SetRowSpan(_pictureBox, 5);
                _pictureBox.Visible = true;
                break;

            case PanelMode.Live:
                _tableLayoutPanel.Controls.Add(_columnCounterLabel, 1, 0);
                _columnCounterLabel.Text    = "";
                _columnCounterLabel.Visible = false;
                _tableLayoutPanel.Controls.Add(_rowCounterLabel, 2, 0);
                _rowCounterLabel.Text    = "";
                _rowCounterLabel.Visible = false;
                _tableLayoutPanel.Controls.Add(_lineMiddlePanel, 1, 1);
                _tableLayoutPanel.SetColumnSpan(_lineMiddlePanel, 2);
                _lineMiddlePanel.Visible = false;
                _executionModeLabel.Text = "Live mode";
                _tableLayoutPanel.Controls.Add(_executionModeLabel, 1, 2);
                _tableLayoutPanel.SetColumnSpan(_executionModeLabel, 2);
                _executionModeLabel.Visible = true;
                _pictureBox.Image           = Properties.Resources.LiveMode_32x32;
                _tableLayoutPanel.Controls.Add(_pictureBox, 1, 3);
                _tableLayoutPanel.SetColumnSpan(_pictureBox, 2);
                _tableLayoutPanel.SetRowSpan(_pictureBox, 1);
                _pictureBox.Visible = true;
                break;

            case PanelMode.Batch:
                _tableLayoutPanel.Controls.Add(_columnCounterLabel, 1, 0);
                _columnCounterLabel.Text    = "";
                _columnCounterLabel.Visible = false;
                _tableLayoutPanel.Controls.Add(_rowCounterLabel, 2, 0);
                _rowCounterLabel.Text    = "";
                _rowCounterLabel.Visible = false;
                _tableLayoutPanel.Controls.Add(_lineMiddlePanel, 1, 1);
                _tableLayoutPanel.SetColumnSpan(_lineMiddlePanel, 2);
                _lineMiddlePanel.Visible = false;
                _executionModeLabel.Text = "Batch mode";
                _tableLayoutPanel.Controls.Add(_executionModeLabel, 1, 2);
                _tableLayoutPanel.SetColumnSpan(_executionModeLabel, 2);
                _executionModeLabel.Visible = true;
                _pictureBox.Image           = Properties.Resources.BatchMode_32x32;
                _tableLayoutPanel.Controls.Add(_pictureBox, 1, 3);
                _tableLayoutPanel.SetColumnSpan(_pictureBox, 2);
                _tableLayoutPanel.SetRowSpan(_pictureBox, 1);
                _pictureBox.Visible = true;
                break;

            case PanelMode.LoadFomDB:
                _columnCounterLabel.Text    = "";
                _columnCounterLabel.Visible = false;
                _rowCounterLabel.Text       = "";
                _rowCounterLabel.Visible    = false;
                _lineMiddlePanel.Visible    = false;
                _executionModeLabel.Text    = "Loaded from DB";
                _tableLayoutPanel.Controls.Add(_executionModeLabel, 1, 0);
                _tableLayoutPanel.SetColumnSpan(_executionModeLabel, 2);
                _executionModeLabel.Visible = true;
                _pictureBox.Image           = Properties.Resources.LoadFromDB_32x32;
                _tableLayoutPanel.Controls.Add(_pictureBox, 1, 3);
                _tableLayoutPanel.SetColumnSpan(_pictureBox, 2);
                _tableLayoutPanel.SetRowSpan(_pictureBox, 1);
                _pictureBox.Visible = true;
                break;

            default:
                _columnCounterLabel.Visible = false;
                _rowCounterLabel.Visible    = false;
                _lineMiddlePanel.Visible    = false;
                _executionModeLabel.Text    = "";
                _executionModeLabel.Visible = false;
                _pictureBox.Image           = Properties.Resources.ASQA_Logo_32x32;
                _tableLayoutPanel.Controls.Add(_pictureBox, 1, 0);
                _tableLayoutPanel.SetColumnSpan(_pictureBox, 2);
                _tableLayoutPanel.SetRowSpan(_pictureBox, 5);
                _pictureBox.Visible = true;
                break;
            }

            #endregion

            Controls.Add(_tableLayoutPanel);
        }