Przeglądaj źródła

配置获取调试

样式分支
pry 2 lat temu
rodzic
commit
aa4322ea5e
5 zmienionych plików z 12 dodań i 7 usunięć
  1. +2
    -2
      BPASmartClient.Business/Plugin/ConfigMgr.cs
  2. +2
    -0
      BPASmartClient.Business/Plugin/MQTTMgr.cs
  3. +2
    -2
      BPASmartClient.Business/Plugin/OrderProxy.cs
  4. +3
    -1
      BPASmartClient/App.config
  5. +3
    -2
      BPASmartClient/DeviceInfo.xml

+ 2
- 2
BPASmartClient.Business/Plugin/ConfigMgr.cs Wyświetl plik

@@ -1,5 +1,6 @@
using BPA.ApolloClient;
using BPA.Message;
using BPASmartClient.Message;
using BPASmartClient.Model;
using Microsoft.Extensions.Configuration;
using System.Xml.Linq;
@@ -35,7 +36,6 @@ namespace BPASmartClient.Business
apolloUri = System.Configuration.ConfigurationManager.AppSettings["ApolloUri"].ToString();
InternetInfo.OrderServer = System.Configuration.ConfigurationManager.AppSettings["OrderServiceUri"].ToString();
InternetInfo.StockServer = System.Configuration.ConfigurationManager.AppSettings["StockServiceUri"].ToString();

InitDeviceModel();
InitMQTT();
}
@@ -92,7 +92,6 @@ namespace BPASmartClient.Business
/// </summary>
private void InitMQTT()
{

IConfigurationBuilder configurationBuilder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory());
configurationBuilder.AddApolloConfiguration(p =>
{
@@ -103,6 +102,7 @@ namespace BPASmartClient.Business
IConfiguration config = configurationBuilder.Build();
var mqttBroker = config.GetSection("BrokerHostSettings");
MQTT_Config = mqttBroker.Value.FromJSON<MQTT_Entity>();
if (MQTT_Config == null) MessageLog.GetInstance.Show("获取配置数据为空!");
}

public void Start()


+ 2
- 0
BPASmartClient.Business/Plugin/MQTTMgr.cs Wyświetl plik

@@ -1,5 +1,6 @@
using BPA.Message;
using BPASmartClient.Helper;
using BPASmartClient.Message;
using BPASmartClient.MQTT;
using HBLConsole.Communication;
using Microsoft.Extensions.Configuration;
@@ -56,6 +57,7 @@ namespace BPASmartClient.Business
{
msg.Enqueue(message);
});
MessageLog.GetInstance.Show("准备连接MQTT");
//MQTT 初始化
mqttProxy.Connect(Plugin.GetInstance().GetPlugin<ConfigMgr>().MQTT_Config.Host, Plugin.GetInstance().GetPlugin<ConfigMgr>().MQTT_Config.Port,
Guid.NewGuid().ToString());


+ 2
- 2
BPASmartClient.Business/Plugin/OrderProxy.cs Wyświetl plik

@@ -1,4 +1,4 @@
//#define test
#define test
using BPA.Message;
using BPA.Message.Enum;
using BPASmartClient.EventBus;
@@ -127,7 +127,7 @@ namespace BPASmartClient.Business
try
{
string header = $"[{InternetInfo.OrderServer}/order/robotstatuschange]_[{DateTime.Now.Ticks}]".AESEncrypt();
string url = $"{InternetInfo.OrderServer}/order/robotstatuschange";
string url = $"{InternetInfo.OrderServer}order/robotstatuschange";
result = APIHelper.GetInstance.HttpRequest(url, header, orderStatusChange, RequestType.POST);
}
catch (Exception ex)


+ 3
- 1
BPASmartClient/App.config Wyświetl plik

@@ -16,7 +16,9 @@
<add key="OrderServiceUri" value="http://10.2.1.26:21527/order/"/>
<add key="StockServiceUri" value="http://10.2.1.26:21527/stock/"/>-->

<add key="ApolloUri" value="https://bpa.black-pa.com:28080"/>
<!--<add key="ApolloUri" value="https://bpa.black-pa.com:28080"/>-->
<add key="ApolloUri" value="http://10.2.1.21:28080"/>

<add key="OrderServiceUri" value="https://bpa.black-pa.com:21527/order/"/>
<add key="StockServiceUri" value="https://bpa.black-pa.com:21527/stock/"/>



+ 3
- 2
BPASmartClient/DeviceInfo.xml Wyświetl plik

@@ -27,8 +27,9 @@
<Peripherals>
<Peripheral Module="BPASmartClient.PLC.MorksMachine">
<Parameters>
<IpAddress>192.168.1.11</IpAddress>
<Port>508</Port>
<!--<IpAddress>192.168.1.11</IpAddress>-->
<IpAddress>127.0.0.1</IpAddress>
<Port>502</Port>
<PLCReadAddress>M,M0.3,3;M,M100.0,16;M,M235.0,1;M,M102.0,7;M,M103.0,6;VW,VW372,1</PLCReadAddress>
</Parameters>
</Peripheral>


Ładowanie…
Anuluj
Zapisz