Exemple #1
0
        void CompareAnalysesExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            string fileNameAnalysisLower = TwFile.GetAnalysisFile();

            if (fileNameAnalysisLower == null || fileNameAnalysisLower == string.Empty)
            {
                return;
            }

            string fileNameAnalysisUpper = TwFile.GetAnalysisFile();

            if (fileNameAnalysisUpper == null || fileNameAnalysisUpper == string.Empty)
            {
                return;
            }

            UpdateAnalysisFolder(fileNameAnalysisUpper);

            Mouse.OverrideCursor = Cursors.Wait;

            var analysisLower = TwServices.CreateAnalysis(fileNameAnalysisLower);
            var analysisUpper = TwServices.CreateAnalysis(fileNameAnalysisUpper);

            var compareAnalysesPanel = new CompareAnalysesPanel();

            compareAnalysesPanel.AnalysisLower = analysisLower;
            compareAnalysesPanel.AnalysisUpper = analysisUpper;
            compareAnalysesPanel.Initialize();

            AddTab(CreateTabItemHeader("Compare", TwGui.GetImage("traces2.png"), CreateCompareAnalysesHeaderToolTip(fileNameAnalysisUpper, fileNameAnalysisLower)), compareAnalysesPanel, compareAnalysesPanel.StyledEventsViewerUpper.EventsViewer.ScrollViewer, false);

            Mouse.OverrideCursor = null;
        }
Exemple #2
0
        void Application_Exit(object sender, ExitEventArgs e)
        {
            SaveWindowPosition();

            Properties.Settings.Default.Save();
            TwFile.DeleteExtractedDirectory();
        }
        public UIElement Report() {

            reportSelector = new ProjectReportSelector(attributes = new ProjectReportAttributes());
            reportSelector.Owner = Application.Current.MainWindow;
            reportSelector.ShowDialog();

            if (!reportSelector.DialogResult.HasValue || reportSelector.DialogResult.Value == false)
                return panel;

            analysisFiles = TwFile.GetAnalysisFilesIncludingZipped();
            if (analysisFiles.Count == 0)
                return panel;

            aggregateFile = TwFile.GetProjectReportFileToSave("TraceWizardProjectReport");
            if (aggregateFile == null || aggregateFile.Length == 0)
                return panel;

            System.IO.File.Delete(aggregateFile);

            InitProgressWindow();

            ReportDone();

            return panel;
        }
Exemple #4
0
        void ExportLow()
        {
            var analysisAdapterTarget = new ArffAnalysisAdapter();

            analysisAdapterTarget.Attributes = attributes;

            this.Total = analysisFiles.Count;

            foreach (string analysisFile in analysisFiles)
            {
                if (this._isCancelationPending == true)
                {
                    break;
                }

                ++this.Current;
                this.KeyCode = GetKeyCode(analysisFile);

                Analysis analysis = Services.TwServices.CreateAnalysis(analysisFile);

                EventsArff events = analysisAdapterTarget.Load(analysis.Events);
                analysisAdapterTarget.Save(arffFile, new Analysis(events, analysis.KeyCode), false);
            }

            if (launchTextEditor)
            {
                TwFile.LaunchNotepad(arffFile);
            }
            else
            {
                MessageBox.Show("Export file successfully created: \r\n\r\n" + arffFile, TwAssembly.TitleTraceWizard());
            }
        }
Exemple #5
0
        void window_Loaded(object sender, RoutedEventArgs e)
        {
            LoadWindowPosition();

            DispatchLoad(TwFile.GetCommandLineArgs());

            TwEnvironment.SetCurrentDirectoryToExecutableDirectory();

            KeyDown += new KeyEventHandler(window_KeyDown);
        }
Exemple #6
0
        public UIElement Report()
        {
            analysisFiles = TwFile.GetAnalysisFilesIncludingZipped();
            if (analysisFiles.Count != 0)
            {
                InitProgressWindow();
                ReportDone();
            }

            return(panel);
        }
