public MainWindow()
        {
            InitializeComponent();
            MyBindableTwoDArray  = new BindableTwoDArray <char>(8, 8);
            PathList.ItemsSource = runningTasks;
            parser = new Parser();
            HitsDataGrid.ItemsSource = parser.items;
            //HitsDataGrid.DataContext = parser.items;
            stopwatch = new Stopwatch();
            stopwatch.Start();
            //AnalyzeResults.ItemsSource = parser.items.Values;

            Graph.Axes.Add(new OxyPlot.Wpf.TimeSpanAxis());
            Graph.Axes[0].Position = AxisPosition.Bottom;
            var linearAxis = new OxyPlot.Wpf.LinearAxis();

            linearAxis.Position = AxisPosition.Left;
            Graph.Axes.Add(linearAxis);

            //Analyze_Packets_Click(null, null);

            PathList.Columns[2].SortDirection = ListSortDirection.Descending;

            AnalyzeResults.ItemsSource = parser.items.Values;
        }
Example #2
0
        public MainWindow()
        {
            InitializeComponent();
            MyBindableTwoDArray  = new BindableTwoDArray <char>(8, 8);
            PathList.ItemsSource = runningTasks;
            PopulateDropdown(PacketMode, PacketDefinitions.GetAll(), "Source", "Name");
            HitsDataGrid.ItemsSource = parser.items;
            //HitsDataGrid.DataContext = parser.items;
            stopwatch = new Stopwatch();
            stopwatch.Start();
            //AnalyzeResults.ItemsSource = parser.items.Values;

            Graph.Axes.Add(new OxyPlot.Wpf.TimeSpanAxis());
            Graph.Axes[0].Position = AxisPosition.Bottom;
            var linearAxis = new OxyPlot.Wpf.LinearAxis();

            linearAxis.Position = AxisPosition.Left;
            Graph.Axes.Add(linearAxis);

            //Button_Click_AnalyzePackets(null, null);

            PathList.Columns[2].SortDirection = ListSortDirection.Descending;

            AnalyzeResults.ItemsSource = parser.items.Values;

            if (CANBUS.App.StartupDBCFilename != null)
            {
                parser = Parser.FromSource(PacketDefinitions.DefinitionSource.DBCFile, CANBUS.App.StartupDBCFilename);
            }

            if (CANBUS.App.StartupLogFilename != null)
            {
                StartParseLog(CANBUS.App.StartupLogFilename);
            }
        }
Example #3
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Plot_Ref = ((OxyPlot.Wpf.Plot)(target));

            #line 38 "..\..\..\NavigationPages\Window_Ref.xaml"
                this.Plot_Ref.Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.axis_left = ((OxyPlot.Wpf.LinearAxis)(target));
                return;

            case 3:
                this.axis_bottom = ((OxyPlot.Wpf.LinearAxis)(target));
                return;

            case 4:
                this.btn_previous = ((System.Windows.Controls.Button)(target));

            #line 66 "..\..\..\NavigationPages\Window_Ref.xaml"
                this.btn_previous.Click += new System.Windows.RoutedEventHandler(this.Btn_previous_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.btn_next = ((System.Windows.Controls.Button)(target));

            #line 73 "..\..\..\NavigationPages\Window_Ref.xaml"
                this.btn_next.Click += new System.Windows.RoutedEventHandler(this.Btn_next_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.plotmodel = ((OxyPlot.Wpf.Plot)(target));
                return;

            case 2:
                this.line1 = ((OxyPlot.Wpf.LineSeries)(target));
                return;

            case 3:
                this.line2 = ((OxyPlot.Wpf.LineSeries)(target));
                return;

            case 4:
                this.lin2axes = ((OxyPlot.Wpf.LinearAxis)(target));
                return;
            }
            this._contentLoaded = true;
        }
