aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.Power/Views/MainView.xaml
blob: 4add8e94ca595f3f88c0221ded256e8f1ffd5f1f (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
75
<UserControl x:Class="Tango.PPC.Power.Views.MainView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:vm="clr-namespace:Tango.PPC.Power.ViewModels"
             xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
             xmlns:global="clr-namespace:Tango.PPC.Power"
             xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
             xmlns:local="clr-namespace:Tango.PPC.Power.Views"
             mc:Ignorable="d" 
             d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}">

    <Grid Background="{StaticResource TangoMidBackgroundBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="1*"/>
        </Grid.RowDefinitions>

        <Border Padding="20" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="0 0 0 1" BorderBrush="{StaticResource TangoDividerBrush}">
            <Border.Effect>
                <DropShadowEffect Color="Silver" ShadowDepth="0" BlurRadius="20" Opacity="1" />
            </Border.Effect>
            <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold">Power</TextBlock>
        </Border>

        <UniformGrid Grid.Row="1" Rows="2" Margin="20 50 20 20">

            <StackPanel Margin="-90 0 0 0" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
                <Image Source="../Images/tablet.png" Width="256" RenderOptions.BitmapScalingMode="Fant" VerticalAlignment="Top" HorizontalAlignment="Left" />

                <Grid VerticalAlignment="Top" Margin="40 0 0 0">
                    <StackPanel>
                        <controls:TableGrid RowHeight="40" MakeFirstColumnVerticalAlignmentBottom="False">
                            <TextBlock FontWeight="SemiBold">CPU:</TextBlock>
                            <TextBlock>38%</TextBlock>
                            <TextBlock FontWeight="SemiBold">RAM:</TextBlock>
                            <TextBlock>50%</TextBlock>
                            <TextBlock FontWeight="SemiBold">UWF:</TextBlock>
                            <TextBlock>Active</TextBlock>
                            <TextBlock FontWeight="SemiBold">Free Space:</TextBlock>
                            <touch:TouchProgressBar Margin="10 5 0 0" Height="10" VerticalAlignment="Top" Maximum="100" Value="60" Foreground="{StaticResource TangoSuccessBrush}" />
                        </controls:TableGrid>

                        <touch:TouchButton Height="60" Margin="0 0 0 0" CornerRadius="30" Width="250" Command="{Binding RestartCommand}">RESTART</touch:TouchButton>
                    </StackPanel>
                </Grid>
            </StackPanel>

            <Grid>
                <Rectangle VerticalAlignment="Top" HorizontalAlignment="Stretch" Margin="100 0" StrokeThickness="1" Stroke="{StaticResource TangoDividerBrush}"></Rectangle>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <Image Source="../Images/machine.png" Width="256" RenderOptions.BitmapScalingMode="Fant" VerticalAlignment="Top" HorizontalAlignment="Left" />

                    <Grid Margin="0 0 0 0" VerticalAlignment="Top">
                        <StackPanel Margin="20 0 0 0">
                            <controls:TableGrid RowHeight="40" MakeFirstColumnVerticalAlignmentBottom="False" HorizontalAlignment="Left">
                                <TextBlock FontWeight="SemiBold">Firmware Version:</TextBlock>
                                <TextBlock Text="{Binding MachineProvider.MachineOperator.DeviceInformation.Version,TargetNullValue='N/A',FallbackValue='N/A'}"></TextBlock>
                                <TextBlock FontWeight="SemiBold">Status:</TextBlock>
                                <TextBlock Text="{Binding MachineProvider.MachineOperator.Status,Converter={StaticResource EnumToDescriptionConverter}}"></TextBlock>
                            </controls:TableGrid>

                            <UniformGrid Columns="3">
                                <touch:TouchButton Style="{StaticResource TangoRoundTouchButton}" Background="{StaticResource TangoErrorBrush}" Width="90" Height="90">TURN OFF</touch:TouchButton>
                                <touch:TouchButton Margin="10 0 0 0" Style="{StaticResource TangoRoundTouchButton}" Background="{StaticResource TangoWarningBrush}" Width="90" Height="90">STAND BY</touch:TouchButton>
                                <touch:TouchButton Margin="10 0 0 0" Style="{StaticResource TangoRoundTouchButton}" Background="{StaticResource TangoSuccessBrush}" Width="90" Height="90">GET READY</touch:TouchButton>
                            </UniformGrid>
                        </StackPanel>
                    </Grid>
                </StackPanel>
            </Grid>
        </UniformGrid>
    </Grid>
