Commit d150bb1f authored by golgoj4's avatar golgoj4

refs #2017 - due to some administrative blunders, need to move Hue_Controller,...

refs #2017 - due to some administrative blunders, need to move Hue_Controller, to HueController in the source tree. The packages in 
the repo have been updated to reflect the new location. the .pro is also set to place the binary in /src/bin and the package
has been updated to reflect that as well.
parent 8cfb6569
......@@ -10,7 +10,7 @@
#include "../pluto_main/Define_Event.h"
#include "../pluto_main/Define_EventParameter.h"
#include "../pluto_main/Define_DeviceData.h"
#include <QObject>
/**
* THESE CLASSES ARE AUTOGENERATED WITH PLUTO DCEGEN APPLICATION
......@@ -136,7 +136,7 @@ public:
* @brief OUR DATA CLASS
*/
class HueController_Data : public DeviceData_Impl
class HueController_Data : public DeviceData_Impl, public QObject
{
public:
......@@ -199,10 +199,10 @@ public:
// OUR COMMAND CLASS
class HueController_Command : public Command_Impl
class HueController_Command : public Command_Impl, public QObject
{
public:
HueController_Command(int DeviceID, string ServerAddress,bool bConnectEventHandler=true,bool bLocalMode=false,class Router *pRouter=NULL)
HueController_Command(int DeviceID, string ServerAddress,bool bConnectEventHandler=true,bool bLocalMode=false,class Router *pRouter=NULL, QObject * parent=0)
: Command_Impl(DeviceID, ServerAddress, bLocalMode, pRouter)
{
}
......@@ -286,7 +286,7 @@ public:
PostConfigCleanup();
return true;
};
HueController_Command(Command_Impl *pPrimaryDeviceCommand, DeviceData_Impl *pData, Event_Impl *pEvent, Router *pRouter) : Command_Impl(pPrimaryDeviceCommand, pData, pEvent, pRouter) {};
HueController_Command(Command_Impl *pPrimaryDeviceCommand, DeviceData_Impl *pData, Event_Impl *pEvent, Router *pRouter, QObject*parent) : Command_Impl(pPrimaryDeviceCommand, pData, pEvent, pRouter) {};
virtual ~HueController_Command() {};
HueController_Event *GetEvents() { return (HueController_Event *) m_pEvent; };
HueController_Data *GetData() { return (HueController_Data *) m_pData; };
......
......@@ -12,12 +12,12 @@
*/
//<-dceag-d-b->
#ifndef Hue_Controller_h
#define Hue_Controller_h
#ifndef HueController_h
#define HueController_h
// DCE Implemenation for #2256 Hue Controller
#include "Gen_Devices/Hue_ControllerBase.h"
#include "Gen_Devices/HueControllerBase.h"
//<-dceag-d-e->
#include <QObject>
#include <qjson/serializer.h>
......@@ -31,7 +31,7 @@
//<-dceag-decl-b->
namespace DCE
{
class Hue_Controller : public Hue_Controller_Command
class HueController : public HueController_Command
{
Q_OBJECT
//<-dceag-decl-e->
......@@ -57,8 +57,8 @@ namespace DCE
//<-dceag-const-b->
public:
// Constructors/Destructor
Hue_Controller(int DeviceID, string ServerAddress,bool bConnectEventHandler=true,bool bLocalMode=false,class Router *pRouter=NULL, QObject*parent=0);
virtual ~Hue_Controller();
HueController(int DeviceID, string ServerAddress,bool bConnectEventHandler=true,bool bLocalMode=false,class Router *pRouter=NULL, QObject*parent=0);
virtual ~HueController();
virtual bool GetConfig();
virtual bool Register();
virtual void ReceivedCommandForChild(DeviceData_Impl *pDeviceData_Impl,string &sCMD_Result,Message *pMessage);
......@@ -80,7 +80,7 @@ namespace DCE
//<-dceag-const2-b->
// The following constructor is only used if this a class instance embedded within a DCE Device. In that case, it won't create it's own connection to the router
// You can delete this whole section and put an ! after dceag-const2-b tag if you don't want this constructor. Do the same in the implementation file
//Hue_Controller(Command_Impl *pPrimaryDeviceCommand, DeviceData_Impl *pData, Event_Impl *pEvent, Router *pRouter);
//HueController(Command_Impl *pPrimaryDeviceCommand, DeviceData_Impl *pData, Event_Impl *pEvent, Router *pRouter);
//<-dceag-const2-e->
//<-dceag-h-b->
......
......@@ -46,8 +46,8 @@ SOURCES += ../Main.cpp \
../../DCE/DeviceData_Base.cpp \
../../DCE/DeviceData_Impl.cpp \
../../PlutoUtils/getch.cpp \
../../Gen_Devices/Hue_ControllerBase.cpp \
../Hue_Controller.cpp \
../../Gen_Devices/HueControllerBase.cpp \
../HueController.cpp \
huecontrollerhardware.cpp \
huebulb.cpp
......@@ -71,7 +71,7 @@ HEADERS += ../../PlutoUtils/ThreadedClass.h \
../../PlutoUtils/FileUtils.h \
../../pluto_main/Define_DeviceCategory.h \
../../pluto_main/Define_DeviceTemplate.h \
../../Gen_Devices/Hue_ControllerBase.h \
../Hue_Controller.h \
../../Gen_Devices/HueControllerBase.h \
../HueController.h \
huecontrollerhardware.h \
huebulb.h
......@@ -11,7 +11,7 @@
See the GNU General Public License for more details.
*/
#include "Hue_Controller.h"
#include "HueController.h"
#include <QCoreApplication>
//<-dceag-incl-b->
......@@ -80,7 +80,7 @@ int IsRuntimePlugin()
// Then the Router will scan for all .so or .dll files, and if found they will be registered with a temporary device number
bool bIsRuntimePlugin=false;
if( bIsRuntimePlugin )
return Hue_Controller::PK_DeviceTemplate_get_static();
return HueController::PK_DeviceTemplate_get_static();
else
return 0;
}
......@@ -94,19 +94,19 @@ class Command_Impl *RegisterAsPlugIn(class Router *pRouter,int PK_Device,Logger
LoggerWrapper::SetInstance(pPlutoLogger);
LoggerWrapper::GetInstance()->Write(LV_STATUS, "Device: %d loaded as plug-in",PK_Device);
Hue_Controller *pHue_Controller = new Hue_Controller(PK_Device, "localhost",true,false,pRouter);
if( pHue_Controller->m_bQuit_get()|| !pHue_Controller->GetConfig() )
HueController *pHueController = new HueController(PK_Device, "localhost",true,false,pRouter);
if( pHueController->m_bQuit_get()|| !pHueController->GetConfig() )
{
delete pHue_Controller;
delete pHueController;
return NULL;
}
else
{
g_pCommand_Impl=pHue_Controller;
g_pCommand_Impl=pHueController;
g_pDeadlockHandler=Plugin_DeadlockHandler;
g_pSocketCrashHandler=Plugin_SocketCrashHandler;
}
return pHue_Controller;
return pHueController;
}
}
//<-dceag-plug-e->
......@@ -119,7 +119,7 @@ int main(int argc, char* argv[])
g_sBinary = FileUtils::FilenameWithoutPath(argv[0]);
g_sBinaryPath = FileUtils::BasePath(argv[0]);
cout << "Hue_Controller, v." << VERSION << endl
cout << "HueController, v." << VERSION << endl
<< "Visit www.plutohome.com for source code and license information" << endl << endl;
string sRouter_IP="dcerouter";
......@@ -160,7 +160,7 @@ int main(int argc, char* argv[])
if (bError)
{
cout << "A Pluto DCE Device. See www.plutohome.com/dce for details." << endl
<< "Usage: Hue_Controller [-r Router's IP] [-d My Device ID] [-l dcerouter|stdout|null|filename]" << endl
<< "Usage: HueController [-r Router's IP] [-d My Device ID] [-l dcerouter|stdout|null|filename]" << endl
<< "-r -- the IP address of the DCE Router Defaults to 'dcerouter'." << endl
<< "-d -- This device's ID number. If not specified, it will be requested from the router based on our IP address." << endl
<< "-l -- Where to save the log files. Specify 'dcerouter' to have the messages logged to the DCE Router. Defaults to stdout." << endl;
......@@ -184,7 +184,7 @@ int main(int argc, char* argv[])
try
{
if( sLogger=="dcerouter" )
LoggerWrapper::SetInstance(new ServerLogger(PK_Device, Hue_Controller::PK_DeviceTemplate_get_static(), sRouter_IP));
LoggerWrapper::SetInstance(new ServerLogger(PK_Device, HueController::PK_DeviceTemplate_get_static(), sRouter_IP));
else if( sLogger=="null" )
LoggerWrapper::SetType(LT_LOGGER_NULL);
else if( sLogger!="stdout" )
......@@ -201,18 +201,18 @@ int main(int argc, char* argv[])
bool bAppError=false;
bool bReload=false;
Hue_Controller *pHue_Controller = new Hue_Controller(PK_Device, sRouter_IP,true,bLocalMode);
HueController *pHueController = new HueController(PK_Device, sRouter_IP,true,bLocalMode);
if ( pHue_Controller->GetConfig() && pHue_Controller->Connect(pHue_Controller->PK_DeviceTemplate_get()) )
if ( pHueController->GetConfig() && pHueController->Connect(pHueController->PK_DeviceTemplate_get()) )
{
LoggerWrapper::GetInstance()->Write(LV_STATUS, "Connect OK");
pHue_Controller->CreateChildren();
pHueController->CreateChildren();
return a.exec();
}
else
{
bAppError = true;
if( pHue_Controller->m_pEvent && pHue_Controller->m_pEvent->m_pClientSocket && pHue_Controller->m_pEvent->m_pClientSocket->m_eLastError==ClientSocket::cs_err_CannotConnect )
if( pHueController->m_pEvent && pHueController->m_pEvent->m_pClientSocket && pHueController->m_pEvent->m_pClientSocket->m_eLastError==ClientSocket::cs_err_CannotConnect )
{
bAppError = false;
bReload = false;
......@@ -223,10 +223,10 @@ int main(int argc, char* argv[])
}
if( pHue_Controller->m_bReload )
if( pHueController->m_bReload )
bReload=true;
delete pHue_Controller;
delete pHueController;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment