Skip to content

Commit

Permalink
Merge pull request #95 from OpenIPC/ui-updates
Browse files Browse the repository at this point in the history
change app name and styles
  • Loading branch information
mikecarr authored Mar 1, 2025
2 parents 2094d29 + edeafec commit fd5de17
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 79 deletions.
200 changes: 123 additions & 77 deletions OpenIPC_Config/Views/FirmwareTabView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,104 +6,150 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="OpenIPC_Config.Views.FirmwareTabView"
x:DataType="vm:FirmwareTabViewModel">
<Panel>
<StackPanel Orientation="Vertical">

<!-- <Rectangle Height="300" Width="300" Fill="LightGray" /> -->
<Border Background="#B0B0B0" CornerRadius="10" Padding="10" Margin="10">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Path Data="M10,20 A10,10 0 1,1 10,0 A10,10 0 1,1 10,20 Z M10,7 A1.5,1.5 0 1,0 10,4 A1.5,1.5 0 1,0 10,7 Z M9,8 L11,8 L11,14 L9,14 Z"
Fill="White"
Width="20"
Height="20"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="1"
Text="This tab is used to flash firmware to your camera. There are three ways of selecting firmware. We strongly recommend the first, automatic."
Foreground="Black"
FontSize="14"
TextWrapping="Wrap"
VerticalAlignment="Center"
Margin="10,0,0,0" />
</Grid>
</Border>

<Border Background="#F0F0F0" CornerRadius="8" Padding="16" Margin="8">
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto" ColumnDefinitions="Auto,Auto,Auto,*" ShowGridLines="False">

<!-- Manufacturer -->
<TextBlock Text="Manufacturer" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" />
<ComboBox Grid.Row="0" Grid.Column="1"
IsEnabled="{Binding CanUseDropdowns}"
SelectedItem="{Binding SelectedManufacturer, Mode=TwoWay}"
ItemsSource="{Binding Manufacturers}" />

<!-- Device -->
<TextBlock Text="Device" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" />
<ComboBox Grid.Row="1" Grid.Column="1"
IsEnabled="{Binding CanUseDropdowns}"
SelectedItem="{Binding SelectedDevice, Mode=TwoWay}"
ItemsSource="{Binding Devices}" />

<!-- WFB/Ruby -->
<TextBlock Text="WFB/Ruby" Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" />
<ComboBox Grid.Row="2" Grid.Column="1"
IsEnabled="{Binding CanUseDropdowns}"
SelectedItem="{Binding SelectedFirmware, Mode=TwoWay}"
ItemsSource="{Binding Firmwares}" />

<TextBlock Text="or" Grid.Row="2" Grid.Column="2" VerticalAlignment="Center" />
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto"
ColumnDefinitions="Auto,Auto,Auto"
ShowGridLines="False">

<TextBlock Text="Choice" Grid.Row="3" Grid.Column="0"
IsEnabled="{Binding CanUseDropdowns}"
VerticalAlignment="Center" />
<Border Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Background="#E7E7E7" CornerRadius="8" Padding="5">
<Panel>
<Grid RowDefinitions="Auto,Auto,Auto" ColumnDefinitions="Auto,Auto,Auto,*"
ShowGridLines="False">
<!-- Manufacturer -->
<TextBlock Text="Manufacturer" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" />
<ComboBox Grid.Row="0" Grid.Column="1"
IsEnabled="{Binding CanUseDropdowns}"
SelectedItem="{Binding SelectedManufacturer, Mode=TwoWay}"
ItemsSource="{Binding Manufacturers}" />

<ComboBox Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" Width="400"
IsEnabled="{Binding CanUseDropdownsBySoc}"
SelectedItem="{Binding SelectedFirmwareBySoc, Mode=TwoWay}"
ItemsSource="{Binding FirmwareBySoc}" />
<!-- Device -->
<TextBlock Text="Device" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" />
<ComboBox Grid.Row="1" Grid.Column="1"
IsEnabled="{Binding CanUseDropdowns}"
SelectedItem="{Binding SelectedDevice, Mode=TwoWay}"
ItemsSource="{Binding Devices}" />

<TextBlock Text=" or" Grid.Row="3" Grid.Column="4" VerticalAlignment="Center" />

<!-- Manual upload -->
<TextBlock Text="Local" Grid.Row="4" Grid.Column="0"
VerticalAlignment="Center" />
<!-- WFB/Ruby -->
<TextBlock Text="WFB/Ruby" Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" />
<ComboBox Grid.Row="2" Grid.Column="1"
IsEnabled="{Binding CanUseDropdowns}"
SelectedItem="{Binding SelectedFirmware, Mode=TwoWay}"
ItemsSource="{Binding Firmwares}" />
</Grid>
</Panel>
</Border>


<Button Grid.Row="4" Grid.Column="1" Content="Select Firmware"
Margin="5,10,0,0"
IsEnabled="{Binding CanUseSelectFirmware}"
Command="{Binding SelectFirmwareCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=Window}}" />

