Browse Source

fix bundle upload

Robert 4 years ago
parent
commit
f1e5f373a9

+ 1 - 1
AwInitilizer/App.config

@@ -11,7 +11,7 @@
     <userSettings>
         <AwInitilizer.Properties.Settings>
             <setting name="FirmwareRoot" serializeAs="String">
-                <value>./</value>
+                <value>./Firmware</value>
             </setting>
         </AwInitilizer.Properties.Settings>
     </userSettings>

+ 3 - 1
AwInitilizer/App.xaml

@@ -5,6 +5,8 @@
              xmlns:converterNamespace="clr-namespace:AwInitilizer.Converter"
              StartupUri="MainWindow.xaml">
     <Application.Resources>
-        <converterNamespace:BooleanAndConverter x:Key="booleanAndConverter" />
+        <ResourceDictionary>
+            <converterNamespace:BooleanAndConverter x:Key="booleanAndConverter" />
+        </ResourceDictionary>
     </Application.Resources>
 </Application>

+ 4 - 2
AwInitilizer/App.xaml.cs

@@ -26,13 +26,15 @@ namespace AwInitilizer
             base.OnActivated(e);
 
             var startResult = SajetConnect.SajetTransStart();
+
+            Cultures.CulturesHelper.Instance.ChangeCulture(System.Globalization.CultureInfo.GetCultureInfo("zh-CHS"));
         }
 
         private void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
         {
             var fileName = DateTime.Now.ToString("yyyyMMddHHmmss") + ".txt";
-            File.WriteAllText(fileName,e.Exception.Message);
-            File.WriteAllText(fileName, e.Exception.StackTrace);
+            var msg = e.Exception.Message + "\n"+ e.Exception.StackTrace;
+            File.WriteAllText(fileName,msg);
             MessageBox.Show($"App crashed,Please report error and send back {fileName}");
             Application.Current.Shutdown();
         }

+ 107 - 0
AwInitilizer/Cultures/CulturesHelper.cs

@@ -0,0 +1,107 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace AwInitilizer.Cultures
+{
+    public enum Languages
+    {
+        English, TraditionalChinese, SimplfyChinese
+    }
+
+    public class CulturesHelper
+    {
+        private static Lazy<CulturesHelper> _Instance = new Lazy<CulturesHelper>(() => new CulturesHelper());
+        public static CulturesHelper Instance
+        {
+            get
+            {
+                return _Instance.Value;
+            }
+        }
+
+        private static string resourcePrefix = "StringResource";
+        private static string culturesFolder = "Cultures";
+        private static List<CultureInfo> _supportedCultures = new List<CultureInfo>();
+        public static List<CultureInfo> SupportedCultures
+        {
+            get
+            {
+                return _supportedCultures;
+            }
+        }
+        private static ResourceDictionary resourceDictionary;
+        public static ResourceDictionary ResourceDictionary
+        {
+            get
+            {
+                return resourceDictionary;
+            }
+        }
+        public Languages CurrentCulture { get; private set; }
+        public event EventHandler<Languages> OnCultureChange;
+
+        private CulturesHelper()
+        {
+
+            CultureInfo cultureInfo = new CultureInfo("");
+            List<string> files = Directory.GetFiles(string.Format("{0}\\{1}", Directory.GetCurrentDirectory(), culturesFolder))
+            .Where(s => s.Contains(resourcePrefix) && s.ToLower().EndsWith("xaml")).ToList();
+            foreach (string file in files)
+            {
+                try
+                {
+                    string cultureName = file.Substring(file.IndexOf(".") + 1).Replace(".xaml", "");
+                    cultureInfo = CultureInfo.GetCultureInfo(cultureName);
+                    if (cultureInfo != null)
+                    {
+                        _supportedCultures.Add(cultureInfo);
+                    }
+                }
+                catch (ArgumentException)
+                {
+                }
+            }
+
+        }
+        public void ChangeCulture(CultureInfo culture)
+        {
+            if (_supportedCultures.Contains(culture))
+            {
+                string loadedFileName = string.Format("{0}\\{1}\\{2}.{3}.xaml",
+                    Directory.GetCurrentDirectory(),
+                    culturesFolder,
+                    resourcePrefix,
+                    culture.Name);
+                //FileStream fileStream = new FileStream(loadedFileName, FileMode.Open);
+                //resourceDictionary = XamlReader.Load(fileStream) as ResourceDictionary;
+                resourceDictionary = new ResourceDictionary() { Source = new Uri(loadedFileName) };
+
+                Application.Current.Resources.MergedDictionaries.Add(resourceDictionary);
+                //MainWindow.window.Resources.MergedDictionaries.Add(resourceDictionary);
+                //Properties.Settings.Default.DefaultCulture = culture;
+                //Properties.Settings.Default.Save();
+                if (culture.Name == "en-US")
+                {
+                    CurrentCulture = Languages.English;
+                }
+                else if (culture.Name == "zh-TW")
+                {
+                    CurrentCulture = Languages.TraditionalChinese;
+                }
+                else if (culture.Name == "zh-CHS")
+                {
+                    CurrentCulture = Languages.SimplfyChinese;
+                }
+
+                OnCultureChange?.Invoke(this, CurrentCulture);
+            }
+
+        }
+    }
+}

+ 78 - 0
AwInitilizer/Cultures/StringResource.xaml

@@ -0,0 +1,78 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+                    xmlns:local="clr-namespace:AwInitilizer.Cultures"
+                    xmlns:sys="clr-namespace:System;assembly=mscorlib">
+    
+    <sys:String x:Key="Confirm">OK</sys:String>
+    
+    <sys:String x:Key="SigninDialogTitle">Sigin in</sys:String>
+    <sys:String x:Key="SigninDialogEnterIDHint">Enter ID</sys:String>
+    <sys:String x:Key="SigninDialogEnterWOHint">Enter WorkOrder</sys:String>
+    <sys:String x:Key="SigninDialogEnterWOError">WorkOrder Error</sys:String>
+    <sys:String x:Key="SigninDialogEnterIDError">ID Error</sys:String>
+    <sys:String x:Key="SigninDialogNoResponseError">MES no response</sys:String>
+
+    <sys:String x:Key="Account">Account</sys:String>
+    <sys:String x:Key="logout">logout</sys:String>
+    <sys:String x:Key="UserID">User Id</sys:String>
+    <sys:String x:Key="WorkOrder">Work Order</sys:String>
+
+    <sys:String x:Key="BarcodeSetting">Barcode Setting</sys:String>
+    <sys:String x:Key="ModelName">Model Name</sys:String>
+    <sys:String x:Key="SerialNumber">Serial Number</sys:String>
+    <sys:String x:Key="SimStatus">4G Sim Card Inserted</sys:String>
+    <sys:String x:Key="ICCID">Sim ICCID</sys:String>
+    <sys:String x:Key="IMSI">Sim IMSI</sys:String>
+
+    <sys:String x:Key="FirmwareVersion">Firmware version</sys:String>
+    <sys:String x:Key="FirmwareVersionHeaderName">Module</sys:String>
+    <sys:String x:Key="FirmwareVersionHeaderVersion">Version</sys:String>
+
+    <sys:String x:Key="StartProcedure">Start</sys:String>
+
+    <sys:String x:Key="StatusIdel">Idel</sys:String>
+    <sys:String x:Key="StatusUpdating">Updating</sys:String>
+    <sys:String x:Key="StatusSuccess">Success</sys:String>
+    <sys:String x:Key="StatusFail">Fail</sys:String>
+
+    <sys:String x:Key="StatusBarUpdating">Processing {0}</sys:String>
+    <sys:String x:Key="StatusBarFailed">Process {0} Failed</sys:String>
+
+    <sys:String x:Key="SnWoMisMatch">Serial Number or WorkOrder Error</sys:String>
+
+    <sys:String x:Key="ModelNameEmptyAlert">Model Name is Required</sys:String>
+    <sys:String x:Key="ModelNameMismatchAlert">Model Name setting is Mismathed</sys:String>
+    <sys:String x:Key="SerialNumberEmptyAlert">Serial Number is Required</sys:String>
+    <sys:String x:Key="ModelNameErrorAlert">Model Name format Error</sys:String>
+    <sys:String x:Key="FourGenVersionEmptyAlert">4G Module Version is Required</sys:String>
+    <sys:String x:Key="IccidEmptyAlert">ICCID is Required when sim installed</sys:String>
+    <sys:String x:Key="ImsiEmptyAlert">IMSI is Required when sim installed</sys:String>
+    <sys:String x:Key="FirmwareListNullAlert">FirmwareUpdateModels should be decalred</sys:String>
+    <sys:String x:Key="FirmwareNameEmptyAlert">Firmware module name is Required</sys:String>
+    <sys:String x:Key="FirmwareVersionEmptyAlert">Firmware version is Required</sys:String>
+    <sys:String x:Key="FirmwareFileEmptyAlert">Firmware file is Required</sys:String>
+
+    <sys:String x:Key="LoadConfigRootFolderNotfoundAlert">Firmware root path ERROR</sys:String>
+    <sys:String x:Key="LoadConfigFolderNotfoundAlert">Firmware root path not exist</sys:String>
+    <sys:String x:Key="LoadConfigModelFolderNotfoundAlert">Model firmware root path not exist</sys:String>
+    <sys:String x:Key="LoadConfigModelInitNotfoundAlert">Model firmware setting not exist</sys:String>
+    <sys:String x:Key="LoadConfigModelInitFormatErrorAlert">Setting file ERROR</sys:String>
+
+    <sys:String x:Key="InitModelNameEmptyAlert">ModelName is requred</sys:String>
+    <sys:String x:Key="InitModelNameErrorAlert">ModelName format Error</sys:String>
+    <sys:String x:Key="InitIccidEmptyAlert">ICCID should not empty while IsSimInsert is set</sys:String>
+    <sys:String x:Key="InitImsiEmptyAlert">IMSI should not empty while IsSimInsert is set</sys:String>
+    <sys:String x:Key="InitFirmwareNameEmptyAlert">Firmware module name should not empty</sys:String>
+    <sys:String x:Key="InitFirmwareVersionEmptyAlert">Version should not empty while {0} firmware is set</sys:String>
+    <sys:String x:Key="InitFirmwareFileEmptyAlert">File name should not empty while {0} version is set</sys:String>
+    <sys:String x:Key="InitFirmwareFileMissingAlert">{0} Firemware file is missing</sys:String>
+    <sys:String x:Key="InitFirmwareFileHeaderMismatchAlert">{0} Firemware and ModelName is Mismatched</sys:String>
+    <sys:String x:Key="InitFirmwareFileHeaderFormatAlert">{0} Firemware header ERROR</sys:String>
+
+    <sys:String x:Key="BtnPressHintTitle">Starting Button test</sys:String>
+    <sys:String x:Key="BtnPressUnpressHint">Please make sure All button is Unpressed&#x0a;Press Ok while complete</sys:String>
+    <sys:String x:Key="BtnPressPressHint">PRESS {0} 2 secnds</sys:String>
+    <sys:String x:Key="BtnPressGreenBtn">GREEN Button</sys:String>
+    <sys:String x:Key="BtnPressBlueBtn">BLUE Button</sys:String>
+    <sys:String x:Key="BtnPressEmergencyBtn">EMERGENCY Button</sys:String>
+</ResourceDictionary>

+ 79 - 0
AwInitilizer/Cultures/StringResource.zh-CHS.xaml

