Esempio n. 1
0
        private void Reload()
        {
            init = true;
            MagicFormulaRB.Checked = true;

            AutoScaleX.Checked = Viewer.AutoScaleX;
            AutoAxisStateChanged(AutoScaleX, new EventArgs());
            AutoScaleY.Checked = Viewer.AutoScaleY;
            AutoAxisStateChanged(AutoScaleY, new EventArgs());

            foreach (var name in Enum.GetValues(typeof(StringAlignment)))
            {
                LegendAlignCB.Items.Add(name);
            }
            foreach (var name in Enum.GetValues(typeof(Docking)))
            {
                LegendDockCB.Items.Add(name);
                TitleDockCB.Items.Add(name);
            }
            foreach (var name in Enum.GetValues(typeof(LegendStyle)))
            {
                LegendStyleCB.Items.Add(name);
            }
            var legend = Viewer.GetLegend();

            LegendAlignCB.SelectedItem = legend.Alignment;
            LegendDockCB.SelectedItem  = legend.Docking;
            LegendStyleCB.SelectedItem = legend.LegendStyle;
            DockToAreaCB.Checked       = legend.IsDockedInsideChartArea;
            TitleDockCB.SelectedItem   = Viewer.GetTitle().Docking;
            if (Viewer.Axis() == TireDataViewer.EnumAxis.RawTireData)
            {
                RawDataRB.Checked     = true;
                XAxisCB.SelectedIndex = (int)Viewer.X1;
                YAxisCB.SelectedIndex = (int)Viewer.Y1;
            }
            else
            {
                MagicFormulaRB.Checked = true;
                XAxisCB.SelectedIndex  = (int)Viewer.X2;
                YAxisCB.SelectedIndex  = (int)Viewer.Y2;
            }
            if (Viewer.GetTitle().Text == null)
            {
                ShowTitleCB.Checked = false;
            }
            else
            {
                TitleTB.Text        = Viewer.GetTitle().Text;
                ShowTitleCB.Checked = true;
            }

            foreach (var e in Enum.GetValues(typeof(TickMarkStyle)))
            {
                XTickStyleCB.Items.Add(e);
                YTickStyleCB.Items.Add(e);
            }
            foreach (var e in Enum.GetValues(typeof(ChartDashStyle)))
            {
                XGridLineStyleCB.Items.Add(e);
                YGridLineStyleCB.Items.Add(e);
            }

            var xas = Viewer.GetXAxisStyle();
            var yas = Viewer.GetYAxisStyle();

            XTickStyleCB.SelectedItem     = xas.tms;
            YTickStyleCB.SelectedItem     = yas.tms;
            XGridLineStyleCB.SelectedItem = xas.ds;
            YGridLineStyleCB.SelectedItem = yas.ds;
            XGridLabelFormat.Text         = xas.format;
            YGridLabelFormat.Text         = yas.format;
            //XGridLineOffsetCB.Checked = xas.offset;
            //YGridLineOffsetCB.Checked = xas.offset;
            PointsToRenderTB.Text = Viewer.numPoints.ToString();
            init = false;
        }