<TextBox Grid.Row="4" Grid.Column="2"
Margin="0,10,0,0"
IsReadOnly="True"
IsEnabled="{Binding CanUseSelectFirmware}"
Text="{Binding Path=ManualFirmwareFile, Mode=TwoWay}"
/>
<TextBlock Text="OR" Grid.Row="1" Grid.Column="1" Padding="0,5,0,5" VerticalAlignment="Center" />

<!-- Update Button -->
<Button Content="Update"
Grid.Row="5"
Grid.Column="1"
HorizontalAlignment="Left"
Width="100"
Command="{Binding PerformFirmwareUpgradeAsyncCommand}"
IsEnabled="{Binding CanConnect}"
Margin="5,10,0,0" />
<!-- Choice Section -->
<Border Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" Background="#E7E7E7" CornerRadius="8" Padding="5">
<Grid ColumnDefinitions="Auto, Auto, *" RowDefinitions="Auto">
<TextBlock Text="Select Firmware" Grid.Row="0" Grid.Column="0"
IsEnabled="{Binding CanUseDropdowns}"
VerticalAlignment="Center" />

<ComboBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2"
Width="350"
IsEnabled="{Binding CanUseDropdownsBySoc}"
SelectedItem="{Binding SelectedFirmwareBySoc, Mode=TwoWay}"
ItemsSource="{Binding FirmwareBySoc}" />
</Grid>
</Border>

<TextBlock Text="OR" Grid.Row="5" Grid.Column="1" Padding="0,5,0,5" VerticalAlignment="Center" />

<!-- Manual Section -->
<Border Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="2" Background="#E7E7E7"
CornerRadius="8" Padding="5">

<Grid ColumnDefinitions="Auto, Auto, Auto"
RowDefinitions="Auto, Auto"
ShowGridLines="False" >

<!-- Manual upload -->
<TextBlock Text="Local" Grid.Row="0" Grid.Column="0"
VerticalAlignment="Center" />

<Button Grid.Row="0" Grid.Column="1" Content="Select Firmware"
Margin="5,5,0,0"
VerticalAlignment="Center"
IsEnabled="{Binding CanUseSelectFirmware}"
Command="{Binding SelectFirmwareCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=Window}}" />

<TextBlock Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"
Margin="0,5,0,0"
VerticalAlignment="Center"
Background="#F0F0F0"
Width="400"
IsEnabled="{Binding CanUseSelectFirmware}"
Text="{Binding Path=ManualFirmwareFile, Mode=TwoWay}" />
</Grid>
</Border>

<!-- Clear Button -->
<Button Content="Clear"
Grid.Row="5"
Grid.Column="2"
Grid.Row="7"
Grid.Column="0"
HorizontalAlignment="Left"
Background="LightGray"
IsDefault="False"
Width="100"
Command="{Binding ClearFormCommand}"
IsEnabled="{Binding CanConnect}"
Margin="5,10,0,0" />

<!-- Update Button -->
<Button Content="Update"
Grid.Row="7"
Grid.Column="1"
IsDefault="True"
HorizontalAlignment="Right"
Width="100"
Command="{Binding PerformFirmwareUpgradeAsyncCommand}"
IsEnabled="{Binding CanConnect}"
Margin="0,10,0,0" />
<TextBlock Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3"


<TextBlock Grid.Column="0" Grid.Row="8" Grid.ColumnSpan="3"
Margin="0,50,0,5"
Text="Firmware Upgrade Progress" FontWeight="Medium" />
<ProgressBar Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="3"
Minimum="0" Maximum="100" Value="{Binding ProgressValue}" Height="20" />
<!-- <TextBox Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="3" -->
<!-- BorderBrush="Transparent" -->
<!-- Background="Transparent" -->
<!-- Margin="0,10,0,0" -->
<!-- Text="" -->
<!-- AcceptsReturn="True" -->
<!-- IsReadOnly="True" -->
<!-- Height="100" /> -->
Text="Firmware Upgrade Progress" FontWeight="Medium" />

<ProgressBar Grid.Column="0" Grid.Row="9" Grid.ColumnSpan="3"
Background="#F0F0F0"
Minimum="0" Maximum="100"
Value="{Binding ProgressValue}"
/>

</Grid>
</Border>

</Panel>
</StackPanel>


</UserControl>
2 changes: 1 addition & 1 deletion OpenIPC_Config/Views/HeaderView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<Svg Width="150" Margin="10,5,0,0" Path="/Assets/Icons/openipc-logo.svg" />

<TextBlock FontSize="14" Foreground="White" Margin="10,5,0,5">
<Run Text="CONFIGURATOR" />
<Run Text="COMPANION" />
<Run Text="{Binding AppVersionText}" />
</TextBlock>

Expand Down
2 changes: 1 addition & 1 deletion OpenIPC_Config/Views/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:views="clr-namespace:OpenIPC_Config.Views"
x:Class="OpenIPC_Config.Views.MainWindow"
Title="OpenIPC FPV Config Tool"
Title="OpenIPC Companion"
Icon="/Assets/Icons/OpenIPC.ico">
<!-- Width="900" Height="850" MinWidth="600" MinHeight="800"> -->

Expand Down

0 comments on commit fd5de17

Please sign in to comment.