Browse Source

New Background, New ICO, Support modify 2 logos of ICO

Snoopy 4 years ago
parent
commit
14ef1269fa

+ 15 - 0
App.config

@@ -109,6 +109,21 @@
             <setting name="LogoCustomImgPath_org" serializeAs="String">
                 <value />
             </setting>
+            <setting name="IsCompLogoDefault" serializeAs="String">
+                <value>True</value>
+            </setting>
+            <setting name="CompLogoCustomImgPath" serializeAs="String">
+                <value />
+            </setting>
+            <setting name="CompLogoCustomImgPath_org" serializeAs="String">
+                <value />
+            </setting>
+            <setting name="Mode" serializeAs="String">
+                <value>123456</value>
+            </setting>
+            <setting name="SdCardPath" serializeAs="String">
+                <value />
+            </setting>
         </Phihong_EVSE_UI_Tool.Properties.Settings>
     </userSettings>
 </configuration>

+ 10 - 0
AuthenticationUC.xaml.cs

@@ -1,6 +1,7 @@
 using Microsoft.WindowsAPICodePack.Dialogs;
 using System;
 using System.IO;
+using System.Linq;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Media.Imaging;
@@ -52,18 +53,21 @@ namespace Phihong_EVSE_UI_Tool
                     srcPath = new Uri(Path.Combine(Utility.BG_PARENTFOLDER, Utility.BG_VERIFY), UriKind.Relative);
                     uxVerifyImage.Source = new BitmapImage(srcPath);
                     Utility.CopyFileFromResource(srcPath, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_VERIFY));
+                    Utility.ChangedFiles[Utility.BG_VERIFY] = true;
                     mySettings.IsVerifyDefault = true;
                     break;
                 case "VerifyOk":
                     srcPath = new Uri(Path.Combine(Utility.BG_PARENTFOLDER, Utility.BG_VERIFYOK), UriKind.Relative);
                     uxVerifyOkImage.Source = new BitmapImage(srcPath);
                     Utility.CopyFileFromResource(srcPath, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_VERIFYOK));
+                    Utility.ChangedFiles[Utility.BG_VERIFYOK] = true;
                     mySettings.IsVerifyOkDefault = true;
                     break;
                 case "VerifyFail":
                     srcPath = new Uri(Path.Combine(Utility.BG_PARENTFOLDER, Utility.BG_VERIFYFAIL), UriKind.Relative);
                     uxVerifyFailImage.Source = new BitmapImage(srcPath);
                     Utility.CopyFileFromResource(srcPath, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_VERIFYFAIL));
+                    Utility.ChangedFiles[Utility.BG_VERIFYFAIL] = true;
                     mySettings.IsVerifyFailDefault = true;
                     break;
                 default:
@@ -88,6 +92,7 @@ namespace Phihong_EVSE_UI_Tool
                     {
                         Utility.LoadImageFromPath(uxVerifyImage, verifyCustomImgPath);
                         File.Copy(verifyCustomImgPath, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_VERIFY), true);
+                        Utility.ChangedFiles[Utility.BG_VERIFY] = true;
                         mySettings.IsVerifyDefault = false;
                     }
                     break;
@@ -96,6 +101,7 @@ namespace Phihong_EVSE_UI_Tool
                     {
                         Utility.LoadImageFromPath(uxVerifyOkImage, verifyOkCustomImgPath);
                         File.Copy(verifyOkCustomImgPath, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_VERIFYOK), true);
+                        Utility.ChangedFiles[Utility.BG_VERIFYOK] = true;
                         mySettings.IsVerifyOkDefault = false;
                     }
                     break;
@@ -104,6 +110,7 @@ namespace Phihong_EVSE_UI_Tool
                     {
                         Utility.LoadImageFromPath(uxVerifyFailImage, verifyFailCustomImgPath);
                         File.Copy(verifyFailCustomImgPath, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_VERIFYFAIL), true);
+                        Utility.ChangedFiles[Utility.BG_VERIFYFAIL] = true;
                         mySettings.IsVerifyFailDefault = false;
                     }
                     break;
@@ -146,6 +153,7 @@ namespace Phihong_EVSE_UI_Tool
                         File.Copy(dlg.FileName, verifyCustomImgPath, true);
                         File.Copy(dlg.FileName, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_VERIFY), true);
                         Utility.LoadImageFromPath(uxVerifyImage, verifyCustomImgPath);
+                        Utility.ChangedFiles[Utility.BG_VERIFY] = true;
                         mySettings.IsVerifyDefault = false;
                         mySettings.VerifyCustomImgPath = verifyCustomImgPath;
                         mySettings.VerifyCustomImgPath_org = uxVerifyExploreTextBox.Text;
@@ -156,6 +164,7 @@ namespace Phihong_EVSE_UI_Tool
                         File.Copy(dlg.FileName, verifyOkCustomImgPath, true);
                         File.Copy(dlg.FileName, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_VERIFYOK), true);
                         Utility.LoadImageFromPath(uxVerifyOkImage, verifyOkCustomImgPath);
+                        Utility.ChangedFiles[Utility.BG_VERIFYOK] = true;
                         mySettings.IsVerifyOkDefault = false;
                         mySettings.VerifyOkCustomImgPath = verifyOkCustomImgPath;
                         mySettings.VerifyOkCustomImgPath_org = uxVerifyOkExploreTextBox.Text;
@@ -166,6 +175,7 @@ namespace Phihong_EVSE_UI_Tool
                         File.Copy(dlg.FileName, verifyFailCustomImgPath, true);
                         File.Copy(dlg.FileName, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_VERIFYFAIL), true);
                         Utility.LoadImageFromPath(uxVerifyFailImage, verifyFailCustomImgPath);
+                        Utility.ChangedFiles[Utility.BG_VERIFYFAIL] = true;
                         mySettings.IsVerifyFailDefault = false;
                         mySettings.VerifyFailCustomImgPath = verifyFailCustomImgPath;
                         mySettings.VerifyFailCustomImgPath_org = uxVerifyFailExploreTextBox.Text;

BIN
Background/1_idle.bmp


BIN
Background/2_verify.bmp


BIN
Background/3_carChkok.bmp


BIN
Background/4_chkfail.bmp


BIN
Background/5_plug.bmp


BIN
Background/6_precharge.bmp


BIN
Background/7_charging.bmp


BIN
Background/8_complete.bmp


BIN
Background/9_fix.bmp


+ 1 - 1
BuildIco.xaml

@@ -26,7 +26,7 @@
                         <md:PackIcon Kind="Refresh" VerticalAlignment="Center"/>
                     </Button>
                 </StackPanel>
-                <StackPanel x:Name="uxDataStackPanel" Margin="22,0,180,12" Visibility="Collapsed">
+                <StackPanel x:Name="uxDataStackPanel" Margin="22,0,20,12" Visibility="Collapsed">
                     <DataGrid x:Name="uxImagesDataGrid"  AutoGenerateColumns="False" IsReadOnly="True" 
                               Height="245" Width="470" HorizontalAlignment="Left">
                         <DataGrid.Columns>

+ 3 - 3
BuildIco.xaml.cs

@@ -59,7 +59,7 @@ namespace Phihong_EVSE_UI_Tool
 
                     int width = 0, height = 0;
                     byte[] pixels = null;
-                    Utility.ConvertToBitmap565Array(f.FullName, out width, out height, out pixels);
+                    Utility.ConvertFileToBitmap565Array(f.FullName, out width, out height, out pixels);
 
                     imageList.Add(new ImageList(index, System.IO.Path.GetFileName(f.FullName),
                                                 (byte)width, (byte)height, pixels));
@@ -170,8 +170,8 @@ namespace Phihong_EVSE_UI_Tool
 
             Image image = new Image()
             {
-                Width = 200,
-                Height = 200,
+                Width = 270,
+                Height = 270,
                 Stretch = Stretch.None,
                 Margin = new Thickness(0),
                 Source = wbitmap

+ 13 - 7
Enums.cs

@@ -53,13 +53,19 @@
         CostComplete,
         TimeComplete, //50
         IconUnit,
-        SideRfidOff,
-        SideRfidOn,
-        SideAppOff,
-        SideAppOn, //55
-        SideQrOff,
-        SideQrOn,
         EthernetOff,
-        EthernetOn, //59
+        EthernetOn,
+        ChademoDarkComplete,
+        CssDarkComplete, //55
+        GbtDarkComplete,
+        AcDarkComplete,
+        ChademoLightComplete,
+        CssLightComplete,
+        GbtLightComplete, //60
+        AcLightComplete,
+        LogoComplete, //62
+        HourGlass_Complete,
+        Flash_Complete,
+        Charge_Complete //65
     }
 }

BIN
ICO/10.bmp


BIN
ICO/10_logo.bmp


BIN
ICO/60.ICO


BIN
ICO/62.bmp


+ 6 - 0
InitialIdleUC.xaml.cs

@@ -46,12 +46,14 @@ namespace Phihong_EVSE_UI_Tool
                     srcPath = new Uri(Path.Combine(Utility.BG_PARENTFOLDER, Utility.BG_INITIAL), UriKind.Relative);
                     uxInitImage.Source = new BitmapImage(srcPath);
                     Utility.CopyFileFromResource(srcPath, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_INITIAL));
+                    Utility.ChangedFiles[Utility.BG_INITIAL] = true;
                     mySettings.IsInitialDefault = true;
                     break;
                 case "Idle":
                     srcPath = new Uri(Path.Combine(Utility.BG_PARENTFOLDER, Utility.BG_IDLE), UriKind.Relative);
                     uxIdleImage.Source = new BitmapImage(srcPath);
                     Utility.CopyFileFromResource(srcPath, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_IDLE));
+                    Utility.ChangedFiles[Utility.BG_IDLE] = true;
                     mySettings.IsIdleDefault = true;
                     break;
                 default:
@@ -76,6 +78,7 @@ namespace Phihong_EVSE_UI_Tool
                     {
                         Utility.LoadImageFromPath(uxInitImage, initCustomImgPath);
                         File.Copy(initCustomImgPath, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_INITIAL), true);
+                        Utility.ChangedFiles[Utility.BG_INITIAL] = true;
                         mySettings.IsInitialDefault = false;
                     }
                     break;
@@ -84,6 +87,7 @@ namespace Phihong_EVSE_UI_Tool
                     {
                         Utility.LoadImageFromPath(uxIdleImage, idleCustomImgPath);
                         File.Copy(initCustomImgPath, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_IDLE), true);
+                        Utility.ChangedFiles[Utility.BG_IDLE] = true;
                         mySettings.IsIdleDefault = false;
                     }
                     break;
@@ -126,6 +130,7 @@ namespace Phihong_EVSE_UI_Tool
                         File.Copy(dlg.FileName, initCustomImgPath, true);
                         File.Copy(dlg.FileName, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_INITIAL), true);
                         Utility.LoadImageFromPath(uxInitImage, initCustomImgPath);
+                        Utility.ChangedFiles[Utility.BG_INITIAL] = true;
                         mySettings.IsInitialDefault = false;
                         mySettings.InitialCustomImgPath = initCustomImgPath;
                         mySettings.InitialCustomImgPath_org = uxInitExploreTextBox.Text;
@@ -136,6 +141,7 @@ namespace Phihong_EVSE_UI_Tool
                         File.Copy(dlg.FileName, idleCustomImgPath, true);
                         File.Copy(dlg.FileName, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_IDLE), true);
                         Utility.LoadImageFromPath(uxIdleImage, idleCustomImgPath);
+                        Utility.ChangedFiles[Utility.BG_IDLE] = true;
                         mySettings.IsIdleDefault = false;
                         mySettings.IdleCustomImgPath = idleCustomImgPath;
                         mySettings.IdleCustomImgPath_org = uxIdleExploreTextBox.Text;

+ 1 - 1
MainWindow.xaml

@@ -81,7 +81,7 @@
                 </ListView>
             </StackPanel>
             <TextBlock Text="Icon" FontWeight="SemiBold" FontSize="15" HorizontalAlignment="Left" Margin="17,318,0,460"/>
