aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/ChartsView.xaml.cs
blob: bd97ed2bc0d831161495e28d0f917cbd0632b27c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using LiveCharts;
using LiveCharts.Wpf;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Tango.MachineStudio.Statistics.Views
{
    /// <summary>
    /// Interaction logic for ChartsView.xaml
    /// </summary>
    public partial class ChartsView : UserControl
    {
        public ChartsView()
        {
            InitializeComponent();
        }
        private void PieChart_DataHover(object sender, ChartPoint chartPoint)
        {
            var tooltip = ((chartPoint.ChartView as PieChart).DataTooltip as Tooltips.PieChartTooltipControl).Title;
            txtPieTitle.Text = tooltip;
        }
        private void StartDatePicker_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
        {
            DatePicker datePickerObj = sender as DatePicker;
            if (datePickerObj != null && datePickerObj.SelectedDate != null && endDatePicker.SelectedDate != null)
            {
                if (datePickerObj.SelectedDate > endDatePicker.SelectedDate)
                {
                    BindingExpression start_be = datePickerObj.GetBindingExpression(DatePicker.SelectedDateProperty);
                    ValidationError validationError = new ValidationError(StartDateExpiredRule, start_be);
                    validationError.ErrorContent = "The start time must be less than or equal to end time.";
                    Validation.MarkInvalid(start_be, validationError);
                }
                else if (Validation.GetHasError(endDatePicker))
                {
                    BindingExpression end_be = endDatePicker.GetBindingExpression(DatePicker.SelectedDateProperty);
                    Validation.ClearInvalid(end_be);
                }
            }
        }

        private void EndDatePicker_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
        {
            DatePicker datePickerObj = sender as DatePicker;
            if (datePickerObj.SelectedDate != null && startdatePicker.SelectedDate != null)
            {
                if (datePickerObj != null && datePickerObj.SelectedDate < startdatePicker.SelectedDate)
                {
                    BindingExpression end_be = datePickerObj.GetBindingExpression(DatePicker.SelectedDateProperty);
                    ValidationError validationError = new ValidationError(EndDateExpiredRule, end_be);
                    validationError.ErrorContent = "The end time must be greater than or equal to the start time.";
                    Validation.MarkInvalid(end_be, validationError);
                }
                else if (Validation.GetHasError(startdatePicker))
                {
                    BindingExpression start_be = startdatePicker.GetBindingExpression(DatePicker.SelectedDateProperty);
                    Validation.ClearInvalid(start_be);
                }
            }
        }
    }
}
n>new Hwi.Params(); hwi17Params.instance.name = "timer3"; hwi17Params.arg = 3; hwi17Params.priority = 96; Program.global.timer3 = Hwi.create(51, "&ScrewTimerInterrupt", hwi17Params); var semaphore0Params = new Semaphore.Params(); semaphore0Params.instance.name = "adcResultSem"; semaphore0Params.mode = Semaphore.Mode_BINARY; Program.global.adcResultSem = Semaphore.create(null, semaphore0Params); var semaphore3Params = new Semaphore.Params(); semaphore3Params.instance.name = "updateSem"; semaphore3Params.mode = Semaphore.Mode_BINARY; Program.global.updateSem = Semaphore.create(null, semaphore3Params); var semaphore4Params = new Semaphore.Params(); semaphore4Params.instance.name = "initConnectionSem"; semaphore4Params.mode = Semaphore.Mode_BINARY; Program.global.initConnectionSem = Semaphore.create(null, semaphore4Params); var semaphore5Params = new Semaphore.Params(); semaphore5Params.instance.name = "I2C_Sem"; semaphore5Params.mode = Semaphore.Mode_BINARY; Program.global.I2C_Sem = Semaphore.create(null, semaphore5Params); var semaphore6Params = new Semaphore.Params(); semaphore6Params.instance.name = "FFS_Sem"; semaphore6Params.mode = Semaphore.Mode_BINARY; Program.global.FFS_Sem = Semaphore.create(null, semaphore6Params); var semaphore8Params = new Semaphore.Params(); semaphore8Params.instance.name = "FileUpload_sem_param"; semaphore8Params.mode = Semaphore.Mode_BINARY; Program.global.FileUpload_sem_param = Semaphore.create(null, semaphore8Params); var semaphore9Params = new Semaphore.Params(); semaphore9Params.instance.name = "shinkoSem"; semaphore9Params.mode = Semaphore.Mode_BINARY; Program.global.shinkoSem = Semaphore.create(null, semaphore9Params); var semaphore7Params = new Semaphore.Params(); semaphore7Params.instance.name = "ReconnectSem"; semaphore7Params.mode = Semaphore.Mode_BINARY; Program.global.ReconnectSem = Semaphore.create(null, semaphore7Params); Task.addHookSet({ // registerFxn: '&myRegisterFxn', // createFxn: '&myCreateFxn', // deleteFxn: '&myDeleteFxn', switchFxn: '&MyswitchFxn' }); var MillisecTaskParams = new Task.Params(); MillisecTaskParams.instance.name = "MilliSecond"; MillisecTaskParams.stackSize = 4096; MillisecTaskParams.priority = 23; Program.global.millisec = Task.create("&MillisecTask", MillisecTaskParams); var ControlTaskParams = new Task.Params(); ControlTaskParams.instance.name = "control"; ControlTaskParams.stackSize = 4096; ControlTaskParams.priority = 22; Program.global.control = Task.create("&controlTask", ControlTaskParams); var CommTxTaskParams = new Task.Params(); CommTxTaskParams.instance.name = "communicationTx"; CommTxTaskParams.priority = 21; CommTxTaskParams.stackSize = 4096; Program.global.communicationTx = Task.create("&communicationTxTask", CommTxTaskParams); var CommRxTaskParams = new Task.Params(); CommRxTaskParams.instance.name = "communicationRx"; CommRxTaskParams.priority = 20; CommRxTaskParams.stackSize = 8192; Program.global.communication = Task.create("&communicationTask", CommRxTaskParams); var AlarmHandlingTaskParams = new Task.Params(); AlarmHandlingTaskParams.instance.name = "AlarmHandling"; AlarmHandlingTaskParams.stackSize = 4096; AlarmHandlingTaskParams.priority = 19; Program.global.AlarmHandling = Task.create("&AlarmHandlingTask", AlarmHandlingTaskParams); var ProcessTaskParams = new Task.Params(); ProcessTaskParams.instance.name = "process"; ProcessTaskParams.stackSize = 4096; ProcessTaskParams.priority = 18; Program.global.process = Task.create("&jobTask", ProcessTaskParams); /*var I2C_Reading = new Task.Params(); I2C_Reading.instance.name = "I2C_Reading"; I2C_Reading.stackSize = 2048; I2C_Reading.priority = 17; Program.global.I2C_Reading = Task.create("&I2C_ReadingTask", I2C_Reading); */ var HeaterControlTaskParams = new Task.Params(); HeaterControlTaskParams.instance.name = "HeatersControl"; HeaterControlTaskParams.priority = 16; Program.global.HeatersControl = Task.create("&HeatersControlTask", HeaterControlTaskParams); var ReportTaskParams = new Task.Params(); ReportTaskParams.instance.name = "report"; ReportTaskParams.stackSize = 4096; ReportTaskParams.priority = 15; Program.global.report = Task.create("&reportService", ReportTaskParams); var ControlLowTaskParams = new Task.Params(); ControlLowTaskParams.instance.name = "controlLow"; ControlLowTaskParams.stackSize = 4096; ControlLowTaskParams.priority = 14; Program.global.controlLow = Task.create("&controlLowTask", ControlLowTaskParams); var DiagnosticsTaskParams = new Task.Params(); DiagnosticsTaskParams.instance.name = "Diagnostics"; DiagnosticsTaskParams.priority = 13; DiagnosticsTaskParams.stackSize = 8192; Program.global.Diagnostics = Task.create("&DiagnosticsTask", DiagnosticsTaskParams); var MillisecLowTaskParams = new Task.Params(); MillisecLowTaskParams.instance.name = "MilliSecondLow"; MillisecLowTaskParams.stackSize = 4096; MillisecLowTaskParams.priority = 12; Program.global.millisecLow = Task.create("&MillisecLowTask", MillisecLowTaskParams); /* var RFID_TaskParams = new Task.Params(); --- moved to I2C_RFID_Disp_Task.c RFID_TaskParams.instance.name = "RFID"; RFID_TaskParams.stackSize = 4096; RFID_TaskParams.priority = 10; Program.global.millisecLow = Task.create("&RFID_Task", RFID_TaskParams); */ var ADCProcessTaskParams = new Task.Params(); ADCProcessTaskParams.instance.name = "adcProcess"; ADCProcessTaskParams.stackSize = 512; ADCProcessTaskParams.priority = 9; Program.global.adcProcess = Task.create("&ADCProcessTask", ADCProcessTaskParams); var FPGALoad = new Task.Params(); FPGALoad.instance.name = "FPGALoad"; FPGALoad.stackSize = 4096; FPGALoad.priority = 5; Program.global.FPGALoad = Task.create("&FPGALoadTask", FPGALoad); var updateTaskParams = new Task.Params(); updateTaskParams.instance.name = "update"; updateTaskParams.priority = 4; Program.global.update = Task.create("&updateTask", updateTaskParams); var shinkoTaskParams = new Task.Params(); shinkoTaskParams.instance.name = "shinko"; shinkoTaskParams.stackSize = 1024; shinkoTaskParams.priority = 3; Program.global.shinko = Task.create("&shinkoTask", shinkoTaskParams); /* ================ Text configuration ================ */ var Text = xdc.useModule('xdc.runtime.Text'); /* * These strings are placed in the .const section. Setting this parameter to * false will save space in the .const section. Error, Assert and Log messages * will print raw ids and args instead of a formatted message. * * Pick one: * - true (default) * This option loads test string into the .const for easier debugging. * - false * This option reduces the .const footprint. */ Text.isLoaded = true; //Text.isLoaded = false; /* ================ Error configuration ================ */ /* set errHook (defined in main.c) as the error * hook function. Strings begining with '&' * can be assigned to function pointers to * reference unspecified external functions */ Error.raiseHook = "&errHook"; BIOS.customCCOpts += " -Dxdc_FILE=__FILE__ "; /* set user-defined code for E_generic errors */ Error.E_generic.code = 28; /* ================ Types configuration ================ */ var Types = xdc.useModule('xdc.runtime.Types'); /* * This module defines basic constants and types used throughout the * xdc.runtime package. */ /* ================ TI-RTOS middleware configuration ================ */ var mwConfig = xdc.useModule('ti.mw.Config'); /* * Include TI-RTOS middleware libraries */ /* ================ TI-RTOS drivers' configuration ================ */ var driversConfig = xdc.useModule('ti.drivers.Config'); /* * Include TI-RTOS drivers * * Pick one: * - driversConfig.LibType_NonInstrumented (default) * Use TI-RTOS drivers library optimized for footprint and performance * without asserts or logs. * - driversConfig.LibType_Instrumented * Use TI-RTOS drivers library for debugging with asserts and logs enabled. */ driversConfig.libType = driversConfig.LibType_NonInstrumented; //driversConfig.libType = driversConfig.LibType_Instrumented; /* ================ Application Specific Instances ================ */ var FatFS = xdc.useModule('ti.mw.fatfs.FatFS'); System.maxAtexitHandlers = 2; TimestampProvider.timerId = 3; TimestampProvider.useClockTimer = true; Program.gen.debuggerFiles = false; Task.defaultStackSize = 1024; Task.idleTaskVitalTaskFlag = false; Task.enableIdleTask = false;