Exemple #7
0
        void OpenRecoverExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            List <string> fileNames = TwFile.GetArffAnalysisFilesRecover();

            foreach (string fileNameActualAnalysis in fileNames)
            {
                if (TwServices.IsAnalysis(fileNameActualAnalysis))
                {
                    AddTabLoadAnalysis(fileNameActualAnalysis);
                }
            }
        }
        public List <UIElement> Report()
        {
            var reports = new List <UIElement>();

            files = TwFile.GetAnalysisFilesIncludingZipped();
            if (files.Count != 0)
            {
                foreach (string file in files)
                {
                    reports.Add(Load(file));
                }
            }
            return(reports);
        }
Exemple #9
0
        void ExecuteConfusionMatrix(List <Classifier> classifiers, Adopter adopter)
        {
            List <string> files = TwFile.GetAnalysisFilesIncludingZipped();

            if (files.Count > 0)
            {
                foreach (var classifier in classifiers)
                {
                    var panel = LoadConfusionMatrix(files, classifier, adopter);
                    AddTab(CreateTabItemHeader("Confusion Matrix: " + classifier.Name,
                                               TwGui.GetImage("confusionmatrix.png")), panel, null, true);
                }
            }
        }
        public UIElement Report()
        {
            files = TwFile.GetLogFilesIncludingZipped();
            if (files.Count == 0)
            {
                return(panel);
            }

            InitProgressWindow();

            ReportDone();

            return(panel);
        }
Exemple #11
0
        void ExportLogToTwdbExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            var files = TwFile.GetLogFilesIncludingZipped(Properties.Settings.Default.DirectoryLog);

            if (files != null && files.Count > 0)
            {
                var list = new List <string>();
                for (int i = 0; i < files.Count; i++)
                {
                    list.Add(files[i]);
                }
                var countFilesSaved = TwServices.ExportLogToTwdb(list, new Tw4PostTrickleMergeMidnightSplitDisaggregator());
                MessageBox.Show(countFilesSaved + " TWDB file(s) were created.", TwAssembly.TitleTraceWizard());
            }
        }
Exemple #12
0
        void ExportMdbToCsvExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            var files = TwFile.GetMdbLogFiles(Properties.Settings.Default.DirectoryLog);

            if (files != null && files.Length > 0)
            {
                var list = new List <string>();
                for (int i = 0; i < files.Length; i++)
                {
                    list.Add(files[i]);
                }
                var countFilesSaved = TwServices.ExportMdbToCsv(list);
                MessageBox.Show(countFilesSaved + " CSV file(s) were created.", TwAssembly.TitleTraceWizard());
            }
        }
Exemple #13
0
        void BackupSave(AnalysisDatabase analysis)
        {
//            string arffFile = TwFile.GetBackupArffFileToSave(analysis.DataSourceDirectoryName, analysis.KeyCode);
            string arffFile = TwFile.GetBackupArffFileToSave(".", analysis.KeyCode);

            if (arffFile == null || arffFile.Length == 0)
            {
                return;
            }

            var analysisAdapter = new ArffAnalysisAdapter();

            analysisAdapter.Save(arffFile, analysis, true);
            analysis.Events.IsBackupDirty = false;
        }
