Skip to content

Commit

Permalink
added js nodes and new update for freja controller
Browse files Browse the repository at this point in the history
  • Loading branch information
santais committed Jun 10, 2016
1 parent 9a33934 commit c1b1a37
Show file tree
Hide file tree
Showing 6 changed files with 906 additions and 138 deletions.
20 changes: 20 additions & 0 deletions freja_controller/include/BuildingController.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,20 @@ namespace OIC { namespace Service {
ResourceObject::ResourceObjectCacheCallback getControllerResourceCacheObjCallback();
ResourceObject::ResourceObjectStateCallback getControllerResourceStateObjCallback();


/**
* @brief setMaxTemperatureThreshold Set min and max threshold
* @param threshold
*/
void setMaxTemperatureThreshold(const double &threshold);
void setMinTemperatureThreshold(const double &threshold);

/**
* @brief getMaxTemperatureThreshold
* @return
*/
double getMaxTemperatureThreshold();
double getMinTemperatureThreshold();
private:
/**
* Map containing all discovered resources.
Expand Down Expand Up @@ -159,6 +173,12 @@ namespace OIC { namespace Service {
ResourceObject::ResourceObjectCacheCallback m_resourceObjectCacheCallback;
ResourceObject::ResourceObjectStateCallback m_resourceObjectStateCallback;

/**
* Min and Max threshold
*/
double m_maxThreshold;
double m_minThreshold;

private:

/**
Expand Down
17 changes: 16 additions & 1 deletion freja_controller/program/buildingControllerMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,25 @@ void handleSigInt(int signum)
}
}

int main()
int main(int argc, char** argv)
{
std::cout << "Starting test program" << std::endl;
controller = BuildingController::Ptr(BuildingController::getInstance());

// Set max and minimum threshold
if(argc > 1)
{
if(argv[1])
{
std::cout << "Min temperature is set to: " << argv[1] << std::endl;
controller->setMinTemperatureThreshold(static_cast<double>(atof(argv[1])));
}
if(argv[2])
{
std::cout << "Max temperature is set to " << argv[2] << std::endl;
controller->setMaxTemperatureThreshold(static_cast<double>(atof(argv[2])));
}
}
controller->start();
signal(SIGINT, handleSigInt);
while (!g_quitFlag)
Expand Down
Loading

0 comments on commit c1b1a37

Please sign in to comment.