-            <TextBlock Text="Save" FontWeight="SemiBold" FontSize="15" HorizontalAlignment="Left" Margin="17,479,0,280"/>
+            <TextBlock x:Name="uxSaveMenuTextBlock" Text="Save" FontWeight="SemiBold" FontSize="15" HorizontalAlignment="Left" Margin="17,479,0,280"/>
         </Grid>
 
         <Grid x:Name="uxTitleGrid" Grid.Column="1" Grid.Row="0" Background="White" fd:PointerTracker.Enabled="True">

+ 9 - 0
MainWindow.xaml.cs

@@ -12,6 +12,7 @@ namespace Phihong_EVSE_UI_Tool
     /// </summary>
     public partial class MainWindow : Window
     {
+        private Properties.Settings mySettings = Properties.Settings.Default;
         private ListViewItem lastSelectedItem = null;
         private InitialIdleUC ucInitialIdle = new InitialIdleUC();
         private AuthenticationUC ucAuthentaction = new AuthenticationUC();
@@ -30,6 +31,14 @@ namespace Phihong_EVSE_UI_Tool
 
             uxInitListViewItem.IsSelected = true;
             uxInitListViewItem.Focus();
+
+            if (!mySettings.Mode.Equals("54088"))
+            {
+                uxBuildListViewItem.Visibility = Visibility.Collapsed;
+                uxSaveMenuTextBlock.Margin = new Thickness(17, 433, 0, 280);
+            }
+
+            Utility.ChangedFiles = Utility.ChangedFiles.ToDictionary(p => p.Key, p => false);
         }
 
         private void uxMenuListView_SelectionChanged(object sender, SelectionChangedEventArgs e)

+ 4 - 0
MaintenanceUC.xaml.cs

@@ -1,6 +1,7 @@
 using Microsoft.WindowsAPICodePack.Dialogs;
 using System;
 using System.IO;
+using System.Linq;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Media.Imaging;
@@ -40,6 +41,7 @@ namespace Phihong_EVSE_UI_Tool
                     srcPath = new Uri(Path.Combine(Utility.BG_PARENTFOLDER, Utility.BG_MAINTAIN), UriKind.Relative);
                     uxMaintainImage.Source = new BitmapImage(srcPath);
                     Utility.CopyFileFromResource(srcPath, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_MAINTAIN));
+                    Utility.ChangedFiles[Utility.BG_MAINTAIN] = true;
                     mySettings.IsMaintainDefault = true;
                     break;
                 default:
@@ -64,6 +66,7 @@ namespace Phihong_EVSE_UI_Tool
                     {
                         Utility.LoadImageFromPath(uxMaintainImage, maintainCustomImgPath);
                         File.Copy(maintainCustomImgPath, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_MAINTAIN), true);
+                        Utility.ChangedFiles[Utility.BG_MAINTAIN] = true;
                         mySettings.IsMaintainDefault = false;
                     }
                     break;
@@ -106,6 +109,7 @@ namespace Phihong_EVSE_UI_Tool
                         File.Copy(dlg.FileName, maintainCustomImgPath, true);
                         File.Copy(dlg.FileName, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_MAINTAIN), true);
                         Utility.LoadImageFromPath(uxMaintainImage, maintainCustomImgPath);
+                        Utility.ChangedFiles[Utility.BG_MAINTAIN] = true;
                         mySettings.IsMaintainDefault = false;
                         mySettings.MaintainCustomImgPath = maintainCustomImgPath;
                         mySettings.MaintainCustomImgPath_org = uxMaintainExploreTextBox.Text;

+ 28 - 7
ModifyIco.xaml

@@ -14,11 +14,11 @@
     <Grid fd:PointerTracker.Enabled="True">
         <ScrollViewer x:Name="uxContentScrollViewer" HorizontalContentAlignment="Center" PanningMode="VerticalOnly" IsDeferredScrollingEnabled="False" DataContext="{Binding}">
             <StackPanel>
-                <!-- Logo -->
-                <TextBlock Text="Change Logo" FontSize="24" HorizontalAlignment="Left" Margin="22,6,0,8"/>
-                <TextBlock Text="Logo image (186x34)" HorizontalAlignment="Left" Margin="22,6,0,12"/>
-                <Image x:Name="uxLogoImage" Source="/ICO/10_logo.bmp" HorizontalAlignment="Left" Margin="22,0,0,12" Height="70" Width="300" RenderOptions.BitmapScalingMode="HighQuality"/>
-                <StackPanel Orientation="Horizontal" Margin="22,8,370,12">
+                <!-- Main Logo -->
+                <TextBlock Text="Change Main Logo" FontSize="24" HorizontalAlignment="Left" Margin="22,6,0,8"/>
+                <TextBlock Text="Logo image (255x34)" HorizontalAlignment="Left" Margin="22,6,0,6"/>
+                <Image x:Name="uxLogoImage" Source="/ICO/10.bmp" HorizontalAlignment="Left" Margin="22,0,0,6" Height="60" Width="260" RenderOptions.BitmapScalingMode="HighQuality"/>
+                <StackPanel Orientation="Horizontal" Margin="22,0,370,12">
                     <RadioButton x:Name="uxLogoDefaultRadioButton" Tag="Logo" GroupName="logoSelect" Margin="0,0,36,0" Style="{StaticResource MaterialDesignRadioButton}" 
                                  Background="{Binding Path=(fd:AccentColors.ImmersiveSystemAccentBrush)}"
                                  Checked="uxDefaultRadioButton_Checked">Default</RadioButton>
@@ -33,9 +33,30 @@
                     <TextBox x:Name="uxLogoBrowseTextBox" VerticalContentAlignment="Center" Margin="1,0,0,0" Width="270" Height="35" 
                              Style="{StaticResource TextBoxRevealStyle}" Text="Please select logo image" IsReadOnly="True"/>
                 </StackPanel>
