|
@@ -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";
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|