@@ -0,0 +1,79 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+                    xmlns:local="clr-namespace:AwInitilizer.Cultures"
+                    xmlns:sys="clr-namespace:System;assembly=mscorlib">
+
+    <sys:String x:Key="Confirm">确认</sys:String>
+
+    <sys:String x:Key="SigninDialogTitle">登入</sys:String>
+    <sys:String x:Key="SigninDialogEnterIDHint">输入员工证号</sys:String>
+    <sys:String x:Key="SigninDialogEnterWOHint">输入工单号</sys:String>
+    <sys:String x:Key="SigninDialogEnterWOError">工单号错误</sys:String>
+    <sys:String x:Key="SigninDialogEnterIDError">员工证号错误</sys:String>
+    <sys:String x:Key="SigninDialogNoResponseError">MES没有反应</sys:String>
+
+    <sys:String x:Key="Account">账户</sys:String>
+    <sys:String x:Key="logout">注销</sys:String>
+    <sys:String x:Key="UserID">员工证号</sys:String>
+    <sys:String x:Key="WorkOrder">工单号</sys:String>
+
+    <sys:String x:Key="BarcodeSetting">Barcode信息</sys:String>
+    <sys:String x:Key="ModelName">Model Name</sys:String>
+    <sys:String x:Key="SerialNumber">Serial Number</sys:String>
+    <sys:String x:Key="SimStatus">SIM卡是否插入</sys:String>
+    <sys:String x:Key="ICCID">Sim卡ICCID</sys:String>
+    <sys:String x:Key="IMSI">Sim卡IMSI</sys:String>
+
+    <sys:String x:Key="FirmwareVersion">韧体版本</sys:String>
+    <sys:String x:Key="FirmwareVersionHeaderName">模块</sys:String>
+    <sys:String x:Key="FirmwareVersionHeaderVersion">版本</sys:String>
+
+    <sys:String x:Key="StartProcedure">开始</sys:String>
+
+    <sys:String x:Key="StatusIdel">闲置</sys:String>
+    <sys:String x:Key="StatusUpdating">更新中</sys:String>
+    <sys:String x:Key="StatusSuccess">成功</sys:String>
+    <sys:String x:Key="StatusFail">失败</sys:String>
+
+    <sys:String x:Key="StatusBarUpdating">{0} 处理中</sys:String>
+    <sys:String x:Key="StatusBarFailed">{0} 失败</sys:String>
+
+    <sys:String x:Key="SnWoMisMatch">序号或工单号错误</sys:String>
+
+    <sys:String x:Key="ModelNameEmptyAlert">Model Name不能为空</sys:String>
+    <sys:String x:Key="ModelNameMismatchAlert">Model Name不相同</sys:String>
+    <sys:String x:Key="SerialNumberEmptyAlert">Serial Number不能为空</sys:String>
+    <sys:String x:Key="ModelNameErrorAlert">Model Name格式错误</sys:String>
+    <sys:String x:Key="FourGenVersionEmptyAlert">4G模块版本不能为空</sys:String>
+    <sys:String x:Key="IccidEmptyAlert">当SIM卡插入则ICCID不能为空</sys:String>
+    <sys:String x:Key="ImsiEmptyAlert">当SIM卡插入则IMSI不能为空</sys:String>
+    <sys:String x:Key="FirmwareListNullAlert">必须宣告更新韧体列表</sys:String>
+    <sys:String x:Key="FirmwareNameEmptyAlert">韧体模块名称不能为空</sys:String>
+    <sys:String x:Key="FirmwareVersionEmptyAlert">韧体模块版本不能为空</sys:String>
+    <sys:String x:Key="FirmwareFileEmptyAlert">韧体更新档不能为空</sys:String>
+
+    <sys:String x:Key="LoadConfigRootFolderNotfoundAlert">韧体主目录错误</sys:String>
+    <sys:String x:Key="LoadConfigFolderNotfoundAlert">韧体主目录不存在</sys:String>
+    <sys:String x:Key="LoadConfigModelFolderNotfoundAlert">模块韧体目录不存在</sys:String>
+    <sys:String x:Key="LoadConfigModelInitNotfoundAlert">模块韧体配置文件不存在</sys:String>
+    <sys:String x:Key="LoadConfigModelInitFormatErrorAlert">模块韧体配置文件格示错误</sys:String>
+
+    <sys:String x:Key="InitModelNameEmptyAlert">ModelName不能为空</sys:String>
+    <sys:String x:Key="InitModelNameErrorAlert">ModelName格式错误</sys:String>
+    <sys:String x:Key="InitIccidEmptyAlert">当SIM卡插入则ICCID不能为空</sys:String>
+    <sys:String x:Key="InitImsiEmptyAlert">当SIM卡插入则IMSI不能为空</sys:String>
+    <sys:String x:Key="InitFirmwareNameEmptyAlert">韧体模块名称不能为空</sys:String>
+    <sys:String x:Key="InitFirmwareVersionEmptyAlert">{0}的版本不能为空</sys:String>
+    <sys:String x:Key="InitFirmwareFileEmptyAlert">{0}的韧体文件名不能为空</sys:String>
+    <sys:String x:Key="InitFirmwareFileMissingAlert">找不到{0}的韧体更新档</sys:String>
+    <sys:String x:Key="InitFirmwareFileHeaderMismatchAlert">{0}的韧体与Model Name不相同</sys:String>
+    <sys:String x:Key="InitFirmwareFileHeaderFormatAlert">{0}的韧体标题错误</sys:String>
+
+    <sys:String x:Key="BtnPressHintTitle">按钮测试</sys:String>
+    <sys:String x:Key="BtnPressUnpressHint">请确认所有按钮皆没有被按下&#x0a;确认后按下下方确认</sys:String>
+    <sys:String x:Key="BtnPressPressHint">请按下{0}2秒后放开</sys:String>
+    <sys:String x:Key="BtnPressGreenBtn">绿色按钮</sys:String>
+    <sys:String x:Key="BtnPressBlueBtn">蓝色按钮</sys:String>
+    <sys:String x:Key="BtnPressEmergencyBtn">紧急按钮</sys:String>
+
+</ResourceDictionary>

+ 78 - 0
AwInitilizer/Cultures/StringResource.zh-TW.xaml

@@ -0,0 +1,78 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+                    xmlns:local="clr-namespace:AwInitilizer.Cultures"
+                    xmlns:sys="clr-namespace:System;assembly=mscorlib">
+
+    <sys:String x:Key="Confirm">確認</sys:String>
+
+    <sys:String x:Key="SigninDialogTitle">登入</sys:String>
+    <sys:String x:Key="SigninDialogEnterIDHint">輸入員工證號</sys:String>
+    <sys:String x:Key="SigninDialogEnterWOHint">輸入工單號</sys:String>
+    <sys:String x:Key="SigninDialogEnterWOError">工單號錯誤</sys:String>
+    <sys:String x:Key="SigninDialogEnterIDError">員工證號錯誤</sys:String>
+    <sys:String x:Key="SigninDialogNoResponseError">MES沒有反應</sys:String>
+
+    <sys:String x:Key="Account">帳戶</sys:String>
+    <sys:String x:Key="logout">登出</sys:String>
+    <sys:String x:Key="UserID">員工證號</sys:String>
+    <sys:String x:Key="WorkOrder">工單號</sys:String>
+
+    <sys:String x:Key="BarcodeSetting">Barcode資訊</sys:String>
+    <sys:String x:Key="ModelName">Model Name</sys:String>
+    <sys:String x:Key="SerialNumber">Serial Number</sys:String>
+    <sys:String x:Key="SimStatus">SIM卡是否插入</sys:String>
+    <sys:String x:Key="ICCID">Sim卡ICCID</sys:String>
+    <sys:String x:Key="IMSI">Sim卡IMSI</sys:String>
+
+    <sys:String x:Key="FirmwareVersion">韌體版本</sys:String>
+    <sys:String x:Key="FirmwareVersionHeaderName">模組</sys:String>
+    <sys:String x:Key="FirmwareVersionHeaderVersion">版本</sys:String>
+
+    <sys:String x:Key="StartProcedure">開始</sys:String>
+
+    <sys:String x:Key="StatusIdel">閒置</sys:String>
+    <sys:String x:Key="StatusUpdating">更新中</sys:String>
+    <sys:String x:Key="StatusSuccess">成功</sys:String>
+    <sys:String x:Key="StatusFail">失敗</sys:String>
+
+    <sys:String x:Key="StatusBarUpdating">{0} 處理中</sys:String>
+    <sys:String x:Key="StatusBarFailed">{0} 失敗</sys:String>
+
+    <sys:String x:Key="SnWoMisMatch">序號或工單號錯誤</sys:String>
+
+    <sys:String x:Key="ModelNameEmptyAlert">Model Name不能為空</sys:String>
+    <sys:String x:Key="ModelNameMismatchAlert">Model Name不相同</sys:String>
+    <sys:String x:Key="SerialNumberEmptyAlert">Serial Number不能為空</sys:String>
+    <sys:String x:Key="ModelNameErrorAlert">Model Name格式錯誤</sys:String>
+    <sys:String x:Key="FourGenVersionEmptyAlert">4G模組版本不能為空</sys:String>
+    <sys:String x:Key="IccidEmptyAlert">當SIM卡插入則ICCID不能為空</sys:String>
+    <sys:String x:Key="ImsiEmptyAlert">當SIM卡插入則IMSI不能為空</sys:String>
+    <sys:String x:Key="FirmwareListNullAlert">必須宣告更新韌體列表</sys:String>
+    <sys:String x:Key="FirmwareNameEmptyAlert">韌體模組名稱不能為空</sys:String>
+    <sys:String x:Key="FirmwareVersionEmptyAlert">韌體模組版本不能為空</sys:String>
+    <sys:String x:Key="FirmwareFileEmptyAlert">韌體更新檔不能為空</sys:String>
+
+    <sys:String x:Key="LoadConfigRootFolderNotfoundAlert">韌體主目錄錯誤</sys:String>
+    <sys:String x:Key="LoadConfigFolderNotfoundAlert">韌體主目錄不存在</sys:String>
+    <sys:String x:Key="LoadConfigModelFolderNotfoundAlert">模組韌體目錄不存在</sys:String>
+    <sys:String x:Key="LoadConfigModelInitNotfoundAlert">模組韌體設定檔不存在</sys:String>
+    <sys:String x:Key="LoadConfigModelInitFormatErrorAlert">模組韌體設定檔格示錯誤</sys:String>
+
+    <sys:String x:Key="InitModelNameEmptyAlert">ModelName不能為空</sys:String>
+    <sys:String x:Key="InitModelNameErrorAlert">ModelName格式錯誤</sys:String>
+    <sys:String x:Key="InitIccidEmptyAlert">當SIM卡插入則ICCID不能為空</sys:String>
+    <sys:String x:Key="InitImsiEmptyAlert">當SIM卡插入則IMSI不能為空</sys:String>
+    <sys:String x:Key="InitFirmwareNameEmptyAlert">韌體模組名稱不能為空</sys:String>
+    <sys:String x:Key="InitFirmwareVersionEmptyAlert">{0}的版本不能為空</sys:String>
+    <sys:String x:Key="InitFirmwareFileEmptyAlert">{0}的韌體檔案名稱不能為空</sys:String>
+    <sys:String x:Key="InitFirmwareFileMissingAlert">找不到{0}的韌體更新檔</sys:String>
+    <sys:String x:Key="InitFirmwareFileHeaderMismatchAlert">{0}的韌體與Model Name不相同</sys:String>
+    <sys:String x:Key="InitFirmwareFileHeaderFormatAlert">{0}的韌體標題錯誤</sys:String>
+
+    <sys:String x:Key="BtnPressHintTitle">按鈕測試</sys:String>
+    <sys:String x:Key="BtnPressUnpressHint">請確認所有按鈕皆沒有被按下&#x0a;確認後按下下方確認</sys:String>
+    <sys:String x:Key="BtnPressPressHint">請按下{0}2秒後放開</sys:String>
+    <sys:String x:Key="BtnPressGreenBtn">綠色按鈕</sys:String>
+    <sys:String x:Key="BtnPressBlueBtn">藍色按鈕</sys:String>
+    <sys:String x:Key="BtnPressEmergencyBtn">緊急按鈕</sys:String>
+</ResourceDictionary>

+ 11 - 6
AwInitilizer/DLL/SajetConnect.cs

@@ -123,6 +123,10 @@ namespace AwInitilizer.DLL
             if (string.IsNullOrEmpty(msg))
                 return false;
             Result = false;