+
+                <!-- Complete Logo -->
+                <TextBlock Text="Change Logo (charging complete page)" FontSize="24" HorizontalAlignment="Left" Margin="22,24,0,8"/>
+                <TextBlock Text="Logo image (255x34)" HorizontalAlignment="Left" Margin="22,6,0,6"/>
+                <Image x:Name="uxCompLogoImage" Source="/ICO/62.bmp" HorizontalAlignment="Left" Margin="22,0,0,6" Height="60" Width="260" RenderOptions.BitmapScalingMode="HighQuality"/>
+                <StackPanel Orientation="Horizontal" Margin="22,0,370,12">
+                    <RadioButton x:Name="uxCompLogoDefaultRadioButton" Tag="CompLogo" GroupName="complogoSelect" Margin="0,0,36,0" Style="{StaticResource MaterialDesignRadioButton}" 
+                                 Background="{Binding Path=(fd:AccentColors.ImmersiveSystemAccentBrush)}"
+                                 Checked="uxDefaultRadioButton_Checked">Default</RadioButton>
+                    <RadioButton x:Name="uxCompLogoCustomRadioButton" Tag="CompLogo" GroupName="complogoSelect" Style="{StaticResource MaterialDesignRadioButton}" 
+                                 Background="{Binding Path=(fd:AccentColors.ImmersiveSystemAccentBrush)}"
+                                 Checked="uxCustomRadioButton_Checked">Customized</RadioButton>
+                </StackPanel>
+                <StackPanel x:Name="uxCompLogoCustomStackPanel" Orientation="Horizontal" Margin="22,0,450,12" 
+                            Visibility="{Binding IsChecked,ElementName=uxCompLogoCustomRadioButton,Converter={StaticResource b2v}}">
+                    <Button Tag="CompLogo" Content="Browse" HorizontalAlignment="Left" Width="90" Height="35"
+                            Style="{StaticResource ButtonRevealStyle}" Click="uxBrowseButton_Click" Foreground="Black"/>
+                    <TextBox x:Name="uxCompLogoBrowseTextBox" VerticalContentAlignment="Center" Margin="1,0,0,0" Width="270" Height="35" 
+                             Style="{StaticResource TextBoxRevealStyle}" Text="Please select logo image" IsReadOnly="True"/>
+                </StackPanel>
+
                 <!-- Ico Preview -->
-                <TextBlock Text="ICO Preview" FontSize="24" HorizontalAlignment="Left" Margin="22,18,0,0"/>
-                <Viewbox x:Name="viewbox" Stretch="Uniform" Margin="22,12,180,12" RenderOptions.BitmapScalingMode="HighQuality">
+                <TextBlock Text="ICO Preview" FontSize="24" HorizontalAlignment="Left" Margin="22,24,0,0"/>
+                <Viewbox x:Name="viewbox" Stretch="Uniform" Margin="22,12,20,12" RenderOptions.BitmapScalingMode="HighQuality">
                     <UniformGrid x:Name="uxIcoUniformGrid" Background="AliceBlue"/>
                 </Viewbox>
                 <StackPanel Margin="22,0,450,10" Height="15"/>

+ 68 - 26
ModifyIco.xaml.cs

@@ -15,6 +15,7 @@ namespace Phihong_EVSE_UI_Tool
     {
         private Properties.Settings mySettings = Properties.Settings.Default;
         private string logoCustomImgPath;
+        private string compLogoCustomImgPath;
         private int bytesPerPixel = 2;
 
         public ModifyIco()
@@ -25,21 +26,35 @@ namespace Phihong_EVSE_UI_Tool
             uxLogoDefaultRadioButton.IsChecked = mySettings.IsLogoDefault;
             uxLogoCustomRadioButton.IsChecked = !mySettings.IsLogoDefault;
             uxLogoBrowseTextBox.Text = mySettings.LogoCustomImgPath_org;
+
+            compLogoCustomImgPath = mySettings.CompLogoCustomImgPath;
+            uxCompLogoDefaultRadioButton.IsChecked = mySettings.IsCompLogoDefault;
+            uxCompLogoCustomRadioButton.IsChecked = !mySettings.IsCompLogoDefault;
+            uxCompLogoBrowseTextBox.Text = mySettings.CompLogoCustomImgPath_org;
         }
 
-        private void ModifyIcoContent(int index)
+        private void ModifyIcoContent(int index, string path)
         {
-            Uri srcPath = new Uri(Path.Combine(Utility.ICO_PARENTFOLDER, Utility.ICO_NAME), UriKind.Relative);
-            Utility.CopyFileFromResource(srcPath, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.ICO_NAME));
-
-            if (mySettings.IsLogoDefault)
+            string icoPath = Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.ICO_NAME);
+            if (!File.Exists(icoPath))
             {
-                return;
+                Uri srcPath = new Uri(Path.Combine(Utility.ICO_PARENTFOLDER, Utility.ICO_NAME), UriKind.Relative);
+                Utility.CopyFileFromResource(srcPath, icoPath);
             }
 
             int width = 0, height = 0;
             byte[] pixels = null;
-            Utility.ConvertToBitmap565Array(logoCustomImgPath, out width, out height, out pixels);
+
+            if (String.IsNullOrEmpty(path))
+            {
+                //Default
+                Uri resourcePath = new Uri(Path.Combine(Utility.ICO_PARENTFOLDER, index.ToString() + ".bmp"), UriKind.Relative);
+                Utility.ConvertResourceToBitmap565Array(resourcePath, out width, out height, out pixels);
+            }
+            else
+            {
+                Utility.ConvertFileToBitmap565Array(path, out width, out height, out pixels);
+            }
 
             FileStream icoFile = new FileStream(Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.ICO_NAME), 
                                                 FileMode.OpenOrCreate, FileAccess.ReadWrite);