Example #5
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 10 "..\..\MainWindow.xaml"
                ((xoyplot_zjk.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.window_load_init);

            #line default
            #line hidden

            #line 12 "..\..\MainWindow.xaml"
                ((xoyplot_zjk.MainWindow)(target)).Closed += new System.EventHandler(this.window_close_click);

            #line default
            #line hidden
                return;

            case 2:

            #line 18 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Btn_Clicked_About);

            #line default
            #line hidden
                return;

            case 3:

            #line 24 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Btn_Clicked_upload);

            #line default
            #line hidden
                return;

            case 4:
                this.tabitem_ctl = ((System.Windows.Controls.TabItem)(target));
                return;

            case 5:

            #line 48 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btn_start);

            #line default
            #line hidden
                return;

            case 6:

            #line 49 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btn_stop);

            #line default
            #line hidden
                return;

            case 7:
                this.btn_display_clear = ((System.Windows.Controls.Button)(target));

            #line 50 "..\..\MainWindow.xaml"
                this.btn_display_clear.Click += new System.Windows.RoutedEventHandler(this.btn_click_display_clear);

            #line default
            #line hidden
                return;

            case 8:
                this.btn_display_switch = ((System.Windows.Controls.Button)(target));

            #line 51 "..\..\MainWindow.xaml"
                this.btn_display_switch.Click += new System.Windows.RoutedEventHandler(this.btn_click_display);

            #line default
            #line hidden
                return;

            case 9:
                this.tabitem_stand = ((System.Windows.Controls.TabItem)(target));
                return;

            case 10:
                this.textBox_calibration_1 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 11:
                this.textBox_average_1 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 12:
                this.textBox_gain_1 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 13:

            #line 77 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Btn_first_click);

            #line default
            #line hidden
                return;

            case 14:

            #line 78 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Btn_Clicked_saveParam);

            #line default
            #line hidden
                return;

            case 15:
                this.btn_stand = ((System.Windows.Controls.Button)(target));

            #line 79 "..\..\MainWindow.xaml"
                this.btn_stand.Click += new System.Windows.RoutedEventHandler(this.Btn_Clicked_Stand);

            #line default
            #line hidden
                return;

            case 16:
                this.btn_reStandFirst = ((System.Windows.Controls.Button)(target));

            #line 80 "..\..\MainWindow.xaml"
                this.btn_reStandFirst.Click += new System.Windows.RoutedEventHandler(this.btn_reset_stand_click);

            #line default
            #line hidden
                return;

            case 17:
                this.texblock_standFirstLog = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 18:
                this.textBox_calibration_2 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 19:
                this.textBox_average_2 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 20:
                this.textBox_gain_2 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 21:

            #line 92 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Btn_second_click);

            #line default
            #line hidden
                return;

            case 22:
                this.btn_stand_2 = ((System.Windows.Controls.Button)(target));

            #line 93 "..\..\MainWindow.xaml"
                this.btn_stand_2.Click += new System.Windows.RoutedEventHandler(this.Btn_Clicked_Stand_2);

            #line default
            #line hidden
                return;

            case 23:

            #line 94 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Btn_Clicked_saveParam_2);

            #line default
            #line hidden
                return;

            case 24:
                this.btn_reStandSecond = ((System.Windows.Controls.Button)(target));

            #line 95 "..\..\MainWindow.xaml"
                this.btn_reStandSecond.Click += new System.Windows.RoutedEventHandler(this.btn_reset_stand2_click);

            #line default
            #line hidden
                return;

            case 25:
                this.texblock_standSecondLog = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 26:
                this.textBox_calibration_3 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 27:
                this.textBox_average_3 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 28:
                this.textBox_gain_3 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 29:

            #line 107 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Btn_third_click);

            #line default
            #line hidden
                return;

            case 30:
                this.btn_stand_3 = ((System.Windows.Controls.Button)(target));

            #line 108 "..\..\MainWindow.xaml"
                this.btn_stand_3.Click += new System.Windows.RoutedEventHandler(this.Btn_Clicked_Stand_3);

            #line default
            #line hidden
                return;

            case 31:

            #line 109 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Btn_Clicked_saveParam_3);

            #line default
            #line hidden
                return;

            case 32:
                this.btn_reStandThird = ((System.Windows.Controls.Button)(target));

            #line 110 "..\..\MainWindow.xaml"
                this.btn_reStandThird.Click += new System.Windows.RoutedEventHandler(this.btn_reset_stand3_click);

            #line default
            #line hidden
                return;

            case 33:
                this.texblock_standThirdLog = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 34:
                this.label_first = ((System.Windows.Controls.Label)(target));
                return;

            case 35:
                this.stand_slider = ((System.Windows.Controls.Slider)(target));

            #line 118 "..\..\MainWindow.xaml"
                this.stand_slider.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.slider_value_change);

            #line default
            #line hidden
                return;

            case 36:

            #line 120 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Btn_Clicked_getStandParam);

            #line default
            #line hidden
                return;

            case 37:

            #line 121 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btn_standMode_switch);

            #line default
            #line hidden
                return;

            case 38:
                this.tabitem_cfg = ((System.Windows.Controls.TabItem)(target));
                return;

            case 39:
                this.RadioBtn_Front = ((System.Windows.Controls.RadioButton)(target));

            #line 126 "..\..\MainWindow.xaml"
                this.RadioBtn_Front.Click += new System.Windows.RoutedEventHandler(this.radioBtn_front_click);

            #line default
            #line hidden
                return;

            case 40:
                this.RadioBtn_Base = ((System.Windows.Controls.RadioButton)(target));

            #line 127 "..\..\MainWindow.xaml"
                this.RadioBtn_Base.Click += new System.Windows.RoutedEventHandler(this.radioBtn_base_click);

            #line default
            #line hidden
                return;

            case 41:

            #line 128 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.reset_button_click);

            #line default
            #line hidden
                return;

            case 42:
                this.Btn_Get_Parm = ((System.Windows.Controls.Button)(target));

            #line 129 "..\..\MainWindow.xaml"
                this.Btn_Get_Parm.Click += new System.Windows.RoutedEventHandler(this.Btn_Click_getParam);

            #line default
            #line hidden
                return;

            case 43:

            #line 130 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btn_click_setBaudRate);

            #line default
            #line hidden
                return;

            case 44:
                this.sensor_baudRate_combox = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 45:

            #line 132 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btn_click_powerOn_mode);

            #line default
            #line hidden
                return;

            case 46:
                this.sensor_autoRun_mode_combox = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 47:
                this.sensor_ouput_data_freq_slider = ((System.Windows.Controls.Slider)(target));
                return;

            case 48:

            #line 136 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btn_click_ouput_data_freq);

            #line default
            #line hidden
                return;

            case 49:
                this.sensor_front_switch_slider = ((System.Windows.Controls.Slider)(target));
                return;

            case 50:

            #line 139 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btn_click_front_switch);

            #line default
            #line hidden
                return;

            case 51:
                this.sensor_base_switch_slider = ((System.Windows.Controls.Slider)(target));
                return;

            case 52:

            #line 142 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btn_click_base_switch);

            #line default
            #line hidden
                return;

            case 53:
                this.tabitem_programer = ((System.Windows.Controls.TabItem)(target));
                return;

            case 54:

            #line 148 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btn_debug_start);

            #line default
            #line hidden
                return;

            case 55:

            #line 149 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btn_stop);

            #line default
            #line hidden
                return;

            case 56:
                this.btn_connect = ((System.Windows.Controls.Button)(target));

            #line 154 "..\..\MainWindow.xaml"
                this.btn_connect.Click += new System.Windows.RoutedEventHandler(this.btn_serial_connect);

            #line default
            #line hidden
                return;

            case 57:
                this.baud_Selcet = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 58:
                this.Com_Selcet = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 59:
                this.lk_yaxi = ((OxyPlot.Wpf.LinearAxis)(target));
                return;

            case 60:
                this.text_string = ((System.Windows.Controls.TextBox)(target));
                return;

            case 61:
                this.text_Log = ((System.Windows.Controls.TextBlock)(target));
                return;
            }
            this._contentLoaded = true;
        }