+
+            if (!Result)
+                return true;
+
             if (Result)
             {
                 msg += "OK,";
@@ -220,7 +224,7 @@ namespace AwInitilizer.DLL
 
         private static bool SajetTransData(int command,ref string data)
         {
-            return true;
+            //return true;
             if(!data.EndsWith(","))
             {
                 data = data + ",";
@@ -229,11 +233,12 @@ namespace AwInitilizer.DLL
             var idByte = Encoding.ASCII.GetBytes(data);
             var length = idByte.Length;
 
-            var dataArray = new byte[100];
-            Array.Copy(idByte, 0, dataArray, 0, Math.Min(dataArray.Length, idByte.Length));
+            var dataArrayLength = Math.Max(length, 100);
+            var dataArray = new byte[dataArrayLength];
+            Array.Copy(idByte, 0, dataArray, 0, length);
 
-            IntPtr dataIntPtr = System.Runtime.InteropServices.Marshal.AllocCoTaskMem(100);
-            System.Runtime.InteropServices.Marshal.Copy(idByte, 0, dataIntPtr, idByte.Length);
+            IntPtr dataIntPtr = System.Runtime.InteropServices.Marshal.AllocCoTaskMem(dataArrayLength);
+            System.Runtime.InteropServices.Marshal.Copy(dataArray, 0, dataIntPtr, dataArray.Length);
 
             IntPtr lengthIntPtr = System.Runtime.InteropServices.Marshal.AllocCoTaskMem(10);
             System.Runtime.InteropServices.Marshal.WriteInt32(lengthIntPtr, length);
@@ -242,7 +247,7 @@ namespace AwInitilizer.DLL
 
             var resultString1 = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(dataIntPtr);
 
-            System.Runtime.InteropServices.Marshal.Copy(dataIntPtr, dataArray, 0, 100);
+            System.Runtime.InteropServices.Marshal.Copy(dataIntPtr, dataArray, 0, dataArrayLength);
             System.Runtime.InteropServices.Marshal.Release(dataIntPtr);
 
             var readLength = System.Runtime.InteropServices.Marshal.ReadInt32(lengthIntPtr);

+ 15 - 0
AwInitilizer/HintDialog.xaml.cs

@@ -19,6 +19,21 @@ namespace AwInitilizer
     /// </summary>
     public partial class HintDialog : Window
     {
+        public static void ShowMessage(string msg)
+        {
+            var confirmString = (string)Application.Current.FindResource("Confirm");
+            var dialog = new HintDialog() { Title = "",Message = msg,BtnText= confirmString };
+            try
+            {
+                dialog.Owner = Application.Current.MainWindow;
+            }
+            catch
+            {
+
+            }
+            dialog.ShowDialog();
+        }
+
         public string Message
         {
             get => (string) uxConentText.Content;

+ 19 - 0
AwInitilizer/Initilizer.csproj

@@ -65,10 +65,29 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </ApplicationDefinition>
+    <Compile Include="Cultures\CulturesHelper.cs" />
+    <Compile Include="Procedure\FirmwareBundleUploadProcedure.cs" />
+    <Compile Include="Procedure\FirmwareCheckVersionProcedure.cs" />
+    <Compile Include="Procedure\FirmwareUploadProcedure.cs" />
     <Compile Include="Procedure\VersionLogProcedure.cs" />
     <Compile Include="SigninDialog.xaml.cs">
       <DependentUpon>SigninDialog.xaml</DependentUpon>
     </Compile>
+    <Content Include="Cultures\StringResource.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Cultures\StringResource.zh-TW.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Cultures\StringResource.zh-CHS.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
     <Page Include="HintDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 124 - 145
AwInitilizer/MainWindow.xaml

@@ -6,173 +6,152 @@
     xmlns:input="clr-namespace:System.Windows.Input;assembly=PresentationCore"
         xmlns:local="clr-namespace:AwInitilizer"
         mc:Ignorable="d"
-        Title="Initlizer" Height="590" Width="790" Background="#FF363535"
+        Title="Initlizer" Height="1080" Width="1920" Background="#FF363535"
         input:InputMethod.IsInputMethodEnabled="False"
+        WindowStartupLocation="CenterScreen"
+        WindowState="Maximized"
         x:Name="uxManinWindow">
     <Window.Resources>
     </Window.Resources>
     <Viewbox>
-        <StackPanel Orientation="Horizontal">
-            <StackPanel Orientation="Vertical" Width="790">
-                <GroupBox>
-                    <GroupBox.Header>
-                        <Label Content="Account" Foreground="White" FontSize="16"/>
-                    </GroupBox.Header>
-                    <StackPanel Orientation="Vertical">
-                        <StackPanel Orientation="Horizontal" Height="30" Margin="0,0,0,10">
-                            <Grid Width="200">
-                                <Label Content="User Id" Foreground="White" FontSize="16" HorizontalAlignment="Center"/>
-                            </Grid>
-                            <TextBox Text="{Binding UserID}" IsEnabled="{Binding IsInputLock}" IsReadOnly="True" Width="440" FontSize="16" TextAlignment="Center" VerticalContentAlignment="Center"/>
+        <StackPanel Orientation="Vertical">
+            <StackPanel Orientation="Horizontal">
+                <StackPanel Orientation="Vertical" Width="400" Margin="10,0,0,0">
+                    <GroupBox>
+                        <GroupBox.Header>
+                            <Label Content="{DynamicResource Account}" Foreground="White" FontSize="16"/>
+                        </GroupBox.Header>
+                        <StackPanel Orientation="Vertical">
                             <Button Width="100" Click="Logout_Click" IsEnabled="{Binding IsInputLock}">
-                                <Label Content="Logout"/>
+                                <Label Content="{DynamicResource logout}"/>
                             </Button>
-                        </StackPanel>
-                        <StackPanel Orientation="Horizontal" Height="30" Margin="0,0,0,10">
-                            <Grid Width="200">
-                                <Label Content="Work Order" Foreground="White" FontSize="16" HorizontalAlignment="Center"/>
-                            </Grid>
-                            <TextBox Text="{Binding WorkOrder}" IsEnabled="{Binding IsInputLock}" IsReadOnly="True" Width="540" FontSize="16" TextAlignment="Center" VerticalContentAlignment="Center"
+                            <StackPanel Orientation="Horizontal" Height="30" Margin="0,10,0,10">
+                                <Grid Width="178">
+                                    <Label Content="{DynamicResource UserID}" Foreground="White" FontSize="16" HorizontalAlignment="Center"/>
+                                </Grid>
+                                <TextBox Text="{Binding UserID}" IsEnabled="{Binding IsInputLock}" IsReadOnly="True" Width="200" FontSize="16" TextAlignment="Center" VerticalContentAlignment="Center"/>
+                            </StackPanel>
+                            <StackPanel Orientation="Horizontal" Height="30" Margin="0,0,0,10">
+                                <Grid Width="178">
+                                    <Label Content="{DynamicResource WorkOrder}" Foreground="White" FontSize="16" HorizontalAlignment="Center"/>
+                                </Grid>
+                                <TextBox Text="{Binding WorkOrder}" IsEnabled="{Binding IsInputLock}" IsReadOnly="True" Width="200" FontSize="16" TextAlignment="Center" VerticalContentAlignment="Center"
                                      TextChanged="WorkOrder_TextChanged" KeyDown="WorkOrder_KeyDown"/>
+                            </StackPanel>
+                            
                         </StackPanel>
-                    </StackPanel>
-                </GroupBox>
-                <GroupBox>
-                    <GroupBox.Header>
-                        <Label Content="Barcode Setting" Foreground="White" FontSize="16"/>
-                    </GroupBox.Header>
-                    <StackPanel Orientation="Vertical">
-                        <StackPanel Orientation="Horizontal">
+                    </GroupBox>
+                    <GroupBox>
+                        <GroupBox.Header>
+                            <Label Content="{DynamicResource BarcodeSetting}" Foreground="White" FontSize="16"/>
+                        </GroupBox.Header>
+                        <StackPanel Orientation="Vertical">
                             <StackPanel Orientation="Horizontal" Height="30">
-                                <Grid Width="200">
-                                    <Label Content="Model Name" Foreground="White" FontSize="16" HorizontalAlignment="Center"/>
+                                <Grid Width="178">
+                                    <Label Content="{DynamicResource ModelName}" Foreground="White" FontSize="16" HorizontalAlignment="Center"/>
                                 </Grid>
-                                <TextBox x:Name="uxModelName" Text="{Binding ModelName}" IsEnabled="{Binding IsInputLock}" IsReadOnly="True" Width="170" FontSize="16" TextAlignment="Center" VerticalContentAlignment="Center"/>
+                                <TextBox x:Name="uxModelName" Text="{Binding ModelName}" IsEnabled="{Binding IsInputLock}" IsReadOnly="True" Width="200" FontSize="16" TextAlignment="Center" VerticalContentAlignment="Center"/>
                             </StackPanel>
-                            <StackPanel Orientation="Horizontal" Height="30">
-                                <Grid Width="200">
-                                    <Label Content="Serial Number" Foreground="White" FontSize="16" HorizontalAlignment="Center"/>
+                            <StackPanel Orientation="Horizontal" Height="30" Margin="0,10,0,10">
+                                <Grid Width="178">
+                                    <Label Content="{DynamicResource SerialNumber}" Foreground="White" FontSize="16" HorizontalAlignment="Center"/>
                                 </Grid>
-                                <TextBox x:Name="uxSerialNumber" Text="{Binding SerialNumber}" IsEnabled="{Binding IsInputLock}" IsReadOnly="True" Width="170" FontSize="16" TextAlignment="Center" VerticalContentAlignment="Center"/>
+                                <TextBox x:Name="uxSerialNumber" Text="{Binding SerialNumber}" IsEnabled="{Binding IsInputLock}" IsReadOnly="True" Width="200" FontSize="16" TextAlignment="Center" VerticalContentAlignment="Center"/>
+                            </StackPanel>
+                            <StackPanel Orientation="Horizontal" Height="30" Margin="0,0,0,10">
+                                <Grid Width="178">
+                                    <Label Content="{DynamicResource SimStatus}" Foreground="White" FontSize="16" HorizontalAlignment="Center"/>
+                                </Grid>
+                                <CheckBox x:Name="uxIsSimCheckEnabled" IsChecked="{Binding IsSimInsert}" IsEnabled="{Binding IsInputLock}" IsHitTestVisible="False" VerticalAlignment="Center" />
+                            </StackPanel>
+                            <StackPanel Orientation="Horizontal" Height="30" Margin="0,0,0,10">
+                                <Grid Width="178">
+                                    <Label Content="{DynamicResource ICCID}" Foreground="White" FontSize="16" HorizontalAlignment="Center"/>
+                                </Grid>
+                                <TextBox x:Name="uxICCID" Text="{Binding ICCID}" IsReadOnly="True" Width="200" FontSize="16" TextAlignment="Center" VerticalContentAlignment="Center">
+                                    <TextBox.IsEnabled>
+                                        <MultiBinding Converter="{StaticResource booleanAndConverter}">
+                                            <Binding Path="IsSimInsert" />
+                                            <Binding Path="IsInputLock" />
+                                        </MultiBinding>
+                                    </TextBox.IsEnabled>
+                                </TextBox>
+                            </StackPanel>
+                            <StackPanel Orientation="Horizontal" Height="30" Margin="0,0,0,10">
+                                <Grid Width="178">
+                                    <Label Content="{DynamicResource IMSI}" Foreground="White" FontSize="16" HorizontalAlignment="Center"/>
+                                </Grid>
+                                <TextBox x:Name="uxIMSI" Text="{Binding IMSI}" IsReadOnly="True" Width="200" FontSize="16" TextAlignment="Center" VerticalContentAlignment="Center">
+                                    <TextBox.IsEnabled>
+                                        <MultiBinding Converter="{StaticResource booleanAndConverter}">
+                                            <Binding Path="IsSimInsert" />
+                                            <Binding Path="IsInputLock" />
+                                        </MultiBinding>
+                                    </TextBox.IsEnabled>
+                                </TextBox>
                             </StackPanel>
                         </StackPanel>
-                        <Frame Height="10"/>
-                    </StackPanel>
-                </GroupBox>
-                <GroupBox>
-                    <GroupBox.Header>
-                        <Label Content="Config Setting" Foreground="White" FontSize="16"/>
-                    </GroupBox.Header>
-                    <StackPanel Orientation="Vertical">
-                        <StackPanel Orientation="Horizontal" Height="30">
-                            <Grid Width="200">
-                                <Label Content="Setting File" Foreground="White" FontSize="16" HorizontalAlignment="Center"/>
-                            </Grid>
-                            <TextBox x:Name="uxSettingFile" Text="{Binding SettingFileName}" IsEnabled="{Binding IsInputLock}" IsReadOnly="True" Width="540" FontSize="16" TextAlignment="Center" VerticalContentAlignment="Center"/>
-                        </StackPanel>
-                        <Frame Height="10"/>
-                        <StackPanel Orientation="Horizontal" Height="30">
-                            <Grid Width="200">
-                                <Label Content="4G Module Reversiion" Foreground="White" FontSize="16" HorizontalAlignment="Center"/>
-                            </Grid>
-                            <TextBox x:Name="uxFourGModuleVer" Text="{Binding FourGenModuleVersion}" IsEnabled="{Binding IsInputLock}" IsReadOnly="True" Width="540" FontSize="16" TextAlignment="Center" VerticalContentAlignment="Center"/>
-                        </StackPanel>
-                        <Frame Height="10"/>
-                        <StackPanel Orientation="Horizontal" Height="30">
-                            <Grid Width="200">
-                                <Label Content="4G Sim Card Information" Foreground="White" FontSize="16" HorizontalAlignment="Center"/>
-                            </Grid>
-                            <CheckBox x:Name="uxIsSimCheckEnabled" IsChecked="{Binding IsSimInsert}" IsEnabled="{Binding IsInputLock}" IsHitTestVisible="False" VerticalAlignment="Center" />
-                            <Grid Width="10"/>
-                            <Grid Width="70">
-                                <Label Content="ICCID" Foreground="White" FontSize="16" HorizontalAlignment="Center"/>
-                            </Grid>
-                            <Grid Width="10"/>
-                            <TextBox x:Name="uxICCID" Text="{Binding ICCID}" IsReadOnly="True" Width="176" FontSize="16" TextAlignment="Center" VerticalContentAlignment="Center">
-                                <TextBox.IsEnabled>
-                                    <MultiBinding Converter="{StaticResource booleanAndConverter}">
-                                        <Binding Path="IsSimInsert" />
-                                        <Binding Path="IsInputLock" />
-                                    </MultiBinding>
-                                </TextBox.IsEnabled>
-                            </TextBox>
-                            <Grid Width="70">
-                                <Label Content="IMSI" Foreground="White" FontSize="16" HorizontalAlignment="Center"/>
-                            </Grid>
-                            <Grid Width="10"/>
-                            <TextBox x:Name="uxIMSI" Text="{Binding IMSI}" IsReadOnly="True" Width="176" FontSize="16" TextAlignment="Center" VerticalContentAlignment="Center">
-                                <TextBox.IsEnabled>
-                                    <MultiBinding Converter="{StaticResource booleanAndConverter}">
-                                        <Binding Path="IsSimInsert" />
-                                        <Binding Path="IsInputLock" />
-                                    </MultiBinding>
-                                </TextBox.IsEnabled>
-                            </TextBox>
-                            <Grid Width="10"/>
-                        </StackPanel>
-                        <Frame Height="10"/>
-                    </StackPanel>
-                </GroupBox>
+                    </GroupBox>
+                </StackPanel>
 
-                <GroupBox>
-                    <GroupBox.Header>
-                        <Label Content="Firmware version" Foreground="White" FontSize="16"/>
-                    </GroupBox.Header>
+                <StackPanel Orientation="Vertical" Width="400" Margin="10,0,0,0">
+                    <GroupBox>
+                        <GroupBox.Header>
+                            <Label Content="{DynamicResource FirmwareVersion}" Foreground="White" FontSize="16"/>
+                        </GroupBox.Header>
 
-                    <DataGrid AutoGenerateColumns="False" Margin="10" Height="150" CanUserSortColumns="False" IsEnabled="{Binding IsInputLock}" ItemsSource="{Binding FirmwareUpdateModels}">
-                        <DataGrid.Columns>
-                            <DataGridTextColumn Header="Module" Width="150" MinWidth="50" Binding="{Binding Path=Module}" IsReadOnly="True"/>
-                            <DataGridTextColumn Header="Version" Width="150" MinWidth="70" Binding="{Binding Path=Version}" IsReadOnly="True"/>
-                            <DataGridTextColumn Header="File name" Binding="{Binding Path=FirmwareFileName}" IsReadOnly="False"/>
-                        </DataGrid.Columns>
-                    </DataGrid>
-                </GroupBox>
+                        <DataGrid AutoGenerateColumns="False" Margin="10" Height="335" CanUserSortColumns="False" IsEnabled="{Binding IsInputLock}" ItemsSource="{Binding FirmwareUpdateModels}">
+                            <DataGrid.Columns>
+                                <DataGridTextColumn Header="{DynamicResource FirmwareVersionHeaderName}" Width="150" MinWidth="50" Binding="{Binding Path=Module}" IsReadOnly="True"/>
+                                <DataGridTextColumn Header="{DynamicResource FirmwareVersionHeaderVersion}" Width="150" MinWidth="70" Binding="{Binding Path=Version}" IsReadOnly="True"/>
+                                <!--" DataGridTextColumn Header="File name" Binding="{Binding Path=FirmwareFileName}" IsReadOnly="False"/-->
+                            </DataGrid.Columns>
+                        </DataGrid>
+                    </GroupBox>
+                </StackPanel>
 
-                <Grid Height="50">
-                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
-                        <ProgressBar Minimum="0" Maximum="100" x:Name="uxProgress" VerticalAlignment="Center" Height="10" Width="250"/>
-                        <Label x:Name="uxProgressRate" Content="0%" Foreground="White" FontSize="16"/>
-                        <Grid Width="10"/>
-                        <Button x:Name="uxStartBtn" Click="StartInit_Click">
-                            <Button.IsEnabled>
-                                <MultiBinding Converter="{StaticResource booleanAndConverter}">
-                                    <Binding Path="IsInputLock" />
-                                    <Binding Path="IsInputCheckpassed" />
-                                </MultiBinding>
-                            </Button.IsEnabled>
-                            
-                            <Label Content="Start DC Initialize"/>
-                        </Button>
-                    </StackPanel>
-                </Grid>
+                <Grid Margin="10,0,0,0">
+                    <Grid.RowDefinitions>
+                        <RowDefinition Height="*"/>
+                        <RowDefinition Height="30"/>
+                        <RowDefinition Height="*"/>
+                    </Grid.RowDefinitions>
 
-                <GroupBox Height="280" >
-                    <GroupBox.Header>
-                        <Label Content="Init Procedure" Foreground="White" FontSize="16"/>
-                    </GroupBox.Header>
+                    <Button Grid.Row="0" Margin="30" x:Name="uxStartBtn" Click="StartInit_Click">
+                        <Button.Template>
+                            <ControlTemplate TargetType="Button">
+                                <Border CornerRadius="10" BorderThickness="2" BorderBrush="Gray" Background="White">
+                                    <Border.Effect>
+                                        <DropShadowEffect ShadowDepth="10"/>
+                                    </Border.Effect>
+                                    <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"/>
+                                </Border>
+                            </ControlTemplate>
+                        </Button.Template>
+                        <Button.IsEnabled>
+                            <MultiBinding Converter="{StaticResource booleanAndConverter}">
+                                <Binding Path="IsInputLock" />
+                                <Binding Path="IsInputCheckpassed" />
+                            </MultiBinding>
+                        </Button.IsEnabled>
 
-                    <DataGrid AutoGenerateColumns="False" Margin="10" x:Name="uxProcedureDataGrid" CanUserSortColumns="False" IsEnabled="{Binding IsInputLock}" ItemsSource="{Binding UpdateProcedure}">
-                        <DataGrid.Columns>
-                            <DataGridTextColumn Header="Name" Width="150" MinWidth="50" Binding="{Binding Path=Name}" IsReadOnly="True"/>
-                            <DataGridTextColumn Header="Content" Width="500" MinWidth="70" Binding="{Binding Path=Content}" IsReadOnly="True"/>
-                            <DataGridCheckBoxColumn Header="Action" Binding="{Binding Path=IsActivated}" IsReadOnly="False"/>
-                        </DataGrid.Columns>
-                    </DataGrid>
-                </GroupBox>
-            </StackPanel>
-            <Grid Width="10"/>
-            <StackPanel Orientation="Vertical" Width="400">
-                <GroupBox Height="885">
-                    <GroupBox.Header>
-                        <Label Content="Terminal" Foreground="White" FontSize="16"/>
-                    </GroupBox.Header>
+                        <Label FontSize="36" Content="{DynamicResource StartProcedure}"/>
+                    </Button>
 
-                    <ScrollViewer x:Name="uxTerminalScroller">
-                        <TextBlock x:Name="uxTerminal" Background="Black" Margin="10" Foreground="Green">
-                        </TextBlock>
-                    </ScrollViewer>
-                </GroupBox>
+                    <StackPanel Grid.Row="1" Orientation="Vertical">
+                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
+                            <ProgressBar Minimum="0" Maximum="100" x:Name="uxProgress" VerticalAlignment="Center" Height="20" Width="250"/>
+                            <Label x:Name="uxProgressRate" Content="0%" Foreground="White" FontSize="16"/>
+                        </StackPanel>
+                    </StackPanel>
+
+
+                    <Grid Grid.Row="2" Background="White" Margin="30" x:Name="uxStatusContainer">
+                        <Label FontSize="36" x:Name="uxStatus" Foreground="Black" Content="Idel" VerticalAlignment="Center" HorizontalAlignment="Center"/>
+                    </Grid>
+                </Grid>
             </StackPanel>
+            <Label x:Name="uxStatusBar" FontSize="36" Content="" Margin="0,10,0,0" Foreground="White" HorizontalAlignment="Center"/>
         </StackPanel>
     </Viewbox>
 </Window>

+ 179 - 58
AwInitilizer/MainWindow.xaml.cs

@@ -22,6 +22,14 @@ using System.Windows.Threading;
 
 namespace AwInitilizer
 {
+    enum UpdateStatus
+    {
+        Idel,
+        Updating,
+        Sucess,
+        Fail
+    }
+
     /// <summary>
     /// Interaction logic for MainWindow.xaml
     /// </summary>
@@ -39,6 +47,13 @@ namespace AwInitilizer
 
         private MainViewModel ViewModel => DataContext as MainViewModel;
 
+        private UpdateStatus _UpdateStatus = UpdateStatus.Idel;
+        private UpdateStatus UpdateStatus
+        {
+            get => _UpdateStatus;
+            set => SetUpdateStatus(value);
+        }
+
         public MainWindow()
         {
             InitializeComponent();
@@ -59,7 +74,6 @@ namespace AwInitilizer
             PreviewKeyDown += MainWindow_PreviewKeyDown;
             PreviewKeyUp += MainWindow_PreviewKeyUp;
 
-            SystemID.TryParse("AWLU770001W1P0D2045A001A0", out var systemID);
             //this.DataContext = new MainViewModel();
             this.DataContext = new MainViewModel() {
                 //SystemID = systemID,
@@ -77,6 +91,9 @@ namespace AwInitilizer
 
             };
             this.DataContextChanged += MainWindow_DataContextChanged;
+
+
+            LogoutTimer.Start();
         }
 
         private void MainWindow_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
@@ -108,6 +125,11 @@ namespace AwInitilizer
                 shiftPressed = true;
                 return;
             }
+            else if(e.Key == Key.Capital)
+            {
+                shiftPressed = !shiftPressed;
+                return;
+            }
             else if (e.Key == Key.Enter)
             {
                 e.Handled = true;
@@ -151,11 +173,16 @@ namespace AwInitilizer
             var serialNumber = inputSystemID.SerialNumber;
             if (!DLL.SajetConnect.SajetTransSnCheck(ref serialNumber))
             {
-                MessageBox.Show("Serial Number or WorkOrder Error");
+                HintDialog.ShowMessage((string)Application.Current.FindResource("SnWoMisMatch"));
                 return;
             }
-
-            LoadConfigBySystemID(systemID);
+            else
+            {
+                if (LoadConfigBySystemID(systemID))
+                {
+                    UpdateStatus = UpdateStatus.Idel;
+                }
+            }
         }
 
         private void MainWindow_PreviewKeyUp(object sender, KeyEventArgs e)
@@ -170,6 +197,8 @@ namespace AwInitilizer
         {
             Loaded -= MainWindow_Loaded;
 
+            UpdateStatus = UpdateStatus.Idel;
+
             //init intilize procedure list
             //procedures.Add(new BasicInfoUpdateProcedure());
             //procedures.Add(new FourGenModuleCheckProcedure());
@@ -182,10 +211,10 @@ namespace AwInitilizer
 
             //uxProcedureDataGrid.ItemsSource = procedures;\
 
-//            var test = new HintDialog();
-//            test.ImgPath = "pack://application:,,,/AwInitilizer;component/Image/Blue.png";
-//            test.Message = "BLUE BOTTON"
-//;           test.ShowDialog();
+            //            var test = new HintDialog();
+            //            test.ImgPath = "pack://application:,,,/AwInitilizer;component/Image/Blue.png";
+            //            test.Message = "BLUE BOTTON"
+            //;           test.ShowDialog();
 
             DisplayLogin();
         }
@@ -198,7 +227,7 @@ namespace AwInitilizer
             var serialNumber = inputSystemID.SerialNumber;
             if (!DLL.SajetConnect.SajetTransSnCheck(ref serialNumber))
             {
-                MessageBox.Show("Serial Number or WorkOrder Error");
+                HintDialog.ShowMessage((string)Application.Current.FindResource("SnWoMisMatch"));
                 return;
             }
 
@@ -206,6 +235,7 @@ namespace AwInitilizer
             if (ViewModel.IsInputCheckpassed)
             {
                 ViewModel.IsUdatIng = true;
+                UpdateStatus = UpdateStatus.Updating;
                 _ = UpdateTask();
             }
         }
@@ -247,18 +277,21 @@ namespace AwInitilizer
 
             if (string.IsNullOrEmpty(updateData.ModelName))
             {
-                alertMsg += "Model Name is Required\n";
+                //alertMsg += "Model Name is Required\n";
+                alertMsg += (string)Application.Current.FindResource("ModelNameEmptyAlert") + "\n";
                 isAvaliable = false;
             }
             else if (ViewModel.SettingModelName != updateData.ModelName)
             {
-                alertMsg += "Model Name setting is Mismathed\n";
+                //alertMsg += "Model Name setting is Mismathed\n";
+                alertMsg += (string)Application.Current.FindResource("ModelNameMismatchAlert") + "\n";
                 isAvaliable = false;
             }
 
             if (string.IsNullOrEmpty(updateData.SerialNumber))
             {
-                alertMsg += "Serial Number is Required\n";
+                //alertMsg += "Serial Number is Required\n";
+                alertMsg += (string)Application.Current.FindResource("SerialNumberEmptyAlert") + "\n";
                 isAvaliable = false;
             }
 
@@ -271,7 +304,8 @@ namespace AwInitilizer
                 }
                 else
                 {
-                    alertMsg += "Model Name format Error\n";
+                    //alertMsg += "Model Name format Error\n";
+                    alertMsg += (string)Application.Current.FindResource("ModelNameErrorAlert") + "\n";
                     isAvaliable = false;
                 }
             }
@@ -281,7 +315,8 @@ namespace AwInitilizer
             {
                 if (string.IsNullOrEmpty(updateData.FourGenModuleVersion))
                 {
-                    alertMsg += "4G Module Version is Required\n";
+                    //alertMsg += "4G Module Version is Required\n";
+                    alertMsg += (string)Application.Current.FindResource("FourGenVersionEmptyAlert") + "\n";
                     isAvaliable = false;
                 }
 
@@ -289,13 +324,15 @@ namespace AwInitilizer
                 {
                     if (string.IsNullOrEmpty(updateData.ICCID))
                     {
-                        alertMsg += "ICCID is Required when sim installed\n";
+                        //alertMsg += "ICCID is Required when sim installed\n";
+                        alertMsg += (string)Application.Current.FindResource("IccidEmptyAlert") + "\n";
                         isAvaliable = false;
                     }
 
                     if (string.IsNullOrEmpty(updateData.IMSI))
                     {
-                        alertMsg += "IMSI is Required when sim installed\n";
+                        //alertMsg += "IMSI is Required when sim installed\n";
+                        alertMsg += (string)Application.Current.FindResource("ImsiEmptyAlert") + "\n";
                         isAvaliable = false;
                     }
                 }
@@ -303,7 +340,8 @@ namespace AwInitilizer
 
             if (updateData.FirmwareUpdateModels == null)
             {
-                alertMsg += "FirmwareUpdateModels should be decalred\n";
+                //alertMsg += "FirmwareUpdateModels should be decalred\n";
+                alertMsg += (string)Application.Current.FindResource("FirmwareListNullAlert") + "\n";
                 isAvaliable = false;
             }
             else
@@ -312,19 +350,22 @@ namespace AwInitilizer
                 {
                     if (string.IsNullOrEmpty(model.Module))
                     {
-                        alertMsg += "Firmware module name is Required\n";
+                        //alertMsg += "Firmware module name is Required\n";
+                        alertMsg += (string)Application.Current.FindResource("FirmwareNameEmptyAlert") + "\n";
                         isAvaliable = false;
                     }
 
                     if (string.IsNullOrEmpty(model.Version))
                     {
-                        alertMsg += "Firmware module name is Required\n";
+                        //alertMsg += "Firmware module name is Required\n";
+                        alertMsg += (string)Application.Current.FindResource("FirmwareVersionEmptyAlert") + "\n";
                         isAvaliable = false;
                     }
 
                     if (string.IsNullOrEmpty(model.FirmwareFileName))
                     {
-                        alertMsg += "Firmware file is Required\n";
+                        //alertMsg += "Firmware file is Required\n";
+                        alertMsg += (string)Application.Current.FindResource("FirmwareFileEmptyAlert") + "\n";
                         isAvaliable = false;
                     }
                 }
@@ -332,7 +373,7 @@ namespace AwInitilizer
 
             if (!isAvaliable)
             {
-                MessageBox.Show(alertMsg);
+                HintDialog.ShowMessage(alertMsg);
             }
             return isAvaliable;
         }
@@ -341,7 +382,6 @@ namespace AwInitilizer
         {
             ProcedureBase.UpdateData = ViewModel;
             ProcedureBase.Logger = this;
-            uxTerminal.Inlines.Clear();
 
             Dictionary<string, string> logPairs = new Dictionary<string, string>();
             //logPairs.Add("ModelName", ViewModel.SystemID.ModelName.ToString());
@@ -360,6 +400,8 @@ namespace AwInitilizer
             {
                 uxProgress.Value = (procedureIndex * 100 / procedureList.Count);
                 uxProgressRate.Content = ((int)(procedureIndex * 100 / procedureList.Count)) + "%";
+                uxStatusBar.Content = string.Format((string)Application.Current.FindResource("StatusBarUpdating"), procedureList[procedureIndex].Name);// $"Processing {procedureList[procedureIndex].Name}";
+
                 var result = await procedureList[procedureIndex].DoWork();
 
                 foreach(var procedureLog in procedureList[procedureIndex].LogPair)
@@ -386,9 +428,16 @@ namespace AwInitilizer
             {
                 uxProgress.Value = 100;
                 uxProgressRate.Content = "100%";
+                UpdateStatus = UpdateStatus.Sucess;
                 //report Success
                 DLL.SajetConnect.SajetTranFinish(true);
             }
+            else
+            {
+                UpdateStatus = UpdateStatus.Fail;
+                //uxStatusBar.Content = $"Process {procedureList[procedureIndex].Name} Failed";
+                uxStatusBar.Content = string.Format((string)Application.Current.FindResource("StatusBarFailed"), procedureList[procedureIndex].Name);
+            }
             CreateLogFile();
             ViewModel.IsUdatIng = false;
         }
@@ -482,13 +531,14 @@ namespace AwInitilizer
                 line.Inlines.Add(msg + "\n");
                 Span.SetForeground(line, isError ? Brushes.Red : Brushes.Green);
 
-                uxTerminal.Inlines.Add(line);
-                uxTerminalScroller.ScrollToEnd();
+                //uxTerminal.Inlines.Add(line);
+                //uxTerminalScroller.ScrollToEnd();
             });
+            Console.WriteLine(msg);
         }
         #endregion
 
