void DefaultGUIModel::receiveEvent(const Event::Object *event) { if (event->getName() == Event::RT_PREPERIOD_EVENT) { periodEventPaused = getActive(); setActive(false); } else if (event->getName() == Event::RT_POSTPERIOD_EVENT) { #ifdef DEBUG if (getActive()) ERROR_MSG("DefaultGUIModel::receiveEvent : model unpaused during a period update\n"); #endif update(PERIOD); setActive(periodEventPaused); } }
Layer* Button::getDrawnForeground(void) const { if(getEnabled()) { //if(getFocused()) //{ // return getFocusedTextColor(); //} if(getActive()) { return getActiveForeground(); } else if(_MouseInComponentLastMouse) { return getRolloverForeground(); } else { return getForeground(); } } else { return getDisabledForeground(); } }
Layer* Button::getDrawnBackground(void) const { if(getEnabled()) { //if(getFocused()) //{ // return getFocusedTextColor(); //} if(getActive()) { return getActiveBackground(); } else if(getMouseOver()) { return getRolloverBackground(); } else { return getBackground(); } } else { return getDisabledBackground(); } }
/* * p r i n t */ returnValue Constraints::print( ) { if ( n == 0 ) return SUCCESSFUL_RETURN; #ifndef __SUPPRESSANYOUTPUT__ char myPrintfString[MAX_STRING_LENGTH]; int_t nIAC = getNIAC( ); int_t nAC = getNAC( ); int_t* IAC_idx; getInactive( )->getNumberArray( &IAC_idx ); int_t* AC_idx; getActive( )->getNumberArray( &AC_idx ); snprintf( myPrintfString,MAX_STRING_LENGTH,"Constraints object comprising %d constraints (%d inactive, %d active):\n",(int)n,(int)nIAC,(int)nAC ); myPrintf( myPrintfString ); REFER_NAMESPACE_QPOASES print( IAC_idx,nIAC,"inactive" ); REFER_NAMESPACE_QPOASES print( AC_idx, nAC, "active " ); #endif /* __SUPPRESSANYOUTPUT__ */ return SUCCESSFUL_RETURN; }
void SamplePlayer::modify() { bool active = getActive(); setActive(false); // Ensure that the realtime thread isn't in the middle of executing // DefaultGUIModel::execute() SyncEvent event; RT::System::getInstance()->postEvent(&event); std::map<QString, param_t>::iterator i; for (i = parameter.begin(); i != parameter.end(); ++i) { if (i->second.type & COMMENT) { Workspace::Instance::setComment(i->second.index, i->second.edit->text().latin1()); } } update(MODIFY); setActive(active); for (i = parameter.begin(); i != parameter.end(); ++i) i->second.edit->blacken(); }
void SamplePlayer::refresh() { std::map<QString, param_t>::iterator i; for ( i = parameter.begin(); i != parameter.end(); ++i) { if (i->second.type & (STATE | EVENT)) { QString text = QString::number(getValue(i->second.type, i->second.index)); i->second.edit->setText(text); } else if ((i->second.type & PARAMETER) && !i->second.edit->edited() && i->second.edit->text() != *i->second.str_value) { i->second.edit->setText(*i->second.str_value); } else if ((i->second.type & COMMENT) && !i->second.edit->edited() && i->second.edit->text() != getValueString(COMMENT, i->second.index)) { i->second.edit->setText(getValueString(COMMENT, i->second.index)); } } pauseButton->setOn(!getActive()); }
/// Open the submenu. void coSubMenuItem::openSubmenu() { //cannnot open the submenu if item is inacitve if (!getActive()) return; // set own state open = true; // set Icon to appropriate state subMenuIcon->setState(open); if (subMenu) { // show submenu subMenu->setVisible(open); positionSubmenu(); if (attachment == coUIElement::REPLACE) { myMenu->setVisible(false); } } // contact twin if (myTwin != 0) { myTwin->updateContentBool(open); } if (vruiRendererInterface::the()->getJoystickManager()) vruiRendererInterface::the()->getJoystickManager()->openedSubMenu(this, subMenu); }
Color4f Button::getDrawnTextColor(void) const { if(getEnabled()) { //if(getFocused()) //{ // return getFocusedTextColor(); //} if(getActive()) { return getActiveTextColor(); } else if(_MouseInComponentLastMouse) { return getRolloverTextColor(); } else { return getTextColor(); } } else { return getDisabledTextColor(); } }
UIDrawObjectCanvas* Button::getDrawnDrawObject(void) const { if(getEnabled()) { //if(getFocused()) //{ // return getFocusedDrawObject(); //} if(getActive()) { return getActiveDrawObject(); } else if(_MouseInComponentLastMouse) { return getRolloverDrawObject(); } else { return getDrawObject(); } } else { return getDisabledDrawObject(); } }
void Rgui_configure() { struct structGUI curGUI; getActive(&curGUI); showDialog(&curGUI); }
//任务完成 int CharAllPrestigeTasks::taskDone(int race, int reward_prestige, json_spirit::Object& robj) { int cnt = 0; std::map<int, boost::shared_ptr<CharPrestigeTask> >::iterator it = m_all_prestige_tasks.begin(); while (it != m_all_prestige_tasks.end()) { if (it->second.get() && it->second->m_task.get() && it->second->m_task->target_stronghold.get()) { CharPrestigeTask& ct = *(it->second.get()); if (race != ct.m_task->race || reward_prestige != ct.m_task->reward_prestige) { ++it; continue; } if (ct.state != 1) { ++it; continue; } ++cnt; ct.state = 2; ct.Save(); } ++it; } m_charData.updateTopButton(top_button_prestige_task, getActive()); if (cnt > 0) { std::list<Item> items; Item tmp(ITEM_TYPE_CURRENCY, CURRENCY_ID_PRESTIGE_BEGIN+race, reward_prestige * cnt, 0); items.push_back(tmp); giveLoots(&m_charData,items,NULL,&robj,true,loot_prestige_task); } return HC_SUCCESS; }
std::pair<SUMOTime, MSPhaseDefinition> MSTLLogicControl::getPhaseDef(const std::string &tlid) const { MSTrafficLightLogic *tl = getActive(tlid); return std::make_pair( MSNet::getInstance()->getCurrentTimeStep(), tl->getCurrentPhaseDef()); }
void AgentSubscription::on_message(const struct mosquitto_message* mosqmessage) { char *topic = mosqmessage->topic; uint8_t *buffer = (uint8_t *) mosqmessage->payload; // Call the base message MessageBus::on_message(mosqmessage); // Build a telemetry stream TelemetryStream *stream = new TelemetryStream; if (!stream) { _stream_alloc_failures++; return; } // Deserialize the bytes std::string data((const char *) buffer, mosqmessage->payloadlen); if (!stream->ParseFromString(data)) { _stream_parse_failures++; delete stream; return; } // Build the OpenConfig format desired towards collector Telemetry::OpenConfigData oc_data; // Fill in the common header oc_data.set_system_id(stream->system_id()); oc_data.set_component_id(stream->component_id()); oc_data.set_sub_component_id(stream->sub_component_id()); // TODO ABBAS --- Change this to extracted path from sensor_name oc_data.set_path(topic); oc_data.set_sequence_number(stream->sequence_number()); oc_data.set_timestamp(stream->timestamp()); // Iterate and convert to data stream EnterpriseSensors *EnterpriseSensors_handle; JuniperNetworksSensors *JuniperNetworksSensors_handle; EnterpriseSensors_handle = stream->mutable_enterprise(); JuniperNetworksSensors_handle = EnterpriseSensors_handle->MutableExtension(juniperNetworks); std::string ext_type = get_oc_extension_type(JuniperNetworksSensors_handle); // Dispatch based on the extension type OpenConfig *oc = OpenConfig::find(ext_type); if (!oc) { _oc_lookup_failures++; return; } oc->iterate(JuniperNetworksSensors_handle, &oc_data); // Send it over to the server via the transport channel if (getActive()) { _transport->write(&oc_data); } // Done delete stream; return; }
STDMETHODIMP HostUSBDeviceFilterWrap::COMGETTER(Active)(BOOL *aActive) { LogRelFlow(("{%p} %s: enter aActive=%p\n", this, "HostUSBDeviceFilter::getActive", aActive)); VirtualBoxBase::clearError(); HRESULT hrc; try { CheckComArgOutPointerValidThrow(aActive); AutoCaller autoCaller(this); if (FAILED(autoCaller.rc())) throw autoCaller.rc(); hrc = getActive(aActive); } catch (HRESULT hrc2) { hrc = hrc2; } catch (...) { hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS); } LogRelFlow(("{%p} %s: leave *aActive=%RTbool hrc=%Rhrc\n", this, "HostUSBDeviceFilter::getActive", *aActive, hrc)); return hrc; }
ObstacleLayer * BattleScene::getCurrentStageLayer() { auto stageLayer = stageLayer1; if (!stageLayer->getActive()) { stageLayer = stageLayer2; } return stageLayer; }
// ********************************************************************************************************* void CDisplayerVisual::onErase() { //H_AUTO(R2_CDisplayerVisual_onErase) if (getActive()) { setActive(false); } }
// ********************************************************************************************************* void CDisplayerVisual::onContinentChanged() { //H_AUTO(R2_CDisplayerVisual_onContinentChanged) if (getActive()) { setActive(false); setActive(true); // force a refresh of collision (EntitiesManager::changeContinent updates the primitive, but broken for an unknown reason ...) } }
void Skeleton::traverse(osg::NodeVisitor& nv) { if (!getActive() && nv.getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR // need to process at least 2 frames before shutting off update, since we need to have both frame-alternating RigGeometries initialized // this would be more naturally handled if the double-buffering was implemented in RigGeometry itself rather than in a FrameSwitch decorator node && mLastFrameNumber != 0 && mTraversedEvenFrame && mTraversedOddFrame) return; osg::Group::traverse(nv); }
void Component::handleQueuedEvent(std::shared_ptr<Events::Event> event) { switch(event->getEventType()) { case Events::EventType::SET_ACTIVE: { auto casted_event = std::static_pointer_cast<SetActiveEvent>(event); setActive(casted_event->getActive()); break; } case Events::EventType::SET_ENTITY_ACTIVE: { auto casted_event = std::static_pointer_cast<SetEntityActiveEvent>(event); if(entity.lock() != nullptr) { entity.lock()->setActive(casted_event->getActive()); } break; } default: break; } }
void pwScroll::OnUpdate(float FrameTime) { if (!getActive()) return; myCollisionRect.SetAbsTransformable(*this); myHover = false; // Do pwCollisionObjects collide? if (myCollisionRect.Collides(pwGraphics::get()->GetCursorCollisionObject())) { myHover = true; } if (sf::Mouse::isButtonPressed(sf::Mouse::Left) && myHover) { myMouseDown = true; float Percentage = 0.0f; if (myHorizontal) { Percentage = (pwGraphics::get()->GetCursorCollisionObject()->getPosition().x - getPosition().x) / myCollisionRect.GetSize().x; } else { Percentage = (pwGraphics::get()->GetCursorCollisionObject()->getPosition().y - getPosition().y) / myCollisionRect.GetSize().y; } if (Percentage > 1.0f) Percentage = 1.0f; else if (Percentage < 0.0f) Percentage = 0.0f; myCurrentLine = (unsigned int)(Percentage * (float)myTotalLines); } else { myMouseDown = false; } if (mySlider != NULL && myTotalLines != 0) { mySlider->Update(FrameTime); mySlider->OnUpdate(FrameTime); if (myHorizontal) { mySlider->setPosition(myCollisionRect.GetSize().x * ((float)myCurrentLine / (float)myTotalLines), myCollisionRect.GetSize().y / 2.0f); } else { mySlider->setPosition(myCollisionRect.GetSize().x / 2.0f, myCollisionRect.GetSize().y * ((float)myCurrentLine / (float)myTotalLines)); } } }
// **************************************************************************** void CViewTextFormated::checkCoords() { if (!getActive()) return; ucstring formatedResult; formatedResult = formatString(_FormatString, ucstring("")); // setText (formatedResult); CViewText::checkCoords(); }
bool Robot::beInactive() { if (!getKeepable()) return true; //if dead return if (!getActive()) //not the active tick yet { incTick(); return true; } return false; }
// deactivate //--------------------------------------------------------------------------- // Purpose: Sets the window status to non-active. //--------------------------------------------------------------------------- void View::deactivate() { if (!getActive()) { return; } setActive(false); doDeactivate(); } // end View::deactivate
Vec2f Button::getDrawnOffset(void) const { if(getActive()) { return getActiveOffset(); } else { return Vec2f(0.0f,0.0f); } }
std::string UniformBlock::getName() const { if (m_identity.isName()) return m_identity.name(); GLint length = getActive(GL_UNIFORM_BLOCK_NAME_LENGTH); std::vector<char> name(length); glGetActiveUniformBlockName(m_program->id(), blockIndex(), length, nullptr, name.data()); return std::string(name.data(), length); }
// activate //--------------------------------------------------------------------------- // Purpose: Default Implementation - Sets the window status to active. //--------------------------------------------------------------------------- void View::activate() { if (getActive()) { return; } // Set the active bit. status |= STATUS_ACTIVE; doActivate(); } // end View::activate
// ********************************************************************************************************* void CDisplayerVisual::onPreActChanged() { //H_AUTO(R2_CDisplayerVisual_onPreActChanged) updatePos(); if (!isActiveInCurrentAct()) { if (getActive()) { setActive(false); } } }
// ********************************************************************************************************* void CDisplayerVisual::onActChanged() { //H_AUTO(R2_CDisplayerVisual_onActChanged) updatePos(); if (isActiveInCurrentAct()) { if (!getActive()) { setActive(true); } } }
/* utils::loadRconsole */ SEXP in_loadRconsole(SEXP sfile) { struct structGUI gui; const void *vmax = vmaxget(); if (!isString(sfile) || LENGTH(sfile) < 1) error(_("invalid '%s' argument"), "file"); getActive(&gui); /* Will get defaults if there's no active console */ if (loadRconsole(&gui, translateChar(STRING_ELT(sfile, 0)))) applyGUI(&gui); if (strlen(gui.warning)) warning(gui.warning); vmaxset(vmax); return R_NilValue; }
UIDrawObjectCanvas* CheckboxButton::getDrawnDrawObject(void) const { if(getEnabled()) { if(getActive()) { if(getSelected()) { return getActiveCheckboxDrawObject(); } else { return getActiveSelectedCheckboxDrawObject(); } } else if(_MouseInComponentLastMouse) { if(getSelected()) { return getRolloverSelectedCheckboxDrawObject(); } else { return getRolloverCheckboxDrawObject(); } } else { if(getSelected()) { return getSelectedCheckboxDrawObject(); } else { return getCheckboxDrawObject(); } } } else { if(getSelected()) { return getDisabledSelectedCheckboxDrawObject(); } else { return getDisabledCheckboxDrawObject(); } } }