@@ -130,8 +145,8 @@ namespace Phihong_EVSE_UI_Tool
 
             Image image = new Image()
             {
-                Width = 200,
-                Height = 200,
+                Width = 270,
+                Height = 270,
                 Stretch = Stretch.None,
                 Margin = new Thickness(0),
                 Source = wbitmap
@@ -153,17 +168,23 @@ namespace Phihong_EVSE_UI_Tool
             switch (rb.Tag.ToString())
             {
                 case "Logo":
-                    srcPath = new Uri(Path.Combine(Utility.ICO_PARENTFOLDER, Utility.ICO_LOGO), UriKind.Relative);
+                    srcPath = new Uri(Path.Combine(Utility.ICO_PARENTFOLDER, Utility.ICO_MAINLOGO), UriKind.Relative);
                     uxLogoImage.Source = new BitmapImage(srcPath);
                     mySettings.IsLogoDefault = true;
+                    ModifyIcoContent((int)IcoElement.Logo, String.Empty);
+                    break;
+                case "CompLogo":
+                    srcPath = new Uri(Path.Combine(Utility.ICO_PARENTFOLDER, Utility.ICO_COMPLETELOGO), UriKind.Relative);
+                    uxCompLogoImage.Source = new BitmapImage(srcPath);
+                    mySettings.IsCompLogoDefault = true;
+                    ModifyIcoContent((int)IcoElement.LogoComplete, String.Empty);
                     break;
                 default:
                     return;
             }
-
+            Utility.ChangedFiles[Utility.ICO_NAME] = true;
             mySettings.Save();
 
-            ModifyIcoContent((int)IcoElement.Logo);
             //Display Ico
             uxIcoUniformGrid.Children.Clear();
             DisplayDWIcoContent();
@@ -184,18 +205,26 @@ namespace Phihong_EVSE_UI_Tool
                     {
                         Utility.LoadImageFromPath(uxLogoImage, logoCustomImgPath);
                         mySettings.IsLogoDefault = false;
-
-                        ModifyIcoContent((int)IcoElement.Logo);
-                        //Display Ico
-                        uxIcoUniformGrid.Children.Clear();
-                        DisplayDWIcoContent();
+                        ModifyIcoContent((int)IcoElement.Logo, logoCustomImgPath);
+                    }
+                    break;
+                case "CompLogo":
+                    if (File.Exists(compLogoCustomImgPath))
+                    {
+                        Utility.LoadImageFromPath(uxCompLogoImage, compLogoCustomImgPath);
+                        mySettings.IsCompLogoDefault = false;
+                        ModifyIcoContent((int)IcoElement.LogoComplete, compLogoCustomImgPath);
                     }
                     break;
                 default:
                     return;
             }
-
+            Utility.ChangedFiles[Utility.ICO_NAME] = true;
             mySettings.Save();
+
+            //Display Ico
+            uxIcoUniformGrid.Children.Clear();
+            DisplayDWIcoContent();
         }
 
         private void uxBrowseButton_Click(object sender, RoutedEventArgs e)
@@ -217,7 +246,7 @@ namespace Phihong_EVSE_UI_Tool
             {
                 if (!Utility.IsIcoLogoSizeQualified(dlg.FileName))
                 {
-                    MessageBox.Show(dlg.FileName + "\r\n" + "The resolution of the image must be 186x34",
+                    MessageBox.Show(dlg.FileName + "\r\n" + "The resolution of the image must be 255x34",
                                     "Incorrect Resolution", MessageBoxButton.OK, MessageBoxImage.Error);
                     return;
                 }
@@ -226,24 +255,37 @@ namespace Phihong_EVSE_UI_Tool
                 {
                     case "Logo":
                         uxLogoBrowseTextBox.Text = dlg.FileName;
-                        logoCustomImgPath = Path.Combine(Utility.CUSTOM_DIRECTORY, Utility.ICO_LOGO);
+                        logoCustomImgPath = Path.Combine(Utility.CUSTOM_DIRECTORY, Utility.ICO_MAINLOGO);
                         File.Copy(dlg.FileName, logoCustomImgPath, true);
                         Utility.LoadImageFromPath(uxLogoImage, logoCustomImgPath);
                         mySettings.IsLogoDefault = false;
                         mySettings.LogoCustomImgPath = logoCustomImgPath;
                         mySettings.LogoCustomImgPath_org = uxLogoBrowseTextBox.Text;
 
-                        ModifyIcoContent((int)IcoElement.Logo);
-                        //Display Ico
-                        uxIcoUniformGrid.Children.Clear();
-                        DisplayDWIcoContent();
+                        ModifyIcoContent((int)IcoElement.Logo, logoCustomImgPath);
+                        break;
+                    case "CompLogo":
+                        uxCompLogoBrowseTextBox.Text = dlg.FileName;
+                        compLogoCustomImgPath = Path.Combine(Utility.CUSTOM_DIRECTORY, Utility.ICO_COMPLETELOGO);
+                        File.Copy(dlg.FileName, compLogoCustomImgPath, true);
+                        Utility.LoadImageFromPath(uxCompLogoImage, compLogoCustomImgPath);
+                        mySettings.IsCompLogoDefault = false;
+                        mySettings.CompLogoCustomImgPath = compLogoCustomImgPath;
+                        mySettings.CompLogoCustomImgPath_org = uxCompLogoBrowseTextBox.Text;
+
+                        ModifyIcoContent((int)IcoElement.LogoComplete, compLogoCustomImgPath);
                         break;
                     default:
                         break;
                 }
-            }
 
-            mySettings.Save();
+                Utility.ChangedFiles[Utility.ICO_NAME] = true;
+                mySettings.Save();
+
+                //Display Ico
+                uxIcoUniformGrid.Children.Clear();
+                DisplayDWIcoContent();
+            }
         }
     }
 }

+ 6 - 3
Phihong EVSE UI Tool.csproj

@@ -197,9 +197,6 @@
   <ItemGroup>
     <Folder Include="Output\" />
   </ItemGroup>
-  <ItemGroup>
-    <Resource Include="ICO\10_logo.bmp" />
-  </ItemGroup>
   <ItemGroup>
     <Resource Include="ICO\60.ICO" />
   </ItemGroup>
@@ -215,6 +212,12 @@
       <Install>false</Install>
     </BootstrapperPackage>
   </ItemGroup>
+  <ItemGroup>
+    <Resource Include="ICO\62.bmp" />
+  </ItemGroup>
+  <ItemGroup>
+    <Resource Include="ICO\10.bmp" />
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Import Project="packages\MaterialDesignThemes.3.2.0\build\MaterialDesignThemes.targets" Condition="Exists('packages\MaterialDesignThemes.3.2.0\build\MaterialDesignThemes.targets')" />
   <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">