-        private void LoadConfigBySystemID(SystemID systemID)
+        private bool LoadConfigBySystemID(SystemID systemID)
         {
             string settingRootFolder;
             try
@@ -502,28 +552,32 @@ namespace AwInitilizer
             }
             catch
             {
-                MessageBox.Show("Firmware root path ERROR");
-                return;
+                //HintDialog.ShowMessage("Firmware root path ERROR");
+                HintDialog.ShowMessage((string)Application.Current.FindResource("LoadConfigRootFolderNotfoundAlert"));
+                return false;
             }
 
             if (!Directory.Exists(settingRootFolder))
             {
-                MessageBox.Show("Firmware root path not exist");
-                return;
+                //HintDialog.ShowMessage("Firmware root path not exist");
+                HintDialog.ShowMessage((string)Application.Current.FindResource("LoadConfigFolderNotfoundAlert"));
+                return false;
             }
 
             string modelDirectoy = Path.Combine(settingRootFolder, systemID.ModelName.ToString());
             if (!Directory.Exists(modelDirectoy))
             {
-                MessageBox.Show("Model firmware root path not exist");
-                return;
+                //HintDialog.ShowMessage("Model firmware root path not exist");
+                HintDialog.ShowMessage((string)Application.Current.FindResource("LoadConfigModelFolderNotfoundAlert"));
+                return false;
             }
 
             string modelSeettingFilePath = Path.Combine(modelDirectoy, systemID.ModelName.ToString() + ".ini");
             if (!File.Exists(modelSeettingFilePath))
             {
-                MessageBox.Show("Model firmware setting not exist");
-                return;
+                //HintDialog.ShowMessage("Model firmware setting not exist");
+                HintDialog.ShowMessage((string)Application.Current.FindResource("LoadConfigModelInitNotfoundAlert"));
+                return false;
             }
 
             //check format
