Exemple #1
0
        public TireDataViewerProperty(MultiTireDataViewer viewer)
        {
            InitializeComponent();
            Viewer = viewer;
            Reload();
            foreach (var s in Viewer.GetLegents())
            {
                try
                {
                    var raw = new SeriesEditor(Viewer, s, DataSourceList);
                    if (raw.Initialized)
                    {
                        raw.Dock = DockStyle.Top;

                        DataSourceList.Controls.Add(raw);
                        raw.Click += SeriesEditor_Click;
                        DataSourceList.Controls.SetChildIndex(raw, 0);
                    }
                }
                catch (Exception e)
                {
                    Log.Output(e.Message);
                }
            }
        }
Exemple #2
0
        public SeriesEditor(MultiTireDataViewer viewer, string id, Control owner = null)
            : this(viewer, 0, owner)
        {
            init = true;
            string[] stArrayData = id.Split('_');

            ID     = id;
            suffix = int.Parse(stArrayData[0]);
            InitSourceList();
            Args = Viewer.GetArguments(ID)[0];
            if (Args == null)
            {
                Args = new MagicFormulaArguments(0, 0, 1000, 0, 75, 50);
            }
            if (ID != null)
            {
                Reload(ID);
            }
            ShowCB.Checked = Viewer.GetEnable(ID);
            if (Viewer.GetTableInfo(ID) != null)
            {
                TableCB.SelectedItem = Viewer.GetTableInfo(ID);
            }
            init = false;
        }
Exemple #3
0
        public MFGraphDialog(MultiTireDataViewer viewer, string ID)
        {
            Viewer = viewer;
            InitializeComponent();
            Editor          = new SeriesEditor(Viewer, ID);
            Editor.Location = new Point(12, 38);
            this.Controls.Add(Editor);

            var args = Viewer.GetArguments(ID)[0];

            SATB.Text = args.SA.ToString();
            SRTB.Text = args.SR.ToString();
            FZTB.Text = args.FZ.ToString();
            IATB.Text = args.IA.ToString();
            PTB.Text  = args.P.ToString();
            TTB.Text  = args.T.ToString();
            foreach (Table t in Enum.GetValues(typeof(Table)))
            {
                if (t == Table.None)
                {
                    continue;
                }
                if (t == Table.StaticTable)
                {
                    continue;
                }
                TableCB.Items.Add(t);
            }
            TableCB.SelectedItem = Table.CorneringTable;
            InitSourceList();
            init = false;
        }
Exemple #4
0
        public SeriesEditor(MultiTireDataViewer viewer, int suf, Control owner = null)
        {
            InitializeComponent();
            ShowCB.Checked = true;
            Owner          = owner;
            suffix         = suf;
            if (Owner == null)
            {
                SourceCB.Enabled        = false;
                ArgumentsButton.Enabled = false;
            }
            Viewer = viewer;
            foreach (Control c in this.Controls)
            {
                c.Click += C_Click;
            }
            InitColorList();
            InitSourceList();
            foreach (Table t in Enum.GetValues(typeof(Table)))
            {
                if (t == Table.None)
                {
                    continue;
                }
                TableCB.Items.Add(t);
            }
            TableCB.SelectedItem = Table.StaticTable;
            Initialized          = false;

            PlotTypeCB.Items.Add("Line");
            PlotTypeCB.Items.Add("Points");
            PlotTypeCB.SelectedIndex = Viewer.Axis() == TireDataViewer.EnumAxis.RawTireData?1:0;
            SizeTB.Text = "4";
            Changed     = false;

            SourceCB.SelectedIndexChanged += SourceCB_SelectedIndexChanged;
            init = false;
        }
Exemple #5
0
        static public MultiTireDataViewer LoadViewers(Stream reader)
        {
            var viewer = new MultiTireDataViewer();

            viewer.Dock = DockStyle.Fill;
            BinaryFormatter binaryFormatter = new BinaryFormatter();
            var             data            = binaryFormatter.Deserialize(reader) as MultiTireDataViewer.SaveData;

            for (int i = 0; i < viewer.Viewers.Count; ++i)
            {
                viewer.Viewers[i].SetSaveData(data.listSaveData[i]);
            }
            viewer.PropertyEnable    = true;
            viewer.ScreenCountEnable = true;
            viewer.ResetScreen(data.screenCount);
            viewer.uuid      = data.uuid;
            viewer.GraphName = data.GraphName;
            viewer.AddContextMenuChildren();
            viewer.Load      += viewer.MultiTireDataViewer_Load;
            Application.Idle += viewer.Application_Idle;

            return(viewer);
        }