</UserControl>
lass="w"> xdc.useModule('xdc.runtime.knl.SyncGeneric'); var Mailbox = xdc.useModule('ti.sysbios.knl.Mailbox'); //var HeapStd = xdc.useModule('xdc.runtime.HeapStd'); var GIO = xdc.useModule('ti.sysbios.io.GIO'); var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore'); var Task = xdc.useModule('ti.sysbios.knl.Task'); //var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem'); var HeapTrack = xdc.useModule('ti.sysbios.heaps.HeapTrack'); //var Memory = xdc.useModule('xdc.runtime.Memory'); BIOS.heapSize = 50000; // bios heapmem //Memory.defaultHeapSize = 20000; //Program.heap = 40000; //Program.stack = 4096; Clock.timerId = 7; var hwi0Params = new Hwi.Params(); hwi0Params.instance.name = "adcHwi"; Program.global.adcHwi = Hwi.create(30, "&ADC0SS0Handler", hwi0Params); var hwi1Params = new Hwi.Params(); hwi1Params.instance.name = "sysTick"; Program.global.sysTick = Hwi.create(15, "&SysTickHandler", hwi1Params); var hwi13Params = new Hwi.Params(); hwi13Params.instance.name = "timer0"; hwi13Params.priority = 128; Program.global.timer0 = Hwi.create(35, "&OneMilliSecondControlInterrupt", hwi13Params); var hwi20Params = new Hwi.Params(); hwi20Params.instance.name = "watchdog"; Program.global.watchdog = Hwi.create(34, "&WatchdogIntHandler", hwi20Params); var hwi15Params = new Hwi.Params(); hwi15Params.instance.name = "timer2"; hwi15Params.arg = 2; hwi15Params.priority = 160; Program.global.timer2 = Hwi.create(39, "&EightMilliSecondHeatersInterrupt", hwi15Params); var hwi6Params = new Hwi.Params(); hwi6Params.instance.name = "timer1"; hwi6Params.priority = 128; Program.global.timer1 = Hwi.create(37, "&MillisecInterrupt", hwi6Params); var hwi17Params = new Hwi.Params(); hwi17Params.instance.name = "timer3"; hwi17Params.arg = 3; hwi17Params.priority = 96; Program.global.timer3 = Hwi.create(51, "&ScrewTimerInterrupt", hwi17Params); var semaphore4Params = new Semaphore.Params(); semaphore4Params.instance.name = "initConnectionSem"; semaphore4Params.mode = Semaphore.Mode_BINARY; Program.global.initConnectionSem = Semaphore.create(null, semaphore4Params); 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 = "FFS_Sem"; semaphore4Params.mode = Semaphore.Mode_BINARY; Program.global.FFS_Sem = Semaphore.create(null, semaphore4Params); 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 = 12; Program.global.millisec = Task.create("&MillisecTask", MillisecTaskParams); var FPGALoad = new Task.Params(); FPGALoad.instance.name = "FPGALoad"; FPGALoad.stackSize = 4096; FPGALoad.priority = 5; Program.global.FPGALoad = Task.create("&FPGALoadTask", FPGALoad); var ControlTaskParams = new Task.Params(); ControlTaskParams.instance.name = "control"; ControlTaskParams.stackSize = 2048; ControlTaskParams.priority = 11; Program.global.control = Task.create("&controlTask", ControlTaskParams); var AlarmHandlingTaskParams = new Task.Params(); AlarmHandlingTaskParams.instance.name = "AlarmHandling"; AlarmHandlingTaskParams.stackSize = 2048; AlarmHandlingTaskParams.priority = 9; Program.global.AlarmHandling = Task.create("&AlarmHandlingTask", AlarmHandlingTaskParams); var CommTxTaskParams = new Task.Params(); CommTxTaskParams.instance.name = "communicationTx"; CommTxTaskParams.priority = 10; CommTxTaskParams.stackSize = 4096; Program.global.communicationTx = Task.create("&communicationTxTask", CommTxTaskParams); var ProcessTaskParams = new Task.Params(); ProcessTaskParams.instance.name = "process"; ProcessTaskParams.stackSize = 4096; ProcessTaskParams.priority = 8; Program.global.process = Task.create("&jobTask", ProcessTaskParams); var HeaterControlTaskParams = new Task.Params(); HeaterControlTaskParams.instance.name = "HeatersControl"; HeaterControlTaskParams.priority = 7; Program.global.HeatersControl = Task.create("&HeatersControlTask", HeaterControlTaskParams); var CommRxTaskParams = new Task.Params(); CommRxTaskParams.instance.name = "communicationRx"; CommRxTaskParams.priority = 9; CommRxTaskParams.stackSize = 8192; Program.global.communication = Task.create("&communicationTask", CommRxTaskParams); var MillisecLowTaskParams = new Task.Params(); MillisecLowTaskParams.instance.name = "MilliSecondLow"; MillisecLowTaskParams.stackSize = 2048; MillisecLowTaskParams.priority = 5; Program.global.millisecLow = Task.create("&MillisecLowTask", MillisecLowTaskParams); var ControlLowTaskParams = new Task.Params(); ControlLowTaskParams.instance.name = "controlLow"; ControlLowTaskParams.stackSize = 4096; ControlLowTaskParams.priority = 5; Program.global.controlLow = Task.create("&controlLowTask", ControlLowTaskParams); var DiagnosticsTaskParams = new Task.Params(); DiagnosticsTaskParams.instance.name = "Diagnostics"; DiagnosticsTaskParams.priority = 6; DiagnosticsTaskParams.stackSize = 8192; Program.global.Diagnostics = Task.create("&DiagnosticsTask", DiagnosticsTaskParams); var ADCProcessTaskParams = new Task.Params(); ADCProcessTaskParams.instance.name = "adcProcess"; ADCProcessTaskParams.stackSize = 512; ADCProcessTaskParams.priority = 3; Program.global.adcProcess = Task.create("&ADCProcessTask", ADCProcessTaskParams); var ReportTaskParams = new Task.Params(); ReportTaskParams.instance.name = "report"; ReportTaskParams.stackSize = 2048; ReportTaskParams.priority = 7; Program.global.report = Task.create("&reportService", ReportTaskParams); var updateTaskParams = new Task.Params(); updateTaskParams.instance.name = "update"; updateTaskParams.priority = 4; Program.global.update = Task.create("&updateTask", updateTaskParams); /* ================ 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;