@@ -535,8 +589,9 @@ namespace AwInitilizer
             }
             catch
             {
-                MessageBox.Show("Setting file ERROR");
-                return;
+                //HintDialog.ShowMessage("Setting file ERROR");
+                HintDialog.ShowMessage((string)Application.Current.FindResource("LoadConfigModelInitFormatErrorAlert"));
+                return false;
             }
 
             if (CheckSettingConfig(System.IO.Path.GetDirectoryName(modelSeettingFilePath), ref setting))
@@ -558,6 +613,7 @@ namespace AwInitilizer
                 UpdateProcedure();
                 ViewModel.IsInputCheckpassed = CheckInputData();
             }
+            return true;
         }
 
         private void UpdateProcedure()
@@ -565,14 +621,17 @@ namespace AwInitilizer
             List<ProcedureBase> procedures = new List<ProcedureBase>();
 
             //init intilize procedure list
-            
+
+            //procedures.Add(new ButtonStatusCheckPorcedure());
             procedures.Add(new BasicInfoUpdateProcedure());
-            procedures.Add(new ButtonStatusCheckPorcedure());
             procedures.Add(new FourGenModuleCheckProcedure());
-            for (int firemwareIndex = 0; firemwareIndex < ViewModel.FirmwareUpdateModels.Count ; firemwareIndex++)
-            {
-                procedures.Add(new FirmwareUpdateProcedure(ViewModel.FirmwareUpdateModels[firemwareIndex]));
-            }
+            //for (int firemwareIndex = 0; firemwareIndex < ViewModel.FirmwareUpdateModels.Count ; firemwareIndex++)
+            //{
+            //    //procedures.Add(new FirmwareUpdateProcedure(ViewModel.FirmwareUpdateModels[firemwareIndex]));
+            //    procedures.Add(new FirmwareUploadProcedure(ViewModel.FirmwareUpdateModels[firemwareIndex]));
+            //}
+            procedures.Add(new FirmwareBundleUploadProcedure());
+            procedures.Add(new FirmwareCheckVersionProcedure());
             procedures.Add(new RestarttoIdelProcedure());
             procedures.Add(new VersionLogProcedure());
 
@@ -594,12 +653,14 @@ namespace AwInitilizer
 
             if (string.IsNullOrEmpty(setting.ModelName))
             {
-                MessageBox.Show("ModelName is requred");
+                //HintDialog.ShowMessage("ModelName is requred");
+                HintDialog.ShowMessage((string)Application.Current.FindResource("InitModelNameEmptyAlert"));
                 isCheckPassed = false;
             }
             else if(!ModelName.TryParse(setting.ModelName,out _))
             {
-                MessageBox.Show("ModelName format Error");
+                //HintDialog.ShowMessage("ModelName format Error");
+                HintDialog.ShowMessage((string)Application.Current.FindResource("InitModelNameErrorAlert"));
                 isCheckPassed = false;
             }
 
@@ -607,13 +668,15 @@ namespace AwInitilizer
             {
                 if (string.IsNullOrEmpty(setting.ICCID))
                 {
-                    MessageBox.Show("ICCID should not empty while IsSimInsert is set");
+                    //HintDialog.ShowMessage("ICCID should not empty while IsSimInsert is set");
+                    HintDialog.ShowMessage((string)Application.Current.FindResource("InitIccidEmptyAlert"));
                     isCheckPassed = false;
                 }
 
                 if (string.IsNullOrEmpty(setting.IMSI))
                 {
-                    MessageBox.Show("IMSI should not empty while IsSimInsert is set");
+                    //HintDialog.ShowMessage("IMSI should not empty while IsSimInsert is set");
+                    HintDialog.ShowMessage((string)Application.Current.FindResource("InitImsiEmptyAlert"));
                     isCheckPassed = false;
                 }
             }
@@ -629,20 +692,23 @@ namespace AwInitilizer
 
                     if(!isNoduleNameVaild)
                     {
-                        MessageBox.Show("Firmware module name should not empty");
+                        //HintDialog.ShowMessage("Firmware module name should not empty");
+                        HintDialog.ShowMessage((string)Application.Current.FindResource("InitFirmwareNameEmptyAlert"));
                         isCheckPassed = false;
                     }
                     if (isVersionVaild || isFileNameVaild)
                     {
                         if (!isVersionVaild)
                         {
-                            MessageBox.Show($"Version should not empty while {model.Module} firmware is set");
+                            //HintDialog.ShowMessage($"Version should not empty while {model.Module} firmware is set");
+                            HintDialog.ShowMessage(string.Format((string)Application.Current.FindResource("InitFirmwareVersionEmptyAlert"),model.Module));
                             isCheckPassed = false;
                         }
 
                         if (!isFileNameVaild)
                         {
-                            MessageBox.Show($"File name should not empty while {model.Module} version is set");
+                            //HintDialog.ShowMessage($"File name should not empty while {model.Module} version is set");
+                            HintDialog.ShowMessage(string.Format((string)Application.Current.FindResource("InitFirmwareFileEmptyAlert"), model.Module));
                             isCheckPassed = false;
                         }
 
@@ -652,7 +718,8 @@ namespace AwInitilizer
                             //check file exist
                             if (!File.Exists(filePath))
                             {
-                                MessageBox.Show($"{model.Module} Firemware file is missing");
+                                //HintDialog.ShowMessage($"{model.Module} Firemware file is missing");
+                                HintDialog.ShowMessage(string.Format((string)Application.Current.FindResource("InitFirmwareFileMissingAlert"), model.Module));
                                 isCheckPassed = false;
                             }
                             else
@@ -678,19 +745,22 @@ namespace AwInitilizer
                                             {
                                                 if (modelName.ToString() != setting.ModelName)
                                                 {
-                                                    MessageBox.Show($"{model.Module} Firemware and ModelName is Mismatched");
+                                                    //HintDialog.ShowMessage($"{model.Module} Firemware and ModelName is Mismatched");
+                                                    HintDialog.ShowMessage(string.Format((string)Application.Current.FindResource("InitFirmwareFileHeaderMismatchAlert"), model.Module));
                                                     isCheckPassed = false;
                                                 }
                                             }
                                             else
                                             {
-                                                MessageBox.Show($"{model.Module} Firemware header ERROR");
+                                                // HintDialog.ShowMessage($"{model.Module} Firemware header ERROR");
+                                                HintDialog.ShowMessage(string.Format((string)Application.Current.FindResource("InitFirmwareFileHeaderFormatAlert"), model.Module));
                                                 isCheckPassed = false;
                                             }
                                         }
                                         else
                                         {
-                                            MessageBox.Show($"{model.Module} Firemware header ERROR");
+                                            //HintDialog.ShowMessage($"{model.Module} Firemware header ERROR");
+                                            HintDialog.ShowMessage(string.Format((string)Application.Current.FindResource("InitFirmwareFileHeaderFormatAlert"), model.Module));
                                             isCheckPassed = false;
                                         }
 
@@ -699,20 +769,21 @@ namespace AwInitilizer
                                         //{
                                         //    if (!imgType.SequenceEqual(new byte[] { 0x10, 0x00, 0x00, 0x04, }))
                                         //    {
-                                        //        MessageBox.Show($"{model.Module} Firemware type ERROR");
+                                        //        HintDialog.ShowMessage($"{model.Module} Firemware type ERROR");
                                         //        isCheckPassed = false;
                                         //    }
                                         //}
                                         //else
                                         //{
-                                        //    MessageBox.Show($"{model.Module} Firemware header ERROR");
+                                        //    HintDialog.ShowMessage($"{model.Module} Firemware header ERROR");
                                         //    isCheckPassed = false;
                                         //}
                                     }
                                 }
                                 catch
                                 {
-                                    MessageBox.Show($"{model.Module} Firemware header ERROR");
+                                    //HintDialog.ShowMessage($"{model.Module} Firemware header ERROR");
+                                    HintDialog.ShowMessage(string.Format((string)Application.Current.FindResource("InitFirmwareFileHeaderFormatAlert"), model.Module));
                                     isCheckPassed = false;
                                 }
 
@@ -739,9 +810,23 @@ namespace AwInitilizer
         private void DisplayLogin()
         {
             LogoutTimer?.Stop();
+            ViewModel.UserID = "";
+            ViewModel.WorkOrder = "";
+
             var signinDialog = new SigninDialog();
-            signinDialog.Owner = this;
+            try
+            {
+                signinDialog.Owner = this;
+            }
+            catch
+            {
+
+            }
             signinDialog.ShowDialog();
+
+            SystemID.TryParse("DSWU601J0UW2PHD2045A004A0", out var systemID);
+            SystemIDScanReseived(systemID);
+
             if (signinDialog.DialogResult != true)
             {
                 App.Current.Shutdown();
@@ -762,16 +847,22 @@ namespace AwInitilizer
             if (ViewModel.IsUdatIng)
             {
                 logoutCheckCnt = 0;
+                LogoutTimer.Start();
+                Console.WriteLine("LogoutTimer_Tick reset");
                 return;
             }
-            if (++logoutCheckCnt > 10)
+            else if (++logoutCheckCnt > 10)
             {
                 logoutCheckCnt = 0;
                 DisplayLogin();
+
+                Console.WriteLine("LogoutTimer_Tick DisplayLogin");
             }
             else
             {
                 LogoutTimer.Start();
+
+                Console.WriteLine("LogoutTimer_Tick continue");
             }
         }
 
@@ -782,7 +873,7 @@ namespace AwInitilizer
 
         private void WorkOrder_TextChanged(object sender, TextChangedEventArgs e)
         {
-            ViewModel.IsInputCheckpassed = false;
+            //ViewModel.IsInputCheckpassed = false;
         }
 
         private void WorkOrder_KeyDown(object sender, KeyEventArgs e)
@@ -793,5 +884,35 @@ namespace AwInitilizer
                 SystemIDScanReseived(ViewModel.SystemID);
             }
         }
+
+        private void SetUpdateStatus(UpdateStatus status)
+        {
+            if(status == UpdateStatus.Idel)
+            {
+                uxStatusContainer.Background = new SolidColorBrush(Colors.White);
+                uxStatus.Foreground = new SolidColorBrush(Colors.Black);
+                uxStatus.Content = (string)Application.Current.FindResource("StatusIdel");//"Idel";
+                uxStatusBar.Content = "";
+            }
+            else if (status == UpdateStatus.Updating)
+            {
+                uxStatusContainer.Background = new SolidColorBrush(Colors.SkyBlue);
+                uxStatus.Foreground = new SolidColorBrush(Colors.Black);
+                uxStatus.Content = (string)Application.Current.FindResource("StatusUpdating");//"Updating";
+            }
+            else if (status == UpdateStatus.Sucess)
+            {
+                uxStatusContainer.Background = new SolidColorBrush(Colors.Green);
+                uxStatus.Foreground = new SolidColorBrush(Colors.White);
+                uxStatus.Content = (string)Application.Current.FindResource("StatusSuccess");//"Success";
+                uxStatusBar.Content = "";
+            }
+            else if (status == UpdateStatus.Fail)
+            {
+                uxStatusContainer.Background = new SolidColorBrush(Colors.Red);
+                uxStatus.Foreground = new SolidColorBrush(Colors.White);
+                uxStatus.Content = (string)Application.Current.FindResource("StatusFail");//"Fail";
+            }
+        }
     }
 }

+ 8 - 1
AwInitilizer/Model/SystemID.cs

@@ -139,7 +139,7 @@ namespace AwInitilizer.Model
 
         public enum EVSE_InputConfig
         {
-            Y, D, L, S, W, T, E , N0, N1, N2, N3, N4, N5, N6, N7, N8, N9,
+            Y, D, L, S, W, T, E , N0, N1, N2, N3, N4, N5, N6, N7, N8, N9, A
         }
 
         public enum EVSE_SafetyReg
@@ -169,6 +169,7 @@ namespace AwInitilizer.Model
             Eth4G,
             EthBle,
             EthWiFi4G,
+            WiFi
         }
 
         public EVSE_TYPE Type { get; private set; }
@@ -318,6 +319,9 @@ namespace AwInitilizer.Model
                 case "9":
                     model.InputConfig = EVSE_InputConfig.N9;
                     break;
+                case "A":
+                    model.InputConfig = EVSE_InputConfig.N9;
+                    break;
                 default:
                     return false;
             }
@@ -448,6 +452,9 @@ namespace AwInitilizer.Model
                 case "A":
                     model.Network = EVSE_network.EthWiFi4G;
                     break;
+                case "F":
+                    model.Network = EVSE_network.WiFi;
+                    break;
                 default:
                     return false;
             }

+ 20 - 4
AwInitilizer/Procedure/ButtonStatusCheckPorcedure.cs

