1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- #include "stdafx.h"
- #include "CCOS.Dev.DapMoudle.hpp"
- #include "CCOSDICOMInfo.h"
- using namespace CCOS::Dev;
- using namespace CCOS::Dev::Detail::DAP;
- namespace nsDAP = CCOS::Dev::Detail::DAP;
- nsDAP::DapDevice::DapDevice(std::shared_ptr <CCOS::Dev::IOEventCenter> EventCenter) :super(EventCenter)
- {
- m_EventCenter = EventCenter;
- //m_nXSize = 0;
- //m_nYSize = 0;
- //m_nFilter = 0;
- //m_nSID = 0;
- //m_nAngle = 0;
- //m_nMode = -1;
- m_fDAP = 0;
- }
- nsDAP::DapDevice::~DapDevice()
- {
- }
- void nsDAP::DapDevice::FireNotify(string key, WORD value)
- {
- char szInfo[64] = { 0 };
- sprintf_s(szInfo, "%d", value);
- std::string str = szInfo;
- m_EventCenter->OnNotify(1, key, str);//(int)ATTRACTION_SET 2
- }
- void nsDAP::DapDevice::Register()
- {
- auto Disp = &Dispatch;
- Disp->Action.Push("Clear_DAP", this, &nsDAP::DapDevice::JSClearDAP);
- Disp->Action.Push("Query_DAP", this, &nsDAP::DapDevice::JSQueryDAP);
- Disp->Get.Push("DAP", this, &nsDAP::DapDevice::JSGetDAP);
- }
- bool nsDAP::DapDevice::Prepare()
- {
- Register();
- return true;
- }
- std::string nsDAP::DapDevice::GetGUID() const
- {
- return DapUnitType;
- }
- RET_STATUS DapDevice::JSClearDAP(std::string in, std::string& out)
- {
- ResDataObject json;
- json.decode(in.c_str());
- return ClearDAP(json);
- }
- RET_STATUS DapDevice::JSQueryDAP(std::string in, std::string& out)
- {
- ResDataObject json;
- json.decode(in.c_str());
- return QueryDAP(json);
- }
- RET_STATUS DapDevice::JSGetDAP(std::string& out)
- {
- char szInfo[64] = { 0 };
- sprintf_s(szInfo, "%f", m_fDAP);
- out = szInfo;
- return RET_STATUS::RET_SUCCEED;
- }
- RET_STATUS DapDevice::ClearDAP(ResDataObject& pParam)
- {
- return RET_STATUS::RET_SUCCEED;
- }
- RET_STATUS DapDevice::QueryDAP(ResDataObject& pParam)
- {
- return RET_STATUS::RET_SUCCEED;
- }
- void DapDevice::UpdateMammo_DAP(float Value)
- {
- m_fDAP = Value;
- FireNotify("DAP", Value);
- }
|