Esempio n. 1
0
AREXPORT void ArAction::log(bool verbose) const
{
  int i;
  const ArArg *arg;
  const ArActionDesired *desired;

  ArLog::log(ArLog::Terse, "Action %s isActive %d", getName(), myIsActive);
  if (myIsActive && (desired = getDesired()) != NULL)
    desired->log();
  if (!verbose)
    return;
  if (strlen(getDescription()) != 0)
    ArLog::log(ArLog::Terse, "Action %s is described as: %s", 
	       getName(), getDescription());
  else
    ArLog::log(ArLog::Terse, "Action %s has no description.", 
	       getName());
  if (getNumArgs() == 0)
    ArLog::log(ArLog::Terse, "Action %s has no arguments.\n", 
	       getName());
  else
  {
    ArLog::log(ArLog::Terse, "Action %s has %d arguments, of type(s):", 
	       (getName()), getNumArgs());

    for (i = 0; i < getNumArgs(); i++) 
    {
      arg = getArg(i);
      if (arg == NULL)
	continue;
      arg->log();
    }
    ArLog::log(ArLog::Terse, "");
  }
}
// Software Initialization:
// input parameter:
//       void : nothing
// return type:
//       int  : return SUCCESS, init Software
int init(void) {

	int level;
	double actual, desired;
	char sensorTempData[5];

	initLogging("temp_log");
	initCSVFile("temp_csv");
	initConfigFile("temp_config");

	logging(INFO, "\nStarting CliConWARE Software....");

	// Printing current hour:
	printf("    -- Current hour        : %d:%02d\n", getHour(), getMin());

	// Printing actual temperature:
	readData("/dev/temp_sensor", sensorTempData);
	actual = (double) atof(sensorTempData)/ 1000;
	printf("    -- Actual temperature  : %.2f°C\n", actual);

	// Printing desired temperature:
	desired = getDesired("temp_config");
	printf("    -- Desired temperature : %.2f°C\n", desired);

	// Printing current knob level:
	level = map(actual);
	printf("    -- Current knob level  : %d\n", level);

	logging(INFO, "The Software will start in 3 seconds.....\n");
	sleep(3);

	return SUCCESS;
}
Esempio n. 3
0
void
AmendmentTableImpl::doValidation (Ledger::ref lastClosedLedger,
    STObject& baseValidation)
{
    amendmentList_t lAmendments = getDesired();

    if (lAmendments.empty())
        return;

    STVector256 vAmendments (sfAmendments);
    for (auto const& uAmendment : lAmendments)
        vAmendments.push_back (uAmendment);
    vAmendments.sort ();
    baseValidation.setFieldV256 (sfAmendments, vAmendments);
}