加入通讯模块类型,初步支持wifi通讯
This commit is contained in:
parent
776b9cfe62
commit
3d2a3b10fb
@ -30,6 +30,7 @@ namespace Plane.FormationCreator
|
|||||||
{
|
{
|
||||||
public App()
|
public App()
|
||||||
{
|
{
|
||||||
|
VersionControl.GetSettingFromIni();
|
||||||
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("en-US");
|
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("en-US");
|
||||||
|
|
||||||
ServiceLocatorConfigurer.Instance.Configure();
|
ServiceLocatorConfigurer.Instance.Configure();
|
||||||
@ -69,7 +70,7 @@ namespace Plane.FormationCreator
|
|||||||
};
|
};
|
||||||
//new Test().Prepare().Run();
|
//new Test().Prepare().Run();
|
||||||
|
|
||||||
VersionControl.GetSettingFromIni();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ILogger _logger;
|
private ILogger _logger;
|
||||||
@ -133,20 +134,25 @@ namespace Plane.FormationCreator
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
if (VersionControl.ConType == 1)
|
||||||
UdpServerConnectionManager.Instance.ExceptionThrown += (sender, e1) =>
|
{
|
||||||
{
|
CommModuleManager.Instance.UseTransModule = false;
|
||||||
_logger.Log(e1.Exception);
|
UdpServerConnectionManager.Instance.ExceptionThrown += (sender, e1) =>
|
||||||
};
|
{
|
||||||
UdpServerConnectionManager.Instance.ConnectionEstablished += ConnectionManager_ConnectionEstablished;
|
_logger.Log(e1.Exception);
|
||||||
UdpServerConnectionManager.Instance.StartReceiving();
|
};
|
||||||
*/
|
UdpServerConnectionManager.Instance.ConnectionEstablished += ConnectionManager_ConnectionEstablished;
|
||||||
|
UdpServerConnectionManager.Instance.StartReceiving();
|
||||||
//初始化地面站连接
|
}
|
||||||
CommModuleManager.Instance.CommunicationReceived += CommtionReceivedCopterInfo;
|
else
|
||||||
CommModuleManager.Instance.CommunicationCopterDisconnect += CommCopterDisconnect;
|
{
|
||||||
CommModuleManager.Instance.CommunicationConnected += CommCopterconnected;
|
CommModuleManager.Instance.UseTransModule = true;
|
||||||
CommModuleManager.Instance.Connect();
|
//初始化地面站连接
|
||||||
|
CommModuleManager.Instance.CommunicationReceived += CommtionReceivedCopterInfo;
|
||||||
|
CommModuleManager.Instance.CommunicationCopterDisconnect += CommCopterDisconnect;
|
||||||
|
CommModuleManager.Instance.CommunicationConnected += CommCopterconnected;
|
||||||
|
CommModuleManager.Instance.Connect();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -196,7 +202,8 @@ namespace Plane.FormationCreator
|
|||||||
{
|
{
|
||||||
copter.Connection = Connection;
|
copter.Connection = Connection;
|
||||||
}
|
}
|
||||||
await copter.ConnectAsync().ConfigureAwait(false);
|
if (copter!=null)
|
||||||
|
await copter.ConnectAsync().ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void ConnectionManager_ConnectionEstablished(object sender, ConnectionEstablishedEventArgs e)
|
private async void ConnectionManager_ConnectionEstablished(object sender, ConnectionEstablishedEventArgs e)
|
||||||
|
@ -29,6 +29,8 @@ namespace Plane.FormationCreator.Util
|
|||||||
|
|
||||||
public static string ServerURL = "";
|
public static string ServerURL = "";
|
||||||
|
|
||||||
|
public static int ConType = 0; //通讯模块
|
||||||
|
|
||||||
public static void SetUserLever(int vuserlever)
|
public static void SetUserLever(int vuserlever)
|
||||||
{
|
{
|
||||||
if (vuserlever==0)
|
if (vuserlever==0)
|
||||||
@ -78,13 +80,11 @@ namespace Plane.FormationCreator.Util
|
|||||||
else
|
else
|
||||||
ServerURL = DefaultServrURL;
|
ServerURL = DefaultServrURL;
|
||||||
|
|
||||||
|
readvalue = iniFiles.IniReadvalue("Default", "ConType");
|
||||||
|
if (readvalue != "")
|
||||||
|
ConType = int.Parse(readvalue);
|
||||||
|
else
|
||||||
|
ConType = 0;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SaveLogininfoToIni(string username,string password,bool issavepassword)
|
public static void SaveLogininfoToIni(string username,string password,bool issavepassword)
|
||||||
|
Loading…
Reference in New Issue
Block a user