Robert 11 сар өмнө
parent
commit
8114f99bb4

+ 17 - 1
AwInitilizer/Assist/EvHttpClient.cs

@@ -30,7 +30,7 @@ namespace AwInitilizer.Assist
     {
         private static string account = "admin";
         private static string pass = "1231231238";
-        internal static string ServerIpAddress = "192.168.1.10";
+        //internal static string ServerIpAddress = "192.168.1.10";
         internal static string ServerUrl = "https://192.168.1.10";
         //internal static string ServerIpAddress = "172.18.13.84";
         //internal static string ServerUrl = "https://172.18.13.84";
@@ -41,6 +41,22 @@ namespace AwInitilizer.Assist
         //internal static string ServerIpAddress = "192.168.80.199";
         //internal static string ServerUrl = "https://192.168.80.199";
 
+        internal static void ResetServerIpAddress(string ipAddress = null)
+        {
+            if (string.IsNullOrEmpty(ipAddress))
+            {
+                ServerUrl = "https://192.168.1.10";
+                return;
+            }
+
+            if (!ipAddress.StartsWith("http"))
+            {
+                ipAddress = $"https://{ipAddress}";
+            }
+            ServerUrl = ipAddress;
+            return;
+        }
+
         internal static Task<EvHttpClientResult> GetQueryActionOpt1String()
         {
             string api = "get_query_action.php";

+ 1 - 0
AwInitilizer/Assist/EvHttpClientLogger.cs

@@ -4,6 +4,7 @@ using System.IO;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Windows;
 
 namespace AwInitilizer.Assist
 {

+ 2 - 0
AwInitilizer/MainWindow.xaml.cs

@@ -354,6 +354,7 @@ namespace AwInitilizer
             ValueReportDatas reportDatas = new ValueReportDatas();
             //logPairs.Add("ModelName", ViewModel.SystemID.ModelName.ToString());
             //logPairs.Add("SerialNumber", ViewModel.SystemID.SerialNumber);
+            EvHttpClient.ResetServerIpAddress(ViewModel.IpAddress);
 
             ViewModel.IsUdatIng = true;
             var procedureList = ViewModel.UpdateProcedure.Where(x => x.IsActivated).ToList();
@@ -647,6 +648,7 @@ namespace AwInitilizer
                 ViewModel.IMSI = setting.IMSI;
                 ViewModel.SkipEmergencyButton = setting.SkipEmergencyButton;
                 ViewModel.SkipButtonTest = setting.SkipButtonTest;
+                ViewModel.IpAddress = setting.IpAddress;
                 ViewModel.FirmwareUpdateModels = setting.FirmwareUpdateList
                     .Where(x => !string.IsNullOrEmpty(x.Module) && !string.IsNullOrEmpty(x.FirmwareFileName)
                     ).ToList();

+ 1 - 0
AwInitilizer/Model/SettingConfig.cs

@@ -16,6 +16,7 @@ namespace AwInitilizer.Model
         public string IMSI { get; set; }
         public bool SkipEmergencyButton { get; set; }
         public bool SkipButtonTest { get; set; }
+        public string IpAddress { get; set; }
         public List<FirmwareUpdateModel> FirmwareUpdateList { get; set; }
     }
 }

+ 14 - 0
AwInitilizer/Model/UpdateData.cs

@@ -133,6 +133,20 @@ namespace AwInitilizer.Model
             }
         }
 
+        private string _IpAddress;
+        public string IpAddress
+        {
+            get => _IpAddress;
+            set
+            {
+                if (_IpAddress != value)
+                {
+                    _IpAddress = value;
+                    RaisePropertyChanged("IpAddress");
+                }
+            }
+        }
+
         private List<FirmwareUpdateModel> _FirmwareUpdateModels;
         public List<FirmwareUpdateModel> FirmwareUpdateModels
         {

+ 11 - 1
AwInitilizer/Procedure/ProcedureBase.cs

@@ -66,11 +66,21 @@ namespace AwInitilizer.Procedure
 
         internal async Task<bool> CheckAndCreateSocket()
         {
+            string ipAddress = null;
+            if (!string.IsNullOrEmpty(UpdateData.IpAddress))
+            {
+                ipAddress = UpdateData.IpAddress;
+            }
+            else
+            {
+                ipAddress = ServerIpAddress;
+            }
+
             TcpSerializer socketConnection = null;
             if (socketConnection == null || socketConnection.ConnectStatus == ConnectStatus.ConnectionFail ||
                 socketConnection.ConnectStatus == ConnectStatus.DisConnected)
             {
-                socketConnection = new Assist.TcpSerializer(ip:ServerIpAddress);
+                socketConnection = new Assist.TcpSerializer(ip: ipAddress);
                 await socketConnection.OpenAsync();
                 if(socketConnection.ConnectStatus != ConnectStatus.Connected)
                 {

+ 4 - 4
AwInitilizer/Properties/AssemblyInfo.cs

@@ -31,7 +31,7 @@ using System.Runtime.InteropServices;
 //
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.10.3.0")]
-[assembly: AssemblyVersion("1.10.3.0")]
-[assembly: AssemblyFileVersion("1.10.3.0")]
-[assembly: AssemblyInformationalVersion("90391dc")]
+// [assembly: AssemblyVersion("1.11.0.0")]
+[assembly: AssemblyVersion("1.11.0.0")]
+[assembly: AssemblyFileVersion("1.11.0.0")]
+[assembly: AssemblyInformationalVersion("5acfa48")]

+ 1 - 1
GitVersion.yml

@@ -1,6 +1,6 @@
 assembly-versioning-scheme: MajorMinorPatch
 assembly-informational-format: '{ShortSha}'
-next-version: 1.10.3
+next-version: 1.11.0
 branches: {}
 ignore:
   sha: []

+ 3 - 3
Initilizer/AssemblyInfo.cs

@@ -9,7 +9,7 @@
                                               // app, or any theme specific resource dictionaries)
 )]
 
-[assembly: AssemblyVersion("1.10.3.0")]
-[assembly: AssemblyFileVersion("1.10.3.0")]
-[assembly: AssemblyInformationalVersion("90391dc")]
+[assembly: AssemblyVersion("1.11.0.0")]
+[assembly: AssemblyFileVersion("1.11.0.0")]
+[assembly: AssemblyInformationalVersion("5acfa48")]
 

+ 4 - 4
MesAdaptor/Properties/AssemblyInfo.cs

@@ -31,7 +31,7 @@ using System.Runtime.InteropServices;
 //
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.10.3.0")]
-[assembly: AssemblyVersion("1.10.3.0")]
-[assembly: AssemblyFileVersion("1.10.3.0")]
-[assembly: AssemblyInformationalVersion("90391dc")]
+// [assembly: AssemblyVersion("1.11.0.0")]
+[assembly: AssemblyVersion("1.11.0.0")]
+[assembly: AssemblyFileVersion("1.11.0.0")]
+[assembly: AssemblyInformationalVersion("5acfa48")]