-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnalyticsWindow.xaml
More file actions
226 lines (200 loc) · 12.5 KB
/
Copy pathAnalyticsWindow.xaml
File metadata and controls
226 lines (200 loc) · 12.5 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<Window x:Class="SysMonBar.AnalyticsWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Power Analytics" Width="560" Height="740"
WindowStartupLocation="CenterScreen"
Background="#F9FAFB"
FontFamily="Segoe UI"
TextElement.Foreground="#111827"
Loaded="Window_Loaded">
<Window.Resources>
<!-- Card Style -->
<Style TargetType="Border" x:Key="Card">
<Setter Property="Background" Value="White"/>
<Setter Property="CornerRadius" Value="12"/>
<Setter Property="Margin" Value="20,0,20,20"/>
<Setter Property="Padding" Value="20,16"/>
<Setter Property="Effect">
<Setter.Value>
<DropShadowEffect BlurRadius="10" ShadowDepth="2" Opacity="0.05" Color="Black" Direction="270"/>
</Setter.Value>
</Setter>
</Style>
<!-- Section Header -->
<Style TargetType="TextBlock" x:Key="SectionHeader">
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="Foreground" Value="#6B7280"/>
<Setter Property="Margin" Value="24,20,24,8"/>
<Setter Property="TextOptions.TextFormattingMode" Value="Display"/>
</Style>
<Style TargetType="Button" x:Key="PrimaryButton">
<Setter Property="Background" Value="#3B82F6"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="Padding" Value="16,8"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="8" Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="Button" x:Key="SecondaryButton">
<Setter Property="Background" Value="#F3F4F6"/>
<Setter Property="Foreground" Value="#4B5563"/>
<Setter Property="Padding" Value="12,6"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="FontWeight" Value="Medium"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="6" Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="ComboBox" x:Key="ModernComboBox">
<Setter Property="Padding" Value="8,4"/>
<Setter Property="Background" Value="White"/>
<Setter Property="BorderBrush" Value="#E5E7EB"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Header Controls -->
<Border Background="White" BorderBrush="#E5E7EB" BorderThickness="0,0,0,1" Padding="20,16">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Period:" VerticalAlignment="Center" Foreground="#6B7280" FontWeight="Medium" Margin="0,0,8,0"/>
<ComboBox Grid.Column="1" x:Name="CmbPeriod" Width="140" SelectionChanged="Period_Changed" Style="{StaticResource ModernComboBox}">
<ComboBoxItem Content="24 Hours" IsSelected="True"/>
<ComboBoxItem Content="7 Days"/>
<ComboBoxItem Content="30 Days"/>
</ComboBox>
<Button Grid.Column="3" Content="Refresh Data" Click="Refresh_Click" Style="{StaticResource SecondaryButton}"/>
</Grid>
</Border>
<!-- Scrollable Content -->
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<StackPanel Margin="0,10,0,20">
<TextBlock Text="SUMMARY STATS" Style="{StaticResource SectionHeader}"/>
<Border Style="{StaticResource Card}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Total kWh & Average -->
<StackPanel Grid.Row="0" Grid.Column="0" Margin="0,0,0,16">
<TextBlock Text="Total Energy" Foreground="#6B7280" FontSize="12" FontWeight="Medium" Margin="0,0,0,4"/>
<TextBlock x:Name="TxtKwh" Text="0.00 kWh" Foreground="#3B82F6" FontSize="20" FontWeight="Bold"/>
</StackPanel>
<StackPanel Grid.Row="0" Grid.Column="1" Margin="0,0,0,16">
<TextBlock Text="Average Power" Foreground="#6B7280" FontSize="12" FontWeight="Medium" Margin="0,0,0,4"/>
<TextBlock x:Name="TxtAvg" Text="0 W" Foreground="#3B82F6" FontSize="20" FontWeight="Bold"/>
</StackPanel>
<!-- Max & Min -->
<StackPanel Grid.Row="1" Grid.Column="0" Margin="0,0,0,16">
<TextBlock Text="Peak Power" Foreground="#6B7280" FontSize="12" FontWeight="Medium" Margin="0,0,0,4"/>
<TextBlock x:Name="TxtMax" Text="0 W" Foreground="#EF4444" FontSize="18" FontWeight="SemiBold"/>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="1" Margin="0,0,0,16">
<TextBlock Text="Minimum Power" Foreground="#6B7280" FontSize="12" FontWeight="Medium" Margin="0,0,0,4"/>
<TextBlock x:Name="TxtMin" Text="0 W" Foreground="#10B981" FontSize="18" FontWeight="SemiBold"/>
</StackPanel>
<!-- Duration & Readings -->
<StackPanel Grid.Row="2" Grid.Column="0">
<TextBlock Text="Duration Recorded" Foreground="#6B7280" FontSize="12" FontWeight="Medium" Margin="0,0,0,4"/>
<TextBlock x:Name="TxtDuration" Text="0 hours" Foreground="#374151" FontSize="16" FontWeight="SemiBold"/>
</StackPanel>
<StackPanel Grid.Row="2" Grid.Column="1">
<TextBlock Text="Data Points" Foreground="#6B7280" FontSize="12" FontWeight="Medium" Margin="0,0,0,4"/>
<TextBlock x:Name="TxtReadings" Text="0" Foreground="#374151" FontSize="16" FontWeight="SemiBold"/>
</StackPanel>
</Grid>
</Border>
<TextBlock Text="COST ESTIMATOR" Style="{StaticResource SectionHeader}"/>
<Border Style="{StaticResource Card}">
<StackPanel>
<TextBlock Text="Electricity Cost" FontSize="16" FontWeight="SemiBold" Foreground="#111827" Margin="0,0,0,12"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Rate per kWh:" VerticalAlignment="Center" Foreground="#4B5563" Margin="0,0,12,0"/>
<TextBox Grid.Column="1" x:Name="TxtRate" Width="80" Text="8.0"
TextChanged="TxtRate_TextChanged"
Background="#F9FAFB" Foreground="#111827" BorderBrush="#E5E7EB" BorderThickness="1"
Padding="8,6" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"/>
<TextBlock Grid.Column="2" Text="BDT" VerticalAlignment="Center" Foreground="#6B7280" Margin="8,0,0,0"/>
</Grid>
<Separator Background="#F3F4F6" Margin="0,16"/>
<TextBlock x:Name="TxtCost" Text="Estimated: ৳0.00" Foreground="#F59E0B" FontSize="20" FontWeight="Bold"/>
</StackPanel>
</Border>
<TextBlock Text="CHARTS" Style="{StaticResource SectionHeader}"/>
<Border Style="{StaticResource Card}">
<StackPanel>
<TextBlock Text="Power (Watts)" Foreground="#4B5563" FontWeight="SemiBold" Margin="0,0,0,8"/>
<Border Background="#F9FAFB" BorderBrush="#E5E7EB" BorderThickness="1" CornerRadius="8" Padding="8" Height="120" Margin="0,0,0,20">
<Canvas x:Name="PowerCanvas" ClipToBounds="True"/>
</Border>
<TextBlock Text="Temperatures (°C)" Foreground="#4B5563" FontWeight="SemiBold" Margin="0,0,0,8"/>
<Border Background="#F9FAFB" BorderBrush="#E5E7EB" BorderThickness="1" CornerRadius="8" Padding="8" Height="120" Margin="0,0,0,20">
<Canvas x:Name="TempCanvas" ClipToBounds="True"/>
</Border>
<TextBlock Text="Usage (%)" Foreground="#4B5563" FontWeight="SemiBold" Margin="0,0,0,8"/>
<Border Background="#F9FAFB" BorderBrush="#E5E7EB" BorderThickness="1" CornerRadius="8" Padding="8" Height="120" Margin="0,0,0,20">
<Canvas x:Name="UsageCanvas" ClipToBounds="True"/>
</Border>
<TextBlock Text="RAM (GB)" Foreground="#4B5563" FontWeight="SemiBold" Margin="0,0,0,8"/>
<Border Background="#F9FAFB" BorderBrush="#E5E7EB" BorderThickness="1" CornerRadius="8" Padding="8" Height="120" Margin="0,0,0,20">
<Canvas x:Name="RamCanvas" ClipToBounds="True"/>
</Border>
<TextBlock Text="Network" Foreground="#4B5563" FontWeight="SemiBold" Margin="0,0,0,8"/>
<Border Background="#F9FAFB" BorderBrush="#E5E7EB" BorderThickness="1" CornerRadius="8" Padding="8" Height="120">
<Canvas x:Name="NetCanvas" ClipToBounds="True"/>
</Border>
</StackPanel>
</Border>
</StackPanel>
</ScrollViewer>
<!-- Footer -->
<Border Grid.Row="2" Background="White" BorderBrush="#E5E7EB" BorderThickness="0,1,0,0" Padding="20,16">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button Grid.Column="1" Content="Close" Click="Close_Click" Style="{StaticResource PrimaryButton}" Width="100"/>
</Grid>
</Border>
</Grid>
</Window>