必须最少引用头文件
This commit is contained in:
parent
8f0f21b30f
commit
f11a652f3f
|
@ -11,6 +11,8 @@
|
||||||
|
|
||||||
#include "TokenNet\TokenController.h"
|
#include "TokenNet\TokenController.h"
|
||||||
|
|
||||||
|
#include "Device\RTC.h"
|
||||||
|
|
||||||
AP0801* AP0801::Current = nullptr;
|
AP0801* AP0801::Current = nullptr;
|
||||||
|
|
||||||
AP0801::AP0801()
|
AP0801::AP0801()
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
#include "TokenNet\TokenClient.h"
|
#include "TokenNet\TokenClient.h"
|
||||||
#include "Message\ProxyFactory.h"
|
#include "Message\ProxyFactory.h"
|
||||||
#include "App\Alarm.h"
|
#include "App\Alarm.h"
|
||||||
#include "Device\RTC.h"
|
|
||||||
|
|
||||||
// 阿波罗0801/0802
|
// 阿波罗0801/0802
|
||||||
class AP0801
|
class AP0801
|
||||||
|
|
|
@ -14,7 +14,7 @@ error code
|
||||||
ProxyFactory::ProxyFactory():Proxys(String::Compare)
|
ProxyFactory::ProxyFactory():Proxys(String::Compare)
|
||||||
{
|
{
|
||||||
debug_printf("创建 ProxyFac\r\n");
|
debug_printf("创建 ProxyFac\r\n");
|
||||||
Client = nullptr;
|
Client = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ProxyFactory::Open(TokenClient* client)
|
bool ProxyFactory::Open(TokenClient* client)
|
||||||
|
@ -32,6 +32,7 @@ bool ProxyFactory::Open(TokenClient* client)
|
||||||
Client->Register("Proxy/Read", &ProxyFactory::Read, this);
|
Client->Register("Proxy/Read", &ProxyFactory::Read, this);
|
||||||
Client->Register("Proxy/QueryPorts",&ProxyFactory::QueryPorts, this);
|
Client->Register("Proxy/QueryPorts",&ProxyFactory::QueryPorts, this);
|
||||||
debug_printf("\r\n");
|
debug_printf("\r\n");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,23 +245,27 @@ bool ProxyFactory::QueryPorts(const Pair& args, Stream& result)
|
||||||
bool ProxyFactory::Upload(Proxy& port, Buffer& data)
|
bool ProxyFactory::Upload(Proxy& port, Buffer& data)
|
||||||
{
|
{
|
||||||
if (!Client)return false;
|
if (!Client)return false;
|
||||||
|
|
||||||
MemoryStream ms;
|
MemoryStream ms;
|
||||||
BinaryPair bp(ms);
|
BinaryPair bp(ms);
|
||||||
bp.Set("Port", port.Name);
|
bp.Set("Port", port.Name);
|
||||||
bp.Set("Data", data);
|
bp.Set("Data", data);
|
||||||
Client->Invoke("Proxy/Upload", Buffer(ms.GetBuffer(),ms.Position()));
|
Client->Invoke("Proxy/Upload", Buffer(ms.GetBuffer(),ms.Position()));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ProxyFactory::UpOpen(Proxy& port)
|
bool ProxyFactory::UpOpen(Proxy& port)
|
||||||
{
|
{
|
||||||
if (!Client)return false;
|
if (!Client)return false;
|
||||||
|
|
||||||
MemoryStream ms;
|
MemoryStream ms;
|
||||||
BinaryPair bp(ms);
|
BinaryPair bp(ms);
|
||||||
bp.Set("Port", port.Name);
|
bp.Set("Port", port.Name);
|
||||||
bp.Set("Open", (byte)0x01);
|
bp.Set("Open", (byte)0x01);
|
||||||
|
|
||||||
Client->Invoke("Proxy/Open", Buffer(ms.GetBuffer(), ms.Position()));
|
Client->Invoke("Proxy/Open", Buffer(ms.GetBuffer(), ms.Position()));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
#define __ProxyFactory_H__
|
#define __ProxyFactory_H__
|
||||||
|
|
||||||
#include "Sys.h"
|
#include "Sys.h"
|
||||||
#include "TokenNet\TokenMessage.h"
|
|
||||||
#include "Message\Pair.h"
|
#include "Message\Pair.h"
|
||||||
#include "TokenNet\TokenClient.h"
|
#include "TokenNet\TokenClient.h"
|
||||||
#include "Device\Proxy.h"
|
#include "Device\Proxy.h"
|
||||||
|
@ -15,8 +14,8 @@ public:
|
||||||
Dictionary<cstring, Proxy*> Proxys;
|
Dictionary<cstring, Proxy*> Proxys;
|
||||||
TokenClient* Client;
|
TokenClient* Client;
|
||||||
|
|
||||||
|
|
||||||
ProxyFactory();
|
ProxyFactory();
|
||||||
|
|
||||||
// 工程打开
|
// 工程打开
|
||||||
bool Open(TokenClient* client);
|
bool Open(TokenClient* client);
|
||||||
// 端口注册
|
// 端口注册
|
||||||
|
|
Loading…
Reference in New Issue