+ 12 - 0
PlugChargingUC.xaml.cs

@@ -58,24 +58,28 @@ namespace Phihong_EVSE_UI_Tool
                     srcPath = new Uri(Path.Combine(Utility.BG_PARENTFOLDER, Utility.BG_PLUG), UriKind.Relative);
                     uxPlugImage.Source = new BitmapImage(srcPath);
                     Utility.CopyFileFromResource(srcPath, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_PLUG));
+                    Utility.ChangedFiles[Utility.BG_PLUG] = true;
                     mySettings.IsPlugDefault = true;
                     break;
                 case "Precharge":
                     srcPath = new Uri(Path.Combine(Utility.BG_PARENTFOLDER, Utility.BG_PRECHARGE), UriKind.Relative);
                     uxPrechargeImage.Source = new BitmapImage(srcPath);
                     Utility.CopyFileFromResource(srcPath, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_PRECHARGE));
+                    Utility.ChangedFiles[Utility.BG_PRECHARGE] = true;
                     mySettings.IsPreChargeDefault = true;
                     break;
                 case "Charging":
                     srcPath = new Uri(Path.Combine(Utility.BG_PARENTFOLDER, Utility.BG_CHARGING), UriKind.Relative);
                     uxChargingImage.Source = new BitmapImage(srcPath);
                     Utility.CopyFileFromResource(srcPath, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_CHARGING));
+                    Utility.ChangedFiles[Utility.BG_CHARGING] = true;
                     mySettings.IsChargingDefault = true;
                     break;
                 case "Complete":
                     srcPath = new Uri(Path.Combine(Utility.BG_PARENTFOLDER, Utility.BG_COMPLETE), UriKind.Relative);
                     uxCompleteImage.Source = new BitmapImage(srcPath);
                     Utility.CopyFileFromResource(srcPath, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_COMPLETE));
+                    Utility.ChangedFiles[Utility.BG_COMPLETE] = true;
                     mySettings.IsCompleteDefault = true;
                     break;
                 default:
@@ -100,6 +104,7 @@ namespace Phihong_EVSE_UI_Tool
                     {
                         Utility.LoadImageFromPath(uxPlugImage, plugCustomImgPath);
                         File.Copy(plugCustomImgPath, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_PLUG), true);
+                        Utility.ChangedFiles[Utility.BG_PLUG] = true;
                         mySettings.IsPlugDefault = false;
                     }
                     break;
@@ -108,6 +113,7 @@ namespace Phihong_EVSE_UI_Tool
                     {
                         Utility.LoadImageFromPath(uxPrechargeImage, prechargeCustomImgPath);
                         File.Copy(prechargeCustomImgPath, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_PRECHARGE), true);
+                        Utility.ChangedFiles[Utility.BG_PRECHARGE] = true;
                         mySettings.IsPreChargeDefault = false;
                     }
                     break;
@@ -116,6 +122,7 @@ namespace Phihong_EVSE_UI_Tool
                     {
                         Utility.LoadImageFromPath(uxChargingImage, chargingCustomImgPath);
                         File.Copy(chargingCustomImgPath, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_CHARGING), true);
+                        Utility.ChangedFiles[Utility.BG_CHARGING] = true;
                         mySettings.IsChargingDefault = false;
                     }
                     break;
@@ -124,6 +131,7 @@ namespace Phihong_EVSE_UI_Tool
                     {
                         Utility.LoadImageFromPath(uxCompleteImage, completeCustomImgPath);
                         File.Copy(completeCustomImgPath, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_COMPLETE), true);
+                        Utility.ChangedFiles[Utility.BG_COMPLETE] = true;
                         mySettings.IsCompleteDefault = false;
                     }
                     break;
@@ -166,6 +174,7 @@ namespace Phihong_EVSE_UI_Tool
                         File.Copy(dlg.FileName, plugCustomImgPath, true);
                         File.Copy(dlg.FileName, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_PLUG), true);
                         Utility.LoadImageFromPath(uxPlugImage, plugCustomImgPath);
+                        Utility.ChangedFiles[Utility.BG_PLUG] = true;
                         mySettings.IsPlugDefault = false;
                         mySettings.PlugCustomImgPath = plugCustomImgPath;
                         mySettings.PlugCustomImgPath_org = uxPlugExploreTextBox.Text;
@@ -176,6 +185,7 @@ namespace Phihong_EVSE_UI_Tool
                         File.Copy(dlg.FileName, prechargeCustomImgPath, true);
                         File.Copy(dlg.FileName, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_PRECHARGE), true);
                         Utility.LoadImageFromPath(uxPrechargeImage, prechargeCustomImgPath);
+                        Utility.ChangedFiles[Utility.BG_PRECHARGE] = true;
                         mySettings.IsPreChargeDefault = false;
                         mySettings.PreChargeCustomImgPath = prechargeCustomImgPath;
                         mySettings.PreChargeCustomImgPath_org = uxPrechargeExploreTextBox.Text;
@@ -186,6 +196,7 @@ namespace Phihong_EVSE_UI_Tool
                         File.Copy(dlg.FileName, chargingCustomImgPath, true);
                         File.Copy(dlg.FileName, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_CHARGING), true);
                         Utility.LoadImageFromPath(uxChargingImage, chargingCustomImgPath);
+                        Utility.ChangedFiles[Utility.BG_CHARGING] = true;
                         mySettings.IsChargingDefault = false;
                         mySettings.ChargingCustomImgPath = chargingCustomImgPath;
                         mySettings.ChargingCustomImgPath_org = uxChargingExploreTextBox.Text;
@@ -196,6 +207,7 @@ namespace Phihong_EVSE_UI_Tool
                         File.Copy(dlg.FileName, completeCustomImgPath, true);
                         File.Copy(dlg.FileName, Path.Combine(Utility.OUTPUT_DIRECTORY, Utility.BG_COMPLETE), true);
                         Utility.LoadImageFromPath(uxCompleteImage, completeCustomImgPath);