Example #6
0
        public MainWindow()
        {
            pingResults = new ResultsCollection();

            InitializeComponent();

            System.Threading.Thread.CurrentThread.CurrentCulture =
                System.Globalization.CultureInfo.InvariantCulture;

            //PingList.ItemsSource = pingResults._collection;

            mainWin = this;
            disp    = this.Dispatcher;

            Plot1.Axes.Add(new OxyPlot.Wpf.TimeSpanAxis());
            Plot1.Axes[0].Position = AxisPosition.Bottom;


            var linearAxis = new OxyPlot.Wpf.LinearAxis();

            //linearAxis.Title = "V";
            linearAxis.Key = "V";
            //linearAxis.PositionTier = 1;
            linearAxis.Position = AxisPosition.Left;
            Plot1.Axes.Add(linearAxis);

            // Plot1.Series[0].TrackerFormatString = "{2:0.0},{4:0.0}";

            /*linearAxis = new OxyPlot.Wpf.LinearAxis();
             * linearAxis.Title = "RPM";
             * linearAxis.Key = "RPM";
             * linearAxis.PositionTier = 2;
             * linearAxis.Position = AxisPosition.Right;
             * Plot1.Axes.Add(linearAxis);*/

            /*linearAxis = new OxyPlot.Wpf.LinearAxis();
             * linearAxis.Title = "mAh";
             * linearAxis.Key = "mAh";
             * linearAxis.PositionTier = 2;
             * linearAxis.Position = AxisPosition.Right;
             * Plot1.Axes.Add(linearAxis);
             *
             * linearAxis = new OxyPlot.Wpf.LinearAxis();
             * linearAxis.Title = "Vtot";
             * linearAxis.Key = "Vtot";
             * linearAxis.PositionTier = 2;
             * linearAxis.Position = AxisPosition.Left;
             * Plot1.Axes.Add(linearAxis);
             *
             * linearAxis = new OxyPlot.Wpf.LinearAxis();
             * linearAxis.Title = "C/A";
             * linearAxis.Key = "Temp";
             * linearAxis.PositionTier = 3;
             * linearAxis.Position = AxisPosition.Left;
             * Plot1.Axes.Add(linearAxis);*/

            //c_ThresholdReached += pingResults._collection.CollectionChanged;

            // Get version. Crashes if within visual studio, so we have to catch that.
            try {
                var version = System.Deployment.Application.ApplicationDeployment.CurrentDeployment.CurrentVersion;
                this.Title = "UDPLogger v." + version.ToString();
            } catch (Exception) {
                var version = Assembly.GetExecutingAssembly().GetName().Version;
                this.Title = "UDPLogger development build " + version.ToString();
            }
        }
