Exemplo n.º 1
0
        private void toolStripButton_WCLoadSniff_Click(object sender, EventArgs e)
        {
            waypointsCreator.OpenFileDialog();

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                waypointsCreator.ImportStarted();

                if (!DBC.DBC.IsLoaded())
                {
                    SetCurrentStatus("Loading DBC...");
                    DBC.DBC.Load();
                }

                if (waypointsCreator.GetDataFromFiles(openFileDialog.FileNames) != 0)
                {
                    waypointsCreator.ImportSuccessful(false);
                }
                else
                {
                    toolStripStatusLabel_CurrentAction.Text = "";
                    toolStripStatusLabel_FileStatus.Text    = "No File Loaded";
                    toolStripButton_CSC_ImportSniff.Enabled = true;
                    Cursor = Cursors.Default;
                }
            }
        }
Exemplo n.º 2
0
        private void toolStripButton_WCLoadSniff_Click(object sender, EventArgs e)
        {
            waypointsCreator.OpenFileDialog();

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                waypointsCreator.ImportStarted();

                if (!DBC.DBC.IsLoaded())
                {
                    SetCurrentStatus("Loading DBC...");
                    DBC.DBC.Load();
                }

                if (openFileDialog.FileName.Contains("txt"))
                {
                    if (IsTxtFileValidForParse(openFileDialog.FileName) &&
                        waypointsCreator.GetDataFromSniffFile(openFileDialog.FileName))
                    {
                        waypointsCreator.ImportSuccessful();
                    }
                    else
                    {
                        toolStripStatusLabel_CurrentAction.Text = "";
                        toolStripStatusLabel_FileStatus.Text    = "No File Loaded";
                        toolStripButton_CSC_ImportSniff.Enabled = true;
                        Cursor = Cursors.Default;
                    }
                }
                else if (openFileDialog.FileName.Contains("dat"))
                {
                    if (waypointsCreator.GetPacketsFromDataFile(openFileDialog.FileName))
                    {
                        waypointsCreator.ImportSuccessful();
                    }
                }
            }
        }
Exemplo n.º 3
0
        private void toolStripButton_WCLoadSniff_Click(object sender, EventArgs e)
        {
            waypointsCreator.OpenFileDialog();

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                waypointsCreator.ImportStarted();

                if (IsTxtFileValidForParse(openFileDialog.FileName) &&
                    waypointsCreator.GetDataFromSniffFile(openFileDialog.FileName))
                {
                    waypointsCreator.ImportSuccessful();
                }
                else
                {
                    toolStripStatusLabel_CurrentAction.Text = "";
                    toolStripStatusLabel_FileStatus.Text    = "No File Loaded";
                    toolStripButton_WC_LoadSniff.Enabled    = true;
                    Cursor = Cursors.Default;
                }
            }
        }