@@ -35,10 +35,10 @@ namespace AwInitilizer.Procedure
             int pollinfCnt = 0;
             for (pollinfCnt = 0; pollinfCnt < 14; pollinfCnt++)
             {
-                await Task.Delay(TimeSpan.FromSeconds(30));
                 response = await GetButtonStatus();
                 if (response!=null)
                     break;
+                await Task.Delay(TimeSpan.FromSeconds(30));
             }
 
             //timeout
@@ -49,7 +49,15 @@ namespace AwInitilizer.Procedure
             }
 
             //stage 1 - unpress all
-            ShowDialog("Please make sure All button is Unpressed\nPress Ok while complete", "Starting Button test", "OK","", cancelAble: true);
+            //ShowDialog(
+            //    "Please make sure All button is Unpressed\nPress Ok while complete",
+            //    "Starting Button test",
+            //    "OK","", cancelAble: true);
+            ShowDialog(
+                (string)Application.Current.FindResource("BtnPressUnpressHint"),
+                (string)Application.Current.FindResource("BtnPressHintTitle"),
+                (string)Application.Current.FindResource("Confirm"),
+                "", cancelAble: true);
             ButtonStatus status = await GetButtonStatus();
 
             if (status == null)
@@ -107,29 +115,37 @@ namespace AwInitilizer.Procedure
             ButtonStatus pressStatus = null;
             for (int testType = 0; testType < 3; testType++)
             {
-                string btn,imgUrl;
+                string btn, btnLang, imgUrl;
                 switch (testType)
                 {
                     case 0:
                         btn = "Green Button";
+                        btnLang = (string)Application.Current.FindResource("BtnPressGreenBtn");
                         imgUrl = "pack://application:,,,/AwInitilizer;component/Image/Green.png";
                         break;
                     case 1:
                         btn = "Blue Button";
+                        btnLang = (string)Application.Current.FindResource("BtnPressBlueBtn");
                         imgUrl = "pack://application:,,,/AwInitilizer;component/Image/Blue.png";
                         break;
                     case 2:
                         btn = "EmergencyButton";
+                        btnLang = (string)Application.Current.FindResource("BtnPressEmergencyBtn");
                         imgUrl = "pack://application:,,,/AwInitilizer;component/Image/Emergency.png";
                         break;
                     default:
                         btn = "";
+                        btnLang = "";
                         imgUrl = null;
                         break;
                 };
 
                 //MessageBox.Show($"press {btn}");
-                ShowDialog($"PRESS {btn.ToUpper()}", "Button press test", "", imgUrl, cancelAble: false);
+                //ShowDialog($"PRESS {btn.ToUpper()}", "Button press test", "", imgUrl, cancelAble: false);
+                ShowDialog(
+                    string.Format((string)Application.Current.FindResource("BtnPressPressHint"), btnLang),
+                    (string)Application.Current.FindResource("BtnPressHintTitle"),
+                    "", imgUrl, cancelAble: false); ;
 
                 //retry 20 times, 20*0.5 = 10 seconds 
                 int testCnt;

+ 164 - 0
AwInitilizer/Procedure/FirmwareBundleUploadProcedure.cs

@@ -0,0 +1,164 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using AwInitilizer.Model;
+using AwInitilizer.Assist;
+using System.Collections.Specialized;
+using System.Globalization;
+using System.Net;
+using System.Web;
+using System.IO;
+
+namespace AwInitilizer.Procedure
+{
+    public class FirmwareBundleUploadProcedure : ProcedureBase
+    {
+        public FirmwareBundleUploadProcedure() : base()
+        {
+            Name = string.Format("Firmware Upload");
+            Content = string.Format("Upload all Firemware");
+        }
+
+        internal override async Task<bool> Run()
+        {
+            //wait restart
+            Logger.Print("Waiting restart..");
+
+            bool response = false;
+            int pollingCnt = 0;
+            for (pollingCnt = 0; pollingCnt < 56; pollingCnt++)
+            {
+                await Task.Delay(TimeSpan.FromSeconds(15));
+                response = await ChekCsuBootCompelete();
+                if (response)
+                    break;
+            }
+
+            //timeout
+            if (pollingCnt >= 56)
+            {
+                Logger.Print("Wait restart timeout", isError: true);
+                InfoLog += "Wait restart timeout\n";
+                return false;
+            }
+
+            //upload firmware
+            var updateList = UpdateData.FirmwareUpdateModels;
+            //open all file stream
+            //List<FileStream> firmwareFileStream = new List<FileStream>();
+            List<UploadFile> UploadFileList = new List<UploadFile>();
+            try
+            {
+                for(int modelIndex = 0;modelIndex < updateList.Count;modelIndex++) //foreach (var model in updateList)
+                {
+                    var model = updateList[modelIndex];
+                    var stream = File.Open(model.FirmwareFileName, FileMode.Open);
+                    var uploadFile = new UploadFile()
+                    {
+                        Name = string.Format("files[]", modelIndex + 1),
+                        Filename = Path.GetFileName(model.FirmwareFileName),
+                        Stream = stream
+                    };
+                    UploadFileList.Add(uploadFile);
+                }
+            }
+            catch (Exception e)
+            {
+                InfoLog += $"create file stream failed";
+                LogPair.Add($"FirmwareUpload", "0");
+                return false;
+            }
+            //upload
+            try
+            {
+                var uploadResult = await UploadFiles(
+                $"https://{ServerIpAddress}/upgrade_iso_action.php",
+                files: UploadFileList,
+                new NameValueCollection() {
+                        {"fw_tag","iso" }
+                }
+                );
+
+                var responseStr = Encoding.ASCII.GetString(uploadResult).ToLower();
+                InfoLog += $"get firmware update response {responseStr}\n";
+                if (responseStr.Contains("file is uploaded"))
+                    return true;
+                return false;
+            }
+            catch
+            {
+                InfoLog += $"file upload failed";
+                LogPair.Add($"FirmwareUpload", "0");
+            }
+            LogPair.Add($"FirmwareUpload", "1");
+            //release all
+            foreach (var uploadFile in UploadFileList)
+            {
+                if(uploadFile!=null && uploadFile.Stream!=null)
+                {
+                    uploadFile.Stream.Close();
+                }
+            }
+            return true;
+        }
+
+        public async Task<byte[]> UploadFiles(string address, IEnumerable<UploadFile> files, NameValueCollection values)
+        {
+            var request = (HttpWebRequest)HttpWebRequest.Create(address);
+            //request.Timeout = 10 * 1000;
+            request.KeepAlive = true;
+            request.Accept = "*/*";
+            request.Method = "POST";
+            request.Referer = address;
+            request.Expect = "";
+            var boundary = "---------------------------" + DateTime.Now.Ticks.ToString("x", NumberFormatInfo.InvariantInfo);
+            request.ContentType = "multipart/form-data; boundary=" + boundary;
+            boundary = "--" + boundary;
+            string sendString = "";
+
+            using (var requestStream = request.GetRequestStream())
+            {
+                // Write the values
+                foreach (string name in values.Keys)
+                {
+                    var buffer = Encoding.ASCII.GetBytes(boundary + Environment.NewLine);
+                    requestStream.Write(buffer, 0, buffer.Length);
+                    buffer = Encoding.ASCII.GetBytes(string.Format("Content-Disposition: form-data; name=\"{0}\"{1}{1}", name, Environment.NewLine));
+                    requestStream.Write(buffer, 0, buffer.Length);
+                    buffer = Encoding.ASCII.GetBytes(values[name] + Environment.NewLine);
+                    requestStream.Write(buffer, 0, buffer.Length);
+                }
+
+                // Write the files
+                foreach (var file in files)
+                {
+                    var buffer = Encoding.ASCII.GetBytes(boundary + Environment.NewLine);
+                    requestStream.Write(buffer, 0, buffer.Length);
+                    buffer = Encoding.UTF8.GetBytes(string.Format("Content-Disposition: form-data; name=\"{0}\"; filename=\"{1}\"{2}", file.Name, file.Filename, Environment.NewLine));
+                    requestStream.Write(buffer, 0, buffer.Length);
+                    var ctype = MimeMapping.GetMimeMapping(file.Filename);
+                    buffer = Encoding.ASCII.GetBytes(string.Format("Content-Type: {0}{1}{1}", MimeMapping.GetMimeMapping(file.Filename), Environment.NewLine));
+                    requestStream.Write(buffer, 0, buffer.Length);
+
+                    file.Stream.CopyTo(requestStream);
+
+                    buffer = Encoding.ASCII.GetBytes(Environment.NewLine);
+                    requestStream.Write(buffer, 0, buffer.Length);
+                }
+
+                var boundaryBuffer = Encoding.ASCII.GetBytes(boundary + "--");
+                requestStream.Write(boundaryBuffer, 0, boundaryBuffer.Length);
+            }
+
+            using (var response = await request.GetResponseAsync())
+            using (var responseStream = response.GetResponseStream())
+            using (var stream = new MemoryStream())
+            {
+                responseStream.CopyTo(stream);
+                return stream.ToArray();
+            }
+        }
+    }
+}

+ 161 - 0
AwInitilizer/Procedure/FirmwareCheckVersionProcedure.cs

@@ -0,0 +1,161 @@
+
+using AwInitilizer.Assist;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AwInitilizer.Procedure
+{
+    public class FirmwareCheckVersionProcedure : ProcedureBase
+    {
+        public FirmwareCheckVersionProcedure() : base()
+        {
+            Name = "Firmware Version Check";
+            Content = "Wait restart and check firmware versions";
+        }
+
+        internal override async Task<bool> Run()
+        {
+            //wait restart
+            Logger.Print("Waiting restart..");
+
+            bool response = false;
+            int pollingCnt = 0;
+            await Task.Delay(TimeSpan.FromMinutes(2));
+            for (pollingCnt = 0; pollingCnt < 56; pollingCnt++)
+            {
+                await Task.Delay(TimeSpan.FromSeconds(15));
+                response = await ChekCsuBootCompelete();
+                if (response)
+                    break;
+            }
+
+            //timeout
+            if (pollingCnt >= 56)
+            {
+                Logger.Print("Wait restart timeout", isError: true);
+                InfoLog += "Wait restart timeout\n";
+                return false;
+            }
+
+            //get version 
+            var versionPair = await GetVersion();
+            var updatedList = UpdateData.FirmwareUpdateModels;
+
+            //check all version
+            foreach (var model in updatedList)
+            {
+                if (string.IsNullOrEmpty(model.Module) ||
+                    string.IsNullOrEmpty(model.Version))
+                {
+                    continue;
+                }
+
+                if(versionPair.Keys.Contains(model.Module))
+                {
+                    bool isVersionMatched = false;
+                    if (model.Module == "CsuRootFsFwRev")
+                    {
+                        isVersionMatched = versionPair[model.Module].StartsWith(model.Version);
+                    }
+                    else
+                    {
+                        isVersionMatched = versionPair[model.Module] == model.Version;
+                    }
+
+                    if (isVersionMatched)
+                    {
+                        Logger.Print($"Model {model.Module} updated", isError: false);
+                        InfoLog += $"{Name}:updated success\n";
+                        LogPair.Add($"{model.Module}VersionCheck", "1");
+                    }
+                    else
+                    {
+                        Logger.Print($"Model {model.Module} version mismatch", isError: true);
+                        InfoLog += $"{model.Module}:Updated Version mismatched\n";
+                        LogPair.Add($"{model.Module}VersionCheck", "0");
+                        return false;
+                    }
+                }
+                else
+                {
+                    //model name not found
+                    Logger.Print($"Model {model.Module} version not found", isError: true);
+                    InfoLog += $"Model {model.Module} version not found\n";
+                    LogPair.Add($"{model.Module}VersionCheck", "0");
+                    return false;
+                }
+            }
+
+            return true;
+        }
+
+        internal async Task<Dictionary<string, string>> GetVersion(bool isConnectTest = false)
+        {
+            try
+            {
+                using (WebClientTimeout webClient = new WebClientTimeout())
+                {
+                    NameValueCollection parameters = new NameValueCollection();
+                    parameters.Add("opt", "1");
+                    webClient.QueryString = parameters;
+
+                    using (Stream stream = await webClient.OpenReadTaskAsync($"https://{ServerIpAddress}/get_query_action.php"))
+                    // 使用 StreamReader 讀取 stream 內的字元
+                    using (StreamReader reader = new StreamReader(stream))
+                    {
+                        // 將 StreamReader 所讀到的字元轉為 string
+                        string request = reader.ReadToEnd();
+                        InfoLog += $"get version response:{request}\n";
+                        var values = JsonConvert.DeserializeObject<Dictionary<string, object>>(request);
+
+                        var toReturn = new Dictionary<string, string>();
+                        foreach (var pair in values)
+                        {
+                            if (pair.Value is string v)
+                            {
+                                toReturn.Add(pair.Key, v);
+                            }
+                            else if (pair.Value is Newtonsoft.Json.Linq.JArray a)
+                            {
+                                try
+                                {
+                                    var versionList = JsonConvert.DeserializeObject<List<string>>(a.ToString());
+                                    for (int index = 0; index < versionList.Count; index++)
+                                    {
+                                        toReturn.Add(string.Format("{0}{1}", pair.Key, index), versionList[index]);
+                                    }
+                                }
+                                catch
+                                {
+
+                                }
+                            }
+                        }
+
+                        return toReturn;
+                    }
+                }
+            }
+            catch (Exception e)
+            {
+                if (!isConnectTest)
+                {
+                    Logger.Print("Get Version Failed", isError: true);
+                    Logger.Print(e.Message + "", isError: true);
+
+                    InfoLog += "Get Version Failed\n";
+                    InfoLog += e.Message;
+                    InfoLog += "\n";
+                }
+
+                return null;
+            }
+        }
+    }
+}

+ 15 - 4
AwInitilizer/Procedure/FirmwareUpdateProcedure.cs

@@ -62,16 +62,17 @@ namespace AwInitilizer.Procedure
 
                 bool response = false;
                 int pollinfCnt = 0;
-                for (pollinfCnt = 0; pollinfCnt < 14; pollinfCnt++)
+                await Task.Delay(TimeSpan.FromMinutes(2));
+                for (pollinfCnt = 0; pollinfCnt < 28; pollinfCnt++)
                 {
-                    await Task.Delay(TimeSpan.FromSeconds(30));
+                    await Task.Delay(TimeSpan.FromSeconds(15));
                     response = await ChekCsuBootCompelete();
                     if (response)
                         break;
                 }
 
                 //timeout
-                if(pollinfCnt>=14)
+                if(pollinfCnt>=28)
                 {
                     Logger.Print("Wait restart timeout",isError:true);
                     return false;
@@ -92,7 +93,16 @@ namespace AwInitilizer.Procedure
                 return false;
             }
             InfoLog += $"Get updated version : {updatedVersion}\n";
-            if (updatedVersion != Version)
+            bool isVersionMatched = false;
+            if(module== "CsuRootFsFwRev")
+            {
+                isVersionMatched = updatedVersion.StartsWith(Version);
+            }
+            else
+            {
+                isVersionMatched = updatedVersion == Version;
+            }
+            if (isVersionMatched)
             {
                 InfoLog += $"{Name}:Updated Version mismatched\n";
                 Logger.Print($"{Name}:Updated Version mismatched", isError: true);
@@ -251,6 +261,7 @@ namespace AwInitilizer.Procedure
         public async Task<byte[]> UploadFiles(string address, IEnumerable<UploadFile> files, NameValueCollection values)
         {
             var request = (HttpWebRequest) HttpWebRequest.Create(address);
+            //request.Timeout = 10 * 1000;
             request.KeepAlive = true;
             request.Accept = "*/*";
             request.Method = "POST";

+ 167 - 0
AwInitilizer/Procedure/FirmwareUploadProcedure.cs

@@ -0,0 +1,167 @@
+using AwInitilizer.Model;
+using System;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Text;
+using System.Threading.Tasks;
+using System.Web;
+
+namespace AwInitilizer.Procedure
+{
+    public class FirmwareUploadProcedure : ProcedureBase
+    {
+        internal string Version;
+        internal string fileName;
+        internal string module;
+
+        private FirmwareUpdateModel _model;
+
+        public FirmwareUploadProcedure(FirmwareUpdateModel model) : base()
+        {
+            _model = model;
+
+            Name = string.Format("Firmware {0} upload", model.Module);
+            Content = string.Format("Update {0} Firemware", model.Module);
+
+            Version = model.Version;
+            fileName = model.FirmwareFileName;
+            module = model.Module;
+        }
+
+
+        internal override async Task<bool> Run()
+        {
+            Logger.Print("Firmware Uploading...");
+            var uploadResult = await Uploadfirmware(fileName);
+            LogPair.Add($"{module}Upload", uploadResult?"1":"0");
+            return uploadResult;
+        }
+
+        internal async Task<bool> Uploadfirmware(string fileName)
+        {
+            try
+            {
+                //using (var stream = File.Open(fileName, FileMode.Open))
+                //{
+                //    UploadFileAsync(
+                //    new NameValueCollection()
+                //    {
+                //        {"fw_tag","iso" }
+                //    },
+                //    new UploadFile()
+                //    {
+                //        Name = "file",
+                //        Filename = Path.GetFileName(fileName),
+                //        Stream = stream
+                //    }
+                //    );
+                //}
+
+                //return true;
+                using (var stream = File.Open(fileName, FileMode.Open))
+                {
+                    var response = await UploadFiles(
+                    $"https://{ServerIpAddress}/upgrade_iso_action.php",
+                    new List<UploadFile>() {
+                        new UploadFile()
+                        {
+                            Name="file",
+                            Filename= Path.GetFileName(fileName),
+                            Stream = stream
+                        }
+                    },
+                    new NameValueCollection() {
+                        {"fw_tag","iso" }
+                    }
+                    );
+
+                    var responseStr = Encoding.ASCII.GetString(response).ToLower();
+                    InfoLog += $"get firmware update response {responseStr}\n";
+                    if (responseStr.Contains("file is uploaded"))
+                        return true;
+                    return false;
+                }
+                return true;
+                //using (WebClient webClient = new WebClient())
+                //{
+                //    NameValueCollection parameters = new NameValueCollection();
+                //    parameters.Add("fw_tag", "iso");
+                //    webClient.QueryString = parameters;
+
+                //    var responseBytes = await webClient.UploadFileTaskAsync($"https://{ServerIpAddress}/upgrade_iso_action.php", fileName);
+                //    string responseString = Encoding.ASCII.GetString(responseBytes);
+                //    return true;
+                //}
+            }
+            catch (Exception e)
+            {
+                Logger.Print("Upload Firmware Failed", isError: true);
+                Logger.Print(e.Message + "", isError: true);
+
+                InfoLog += "Upload Firmware Failed\n";
+                InfoLog += e.Message;
+                InfoLog += "\n";
+
+                return false;
+            }
+        }
+
+        public async Task<byte[]> UploadFiles(string address, IEnumerable<UploadFile> files, NameValueCollection values)
+        {
+            var request = (HttpWebRequest)HttpWebRequest.Create(address);
+            //request.Timeout = 10 * 1000;
+            request.KeepAlive = true;
+            request.Accept = "*/*";
+            request.Method = "POST";
+            request.Referer = address;
+            request.Expect = "";
+            var boundary = "---------------------------" + DateTime.Now.Ticks.ToString("x", NumberFormatInfo.InvariantInfo);
+            request.ContentType = "multipart/form-data; boundary=" + boundary;
+            boundary = "--" + boundary;
+
+            using (var requestStream = request.GetRequestStream())
+            {
+                // Write the values
+                foreach (string name in values.Keys)
+                {
+                    var buffer = Encoding.ASCII.GetBytes(boundary + Environment.NewLine);
+                    requestStream.Write(buffer, 0, buffer.Length);
+                    buffer = Encoding.ASCII.GetBytes(string.Format("Content-Disposition: form-data; name=\"{0}\"{1}{1}", name, Environment.NewLine));
+                    requestStream.Write(buffer, 0, buffer.Length);
+                    buffer = Encoding.UTF8.GetBytes(values[name] + Environment.NewLine);
+                    requestStream.Write(buffer, 0, buffer.Length);
+                }
+
+                // Write the files
+                foreach (var file in files)
+                {
+                    var buffer = Encoding.ASCII.GetBytes(boundary + Environment.NewLine);
+                    requestStream.Write(buffer, 0, buffer.Length);
+                    buffer = Encoding.UTF8.GetBytes(string.Format("Content-Disposition: form-data; name=\"{0}\"; filename=\"{1}\"{2}", file.Name, file.Filename, Environment.NewLine));
+                    requestStream.Write(buffer, 0, buffer.Length);
+                    var ctype = MimeMapping.GetMimeMapping(file.Filename);
+                    buffer = Encoding.ASCII.GetBytes(string.Format("Content-Type: {0}{1}{1}", MimeMapping.GetMimeMapping(file.Filename), Environment.NewLine));
+                    requestStream.Write(buffer, 0, buffer.Length);
+                    file.Stream.CopyTo(requestStream);
+                    buffer = Encoding.ASCII.GetBytes(Environment.NewLine);
+                    requestStream.Write(buffer, 0, buffer.Length);
+                }
+
+                var boundaryBuffer = Encoding.ASCII.GetBytes(boundary + "--");
+                requestStream.Write(boundaryBuffer, 0, boundaryBuffer.Length);
+            }
+
+            using (var response = await request.GetResponseAsync())
+            using (var responseStream = response.GetResponseStream())
+            using (var stream = new MemoryStream())
+            {
+                responseStream.CopyTo(stream);
+                return stream.ToArray();
+            }
+        }
+    }
+}

+ 16 - 2
AwInitilizer/Procedure/FourGenModuleCheckProcedure.cs

@@ -61,6 +61,9 @@ namespace AwInitilizer.Procedure
             else
             {
                 LogPair.Add("SimStatus", simstatus.IsInstalled? "1":"0");
+                InfoLog += $"iccidBytes,{BitConverter.ToString(simstatus.ICCID).Replace("-","")}\n";
+                InfoLog += $"imsiBytes,{BitConverter.ToString(simstatus.IMSI).Replace("-", "")}\n";
+
                 if (simstatus.IsInstalled != UpdateData.IsSimInsert)
                 {
                     Logger.Print("sim install status not matched", isError: true);
@@ -70,8 +73,17 @@ namespace AwInitilizer.Procedure
                 {
                     if (simstatus.IsInstalled)
                     {
-                        var ICCIDstring = Encoding.ASCII.GetString(simstatus.ICCID);
-                        var IMSIstring = Encoding.ASCII.GetString(simstatus.IMSI);
+                        var iccidByteList = simstatus.ICCID.ToList();
+                        iccidByteList.RemoveAll(x => x == 0x00);
+                        var iccidBytes = iccidByteList.ToArray();
+
+                        var imsiByteList = simstatus.IMSI.ToList();
+                        imsiByteList.RemoveAll(x => x == 0x00);
+                        var imsiBytes = imsiByteList.ToArray();
+
+
+                        var ICCIDstring = Encoding.ASCII.GetString(iccidBytes).Trim();
+                        var IMSIstring = Encoding.ASCII.GetString(imsiBytes).Trim();
 
                         LogPair.Add("SimICCID", ICCIDstring);
                         LogPair.Add("SimIMSI", IMSIstring);
@@ -81,12 +93,14 @@ namespace AwInitilizer.Procedure
                         if (ICCIDstring != UpdateData.ICCID)
                         {
                             Logger.Print("sim card ICCID not matched", isError: true);
+                            InfoLog += $"Sim card ICCID not matched,{ICCIDstring}:{UpdateData.ICCID}\n";
                             return false;
                         }
 
                         if (IMSIstring != UpdateData.IMSI)
                         {
                             Logger.Print("sim card IMSI not matched", isError: true);
+                            InfoLog += $"Sim card IMSI not matched,{IMSIstring}:{UpdateData.IMSI}\n";
                             return false;
                         }
                     }

+ 1 - 1
AwInitilizer/Procedure/ProcedureBase.cs

@@ -83,7 +83,7 @@ namespace AwInitilizer.Procedure
 
         internal async Task<bool> ChekCsuBootCompelete()
         {
-            await Task.Delay(TimeSpan.FromMinutes(2));
+            //await Task.Delay(TimeSpan.FromMinutes(2));
             try
             {
                 using (WebClientTimeout webClient = new WebClientTimeout())

+ 15 - 1
AwInitilizer/Procedure/VersionLogProcedure.cs

@@ -12,6 +12,17 @@ namespace AwInitilizer.Procedure
 {
     public class VersionLogProcedure : ProcedureBase
     {
+        private List<string> excludeHeaderList = new List<string>() { 
+            "FactoryConfiguration", 
+            "AuxPower5V", 
+            "AuxPower12V",
+            "AuxPower24V", 
+            "AuxPower48V", 
+            "CsuHwRev", 
+            "FirmwareUpdate", 
+            "FanModuleHwRev", 
+            "RelayModuleHwRev" };
+
         public VersionLogProcedure() : base()
         {
             Name = "Version Logger";
@@ -25,7 +36,10 @@ namespace AwInitilizer.Procedure
             {
                 foreach (var infoPair in versionPair)
                 {
-                    LogPair.Add(infoPair.Key, infoPair.Value);
+                    if (!excludeHeaderList.Contains(infoPair.Key))
+                    {
+                        LogPair.Add(infoPair.Key, infoPair.Value);
+                    }
                 }
                 return true;
             }

+ 2 - 2
AwInitilizer/Properties/Settings.Designer.cs

@@ -12,7 +12,7 @@ namespace AwInitilizer.Properties {
     
     
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.7.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")]
     internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
         
         private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -25,7 +25,7 @@ namespace AwInitilizer.Properties {
         
         [global::System.Configuration.UserScopedSettingAttribute()]
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("./")]
+        [global::System.Configuration.DefaultSettingValueAttribute("./Firmware")]
         public string FirmwareRoot {
             get {
                 return ((string)(this["FirmwareRoot"]));

+ 1 - 1
AwInitilizer/Properties/Settings.settings

@@ -3,7 +3,7 @@
   <Profiles />
   <Settings>
     <Setting Name="FirmwareRoot" Type="System.String" Scope="User">
-      <Value Profile="(Default)">./</Value>
+      <Value Profile="(Default)">./Firmware</Value>
     </Setting>
   </Settings>
 </SettingsFile>

+ 12 - 11
AwInitilizer/SigninDialog.xaml

@@ -5,40 +5,41 @@
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:local="clr-namespace:AwInitilizer"
         mc:Ignorable="d"
-        Title="Signin" Height="300" Width="400"
+        Title="Signin" Height="600" Width="800"
         WindowStyle="None"
         ResizeMode="NoResize"
         WindowStartupLocation="CenterOwner"
-        Topmost="True">
+        Topmost="True"
+        FontSize="36">
     <Border BorderBrush="Gray" BorderThickness="2">
         <Grid>
             <Grid.RowDefinitions>
-                <RowDefinition Height="30"/>
+                <RowDefinition Height="60"/>
                 <RowDefinition Height="*"/>
             </Grid.RowDefinitions>
 
             <Grid Grid.Row="0" Background="Gray">
-                <Label x:Name="uxTitle" Content="Message" Foreground="White"/>
+                <Label x:Name="uxTitle" Content="{StaticResource SigninDialogTitle}" Foreground="White"/>
             </Grid>
 
             <Grid Grid.Row="1">
                 <StackPanel Orientation="Vertical" VerticalAlignment="Center" >
                     <StackPanel Orientation="Vertical" VerticalAlignment="Center" >
-                        <Label Foreground="Black" Content="Enter ID" VerticalAlignment="Center" HorizontalAlignment="Center"/>
+                        <Label Foreground="Black" Content="{StaticResource SigninDialogEnterIDHint}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                         <Rectangle Height="10"/>
-                        <TextBox x:Name="uxIdBox" Margin="10" Height="20" TextAlignment="Center"/>
+                        <TextBox x:Name="uxIdBox" Margin="10" Height="60" TextAlignment="Center"/>
                     </StackPanel>
                     <StackPanel Orientation="Vertical" VerticalAlignment="Center" >
-                        <Label Foreground="Black" Content="Enter WorkOrder" VerticalAlignment="Center" HorizontalAlignment="Center"/>
+                        <Label Foreground="Black" Content="{StaticResource SigninDialogEnterWOHint}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                         <Rectangle Height="10"/>
-                        <TextBox x:Name="uxWorkOrderBox" Margin="10" Height="20" TextAlignment="Center"/>
+                        <TextBox x:Name="uxWorkOrderBox" Margin="10" Height="60" TextAlignment="Center"/>
                     </StackPanel>
 
                     <Label x:Name="uxErrmsg" Content="error" Foreground="Red" Visibility="Hidden" HorizontalAlignment="Center"/>
                     <Rectangle Height="10"/>
-                    <Grid x:Name="uxCancelContainer" Grid.Row="2" Height="30">
-                        <Button  HorizontalAlignment="Center" VerticalAlignment="Center" Height="30" Width="100" Click="OK_Pressed">
-                            <Label x:Name="uxBtnText" Content="OK"/>
+                    <Grid x:Name="uxCancelContainer" Grid.Row="2" Height="60">
+                        <Button  HorizontalAlignment="Center" VerticalAlignment="Center" Height="60" Width="150" Click="OK_Pressed">
+                            <Label x:Name="uxBtnText" Content="{StaticResource Confirm}"/>
                         </Button>
                     </Grid>
                 </StackPanel>

+ 12 - 4
AwInitilizer/SigninDialog.xaml.cs

@@ -41,7 +41,7 @@ namespace AwInitilizer
             {
                 if (string.IsNullOrEmpty(id) || id.StartsWith("NG"))
                 {
-                    uxErrmsg.Content = "ID Error";
+                    uxErrmsg.Content = (string)Application.Current.FindResource("SigninDialogEnterIDError");
                     uxErrmsg.Visibility = Visibility.Visible;
                     return;
                 }
@@ -50,7 +50,15 @@ namespace AwInitilizer
             }
             else
             {
-                uxErrmsg.Content = "ID Error";
+                if (id.StartsWith(idBackup))
+                {
+                    //data not changed
+                    uxErrmsg.Content = (string)Application.Current.FindResource("SigninDialogNoResponseError");// "ID Error";
+                }
+                else
+                {
+                    uxErrmsg.Content = (string)Application.Current.FindResource("SigninDialogEnterIDError");// "ID Error";
+                }
                 uxErrmsg.Visibility = Visibility.Visible;
                 return;
             }
@@ -62,7 +70,7 @@ namespace AwInitilizer
                 {
                     if (string.IsNullOrEmpty(workOrder) || workOrder.StartsWith("NG"))
                     {
-                        uxErrmsg.Content = "WorkOrder Error";
+                        uxErrmsg.Content = (string)Application.Current.FindResource("SigninDialogEnterWOError");// "WorkOrder Error";
                         uxErrmsg.Visibility = Visibility.Visible;
                         return;
                     }
@@ -71,7 +79,7 @@ namespace AwInitilizer
                 }
                 else
                 {
-                    uxErrmsg.Content = "WorkOrder Error";
+                    uxErrmsg.Content = (string)Application.Current.FindResource("SigninDialogEnterWOError");
                     uxErrmsg.Visibility = Visibility.Visible;
                     return;
                 }

+ 165 - 13
AwInitlizerInstaller/AwInitlizerInstaller.vdproj

@@ -15,38 +15,68 @@
     {
         "Entry"
         {
-        "MsmKey" = "8:_67ED0F9CA2B2410084704C63C8FB5CE2"
+        "MsmKey" = "8:_0E1A8853BFD745B48324E1D0B8A6FACE"
+        "OwnerKey" = "8:_UNDEFINED"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
+        "MsmKey" = "8:_0FA1000DB6E747B099DBBACCBBD5DCEA"
         "OwnerKey" = "8:_UNDEFINED"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
         "MsmKey" = "8:_757BA0BD19C3D246BA621DB64DE2384D"
-        "OwnerKey" = "8:_67ED0F9CA2B2410084704C63C8FB5CE2"
+        "OwnerKey" = "8:_DAA98DDE772D47D1A3A47A8277D61590"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
         "MsmKey" = "8:_78ADCBE0D92EA001CDA0D5ECE8D69FA4"
-        "OwnerKey" = "8:_67ED0F9CA2B2410084704C63C8FB5CE2"
+        "OwnerKey" = "8:_DAA98DDE772D47D1A3A47A8277D61590"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
+        "MsmKey" = "8:_9190A32435564C0AA37658F1C98CE7D4"
+        "OwnerKey" = "8:_UNDEFINED"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
+        "MsmKey" = "8:_C9BC5A526B0440DCB63705909B3D2F7C"
+        "OwnerKey" = "8:_UNDEFINED"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
+        "MsmKey" = "8:_DAA98DDE772D47D1A3A47A8277D61590"
+        "OwnerKey" = "8:_UNDEFINED"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
+        "MsmKey" = "8:_FFF37EF16AF4429F82201548482AE4A6"
+        "OwnerKey" = "8:_UNDEFINED"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
         "MsmKey" = "8:_UNDEFINED"
-        "OwnerKey" = "8:_67ED0F9CA2B2410084704C63C8FB5CE2"
+        "OwnerKey" = "8:_757BA0BD19C3D246BA621DB64DE2384D"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
         "MsmKey" = "8:_UNDEFINED"
-        "OwnerKey" = "8:_78ADCBE0D92EA001CDA0D5ECE8D69FA4"
+        "OwnerKey" = "8:_DAA98DDE772D47D1A3A47A8277D61590"
         "MsmSig" = "8:_UNDEFINED"
         }
         "Entry"
         {
         "MsmKey" = "8:_UNDEFINED"
-        "OwnerKey" = "8:_757BA0BD19C3D246BA621DB64DE2384D"
+        "OwnerKey" = "8:_78ADCBE0D92EA001CDA0D5ECE8D69FA4"
         "MsmSig" = "8:_UNDEFINED"
         }
     }
@@ -156,7 +186,7 @@
                 {
                 "Name" = "8:.NET Framework"
                 "Message" = "8:[VSDNETMSG]"
-                "FrameworkVersion" = "8:.NETFramework,Version=v4.7.2"
+                "FrameworkVersion" = "8:.NETFramework,Version=v4.8"
                 "AllowLaterVersions" = "11:FALSE"
                 "InstallUrl" = "8:http://go.microsoft.com/fwlink/?LinkId=863262"
                 }
@@ -164,6 +194,46 @@
         }
         "File"
         {
+            "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_0E1A8853BFD745B48324E1D0B8A6FACE"
+            {
+            "SourcePath" = "8:..\\AwInitilizer\\Cultures\\StringResource.xaml"
+            "TargetName" = "8:StringResource.xaml"
+            "Tag" = "8:"
+            "Folder" = "8:_86259A374A5843AD9608FFCDF2EFE3AD"
+            "Condition" = "8:"
+            "Transitive" = "11:FALSE"
+            "Vital" = "11:TRUE"
+            "ReadOnly" = "11:FALSE"
+            "Hidden" = "11:FALSE"
+            "System" = "11:FALSE"
+            "Permanent" = "11:FALSE"
+            "SharedLegacy" = "11:FALSE"
+            "PackageAs" = "3:1"
+            "Register" = "3:1"
+            "Exclude" = "11:FALSE"
+            "IsDependency" = "11:FALSE"
+            "IsolateTo" = "8:"
+            }
+            "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_0FA1000DB6E747B099DBBACCBBD5DCEA"
+            {
+            "SourcePath" = "8:..\\AwInitilizer\\DLL\\SajetConnect.dll"
+            "TargetName" = "8:SajetConnect.dll"
+            "Tag" = "8:"
+            "Folder" = "8:_DE11C1EA8CD74CA9820344EFA2A02676"
+            "Condition" = "8:"
+            "Transitive" = "11:FALSE"
+            "Vital" = "11:TRUE"
+            "ReadOnly" = "11:FALSE"
+            "Hidden" = "11:FALSE"
+            "System" = "11:FALSE"
+            "Permanent" = "11:FALSE"
+            "SharedLegacy" = "11:FALSE"
+            "PackageAs" = "3:1"
+            "Register" = "3:1"
+            "Exclude" = "11:FALSE"
+            "IsDependency" = "11:FALSE"
+            "IsolateTo" = "8:"
+            }
             "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_757BA0BD19C3D246BA621DB64DE2384D"
             {
             "AssemblyRegister" = "3:1"
@@ -226,6 +296,66 @@
             "IsDependency" = "11:TRUE"
             "IsolateTo" = "8:"
             }
+            "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_9190A32435564C0AA37658F1C98CE7D4"
+            {
+            "SourcePath" = "8:..\\AwInitilizer\\Cultures\\StringResource.zh-TW.xaml"
+            "TargetName" = "8:StringResource.zh-TW.xaml"
+            "Tag" = "8:"
+            "Folder" = "8:_86259A374A5843AD9608FFCDF2EFE3AD"
+            "Condition" = "8:"
+            "Transitive" = "11:FALSE"
+            "Vital" = "11:TRUE"
+            "ReadOnly" = "11:FALSE"
+            "Hidden" = "11:FALSE"
+            "System" = "11:FALSE"
+            "Permanent" = "11:FALSE"
+            "SharedLegacy" = "11:FALSE"
+            "PackageAs" = "3:1"
+            "Register" = "3:1"
+            "Exclude" = "11:FALSE"
+            "IsDependency" = "11:FALSE"
+            "IsolateTo" = "8:"
+            }
+            "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_C9BC5A526B0440DCB63705909B3D2F7C"
+            {
+            "SourcePath" = "8:..\\AwInitilizer\\Cultures\\StringResource.zh-CHS.xaml"
+            "TargetName" = "8:StringResource.zh-CHS.xaml"
+            "Tag" = "8:"
+            "Folder" = "8:_86259A374A5843AD9608FFCDF2EFE3AD"
+            "Condition" = "8:"
+            "Transitive" = "11:FALSE"
+            "Vital" = "11:TRUE"
+            "ReadOnly" = "11:FALSE"
+            "Hidden" = "11:FALSE"
+            "System" = "11:FALSE"
+            "Permanent" = "11:FALSE"
+            "SharedLegacy" = "11:FALSE"
+            "PackageAs" = "3:1"
+            "Register" = "3:1"
+            "Exclude" = "11:FALSE"
+            "IsDependency" = "11:FALSE"
+            "IsolateTo" = "8:"
+            }
+            "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_FFF37EF16AF4429F82201548482AE4A6"
+            {
+            "SourcePath" = "8:..\\..\\..\\MES\\SajetConnect\\DLL.INI"
+            "TargetName" = "8:DLL.INI"
+            "Tag" = "8:"
+            "Folder" = "8:_DE11C1EA8CD74CA9820344EFA2A02676"
+            "Condition" = "8:"
+            "Transitive" = "11:FALSE"
+            "Vital" = "11:TRUE"
+            "ReadOnly" = "11:FALSE"
+            "Hidden" = "11:FALSE"
+            "System" = "11:FALSE"
+            "Permanent" = "11:FALSE"
+            "SharedLegacy" = "11:FALSE"
+            "PackageAs" = "3:1"
+            "Register" = "3:1"
+            "Exclude" = "11:FALSE"
+            "IsDependency" = "11:FALSE"
+            "IsolateTo" = "8:"
+            }
         }
         "FileType"
         {
@@ -264,6 +394,28 @@
             "Property" = "8:TARGETDIR"
                 "Folders"
                 {
+                    "{9EF0B969-E518-4E46-987F-47570745A589}:_86259A374A5843AD9608FFCDF2EFE3AD"
+                    {
+                    "Name" = "8:Cultures"
+                    "AlwaysCreate" = "11:TRUE"
+                    "Condition" = "8:"
+                    "Transitive" = "11:FALSE"
+                    "Property" = "8:_2D923104468D437E9FAC97B371829031"
+                        "Folders"
+                        {
+                        }
+                    }
+                    "{9EF0B969-E518-4E46-987F-47570745A589}:_A6A879D1C9544DE8B19D209DB640D876"
+                    {
+                    "Name" = "8:Firmware"
+                    "AlwaysCreate" = "11:TRUE"
+                    "Condition" = "8:"
+                    "Transitive" = "11:FALSE"
+                    "Property" = "8:_A7A39A06DBC846059B6F427CBE277A1A"
+                        "Folders"
+                        {
+                        }
+                    }
                 }
             }
         }
@@ -283,7 +435,7 @@
         "Name" = "8:Microsoft Visual Studio"
         "ProductName" = "8:DCInitializerr"
         "ProductCode" = "8:{57BF893C-BD30-40C3-8C04-55FFFC6E3FFE}"
-        "PackageCode" = "8:{17D0AC44-C1E0-48D8-B99F-B41743507E59}"
+        "PackageCode" = "8:{E56188BF-D337-4DAA-BA44-F5F017E0AE26}"
         "UpgradeCode" = "8:{926B8A82-19A1-436D-A0E4-216EF638690B}"
         "AspNetVersion" = "8:4.0.30319.0"
         "RestartWWWService" = "11:FALSE"
@@ -403,15 +555,15 @@
         }
         "Shortcut"
         {
-            "{970C0BB2-C7D0-45D7-ABFA-7EC378858BC0}:_0029D7AF50AB41009B85628C3EF86FBC"
+            "{970C0BB2-C7D0-45D7-ABFA-7EC378858BC0}:_5862128EB32848B1824C63B6264915EA"
             {
-            "Name" = "8:DCInitlizer"
+            "Name" = "8:Initilizer"
             "Arguments" = "8:"
             "Description" = "8:"
             "ShowCmd" = "3:1"
             "IconIndex" = "3:0"
             "Transitive" = "11:FALSE"
-            "Target" = "8:_67ED0F9CA2B2410084704C63C8FB5CE2"
+            "Target" = "8:_DAA98DDE772D47D1A3A47A8277D61590"
             "Folder" = "8:_5D843E07890C4EEA8A900CE8C1AA8C33"
             "WorkingFolder" = "8:_DE11C1EA8CD74CA9820344EFA2A02676"
             "Icon" = "8:"
@@ -816,9 +968,9 @@
         }
         "ProjectOutput"
         {
-            "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_67ED0F9CA2B2410084704C63C8FB5CE2"
+            "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_DAA98DDE772D47D1A3A47A8277D61590"
             {
-            "SourcePath" = "8:..\\AwInitilizer\\obj\\Release\\AwInitilizer.exe"
+            "SourcePath" = "8:..\\AwInitilizer\\obj\\Debug\\AwInitilizer.exe"
             "TargetName" = "8:"
             "Tag" = "8:"
             "Folder" = "8:_DE11C1EA8CD74CA9820344EFA2A02676"