Example #7
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.CurrentPropertySelected = ((System.Windows.Controls.TextBox)(target));
                return;

            case 2:
                this.CurrentOwnerSelected = ((System.Windows.Controls.TextBox)(target));
                return;

            case 3:
                this.CurrentMortgage = ((System.Windows.Controls.TextBox)(target));
                return;

            case 4:
                this.CurrentRent = ((System.Windows.Controls.TextBox)(target));
                return;

            case 5:
                this.AddInvestmentProperty = ((System.Windows.Controls.Button)(target));

            #line 28 "..\..\MainWindow.xaml"
                this.AddInvestmentProperty.Click += new System.Windows.RoutedEventHandler(this.AddPropertyClicked);

            #line default
            #line hidden
                return;

            case 6:
                this.DefaultRun = ((System.Windows.Controls.Button)(target));

            #line 29 "..\..\MainWindow.xaml"
                this.DefaultRun.Click += new System.Windows.RoutedEventHandler(this.CreateDefaultClicked);

            #line default
            #line hidden
                return;

            case 7:
                this.InvestmentPropertyTab = ((System.Windows.Controls.TabItem)(target));
                return;

            case 8:
                this.SelectedPropertyTextBlock = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 9:
                this.InvestmentAnalysisTab = ((System.Windows.Controls.TabItem)(target));
                return;

            case 10:
                this.PurchasePrice = ((System.Windows.Controls.TextBox)(target));
                return;

            case 11:
                this.OrginalInvestment = ((System.Windows.Controls.TextBox)(target));
                return;

            case 12:
                this.ProfitChk = ((System.Windows.Controls.CheckBox)(target));

            #line 82 "..\..\MainWindow.xaml"
                this.ProfitChk.Checked += new System.Windows.RoutedEventHandler(this.RentAppliedChecked);

            #line default
            #line hidden

            #line 82 "..\..\MainWindow.xaml"
                this.ProfitChk.Unchecked += new System.Windows.RoutedEventHandler(this.RentAppliedChecked);

            #line default
            #line hidden
                return;

            case 13:
                this.NonTanChk = ((System.Windows.Controls.CheckBox)(target));

            #line 83 "..\..\MainWindow.xaml"
                this.NonTanChk.Checked += new System.Windows.RoutedEventHandler(this.RentAppliedChecked);

            #line default
            #line hidden

            #line 83 "..\..\MainWindow.xaml"
                this.NonTanChk.Unchecked += new System.Windows.RoutedEventHandler(this.RentAppliedChecked);

            #line default
            #line hidden
                return;

            case 14:
                this.EquityChk = ((System.Windows.Controls.CheckBox)(target));

            #line 84 "..\..\MainWindow.xaml"
                this.EquityChk.Checked += new System.Windows.RoutedEventHandler(this.RentAppliedChecked);

            #line default
            #line hidden

            #line 84 "..\..\MainWindow.xaml"
                this.EquityChk.Unchecked += new System.Windows.RoutedEventHandler(this.RentAppliedChecked);

            #line default
            #line hidden
                return;

            case 15:
                this.RentAppliedChk = ((System.Windows.Controls.CheckBox)(target));

            #line 85 "..\..\MainWindow.xaml"
                this.RentAppliedChk.Checked += new System.Windows.RoutedEventHandler(this.RentAppliedChecked);

            #line default
            #line hidden

            #line 85 "..\..\MainWindow.xaml"
                this.RentAppliedChk.Unchecked += new System.Windows.RoutedEventHandler(this.RentAppliedChecked);

            #line default
            #line hidden
                return;

            case 16:
                this.AllProfitChk = ((System.Windows.Controls.CheckBox)(target));

            #line 86 "..\..\MainWindow.xaml"
                this.AllProfitChk.Checked += new System.Windows.RoutedEventHandler(this.RentAppliedChecked);

            #line default
            #line hidden

            #line 86 "..\..\MainWindow.xaml"
                this.AllProfitChk.Unchecked += new System.Windows.RoutedEventHandler(this.RentAppliedChecked);

            #line default
            #line hidden
                return;

            case 17:
                this.InvestmentRadioButtonGroup = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 18:
                this.OwnerRadioButtonGroup = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 19:
                this.PAGraph = ((OxyPlot.Wpf.Plot)(target));
                return;

            case 20:
                this.PAGraphBottom = ((OxyPlot.Wpf.LinearAxis)(target));
                return;

            case 21:
                this.PAGraphLeft = ((OxyPlot.Wpf.LinearAxis)(target));
                return;

            case 22:
                this.ProfitGraph = ((OxyPlot.Wpf.LineSeries)(target));
                return;

            case 23:
                this.NonTanGraph = ((OxyPlot.Wpf.LineSeries)(target));
                return;

            case 24:
                this.EquityGraph = ((OxyPlot.Wpf.LineSeries)(target));
                return;

            case 25:
                this.MoneyBackLine = ((OxyPlot.Wpf.LineSeries)(target));
                return;

            case 26:
                this.CashOutLine = ((OxyPlot.Wpf.LineSeries)(target));
                return;

            case 27:
                this.AllProfit = ((OxyPlot.Wpf.LineSeries)(target));
                return;

            case 28:
                this.PmiPaidGraph = ((OxyPlot.Wpf.LineSeries)(target));
                return;

            case 29:
                this.MortgagePaidGraph = ((OxyPlot.Wpf.LineSeries)(target));
                return;

            case 30:
                this.SingleOwnerTab = ((System.Windows.Controls.TabItem)(target));
                return;

            case 31:
                this.SOProfitChk = ((System.Windows.Controls.CheckBox)(target));

            #line 142 "..\..\MainWindow.xaml"
                this.SOProfitChk.Checked += new System.Windows.RoutedEventHandler(this.SORentAppliedChecked);

            #line default
            #line hidden

            #line 142 "..\..\MainWindow.xaml"
                this.SOProfitChk.Unchecked += new System.Windows.RoutedEventHandler(this.RentAppliedChecked);

            #line default
            #line hidden
                return;

            case 32:
                this.SONonTanChk = ((System.Windows.Controls.CheckBox)(target));

            #line 143 "..\..\MainWindow.xaml"
                this.SONonTanChk.Checked += new System.Windows.RoutedEventHandler(this.SORentAppliedChecked);

            #line default
            #line hidden

            #line 143 "..\..\MainWindow.xaml"
                this.SONonTanChk.Unchecked += new System.Windows.RoutedEventHandler(this.RentAppliedChecked);

            #line default
            #line hidden
                return;

            case 33:
                this.SOEquityChk = ((System.Windows.Controls.CheckBox)(target));

            #line 144 "..\..\MainWindow.xaml"
                this.SOEquityChk.Checked += new System.Windows.RoutedEventHandler(this.SORentAppliedChecked);

            #line default
            #line hidden

            #line 144 "..\..\MainWindow.xaml"
                this.SOEquityChk.Unchecked += new System.Windows.RoutedEventHandler(this.RentAppliedChecked);

            #line default
            #line hidden
                return;

            case 34:
                this.SORentAppliedChk = ((System.Windows.Controls.CheckBox)(target));

            #line 145 "..\..\MainWindow.xaml"
                this.SORentAppliedChk.Checked += new System.Windows.RoutedEventHandler(this.RentAppliedChecked);

            #line default
            #line hidden

            #line 145 "..\..\MainWindow.xaml"
                this.SORentAppliedChk.Unchecked += new System.Windows.RoutedEventHandler(this.SORentAppliedChecked);

            #line default
            #line hidden
                return;

            case 35:
                this.SOAllProfitChk = ((System.Windows.Controls.CheckBox)(target));

            #line 146 "..\..\MainWindow.xaml"
                this.SOAllProfitChk.Checked += new System.Windows.RoutedEventHandler(this.SORentAppliedChecked);

            #line default
            #line hidden

            #line 146 "..\..\MainWindow.xaml"
                this.SOAllProfitChk.Unchecked += new System.Windows.RoutedEventHandler(this.RentAppliedChecked);

            #line default
            #line hidden
                return;

            case 36:
                this.SOGraph = ((OxyPlot.Wpf.Plot)(target));
                return;

            case 37:
                this.SOGraphBottom = ((OxyPlot.Wpf.LinearAxis)(target));
                return;

            case 38:
                this.SOGraphLeft = ((OxyPlot.Wpf.LinearAxis)(target));
                return;

            case 39:
                this.SOProfitGraph = ((OxyPlot.Wpf.LineSeries)(target));
                return;

            case 40:
                this.SONonTanGraph = ((OxyPlot.Wpf.LineSeries)(target));
                return;

            case 41:
                this.SOEquityGraph = ((OxyPlot.Wpf.LineSeries)(target));
                return;

            case 42:
                this.SOMoneyBackLine = ((OxyPlot.Wpf.LineSeries)(target));
                return;

            case 43:
                this.SOCashOutLine = ((OxyPlot.Wpf.LineSeries)(target));
                return;

            case 44:
                this.SOAllProfit = ((OxyPlot.Wpf.LineSeries)(target));
                return;

            case 45:
                this.SOPmiPaidGraph = ((OxyPlot.Wpf.LineSeries)(target));
                return;

            case 46:
                this.SOMortgagePaidGraph = ((OxyPlot.Wpf.LineSeries)(target));
                return;

            case 47:
                this.AddPropertyPopup = ((System.Windows.Controls.Primitives.Popup)(target));
                return;

            case 48:
                this.InvestmentPropertyNamePopup = ((System.Windows.Controls.TextBox)(target));
                return;

            case 49:
                this.InvestmentPropertyPricePopup = ((System.Windows.Controls.TextBox)(target));
                return;

            case 50:
                this.InvestmentDatePopup = ((System.Windows.Controls.DatePicker)(target));
                return;

            case 51:
                this.InvestmentRentPopup = ((System.Windows.Controls.TextBox)(target));
                return;

            case 52:
                this.InvestmentMaintancePopup = ((System.Windows.Controls.TextBox)(target));
                return;

            case 53:
                this.InvestmentDescriptionPopup = ((System.Windows.Controls.RichTextBox)(target));
                return;

            case 54:

            #line 223 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.AddInvestorClicked);

            #line default
            #line hidden
                return;

            case 55:
                this.InvestorsListPopup = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 56:
                this.InvestmentPayOffPopup = ((System.Windows.Controls.TextBox)(target));
                return;

            case 57:
                this.SaveProperty = ((System.Windows.Controls.Button)(target));

            #line 230 "..\..\MainWindow.xaml"
                this.SaveProperty.Click += new System.Windows.RoutedEventHandler(this.SavePropertyClicked);

            #line default
            #line hidden
                return;

            case 58:
                this.CancelProperty = ((System.Windows.Controls.Button)(target));

            #line 231 "..\..\MainWindow.xaml"
                this.CancelProperty.Click += new System.Windows.RoutedEventHandler(this.CancelPropertyClicked);

            #line default
            #line hidden
                return;

            case 59:
                this.AddInvestorPopup = ((System.Windows.Controls.Primitives.Popup)(target));
                return;

            case 60:
                this.InvestorNamePopup = ((System.Windows.Controls.TextBox)(target));
                return;

            case 61:
                this.CashDownPopup = ((System.Windows.Controls.TextBox)(target));
                return;

            case 62:
                this.AdditionalDownPopup = ((System.Windows.Controls.TextBox)(target));
                return;

            case 63:
                this.SaveInvestor = ((System.Windows.Controls.Button)(target));

            #line 264 "..\..\MainWindow.xaml"
                this.SaveInvestor.Click += new System.Windows.RoutedEventHandler(this.SaveInvestorClicked);

            #line default
            #line hidden
                return;

            case 64:
                this.CancelInvestor = ((System.Windows.Controls.Button)(target));

            #line 265 "..\..\MainWindow.xaml"
                this.CancelInvestor.Click += new System.Windows.RoutedEventHandler(this.CancelInvestorClicked);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Example #8