Exemple #14
0
        string ExecuteSaveAs(Analysis analysis, string saveFileName)
        {
            var    analysisAdapter = new ArffAnalysisAdapter();
            string arffFile        = TwFile.GetArffFileToSave(saveFileName);

            if (arffFile == null || arffFile.Length == 0)
            {
                return(saveFileName);
            }

            System.IO.File.Delete(arffFile);
            analysisAdapter.Save(arffFile, analysis, true);
            analysis.Events.IsDirty = false;

            return(arffFile);
        }
        void ReportLow() {

            var exporter = new ProjectReportExporter();
            exporter.DataSource = aggregateFile;
            exporter.Attributes = reportSelector.Attributes;

            this.Total = analysisFiles.Count;

            foreach (string analysisFile in analysisFiles) {
                if (this._isCancelationPending == true) break;

                ++this.Current;
                this.KeyCode = GetKeyCode(analysisFile);

                Analysis analysis = Services.TwServices.CreateAnalysis(analysisFile);
                Events eventsFiltered = new Events();

                List<FixtureClass> fixtureClassesToExclude = new List<FixtureClass>();

                if (reportSelector.Attributes.IsExcludeNoiseEnabled)
                    fixtureClassesToExclude.Add(FixtureClasses.Noise);

                if (reportSelector.Attributes.IsExcludeDuplicateEnabled)
                    fixtureClassesToExclude.Add(FixtureClasses.Duplicate);

                List<FixtureClass> fixtureClassesOutdoor = new List<FixtureClass>();
                fixtureClassesOutdoor.Add(FixtureClasses.Irrigation);

                if (reportSelector.Attributes.IsOutdoorPoolEnabled)
                    fixtureClassesOutdoor.Add(FixtureClasses.Pool);

                if (reportSelector.Attributes.IsOutdoorCoolerEnabled)
                    fixtureClassesOutdoor.Add(FixtureClasses.Cooler);

                bool partialDays = reportSelector.Attributes.IsPartialDaysEnabled;

                analysis.FilterEvents(eventsFiltered, partialDays, fixtureClassesToExclude);

                var projectReportProperties = (new ProjectReportCalculator()).CalculateProjectReportProperties(eventsFiltered, fixtureClassesOutdoor);
                exporter.Properties = projectReportProperties;
                exporter.KeyCode = analysis.KeyCode;

                exporter.Export();
            }
            TwFile.Launch(aggregateFile);
        }
Exemple #16
0
        void ExecuteOpen()
        {
            List <string> fileNames = TwFile.GetAnalysisFilesIncludingZipped();

            if (fileNames.Count > 0)
            {
                UpdateAnalysisFolder(fileNames[0]);
            }

            foreach (string fileNameActualAnalysis in fileNames)
            {
                if (TwServices.IsAnalysis(fileNameActualAnalysis))
                {
                    AddTabLoadAnalysis(fileNameActualAnalysis);
                }
            }
        }
Exemple #17
0
        protected void Export(string defaultFileName)
        {
            analysisFiles = TwFile.GetAnalysisFilesIncludingZipped();
            if (analysisFiles.Count == 0)
            {
                return;
            }

            arffFile = TwFile.GetArffFileToSave(defaultFileName);
            if (arffFile == null || arffFile.Length == 0)
            {
                return;
            }

            System.IO.File.Delete(arffFile);
            InitProgressWindow();
        }
Exemple #18
0
        void ExecuteNewLog()
        {
            List <string> fileNames = TwFile.GetLogFilesIncludingZipped(Properties.Settings.Default.DirectoryLog);

            if (fileNames.Count > 0)
            {
                UpdateLogFolder(fileNames[0]);
            }

            foreach (string fileNameLog in fileNames)
            {
                if (TwServices.IsLog(fileNameLog))
                {
                    AddTabLoadLog(fileNameLog);
                }
            }
        }
Exemple #19
0
        static public void ReleaseNotesExecuted(object sender, ExecutedRoutedEventArgs e)
        {
//            throw new Exception("Testing simplified bug reporter");}
            TwFile.Launch(TwEnvironment.TwReleaseNotes);
        }
Exemple #20
0
        static public void TipsExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            var tipsVersion = e.Parameter;

            TwFile.Launch(TwEnvironment.TwTipsBase + tipsVersion + "." + TwEnvironment.TwTipsExtension);
        }
Exemple #21
0
 static public void CommandsHelpExecuted(object sender, ExecutedRoutedEventArgs e)
 {
     TwFile.Launch(TwEnvironment.TwHelpCommands);
 }
Exemple #22
0
 static public void InstallationNotesExecuted(object sender, ExecutedRoutedEventArgs e)
 {
     TwFile.Launch(TwEnvironment.TwReadMe);
 }
Exemple #23
0
 static void ShortcutsHelpExecuted()
 {
     TwFile.Launch(TwEnvironment.TwHelpShortcuts);
 }
Exemple #24
0
 void HyperlinkAbout_RequestNavigate(object sender, RequestNavigateEventArgs e)
 {
     TwFile.Launch(e.Uri.AbsoluteUri);
 }