ossimRefPtr<ossimElevCellHandler> ossimElevationCellDatabase::getOrCreateCellHandler(const ossimGpt& gpt) { ossimRefPtr<ossimElevCellHandler> result = 0; ossim_uint64 id = createId(gpt); { OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_cacheMapMutex); CellMap::iterator iter = m_cacheMap.find(id); if(iter != m_cacheMap.end()) { iter->second->updateTimestamp(); result = iter->second->m_handler.get(); return result.get(); } } result = createCell(gpt); { OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_cacheMapMutex); if(result.valid()) { m_cacheMap.insert(std::make_pair(id, new CellInfo(id, result.get()))); // Check the map size and purge cells if needed. if(m_cacheMap.size() > m_maxOpenCells) { flushCacheToMinOpenCells(); } } } return result; }
DataTrans::DataTrans() :m_Id(createId()), m_sendedSize(0), m_isFailed(false), m_isCancelled(false) { }
bool DemoWriter::writeDemonstration(const sensor_msgs::PointCloud& object, const geometry_msgs::PoseStamped& gripper_pose, const geometry_msgs::PoseStamped& table_pose, const geometry_msgs::PoseStamped& viewpoint, const std::vector<double>& fingerpositions) { SimpleLabel id_msg; id_msg.event_label = labelGraspDemoId(); id_msg.event_label.append(createId()); id_msg.stamp = ros::Time::now(); DoubleVector fs; fs.vals = fingerpositions; ROS_DEBUG("grasp_template_planning::DemoWriter: Writing demonstration to bag: %s", bag_.getFileName().c_str()); try { bag_.write(topicGraspDemoEvents(), ros::Time::now(), id_msg); bag_.write(topicGraspDemoObjectCluster(), ros::Time::now(), object); bag_.write(topicGraspDemoGripperPose(), ros::Time::now(), gripper_pose); bag_.write(topicGraspDemoTable(), ros::Time::now(), table_pose); bag_.write(topicViewpointTransform(), ros::Time::now(), viewpoint); bag_.write(topicFingerpositions(), ros::Time::now(), fs); } catch (rosbag::BagIOException ex) { ROS_DEBUG("grasp_template_planning::DemoWriter: Problem when writing demonstration to file >%s< : %s.", bag_.getFileName().c_str(), ex.what()); return false; } return true; }
Session::Session(Service *parent, SecretCodec *codec) : KSecretObject< Session, orgFreedesktopSecret::SessionAdaptor >(parent), m_secretCodec(codec) { // register on the bus registerWithPath(parent->objectPath().path() + QStringLiteral( "/session/" ) + createId()); }
PromptBase::PromptBase(Service *service, QObject *parent) : KSecretObject< PromptBase, orgFreedesktopSecret::PromptAdaptor >(parent), m_serviceObjectPath(service->objectPath()) { Q_ASSERT(service); registerWithPath(service->objectPath().path() + QStringLiteral( "/prompts/" ) + createId()); }
static int createCode(struct JsonNode *code) { int id = -1; int unit = -1; int state = -1; double itmp = -1; if(json_find_number(code, "id", &itmp) == 0) id = (int)round(itmp); if(json_find_number(code, "unit", &itmp) == 0) unit = (int)round(itmp); if(json_find_number(code, "down", &itmp) == 0) state=0; else if(json_find_number(code, "up", &itmp) == 0) state=1; if(id == -1 || unit == -1 || state == -1) { logprintf(LOG_ERR, "arctech_screen_old: insufficient number of arguments"); return EXIT_FAILURE; } else if(id > 31 || id < 0) { logprintf(LOG_ERR, "arctech_screen_old: invalid id range"); return EXIT_FAILURE; } else if(unit > 15 || unit < 0) { logprintf(LOG_ERR, "arctech_screen_old: invalid unit range"); return EXIT_FAILURE; } else { createMessage(id, unit, state); clearCode(); createUnit(unit); createId(id); createState(state); createFooter(); arctech_screen_old->rawlen = RAW_LENGTH; } return EXIT_SUCCESS; }
MediaObjectImpl::MediaObjectImpl (const boost::property_tree::ptree &config, std::shared_ptr< MediaObject > parent) : config (config) { this->parent = parent; creationTime = time (NULL); initialId = createId(); this->sendTagsInEvents = false; }
/* *createExit function * *line : a pointer to a string represinting an exit * *this function will take a string represinting an exit *and return a struct exit */ struct exit *createExit(char *line) { char **params; struct exit *e; int now; e = malloc(sizeof(struct exit)); assert(e != 0); now = numberOfWords(line); assert(now == 3); params = divideLine(line, now, MAX_STRING_LENGTH); assert(params != 0); e -> exit_waypoint_id = createId(params[1]); e -> entry_point_id = createId(params[2]); freeCharArray(params, now); return e; }
void IdEditDialog::submit() { if (mIsNew) { createId(); } else { updateId(); } }
void KSecretCreateCollectionJob::newPasswordJobResult(KJob *job) { AbstractNewPasswordJob *npj = qobject_cast<AbstractNewPasswordJob*>(job); Q_ASSERT(npj); if(npj->cancelled()) { setCollection(0); setError(BackendErrorOther, i18n("Creating the secret collection was cancelled by the user.")); dismiss(); // this will also emitResult() return; } // TODO: collection needs authentication methods, filenames, ... QString errorMessage; QString collId = createId(); manager()->creatingCollection( collId ); KSecretCollection *coll = KSecretCollection::create(collId, npj->password(), manager(), errorMessage); if(!coll) { setCollection(0); setError(BackendErrorOther, errorMessage); dismiss(); // this will also emitResult() return; } coll->setLabel(label()); // NOTE: coll has to be added to m_collections before serializing it for the // first time, so when slotDirectoryChanged is called, the collection // is already known. m_manager->addCollection(coll); if(locked()) { coll->lock(); } setCollection(coll); // not yet time for emitResult(); // let the ACL dialog to pop before AbstractUiManager *uiManager = BackendMaster::instance()->uiManager(); AbstractAskAclPrefsJob *aclSubjob = uiManager->createAskAclPrefsJob(createCollectionInfo()); if ( addSubjob( aclSubjob ) ) { connect(aclSubjob, SIGNAL(result(KJob*)), SLOT(askAclPrefsJobResult(KJob*))); aclSubjob->start(); } else { qDebug() << "Cannot add aclSubjob"; setErrorText( i18n("Cannot launch ACL preferences job") ); emitResult(); } }
/* *createSpot function * *p : a pointer to an array of strings represinting a spot * *this function will take an array of strings represinting a spot *and return a struct spot */ struct spot *createSpot(char **p) { struct spot *s_s; char *temp; char **params; int now; int n = 0; s_s = malloc(sizeof(struct spot)); assert(s_s != 0); now = numberOfWords(p[n]); assert(now == 2); params = divideLine(p[n], now, MAX_STRING_LENGTH); assert(params != 0); s_s -> spot_id = createId(params[1]); freeCharArray(params, now); n++; temp = "spot_width"; now = numberOfWords(p[n]); params = divideLine(p[n], now, MAX_STRING_LENGTH); assert(params != 0); if(compTwoStrings(params[0], temp)){ assert(now == 2); s_s -> spot_width = atoi(params[1]); n++; } else s_s -> spot_width = -1; freeCharArray(params, now); temp = "checkpoint"; now = numberOfWords(p[n]); params = divideLine(p[n], now, MAX_STRING_LENGTH); assert(params != 0); if(compTwoStrings(params[0], temp)){ assert(now == 3); s_s -> check_waypoint = createCheckpoint(p[n]); n++; } else s_s -> check_waypoint = 0; freeCharArray(params, now); s_s -> waypoint1= createWaypoint(p[n++]); s_s -> waypoint2= createWaypoint(p[n]); return s_s; }
static int createCode(struct JsonNode *code) { int id = -1; int unit = -1; int state = -1; int all = 0; int learn = -1; double itmp = -1; if(json_find_number(code, "id", &itmp) == 0) id = (int)round(itmp); if(json_find_number(code, "unit", &itmp) == 0) unit = (int)round(itmp); if(json_find_number(code, "all", &itmp) == 0) all = (int)round(itmp); if(json_find_number(code, "off", &itmp) == 0) state=0; else if(json_find_number(code, "on", &itmp) == 0) state=1; if(json_find_number(code, "learn", &itmp) == 0) learn = 1; if(all > 0 && learn > -1) { logprintf(LOG_ERR, "arctech_switch: all and learn cannot be combined"); return EXIT_FAILURE; } else if(id == -1 || (unit == -1 && all == 0) || state == -1) { logprintf(LOG_ERR, "arctech_switch: insufficient number of arguments"); return EXIT_FAILURE; } else if(id > 67108863 || id < 1) { logprintf(LOG_ERR, "arctech_switch: invalid id range"); return EXIT_FAILURE; } else if((unit > 15 || unit < 0) && all == 0) { logprintf(LOG_ERR, "arctech_switch: invalid unit range"); return EXIT_FAILURE; } else { if(unit == -1 && all == 1) { unit = 0; } createMessage(id, unit, state, all, learn); createStart(); clearCode(); createId(id); createAll(all); createState(state); createUnit(unit); createFooter(); arctech_switch->rawlen = RAW_LENGTH; } return EXIT_SUCCESS; }
/* *createStop function * *line : a pointer to a string represinting a stop * *this function will take a string represinting a stop *and return a struct stop */ struct stop *createStop(char *line) { char **params; struct stop *s; int now; s = malloc(sizeof(struct stop)); assert(s != 0); now = numberOfWords(line); assert(now == 2); params = divideLine(line, now, MAX_STRING_LENGTH); assert(params != 0); s -> waypoint_id = createId(params[1]); freeCharArray(params, now); return s; }
void tviewer::ArrowArrayObject::addDataToVisualizer (pcl::visualization::PCLVisualizer& v) { for (size_t i = 0; i < data_->size (); ++i) { pcl::PointXYZ p1, p2; auto& arrow = data_->at (i); p1.getVector3fMap () = invert_direction_ ? arrow.target : arrow.source; p2.getVector3fMap () = invert_direction_ ? arrow.source : arrow.target; float r, g, b; std::tie (r, g, b) = getRGBFromColor (arrow.color); arrows_in_visualizer_.push_back (createId (i)); // Counter-intuitively, the arrow head is attached to the first point, so // we pass the target first. v.addArrow (p2, p1, r, g, b, false, arrows_in_visualizer_.back ()); } }
/* *createCheckpoint function * *line : a pointer to a string represinting a checkpoint * *this function will take a string represinting a checkpoint *and return a struct checkpoint */ struct checkpoint *createCheckpoint(char *line) { char **params; struct checkpoint *cp; int now; cp = malloc(sizeof(struct checkpoint)); assert(cp != 0); now = numberOfWords(line); assert(now == 3); params = divideLine(line, now, MAX_STRING_LENGTH); assert(params != 0); cp -> waypoint_id = createId(params[1]); cp -> checkpoint_id = atoi(params[2]); freeCharArray(params, now); return cp; }
static int createCode(JsonNode *code) { int id = -1; int systemcode = -1; int unit = -1; int state = -1; double itmp = -1; if(json_find_number(code, "id", &itmp) == 0) id = (int)round(itmp); if(json_find_number(code, "systemcode", &itmp) == 0) systemcode = (int)round(itmp); if(json_find_number(code, "unit", &itmp) == 0) unit = (int)round(itmp); if(json_find_number(code, "off", &itmp) == 0) state=1; if(json_find_number(code, "on", &itmp) == 0) state=0; if(id == -1 || systemcode == -1 || unit == -1 || state == -1) { logprintf(LOG_ERR, "daycom: insufficient number of arguments"); return EXIT_FAILURE; } else if(id > 63 || id < 0) { logprintf(LOG_ERR, "daycom: invalid id range"); return EXIT_FAILURE; } else if(systemcode > 16999 || systemcode < 0) { logprintf(LOG_ERR, "daycom: invalid systemcode range"); return EXIT_FAILURE; } else if(unit > 7 || unit < 0) { logprintf(LOG_ERR, "daycom: invalid unit range"); return EXIT_FAILURE; } else { createMessage(id, systemcode, unit, state); clearCode(); createId(id); createSystemCode(systemcode); createState(state); createUnit(unit); createFooter(); daycom->rawlen = RAW_LENGTH; state = 0; } return EXIT_SUCCESS; }
static int createCode(struct JsonNode *code) { int id = -1; int unit = -1; int state = -1; int all = 0; double itmp = -1; if(json_find_number(code, "id", &itmp) == 0) id = (int)round(itmp); if(json_find_number(code, "unit", &itmp) == 0) unit = (int)round(itmp); if(json_find_number(code, "all", &itmp) == 0) all = 1; if(json_find_number(code, "off", &itmp) == 0) state=0; if(json_find_number(code, "on", &itmp) == 0) state=1; if(id == -1 || (unit == -1 && all == 0) || (state == -1 && all == 1)) { logprintf(LOG_ERR, "beamish_switch: insufficient number of arguments"); return EXIT_FAILURE; } else if(id > 65535 || id < 1) { logprintf(LOG_ERR, "beamish_switch: invalid id range"); return EXIT_FAILURE; } else if((unit > 4 || unit < 1) && all == 0) { logprintf(LOG_ERR, "beamish_switch: invalid unit range"); return EXIT_FAILURE; } else { if(all == 1 && state == 1) unit = 5; if(all == 1 && state == 0) unit = 6; createMessage(id, unit, state, all); clearCode(); createId(id); unit = map[unit]; createUnit(unit); createFooter(); beamish_switch->rawlen = RAW_LENGTH; } return EXIT_SUCCESS; }
/* *createWaypoint function * *line : a pointer to a string represinting a waypoint * *this function will take a string represinting a waypoint *and return a struct waypoint */ struct waypoint *createWaypoint(char *line) { int now; char **params; struct waypoint *wp; wp = malloc(sizeof(struct waypoint)); assert(wp != 0); now = numberOfWords(line); assert(now == 3); params = divideLine(line, now, MAX_STRING_LENGTH); assert(params != 0); wp -> waypoint_id = createId(params[0]); wp -> latitude = atof(params[1]); wp -> longitude = atof(params[2]); freeCharArray(params, now); return wp; }
static int createCode(JsonNode *code) { double itmp = -1; int unit = -1, id = -1, learn = -1, state = -1, all = 0; if(json_find_number(code, "id", &itmp) == 0) id = (int)round(itmp); if(json_find_number(code, "unit", &itmp) == 0) unit = (int)round(itmp); if(json_find_number(code, "all", &itmp) == 0) all = (int)round(itmp); if(json_find_number(code, "learn", &itmp) == 0) learn = (int)round(itmp); if(json_find_number(code, "off", &itmp) == 0) state=0; else if(json_find_number(code, "on", &itmp) == 0) state=1; if(id==-1 || (unit==-1 && all==0) || state==-1) { logprintf(LOG_ERR, "quigg_gt7000: insufficient number of arguments"); return EXIT_FAILURE; } else if(id > 4095 || id < 0) { logprintf(LOG_ERR, "quigg_gt7000: invalid programm code id range"); return EXIT_FAILURE; } else if((unit > 3 || unit < 0) && all == 0) { logprintf(LOG_ERR, "quigg_gt7000: invalid button code unit range"); return EXIT_FAILURE; } else { if(unit == -1 && all == 1) { unit = 4; } quigg_gt7000->rawlen = RAW_LENGTH; createMessage(id, state, unit, all, learn); clearCode(); createId(id); createUnit(unit); createState(state); createParity(); createFooter(); } return EXIT_SUCCESS; }
char CGameWorld::LoginIn(SNetLink* pLink,const char* strAccout,const char* strPwd) { if (!pLink||!pLink->session) return LOGIN_PWD_ERROR; CUser* pUser = new CUser(); pUser->setUserId(createId()); pUser->Name(strAccout);//²âÊÔÓà pUser->setSession(pLink->session); pLink->valid = false; pLink->session = NULL; addUser(pUser); g_sendCmd->BeginWrite(); g_sendCmd->WriteShort(r2c_login_ret); g_sendCmd->WriteByte(LOGIN_IN_OK); g_sendCmd->WriteLong(pUser->getUserId()); g_sendCmd->WriteString((char*)pUser->Name()); pUser->revCmd(g_sendCmd); return LOGIN_IN_OK; }
#include <KLocalizedString> #include <QString> #include <QDBusInterface> #include <QDBusPendingReply> #include <QIcon> #include <QDBusServiceWatcher> #include "dbusinterfaces.h" // #include "modeltest.h" Q_LOGGING_CATEGORY(KDECONNECT_INTERFACES, "kdeconnect.interfaces"); static QString createId() { return QCoreApplication::instance()->applicationName()+QString::number(QCoreApplication::applicationPid()); } Q_GLOBAL_STATIC_WITH_ARGS(QString, s_keyId, (createId())); DevicesModel::DevicesModel(QObject *parent) : QAbstractListModel(parent) , m_dbusInterface(new DaemonDbusInterface(this)) , m_displayFilter(StatusFilterFlag::NoFilter) { //new ModelTest(this, this); connect(this, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SIGNAL(rowsChanged())); connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SIGNAL(rowsChanged())); connect(m_dbusInterface, SIGNAL(deviceAdded(QString)),
void GraspPlanningParams::setIdAndTime(GraspAnalysis& ana) { ana.uuid = createId(); ana.stamp = ros::Time::now(); }
/* *createPerimeter function * *p : a pointer to an array of strings represinting a perimeter * *this function will take an array of strings represinting a perimeter *and return a struct perimeter */ struct perimeter *createPerimeter(char **p) { struct perimeter *p_s; char *temp; char **params; int now; int n = 0; int i; int numOfEts; p_s = malloc(sizeof(struct perimeter)); assert(p_s != 0); now = numberOfWords(p[n]); assert(now == 2); params = divideLine(p[n], now, MAX_STRING_LENGTH); assert(params != 0); p_s -> perimeter_id = createId(params[1]); freeCharArray(params, now); n++; now = numberOfWords(p[n]); assert(now == 2); params = divideLine(p[n], now, MAX_STRING_LENGTH); assert(params != 0); p_s -> number_of_perimeterpoints = atoi(params[1]); freeCharArray(params, now); n++; numOfEts = 0; temp = "exit"; now = numberOfWords(p[n]); params = divideLine(p[n], now, MAX_STRING_LENGTH); assert(params != 0); while(compTwoStrings(params[0], temp)){ assert(now == 3); freeCharArray(params, now); numOfEts++; now = numberOfWords(p[n + numOfEts]); params = divideLine(p[n + numOfEts], now, MAX_STRING_LENGTH); assert(params != 0); } freeCharArray(params, now); p_s -> number_of_exits = numOfEts; if(numOfEts > 0) p_s -> exits_list = malloc(numOfEts * sizeof(struct stop)); else p_s -> exits_list = 0; for(i = 0; i < numOfEts; i++){ p_s -> exits_list[i] = createExit(p[n]); n++; } p_s -> perimeterpoints_list = malloc( (p_s -> number_of_perimeterpoints) * sizeof(struct perimeterpoint)); assert((p_s -> perimeterpoints_list) != 0); for(i = 0; i < p_s -> number_of_perimeterpoints; i++){ p_s -> perimeterpoints_list[i] = createPerimeterpoint(p[n]); n++; } return p_s; }
/* *createLane function * *p : a pointer to an array of strings represinting a lane * *this function will take an array of strings represinting a lane *and return a struct lane */ struct lane *createLane(char **p) { struct lane *l; char *temp; char **params; int now; int n = 0; int i; int numOfCkPts; int numOfSps; int numOfEts; l = malloc(sizeof(struct lane)); assert( l != 0); now = numberOfWords(p[n]); assert(now == 2); params = divideLine(p[n], now, MAX_STRING_LENGTH); assert(params != 0); l -> lane_id = createId(params[1]); freeCharArray(params, now); n++; now = numberOfWords(p[n]); assert(now == 2); params = divideLine(p[n], now, MAX_STRING_LENGTH); assert(params != 0); l -> number_of_waypoints = atoi(params[1]); freeCharArray(params, now); n++; temp = "lane_width"; now = numberOfWords(p[n]); params = divideLine(p[n], now, MAX_STRING_LENGTH); assert(params != 0); if(compTwoStrings(params[0], temp)){ assert(now == 2); l -> lane_width = atoi(params[1]); n++; } else l -> lane_width = -1; freeCharArray(params, now); temp = "left_boundary"; now = numberOfWords(p[n]); params = divideLine(p[n], now, MAX_STRING_LENGTH); assert(params != 0); if(compTwoStrings(params[0], temp)){ assert(now == 2); l -> left_boundary = malloc(MAX_STRING_LENGTH * sizeof(char)); stringCopy(params[1],l -> left_boundary); n++; } else l -> left_boundary = 0; freeCharArray(params, now); temp = "right_boundary"; now = numberOfWords(p[n]); params = divideLine(p[n], now, MAX_STRING_LENGTH); assert(params != 0); if(compTwoStrings(params[0], temp)){ assert(now == 2); l -> right_boundary = malloc(MAX_STRING_LENGTH * sizeof(char)); stringCopy(params[1],l -> right_boundary); n++; } else l -> right_boundary = 0; freeCharArray(params, now); numOfCkPts = 0; temp = "checkpoint"; now = numberOfWords(p[n]); params = divideLine(p[n], now, MAX_STRING_LENGTH); assert(params != 0); while(compTwoStrings(params[0], temp)){ assert(now == 3); freeCharArray(params, now); numOfCkPts++; now = numberOfWords(p[n + numOfCkPts]); params = divideLine(p[n + numOfCkPts], now, MAX_STRING_LENGTH); assert(params != 0); } freeCharArray(params, now); l -> number_of_checkpoints = numOfCkPts; if(numOfCkPts > 0) l -> checkpoints_list = malloc(numOfCkPts * sizeof(struct checkpoint)); else l -> checkpoints_list = 0; for(i = 0; i < numOfCkPts; i++){ l -> checkpoints_list[i] = createCheckpoint(p[n]); n++; } numOfSps = 0; temp = "stop"; now = numberOfWords(p[n]); params = divideLine(p[n], now, MAX_STRING_LENGTH); assert(params != 0); while(compTwoStrings(params[0], temp)){ assert(now == 2); freeCharArray(params, now); numOfSps++; now = numberOfWords(p[n + numOfSps]); params = divideLine(p[n + numOfSps], now, MAX_STRING_LENGTH); assert(params != 0); } freeCharArray(params, now); l -> number_of_stops = numOfSps; if(numOfSps > 0) l -> stops_list = malloc(numOfSps * sizeof(struct stop)); else l -> stops_list = 0; for(i = 0; i < numOfSps; i++){ l -> stops_list[i] = createStop(p[n]); n++; } numOfEts = 0; temp = "exit"; now = numberOfWords(p[n]); params = divideLine(p[n], now, MAX_STRING_LENGTH); assert(params != 0); while(compTwoStrings(params[0], temp)){ assert(now == 3); freeCharArray(params, now); numOfEts++; now = numberOfWords(p[n + numOfEts]); params = divideLine(p[n + numOfEts], now, MAX_STRING_LENGTH); assert(params != 0); } freeCharArray(params, now); l -> number_of_exits = numOfEts; if(numOfEts > 0) l -> exits_list = malloc(numOfEts * sizeof(struct stop)); else l -> exits_list = 0; for(i = 0; i < numOfEts; i++){ l -> exits_list[i] = createExit(p[n]); n++; } l -> waypoints_list = malloc( (l -> number_of_waypoints) * sizeof(struct waypoint)); assert((l -> waypoints_list) != 0); for(i = 0; i < l -> number_of_waypoints; i++){ l -> waypoints_list[i] = createWaypoint(p[n]); n++; } return l; }
static int createCode(struct JsonNode *code) { int id = -1; int unit = -1; int state = -1; int all = 0; int dimlevel = -1; int learn = -1; int max = 15; int min = 0; double itmp = -1; if(json_find_number(code, "dimlevel-maximum", &itmp) == 0) max = (int)round(itmp); if(json_find_number(code, "dimlevel-minimum", &itmp) == 0) min = (int)round(itmp); if(json_find_number(code, "id", &itmp) == 0) id = (int)round(itmp); if(json_find_number(code, "unit", &itmp) == 0) unit = (int)round(itmp); if(json_find_number(code, "dimlevel", &itmp) == 0) dimlevel = (int)round(itmp); if(json_find_number(code, "all", &itmp) == 0) all = (int)round(itmp); if(json_find_number(code, "learn", &itmp) == 0) learn = 1; if(json_find_number(code, "off", &itmp) == 0) state=0; else if(json_find_number(code, "on", &itmp) == 0) state=1; if(all > 0 && learn > -1) { logprintf(LOG_ERR, "arctech_dimmer: all and learn cannot be combined"); return EXIT_FAILURE; } else if(id == -1 || (unit == -1 && all == 0) || (dimlevel == -1 && state == -1)) { logprintf(LOG_ERR, "arctech_dimmer: insufficient number of arguments"); return EXIT_FAILURE; } else if(id > 67108863 || id < 1) { logprintf(LOG_ERR, "arctech_dimmer: invalid id range"); return EXIT_FAILURE; } else if((unit > 15 || unit < 0) && all == 0) { logprintf(LOG_ERR, "arctech_dimmer: invalid unit range"); return EXIT_FAILURE; } else if(dimlevel != -1 && (dimlevel > max || dimlevel < min) ) { logprintf(LOG_ERR, "arctech_dimmer: invalid dimlevel range"); return EXIT_FAILURE; } else if(dimlevel >= 0 && state == 0) { logprintf(LOG_ERR, "arctech_dimmer: dimlevel and off state cannot be combined"); return EXIT_FAILURE; } else { if(unit == -1 && all == 1) { unit = 0; } if(dimlevel >= 0) { state = -1; } createMessage(id, unit, state, all, dimlevel, learn); createStart(); clearCode(); createId(id); createAll(all); createState(state); createUnit(unit); if(dimlevel > -1) { createDimlevel(dimlevel); } createFooter(); arctech_dimmer->rawlen = RAW_LENGTH; } return EXIT_SUCCESS; }
ToolChainPrivate(const QString &id, bool autodetect) : m_autodetect(autodetect) { m_id = createId(id); }