+                        Utility.ChangedFiles[Utility.BG_COMPLETE] = true;
                         mySettings.IsCompleteDefault = false;
                         mySettings.CompleteCustomImgPath = completeCustomImgPath;
                         mySettings.CompleteCustomImgPath_org = uxCompleteExploreTextBox.Text;

+ 60 - 0
Properties/Settings.Designer.cs

@@ -418,5 +418,65 @@ namespace Phihong_EVSE_UI_Tool.Properties {
                 this["LogoCustomImgPath_org"] = value;
             }
         }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("True")]
+        public bool IsCompLogoDefault {
+            get {
+                return ((bool)(this["IsCompLogoDefault"]));
+            }
+            set {
+                this["IsCompLogoDefault"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
+        public string CompLogoCustomImgPath {
+            get {
+                return ((string)(this["CompLogoCustomImgPath"]));
+            }
+            set {
+                this["CompLogoCustomImgPath"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
+        public string CompLogoCustomImgPath_org {
+            get {
+                return ((string)(this["CompLogoCustomImgPath_org"]));
+            }
+            set {
+                this["CompLogoCustomImgPath_org"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("123456")]
+        public string Mode {
+            get {
+                return ((string)(this["Mode"]));
+            }
+            set {
+                this["Mode"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
+        public string SdCardPath {
+            get {
+                return ((string)(this["SdCardPath"]));
+            }
+            set {
+                this["SdCardPath"] = value;
+            }
+        }
     }
 }

+ 15 - 0
Properties/Settings.settings

@@ -101,5 +101,20 @@
     <Setting Name="LogoCustomImgPath_org" Type="System.String" Scope="User">
       <Value Profile="(Default)" />
     </Setting>
+    <Setting Name="IsCompLogoDefault" Type="System.Boolean" Scope="User">
+      <Value Profile="(Default)">True</Value>
+    </Setting>
+    <Setting Name="CompLogoCustomImgPath" Type="System.String" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
+    <Setting Name="CompLogoCustomImgPath_org" Type="System.String" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
+    <Setting Name="Mode" Type="System.String" Scope="User">
+      <Value Profile="(Default)">123456</Value>
+    </Setting>
+    <Setting Name="SdCardPath" Type="System.String" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
   </Settings>
 </SettingsFile>

+ 17 - 3
SaveSdCard.xaml

@@ -16,13 +16,27 @@
             <StackPanel>
                 <TextBlock Text="Temporary output folder (DO NOT delete)" HorizontalAlignment="Left" Margin="22,6,0,12"/>
                 <TextBlock Text="{x:Static local:Utility.OUTPUT_DIRECTORY}" HorizontalAlignment="Left" Margin="22,0,0,12" Foreground="{Binding Path=(fd:AccentColors.ImmersiveSystemAccentBrush)}"/>
-                <TextBlock Text="Save to SD card" HorizontalAlignment="Left" Margin="22,12,0,12"/>
-                <StackPanel x:Name="uxLogoCustomStackPanel" Orientation="Horizontal" Margin="22,0,450,12">
-                    <Button Tag="Save" Content="Save" HorizontalAlignment="Left" Width="90" Height="35"
+                <TextBlock Text="Locate SD card" FontSize="24" HorizontalAlignment="Left" Margin="22,12,0,12"/>
+                <StackPanel x:Name="uxLogoCustomStackPanel" Orientation="Horizontal" Margin="22,0,400,12">
+                    <Button Tag="Browse" Content="Browse" HorizontalAlignment="Left" Width="90" Height="35"
                             Style="{StaticResource ButtonRevealStyle}" Click="uxBrowseButton_Click" Foreground="Black"/>
                     <TextBox x:Name="uxSdBrowseTextBox" VerticalContentAlignment="Center" Margin="1,0,0,0" Width="270" Height="35" 
                              Style="{StaticResource TextBoxRevealStyle}" Text="Please locate the SD card" IsReadOnly="True"/>
                 </StackPanel>
+
+                <TextBlock Text="Save to SD card" FontSize="24" HorizontalAlignment="Left" Margin="22,18,0,12"/>
+                <StackPanel Orientation="Horizontal" Margin="22,0,480,12">
+                    <RadioButton x:Name="uxSaveAllRadioButton" Tag="Save" GroupName="saveSelect" Margin="0,0,36,0" Style="{StaticResource MaterialDesignRadioButton}" 
+                                 Background="{Binding Path=(fd:AccentColors.ImmersiveSystemAccentBrush)}" IsChecked="True">Save all files</RadioButton>
+                    <RadioButton x:Name="uxSaveChangedRadioButton" Tag="Save" GroupName="saveSelect" Style="{StaticResource MaterialDesignRadioButton}" 
+                                 Background="{Binding Path=(fd:AccentColors.ImmersiveSystemAccentBrush)}">Save changed files</RadioButton>
+                </StackPanel>
+                <StackPanel Orientation="Horizontal" Margin="22,6,480,12">
+                    <Button Tag="Save" Content="Save" HorizontalAlignment="Left" Width="90" Height="35"
+                            Style="{StaticResource ButtonRevealStyle}" Click="uxBrowseButton_Click" Foreground="Black"/>
+                    <TextBlock x:Name="uxMessageTextBlock" VerticalAlignment="Center" Margin="18,0,0,0"
+                               Foreground="{Binding Path=(fd:AccentColors.ImmersiveSystemAccentBrush)}"/>
+                </StackPanel>
             </StackPanel>
         </ScrollViewer>
     </Grid>

+ 72 - 14
SaveSdCard.xaml.cs

@@ -21,38 +21,96 @@ namespace Phihong_EVSE_UI_Tool
     /// </summary>
     public partial class SaveSdCard : UserControl
     {
+        private Properties.Settings mySettings = Properties.Settings.Default;
         private string sdFolderPath;
+        private List<string> toBeSavedFiles = new List<string>();
 
         public SaveSdCard()
         {
             InitializeComponent();
+
+            sdFolderPath = mySettings.SdCardPath;
+            uxSdBrowseTextBox.Text = sdFolderPath;
         }
 
-        private void uxBrowseButton_Click(object sender, RoutedEventArgs e)
+        private void SaveToSdCard()
         {
-            var dlg = new CommonOpenFileDialog()
+            if (uxSaveAllRadioButton.IsChecked.Value)
             {
-                IsFolderPicker = true,
-                Title = "Locate the SD card",
-            };
-
-            if (dlg.ShowDialog() == CommonFileDialogResult.Ok)
+                toBeSavedFiles = new List<string>(Utility.ChangedFiles.Keys);
+            }
+            else
             {
-                sdFolderPath = dlg.FileName;
-                uxSdBrowseTextBox.Text = sdFolderPath;
-                SaveToSdCard();
+                toBeSavedFiles = (from p in Utility.ChangedFiles
+                                  where p.Value
+                                  select p.Key).ToList<string>();
             }
-        }
 
-        private void SaveToSdCard()
-        {
             Directory.CreateDirectory(Path.Combine(sdFolderPath, Utility.SDCARD_SUBDIR));
 
-            foreach (string fileName in Utility.FILES_LIST)
+            foreach (string fileName in toBeSavedFiles)
             {
                 File.Copy(Path.Combine(Utility.OUTPUT_DIRECTORY, fileName),
                           Path.Combine(sdFolderPath, Utility.SDCARD_SUBDIR, fileName), true);
             }
+
+            switch (toBeSavedFiles.Count())
+            {
+                case 0:
+                    uxMessageTextBlock.Text = "Saved no file";
+                    break;
+                case 1:
+                    uxMessageTextBlock.Text = "Saved 1 file to SD card";
+                    break;
+                default:
+                    uxMessageTextBlock.Text = "Saved " + toBeSavedFiles.Count() + " files to SD card";
+                    break;
+            }
+
+            System.Diagnostics.Process process = new System.Diagnostics.Process();
+            process.StartInfo.FileName = Path.Combine(sdFolderPath, Utility.SDCARD_SUBDIR);
+            process.Start();
+        }
+
+        private void uxBrowseButton_Click(object sender, RoutedEventArgs e)
+        {
+            Button btn = e.Source as Button;
+            if (btn is null)
+            {
+                return;
+            }
+
+            switch (btn.Tag.ToString())
+            {
+                case "Browse":
+                    var dlg = new CommonOpenFileDialog()
+                    {
+                        IsFolderPicker = true,
+                        Title = "Locate the SD card",
+                    };
+                    if (dlg.ShowDialog() == CommonFileDialogResult.Ok)
+                    {
+                        sdFolderPath = dlg.FileName;
+                        uxSdBrowseTextBox.Text = sdFolderPath;
+                        mySettings.SdCardPath = sdFolderPath;
+                        mySettings.Save();
+                    }
+                    break;
+                case "Save":
+                    if(!Directory.Exists(sdFolderPath))
+                    {
+                        MessageBox.Show("Please locate the SD card path first",
+                                        "Invalid Path", MessageBoxButton.OK, MessageBoxImage.Error);
+                        break;
+                    }
+                    SaveToSdCard();
+                    break;
+                default:
+                    break;
+            }
+
+
+            
         }
     }
 }

+ 21 - 7
Utility.cs

@@ -26,18 +26,20 @@ namespace Phihong_EVSE_UI_Tool
         public const string ICO_PARENTFOLDER = @"ICO";
 
         public const string ICO_NAME = "60.ICO";
-        public const string ICO_LOGO = "10_logo.bmp";
+        public const string ICO_MAINLOGO = "10.bmp";
+        public const string ICO_COMPLETELOGO = "62.bmp";
 
         public const string SDCARD_SUBDIR = "DWIN_SET";
 
         public static readonly string OUTPUT_DIRECTORY = Environment.CurrentDirectory + @"\Output";
         public static readonly string CUSTOM_DIRECTORY = Environment.CurrentDirectory + @"\CustomTemp";
 
-        public static readonly List<string> FILES_LIST = new List<string>()
+        public static Dictionary<string, bool> ChangedFiles = new Dictionary<string, bool>()
         {
-            BG_INITIAL, BG_IDLE, BG_VERIFY, BG_VERIFYOK, BG_VERIFYFAIL,
-            BG_PLUG, BG_PRECHARGE, BG_CHARGING, BG_COMPLETE, BG_MAINTAIN,
-            ICO_NAME
+            {BG_INITIAL, false}, {BG_IDLE, false}, {BG_VERIFY, false},
+            {BG_VERIFYOK, false}, {BG_VERIFYFAIL, false}, {BG_PLUG, false},
+            {BG_PRECHARGE, false}, {BG_CHARGING, false}, {BG_COMPLETE, false},
+            {BG_MAINTAIN, false}, {ICO_NAME, false}
         };
 
         public static void CopyFileFromResource(Uri uriString, string destPath)
@@ -116,7 +118,7 @@ namespace Phihong_EVSE_UI_Tool
             bitmap.EndInit();
             fstream.Close();
 
-            if (bitmap.PixelWidth != 186 || bitmap.PixelHeight != 34)
+            if (bitmap.PixelWidth != 255 || bitmap.PixelHeight != 34)
             {
                 return false;
             }
@@ -124,10 +126,22 @@ namespace Phihong_EVSE_UI_Tool
             return true;
         }
 
-        public static void ConvertToBitmap565Array(string path, out int width, out int height, out byte[] pixels)
+        public static void ConvertFileToBitmap565Array(string path, out int width, out int height, out byte[] pixels)
         {
             FileStream fstream = new FileStream(path, FileMode.Open);
+            ConvertToBitmap565(out width, out height, out pixels, fstream);
+        }
+
+        public static void ConvertResourceToBitmap565Array(Uri uriString, out int width, out int height, out byte[] pixels)
+        {
+            using (var resource = Application.GetResourceStream(uriString).Stream)
+            {
+                ConvertToBitmap565(out width, out height, out pixels, resource);
+            }
+        }
 
+        private static void ConvertToBitmap565(out int width, out int height, out byte[] pixels, Stream fstream)
+        {
             BitmapImage bitmap = new BitmapImage();
             bitmap.BeginInit();
             bitmap.StreamSource = fstream;