| ofs | hex dump | ascii |
|---|
| 0000 | 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 02 14 00 00 01 52 08 06 00 00 00 aa 93 46 | .PNG........IHDR.......R.......F |
| 0020 | 09 00 00 00 19 74 45 58 74 53 6f 66 74 77 61 72 65 00 41 64 6f 62 65 20 49 6d 61 67 65 52 65 61 | .....tEXtSoftware.Adobe.ImageRea |
| 0040 | 64 79 71 c9 65 3c 00 00 03 b0 69 54 58 74 58 4d 4c 3a 63 6f 6d 2e 61 64 6f 62 65 2e 78 6d 70 00 | dyq.e<....iTXtXML:com.adobe.xmp. |
| 0060 | 00 00 00 00 3c 3f 78 70 61 63 6b 65 74 20 62 65 67 69 6e 3d 22 ef bb bf 22 20 69 64 3d 22 57 35 | ....<?xpacket.begin="...".id="W5 |
| 0080 | 4d 30 4d 70 43 65 68 69 48 7a 72 65 53 7a 4e 54 63 7a 6b 63 39 64 22 3f 3e 20 3c 78 3a 78 6d 70 | M0MpCehiHzreSzNTczkc9d"?>.<x:xmp |
| 00a0 | 6d 65 74 61 20 78 6d 6c 6e 73 3a 78 3d 22 61 64 6f 62 65 3a 6e 73 3a 6d 65 74 61 2f 22 20 78 3a | meta.xmlns:x="adobe:ns:meta/".x: |
| 00c0 | 78 6d 70 74 6b 3d 22 41 64 6f 62 65 20 58 4d 50 20 43 6f 72 65 20 35 2e 30 2d 63 30 36 30 20 36 | xmptk="Adobe.XMP.Core.5.0-c060.6 |
| 00e0 | 31 2e 31 33 34 37 37 37 2c 20 32 30 31 30 2f 30 32 2f 31 32 2d 31 37 3a 33 32 3a 30 30 20 20 20 | 1.134777,.2010/02/12-17:32:00... |
| 0100 | 20 20 20 20 20 22 3e 20 3c 72 64 66 3a 52 44 46 20 78 6d 6c 6e 73 3a 72 64 66 3d 22 68 74 74 70 | .....">.<rdf:RDF.xmlns:rdf="http |
| 0120 | 3a 2f 2f 77 77 77 2e 77 33 2e 6f 72 67 2f 31 39 39 39 2f 30 32 2f 32 32 2d 72 64 66 2d 73 79 6e | ://www.w3.org/1999/02/22-rdf-syn |
| 0140 | 74 61 78 2d 6e 73 23 22 3e 20 3c 72 64 66 3a 44 65 73 63 72 69 70 74 69 6f 6e 20 72 64 66 3a 61 | tax-ns#">.<rdf:Description.rdf:a |
| 0160 | 62 6f 75 74 3d 22 22 20 78 6d 6c 6e 73 3a 78 6d 70 52 69 67 68 74 73 3d 22 68 74 74 70 3a 2f 2f | bout="".xmlns:xmpRights="http:// |
| 0180 | 6e 73 2e 61 64 6f 62 65 2e 63 6f 6d 2f 78 61 70 2f 31 2e 30 2f 72 69 67 68 74 73 2f 22 20 78 6d | ns.adobe.com/xap/1.0/rights/".xm |
| 01a0 | 6c 6e 73 3a 78 6d 70 4d 4d 3d 22 68 74 74 70 3a 2f 2f 6e 73 2e 61 64 6f 62 65 2e 63 6f 6d 2f 78 | lns:xmpMM="http://ns.adobe.com/x |
| 01c0 | 61 70 2f 31 2e 30 2f 6d 6d 2f 22 20 78 6d 6c 6e 73 3a 73 74 52 65 66 3d 22 68 74 74 70 3a 2f 2f | ap/1.0/mm/".xmlns:stRef="http:// |
| 01e0 | 6e 73 2e 61 64 6f 62 65 2e 63 6f 6d 2f 78 61 70 2f 31 2e 30 2f 73 54 79 70 65 2f 52 65 73 6f 75 | ns.adobe.com/xap/1.0/sType/Resou |
| 0200 | 72 63 65 52 65 66 23 22 20 78 6d 6c 6e 73 3a 78 6d 70 3d 22 68 74 74 70 3a 2f 2f 6e 73 2e 61 64 | rceRef#".xmlns:xmp="http://ns.ad |
| 0220 | 6f 62 65 2e 63 6f 6d 2f 78 61 70 2f 31 2e 30 2f 22 20 78 6d 70 52 69 67 68 74 73 3a 4d 61 72 6b | obe.com/xap/1.0/".xmpRights:Mark |
| 0240 | 65 64 3d 22 46 61 6c 73 65 22 20 78 6d 70 4d 4d 3a 4f 72 69 67 69 6e 61 6c 44 6f 63 75 6d 65 6e | ed="False".xmpMM:OriginalDocumen |
| 0260 | 74 49 44 3d 22 78 6d 70 2e 64 69 64 3a 46 38 37 46 31 31 37 34 30 37 32 30 36 38 31 31 39 39 31 | tID="xmp.did:F87F117407206811991 |
| 0280 | 45 45 37 39 35 41 38 37 43 42 45 42 37 22 20 78 6d 70 4d 4d 3a 44 6f 63 75 6d 65 6e 74 49 44 3d | EE795A87CBEB7".xmpMM:DocumentID= |
| 02a0 | 22 78 6d 70 2e 64 69 64 3a 43 36 32 42 43 45 32 44 41 34 33 36 31 31 45 33 42 42 36 42 41 31 33 | "xmp.did:C62BCE2DA43611E3BB6BA13 |
| 02c0 | 46 45 30 34 34 45 44 35 46 22 20 78 6d 70 4d 4d 3a 49 6e 73 74 61 6e 63 65 49 44 3d 22 78 6d 70 | FE044ED5F".xmpMM:InstanceID="xmp |
| 02e0 | 2e 69 69 64 3a 43 36 32 42 43 45 32 43 41 34 33 36 31 31 45 33 42 42 36 42 41 31 33 46 45 30 34 | .iid:C62BCE2CA43611E3BB6BA13FE04 |
| 0300 | 34 45 44 35 46 22 20 78 6d 70 3a 43 72 65 61 74 6f 72 54 6f 6f 6c 3d 22 41 64 6f 62 65 20 50 68 | 4ED5F".xmp:CreatorTool="Adobe.Ph |
| 0320 | 6f 74 6f 73 68 6f 70 20 43 53 35 20 57 69 6e 64 6f 77 73 22 3e 20 3c 78 6d 70 4d 4d 3a 44 65 72 | otoshop.CS5.Windows">.<xmpMM:Der |
| 0340 | 69 76 65 64 46 72 6f 6d 20 73 74 52 65 66 3a 69 6e 73 74 61 6e 63 65 49 44 3d 22 78 6d 70 2e 69 | ivedFrom.stRef:instanceID="xmp.i |
| 0360 | 69 64 3a 39 41 35 43 37 42 36 33 42 39 41 33 45 33 31 31 38 30 34 35 39 31 36 36 44 44 41 32 34 | id:9A5C7B63B9A3E31180459166DDA24 |
| 0380 | 32 37 35 22 20 73 74 52 65 66 3a 64 6f 63 75 6d 65 6e 74 49 44 3d 22 75 75 69 64 3a 35 42 30 34 | 275".stRef:documentID="uuid:5B04 |
| 03a0 | 38 38 41 31 36 32 43 37 45 31 31 31 38 32 39 32 42 41 37 42 41 46 46 33 37 38 45 43 22 2f 3e 20 | 88A162C7E1118292BA7BAFF378EC"/>. |
| 03c0 | 3c 2f 72 64 66 3a 44 65 73 63 72 69 70 74 69 6f 6e 3e 20 3c 2f 72 64 66 3a 52 44 46 3e 20 3c 2f | </rdf:Description>.</rdf:RDF>.</ |
| 03e0 | 78 3a 78 6d 70 6d 65 74 61 3e 20 3c 3f 78 70 61 63 6b 65 74 20 65 6e 64 3d 22 72 22 3f 3e 36 62 | x:xmpmeta>.<?xpacket.end="r"?>6b |
| 0400 | 7c 8f 00 04 cb ed 49 44 41 54 78 da ec bd 09 b8 65 59 51 26 1a 6b cf 67 ba 63 de 1c 2b ab 8a a2 | |.....IDATx.....eYQ&.k.g.c..+... |
| 0420 | a8 a2 28 b4 90 a9 7d 2d 82 dd 28 f8 1c 3e 71 40 a0 15 10 14 64 12 99 47 69 06 19 45 10 45 df e7 | ..(...}-..(..>q@....d..Gi..E.E.. |
| 0440 | f8 06 c5 d7 e2 7b 6d 4b fb d9 dd 4e dd 8a da f8 40 10 a1 8a 82 9a 73 1e ef 7c 86 3d af 17 7f c4 | .....{mK...N....@.....s..|.=.... |
| 0460 | da 27 6f 66 de 9b 79 33 2b a7 4a f3 14 97 7b f3 9c 7d f6 b0 f6 da 2b fe 88 f8 e3 0f 63 ad a5 6b | .'of..y3+.J...{..}....+.....c..k |
| 0480 | af 6b af 6b af 6b af 7f c9 af b4 ac 29 cf 2a aa eb 8a 7c cf a7 9a 97 c5 61 96 d2 c2 f1 c3 64 fc | .k.k.k......).*...|.....a.....d. |
| 04a0 | 9a a6 26 a7 29 0c 22 8a f9 07 2b a6 31 01 ff 18 de be a6 2c cf f1 06 0d 87 2b 54 55 05 51 55 53 | ..&.)."...+.1......,.....+TU.QUS |
| 04c0 | 9a 8d c8 0f db 14 47 21 f9 fc d3 6d b5 29 f4 2c 61 bd c5 f7 d6 ae bb f8 37 5e 78 ab e4 ef 46 51 | ......G!...m.).,a.......7^x...FQ |
| 04e0 | 22 9f 57 55 45 c6 f3 28 0a 42 1a 0c 57 79 3b 8f de f2 b6 b7 18 cf d6 72 5c 7c d1 b8 7d 60 b7 7a | ".WUE..(.B..Wy;........r\|..}`.z |
| 0500 | 5e 64 f0 19 3e 78 ce 0f fe 48 74 f3 a3 6f 99 4a 92 68 96 df 9e f3 42 7f aa 2c ab 56 55 96 31 7f | ^d..>x...Ht..o.J.h....B..,.VU.1. |
| 0520 | 1e f2 77 e2 aa ae 62 fe 36 ff 98 a4 2c 8a 88 a8 ae 8c e7 a7 9e e7 8f 78 9b 8c af 99 7f 9b 41 e0 | ..w...b.6...,..........x......A. |
| 0540 | 07 7d 63 fc 61 18 86 ab 7e 10 1e 0e 03 ff a8 ef 07 43 3e 2c 8f 15 9f 8b c5 ff 8c 9c a3 d1 11 e2 | .}c.a...~........C>,............ |
| 0560 | 6b 29 28 0c 23 aa cb 92 0a fe c1 f5 e8 39 7a 3c 2e 11 79 38 59 cf f0 6f 8f 2a de c7 e2 e2 12 45 | k)(.#........9z<..y8Y..o.*.....E |
| 0580 | 21 8f 97 ef 53 9c 44 72 31 a7 be f0 ce 7a 16 ab 79 5f 7e f3 85 85 7e 20 ef 8f 46 35 85 31 ef 2f | !...S.Dr1....z..y_~...~...F5.1./ |
| 05a0 | 32 54 f0 ad e1 5b 41 35 b6 e1 ff f3 3d 22 be d5 64 2b 1e 77 ab 3b e0 e1 e6 fb 58 f0 b9 5a 3e 0f | 2T...[A5....="..d+.w.;....X..Z>. |
| 05c0 | 43 79 a1 63 89 ed c3 c8 e7 cf 3d 0a f8 9c 43 de 1f be cb d3 85 b7 e1 ef 0c 52 3e 4e 40 49 14 50 | Cy.c......=...C..........R>N@I.P |
| 05e0 | 21 f7 10 f7 6d dd 4b b8 68 2f cc d9 d5 94 a8 70 d7 86 e3 8f f8 dc f8 32 e4 bd b5 a6 7e d7 c4 c5 | !...m.K.h/.....p.......2....~... |
| 0600 | 39 87 e0 da 52 72 ed 75 ed 75 ed 75 ed d5 bc ec 69 ff f2 d6 79 7f c3 d7 a9 16 e4 d4 7f ba cf cd | 9...Rr.u.u.u....i...y........... |
| 0620 | 29 db c1 08 ae 5d f0 df f4 a6 d7 19 58 b1 aa b6 06 fb a8 ab 0a e6 97 cf c2 1a b6 61 06 db b2 21 | )....]......X..............a...! |
| 0640 | 37 b2 2b b6 88 6f 7d eb bb 76 75 3b ed 27 95 55 79 4b 56 94 bb ca 32 df c9 06 7d c7 28 5d 9e 1b | 7.+..o}..vu;.'.UyKV...2...}.(].. |
| 0660 | a5 76 86 bf d3 e3 4d bd b2 c8 d9 b0 66 14 84 01 05 81 82 15 1f 46 9d ad 23 de 13 03 6f 4b de 77 | .v....M.....f........F..#...oK.w |
| 0680 | 41 25 83 80 94 2d 52 c1 80 29 cf 72 e2 fd e2 94 4a cf 0f 17 18 28 1c 0a 82 e0 80 17 f8 0f 79 c6 | A%...-R..).r....J....(........y. |
| 06a0 | df 93 44 f1 43 61 14 ef 6f b7 27 f6 b5 5a ed fd 41 14 5b 00 33 fc c8 19 af 1d 08 73 62 6c cd 19 | ..D.Ca..o.'..Z..A.[.3......sbl.. |
| 06c0 | c6 7e 2d 78 30 74 f2 77 ec 19 40 86 d9 70 8f 0f f3 65 ce 77 16 5d fe 97 b9 44 e7 74 0d 50 5c 7b | .~-x0t.w..@..p...e.w.]...D.t.P\{ |
| 06e0 | 5d 7b 5d 7b 5d 7b 6d 60 14 c4 ee 1b fc cf 9c d1 a0 d8 8d 2c 8f 3d 19 34 ac 8d 4e ac fd fb 2d 6f | ]{]{]{m`...........,.=.4..N...-o |
| 0700 | 7b 2b e3 82 1a 5e bc b1 24 91 0c 39 a4 65 40 c1 ff 21 22 61 d4 83 f6 24 02 f1 f2 97 bd aa 75 e3 | {+...^..$..9.e@..!"a...$......u. |
| 0720 | 8d d7 df 56 14 e5 d3 47 69 ff df a4 c5 e0 89 a3 c5 fe 56 5b 95 94 31 10 c0 3e d8 d0 f3 f6 46 8e | ...V...Gi.........V[..1..>....F. |
| 0740 | 53 29 02 a1 84 bd e8 b9 b9 69 9a e8 4d f2 df 2d 89 a0 20 42 80 a8 c1 5a ab 63 c4 e3 c5 79 d4 12 | S).......i..M..-...B...Z.c...y.. |
| 0760 | 3d 00 10 49 d3 21 ad ac 2c 07 8b 4b 8b 5b 57 57 06 5b fb 83 ea 0e c3 c7 b0 0c 68 6c 2d 51 8a 3a | =..I.!..,..K.[WW.[........hl-Q.: |
| 0780 | 89 93 f9 30 8e ef 6e b7 7b 5f 08 c3 f8 1f 26 26 a6 ff 01 00 c3 37 01 31 c2 20 17 cc 38 f3 b8 99 | ...0..n.{_....&&.....7.1....8... |
| 07a0 | 93 3f 5b 1b 7d 58 cf 30 da 75 00 c7 25 c2 9b 57 de cb 9c 05 fc 5c 64 64 71 0d 50 5c 7b 5d 7b using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Core;
using Tango.Core.Commands;
using Tango.Core.Helpers;
using Tango.Integration.Operation;
using Tango.Logging;
using Tango.PMR.Connection;
using Tango.PPC.Common;
using Tango.PPC.Common.Application;
using Tango.PPC.Common.Connection;
using Tango.PPC.Common.MachineSetup;
using Tango.PPC.Common.Navigation;
using Tango.PPC.Common.OS;
using Tango.PPC.Common.Web;
using Tango.PPC.UI.ViewsContracts;
using Tango.Settings;
using Tango.SharedUI.Helpers;
using Tango.SQLExaminer;
using Tango.Transport.Adapters;
using Tango.Web;
namespace Tango.PPC.UI.ViewModels
{
/// <summary>
/// Represents the machine setup view ViewModel.
/// </summary>
/// <seealso cref="Tango.PPC.Common.PPCViewModel{Tango.PPC.UI.ViewsContracts.IMachineSetupView}" />
public class MachineSetupViewVM : PPCViewModel<IMachineSetupView>
{
/// <summary>
/// Represents the various machine setup view states.
/// </summary>
public enum MachineSetupStates
{
None,
Working,
Completed,
Failed,
}
public enum MachineSetupView
{
WelcomeView,
WiFiSelectionView,
WiFiTestView,
TimeZoneView,
EnvironmentView,
SetupWelcomeView,
SetupProgressView,
SetupCompletedView,
SetupFailedView,
}
private MachineSetupResult _setup_result;
private IOperationSystemManager _operationSystemManager;
private IPPCApplicationManager _appManager;
private PPCWebClient _ppcWebClient;
#region Properties
/// <summary>
/// Gets or sets the machine setup manager.
/// </summary>
public IMachineSetupManager MachineSetupManager { get; set; }
private String _serialNumber;
/// <summary>
/// Gets or sets the serial number.
/// </summary>
public String SerialNumber
{
get { return _serialNumber; }
set { _serialNumber = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
}
private String _hostAddress;
/// <summary>
/// Gets or sets the host address.
/// </summary>
public String HostAddress
{
get { return _hostAddress; }
set { _hostAddress = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
}
private String _log;
/// <summary>
/// Gets or sets the log.
/// </summary>
public String Log
{
get { return _log; }
set { _log = value; RaisePropertyChangedAuto(); }
}
private MachineSetupStates _state;
/// <summary>
/// Gets or sets the state.
/// </summary>
public MachineSetupStates State
{
get { return _state; }
set { _state = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
}
private String _failedError;
/// <summary>
/// Gets or sets the setup failed error.
/// </summary>
public String FailedError
{
get { return _failedError; }
set { _failedError = value; RaisePropertyChangedAuto(); }
}
/// <summary>
/// Gets or sets the available time zones.
/// </summary>
public List<TimeZoneInfo> TimeZones { get; set; }
private TimeZoneInfo _selectedTimeZone;
/// <summary>
/// Gets or sets the selected time zone.
/// </summary>
public TimeZoneInfo SelectedTimeZone
{
get { return _selectedTimeZone; }
set { _selectedTimeZone = value; RaisePropertyChangedAuto(); }
}
private DeploymentSlot _deploymentSlot;
/// <summary>
/// Gets or sets the deployment slot.
/// </summary>
public DeploymentSlot DeploymentSlot
{
get { return _deploymentSlot; }
set { _deploymentSlot = value; RaisePropertyChangedAuto(); }
}
private MachineSetupView _currentView;
public MachineSetupView CurrentView
{
get { return _currentView; }
set { _currentView = value; RaisePropertyChangedAuto(); }
}
#endregion
#region Commands
/// <summary>
/// Gets or sets the complete command.
/// </summary>
public RelayCommand CompleteCommand { get; set; }
/// <summary>
/// Gets or sets the navigate to WiFi command.
/// </summary>
public RelayCommand NavigateToWiFiCommand { get; set; }
/// <summary>
/// Gets or sets the install command.
/// </summary>
public RelayCommand InstallCommand { get; set; }
/// <summary>
/// Gets or sets the restart command.
/// </summary>
public RelayCommand RestartCommand { get; set; }
/// <summary>
/// Gets or sets the time zone selected command.
/// </summary>
public RelayCommand TimeZoneSelectedCommand { get; set; }
/// <summary>
/// Gets or sets the environment selected command.
/// </summary>
public RelayCommand EnvironmentSelectedCommand { get; set; }
#endregion
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="MachineSetupViewVM"/> class.
/// </summary>
/// <param name="applicationManager">The application manager.</param>
/// <param name="machineSetupManager">The machine setup manager.</param>
public MachineSetupViewVM(PPCWebClient ppcWebClient, IPPCApplicationManager applicationManager, IMachineSetupManager machineSetupManager, IOperationSystemManager operationSystemManager)
{
_ppcWebClient = ppcWebClient;
_appManager = applicationManager;
MachineSetupManager = machineSetupManager;
DeploymentSlot = Settings.DeploymentSlot;
SerialNumber = "";
CompleteCommand = new RelayCommand(CompleteSetup, () => State == MachineSetupStates.Completed);
applicationManager.SetupRequired += ApplicationManager_SetupRequired;
NavigateToWiFiCommand = new RelayCommand(EnsureWiFi);
InstallCommand = new RelayCommand(Install);
RestartCommand = new RelayCommand(() => { NavigateTo(MachineSetupView.WelcomeView); });
TimeZoneSelectedCommand = new RelayCommand(() => { NavigateTo(MachineSetupView.EnvironmentView); });
EnvironmentSelectedCommand = new RelayCommand(() =>
{
NavigateTo(MachineSetupView.SetupWelcomeView);
Settings.DeploymentSlot = DeploymentSlot;
HostAddress = Settings.GetMachineServiceAddress();
Settings.Save();
});
_operationSystemManager = operationSystemManager;
TimeZones = _operationSystemManager.GetAvailableTimeZones().ToList();
SelectedTimeZone = TimeZones.SingleOrDefault(x => x.ToString() == "(UTC+02:00) Jerusalem");
}
#endregion
#region Event Handlers
/// <summary>
/// Handles the SetupRequired event of the ApplicationManager.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
private void ApplicationManager_SetupRequired(object sender, EventArgs e)
{
if (!LogManager.Categories.Contains(LogCategory.Debug))
{
LogManager.Categories.Add(LogCategory.Debug);
}
var logger = new SimpleStringLogger();
logger.Categories.Remove(LogCategory.Debug);
LogManager.RegisterLogger(logger);
logger.LogReceived += Logger_LogReceived;
LogManager.Log("SetupRequired event received. Navigating to MachineSetupView...");
NavigationManager.NavigateTo(NavigationView.MachineSetupView);
}
private void Logger_LogReceived(object sender, LogItemBase e)
{
AppendLog(e.Message);
}
#endregion
#region Private Methods
/// <summary>
/// Appends the log.
/// </summary>
/// <param name="msg">The MSG.</param>
private void AppendLog(String msg)
{
if (msg != null && !msg.Contains("SQL Examiner"))
{
InvokeUI(() =>
{
View.AppendLog(msg + Environment.NewLine);
});
}
}
/// <summary>
/// Completes the setup.
/// </summary>
private void CompleteSetup()
{
LogManager.Log("Completing machine setup...");
String updater_exe = Path.Combine(_setup_result.UpdatePackagePath, "Tango.PPC.Updater.exe");
_appManager.UpdateApplication(updater_exe, PathHelper.GetStartupPath());
}
/// <summary>
/// Navigates to the specified view.
/// </summary>
/// <param name="view">The view.</param>
private Task NavigateTo(MachineSetupView view)
{
CurrentView = view;
return View.NavigateTo(view);
}
#endregion
#region WiFi
private async void EnsureWiFi()
{
await NavigateTo(MachineSetupView.WiFiTestView);
await Task.Delay(2000);
bool connected = await ConnectivityProvider.CheckInternetConnection();
if (connected)
{
await NavigateTo(MachineSetupView.TimeZoneView);
}
else
{
await NavigateTo(MachineSetupView.WiFiSelectionView);
await ConnectivityProvider.RefreshAvailableWiFiNetworks();
ConnectivityProvider.ConnectionStateChanged += ConnectivityProvider_ConnectionStateChanged;
}
}
private async void ConnectivityProvider_ConnectionStateChanged(object sender, Common.Connectivity.ConnectionStateEventArgs e)
{
if (e.IsConnected)
{
ConnectivityProvider.ConnectionStateChanged -= ConnectivityProvider_ConnectionStateChanged;
await NavigateTo(MachineSetupView.WiFiTestView);
await Task.Delay(5000);
EnsureWiFi();
}
}
#endregion
#region Setup
private async void Install()
{
await NavigateTo(MachineSetupView.SetupProgressView);
LogManager.Log("Starting machine setup...");
State = MachineSetupStates.Working;
try
{
_ppcWebClient.Environment = DeploymentSlot;
await _operationSystemManager.ChangeTimeZone(SelectedTimeZone);
_setup_result = await MachineSetupManager.Setup(SerialNumber);
State = MachineSetupStates.Completed;
LogManager.Log("Machine setup completed.");
await NavigateTo(MachineSetupView.SetupCompletedView);
}
catch (Exception ex)
{
LogManager.Log(ex, "Machine setup failed.");
FailedError = ex.FlattenMessage();
State = MachineSetupStates.Failed;
await NavigateTo(MachineSetupView.SetupFailedView);
}
}
#endregion
}
}
|