Inheritance: System.Windows.Forms.UserControl
示例#1
0
        private double _timeScaleOffset = 0; // % of the lap offseted.

        #endregion Fields

        #region Constructors

        public MainForm()
        {
            this.FormClosing += new FormClosingEventHandler(_FormClosing);
            InitializeComponent();

            // TRACK MAP
            cTrackMap = new TrackMap {Dock = DockStyle.Fill};
            this.cSidePanelSplit.Panel1.Controls.Add(cTrackMap);

            // TRACKS LIST
            cTracks = new VisualListDetails(false) { Size = new Size(1, 120), Dock = DockStyle.Bottom };
            cTracks.Columns.Add("track", "Track", 200);
            cTracks.MultiSelect = false;
            cTracks.ItemSelectionChanged += cTracks_ItemSelectionChanged;
            this.cSidePanelSplit.Panel2.Controls.Add(cTracks);

            // SESSIONS LIST
            cSessions = new VisualListDetails(false) { Size = new Size(1, 120), Dock = DockStyle.Bottom };
            cSessions.Columns.Add("session", "Session", 150);
            cSessions.Columns.Add("date", "Date", 100);
            cSessions.Columns.Add("iter", "#", 100);
            cSessions.MultiSelect = false;
            cSessions.ItemSelectionChanged += new ListViewItemSelectionChangedEventHandler(cSessions_ItemSelectionChanged);
            this.cSidePanelSplit.Panel2.Controls.Add(cSessions);

            // LAPS LIST
            cLaps = new VisualListDetails(false) { Size = new Size(1, 120), Dock = DockStyle.Bottom };
            cLaps.Columns.Add("lap", "Lap #");
            cLaps.Columns.Add("time", "Time");
            cLaps.Columns.Add("file", "file",1);
            cLaps.ItemSelectionChanged += LapsList_Changed;
            this.cSidePanelSplit.Panel2.Controls.Add(cLaps);

            // Plotter
            cPlotter = new Plotter {Dock = DockStyle.Fill};
            cPlotter.Drawn += cPlotter_Drawn;
            cPlotter.MouseWheel += cPlotter_Scroll;
            cPlotter.timeline.Scroll += cPlotter_TimelineScroll;

            // Plotter configuration
            _PlotterConfiguration = new PlotterConfigurations();
            _PlotterConfiguration.Load("ChartSetup.txt");
            _PlotterConfiguration.Configure(cPlotter);

            cScreenSplit.Panel2.Controls.Add(cPlotter);

            // Select files
            try
            {
                List<string> files =
                    Directory.GetFiles(LogsMap).ToList();
                List<string> tracks = new List<string>();
                foreach (string log in files)
                {
                    string track = log.Substring(0, log.IndexOf("+"));
                    int slash = track.IndexOf("Logs");
                    track = track.Substring(slash + 5);
                    if (tracks.Contains(track) == false)
                        tracks.Add(track);

                }
                foreach (string track in tracks)
                {
                    cTracks.Items.Add(new ListViewItem(track));
                }
            }catch(Exception ex)
            {
                MessageBox.Show(ex.Message);
                MessageBox.Show(ex.StackTrace);
            }
        }
示例#2
0
        public MainForm()
        {
            this.FormClosing += new FormClosingEventHandler(_FormClosing);
            InitializeComponent();


            // TRACK MAP
            cTrackMap = new TrackMap {
                Dock = DockStyle.Fill
            };
            this.cSidePanelSplit.Panel1.Controls.Add(cTrackMap);

            // TRACKS LIST
            cTracks = new VisualListDetails(false)
            {
                Size = new Size(1, 120), Dock = DockStyle.Bottom
            };
            cTracks.Columns.Add("track", "Track", 200);
            cTracks.MultiSelect           = false;
            cTracks.ItemSelectionChanged += cTracks_ItemSelectionChanged;
            this.cSidePanelSplit.Panel2.Controls.Add(cTracks);

            // SESSIONS LIST
            cSessions = new VisualListDetails(false)
            {
                Size = new Size(1, 120), Dock = DockStyle.Bottom
            };
            cSessions.Columns.Add("session", "Session", 150);
            cSessions.Columns.Add("date", "Date", 100);
            cSessions.Columns.Add("iter", "#", 100);
            cSessions.MultiSelect           = false;
            cSessions.ItemSelectionChanged += new ListViewItemSelectionChangedEventHandler(cSessions_ItemSelectionChanged);
            this.cSidePanelSplit.Panel2.Controls.Add(cSessions);

            // LAPS LIST
            cLaps = new VisualListDetails(false)
            {
                Size = new Size(1, 120), Dock = DockStyle.Bottom
            };
            cLaps.Columns.Add("lap", "Lap #");
            cLaps.Columns.Add("time", "Time");
            cLaps.Columns.Add("file", "file", 1);
            cLaps.ItemSelectionChanged += LapsList_Changed;
            this.cSidePanelSplit.Panel2.Controls.Add(cLaps);

            // Plotter
            cPlotter = new Plotter {
                Dock = DockStyle.Fill
            };
            cPlotter.Drawn           += cPlotter_Drawn;
            cPlotter.MouseWheel      += cPlotter_Scroll;
            cPlotter.timeline.Scroll += cPlotter_TimelineScroll;

            // Plotter configuration
            _PlotterConfiguration = new PlotterConfigurations();
            _PlotterConfiguration.Load("ChartSetup.txt");
            _PlotterConfiguration.Configure(cPlotter);


            cScreenSplit.Panel2.Controls.Add(cPlotter);

            // Select files
            try
            {
                List <string> files =
                    Directory.GetFiles(LogsMap).ToList();
                List <string> tracks = new List <string>();
                foreach (string log in files)
                {
                    string track = log.Substring(0, log.IndexOf("+"));
                    int    slash = track.IndexOf("Logs");
                    track = track.Substring(slash + 5);
                    if (tracks.Contains(track) == false)
                    {
                        tracks.Add(track);
                    }
                }
                foreach (string track in tracks)
                {
                    cTracks.Items.Add(new ListViewItem(track));
                }
            }catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                MessageBox.Show(ex.StackTrace);
            }
        }