0
        /// <summary>
        /// Plot data based on given parameters
        /// </summary>
        /// <param name="myPlot"></param>
        /// <param name="mySeries"></param>
        /// <param name="dateFrom_dp"></param>
        /// <param name="dateTo_dp"></param>
        /// <param name="selDataType"></param>
        public void PlotData(Plot myPlot, LineSeries mySeries, DatePicker dateFrom_dp, DatePicker dateTo_dp, string selDataType)
        {
            if (currentId != null)
            {
                Station station = GetCurrentStation();

                // Set filter date the last year of data, if no valid "from" / "to" dates where selected
                var dateTo   = dateTo_dp.SelectedDate ?? station.GetDataToDateTime();
                var dateFrom = dateFrom_dp.SelectedDate ?? station.GetDataToDateTime().AddYears(-1);

                // Set displayed dates to data range and limit to selected dates
                // e.g. If "To-Date" is set to 01.01.2020, the "From-Date" after that date is not possible
                dateFrom_dp.DisplayDateStart = station.GetDataFromDateTime();
                dateFrom_dp.DisplayDateEnd   = dateTo_dp.SelectedDate;
                dateTo_dp.DisplayDateEnd     = station.GetDataToDateTime();
                dateTo_dp.DisplayDateStart   = dateFrom_dp.SelectedDate;

                // Get climate data from database
                CurrentClimateData = DataAccess.LoadClimateData(currentId, dateFrom, dateTo).OrderBy(cd => cd.Date).ToList();

                myPlot.Title = station.StationName + $" ({station.GetDataFromDateTime():dd.MM.yyyy} - {station.GetDataToDateTime():dd.MM.yyyy})";
                myPlot.Axes.Clear();

                string selector;
                switch (averageDataType)
                {
                case AverageDataType.None:
                default:
                    selector = null;
                    break;

                case AverageDataType.Monthly:
                    selector = "MMM yyyy";
                    break;

                case AverageDataType.Yearly:
                    selector = "yyyy";
                    break;
                }

                IEnumerable <ClimateData> aggregatedClimateData = new List <ClimateData>();
                if (selector == null)
                {
                    aggregatedClimateData = CurrentClimateData;
                }
                else
                {
                    aggregatedClimateData = CurrentClimateData.GroupBy(ccd1 => ccd1.GetDate().ToString(selector)).Select(ccd => new ClimateData
                    {
                        Date            = ccd.First().Date,
                        TempMax         = ccd.Where(c => c.TempMax > -99).Select(c => c.TempMax).DefaultIfEmpty(-9999).Average(),
                        TempMin         = ccd.Where(c => c.TempMin > -99).Select(c => c.TempMin).DefaultIfEmpty(-9999).Average(),
                        PressureMiddle  = ccd.Where(c => c.PressureMiddle >= 0).Select(c => c.PressureMiddle).DefaultIfEmpty(-9999).Average(),
                        HumidityMiddle  = (int)ccd.Where(c => c.HumidityMiddle > -99).Select(c => c.HumidityMiddle).DefaultIfEmpty(-9999).Average(),
                        WindForceMiddle = (int)ccd.Where(c => c.WindForceMiddle > 0).Select(c => c.WindForceMiddle).DefaultIfEmpty(-9999).Average(),
                        SunshineSum     = (int)ccd.Where(c => c.SunshineSum > 0).Select(c => c.SunshineSum).DefaultIfEmpty(-9999).Average(),
                    }).ToList();
                }


                // Get data for selected datatype
                IEnumerable <DataPoint> plotData;
                string unit = " C° ";
                switch (selDataType)
                {
                case nameof(ClimateData.DataTypes.Temperatur_Tagesmaximum):
                default:
                    plotData = aggregatedClimateData.Where(c => c.TempMax > -99).Select(dat => new DataPoint(OxyPlot.Axes.DateTimeAxis.ToDouble(dat.GetDate()), Math.Round(dat.TempMax, 1)));
                    break;

                case nameof(ClimateData.DataTypes.Temperatur_Tagesminimum):
                    plotData = aggregatedClimateData.Where(c => c.TempMin > -99).Select(dat => new DataPoint(OxyPlot.Axes.DateTimeAxis.ToDouble(dat.GetDate()), Math.Round(dat.TempMin, 1)));
                    break;

                case nameof(ClimateData.DataTypes.Luftdruck_Tagesmittel):
                    plotData = aggregatedClimateData.Where(c => c.PressureMiddle >= 0).Select(dat => new DataPoint(OxyPlot.Axes.DateTimeAxis.ToDouble(dat.GetDate()), Math.Round(dat.PressureMiddle, 1)));
                    unit     = " hpa ";
                    break;

                case nameof(ClimateData.DataTypes.Relative_Luftfeuchte):
                    plotData = aggregatedClimateData.Where(c => c.HumidityMiddle >= 0).Select(dat => new DataPoint(OxyPlot.Axes.DateTimeAxis.ToDouble(dat.GetDate()), (double)dat.HumidityMiddle));
                    unit     = " % ";
                    break;

                case nameof(ClimateData.DataTypes.Windstaerke_Tagesmittel):
                    plotData = aggregatedClimateData.Where(c => c.WindForceMiddle >= 0).Select(dat => new DataPoint(OxyPlot.Axes.DateTimeAxis.ToDouble(dat.GetDate()), Math.Round(dat.WindForceMiddle, 1)));
                    unit     = " Bft ";
                    break;

                case nameof(ClimateData.DataTypes.Sonnenscheindauer_Tagessumme):
                    plotData = aggregatedClimateData.Where(c => c.SunshineSum > 0).Select(dat => new DataPoint(OxyPlot.Axes.DateTimeAxis.ToDouble(dat.GetDate()), Math.Round(dat.SunshineSum, 1)));
                    unit     = " h ";
                    break;
                }

                int count = plotData.Count();
                int step  = count / 365;
                var yAxis = new OxyPlot.Wpf.LinearAxis()
                {
                    Position = AxisPosition.Left, Unit = unit + " --> "
                };
                var xAxis = new OxyPlot.Wpf.DateTimeAxis()
                {
                    Position = AxisPosition.Bottom
                };
                myPlot.Axes.Add(yAxis);
                myPlot.Axes.Add(xAxis);

                mySeries.ItemsSource = plotData;
            }
        }