void DualTriggerControlAdjust(void* data) { uint8_t* input = data; SoftTimer2[SC_AutoMenuUpdate].timeCompare = FAST_AUTO_MENU_UPDATE; SoftTimerStart(SoftTimer2[SC_AutoMenuUpdate]); switch( *input ) { case KP_UP: SetTrigger(SelectedChannel, GetTrigger(SelectedChannel)+1); break; case KP_DOWN: SetTrigger(SelectedChannel, GetTrigger(SelectedChannel)-1); break; case KP_BACK: UF_MenuUpOneLevel(ActiveMenu); return; } MenuUpdate(ActiveMenu, RESET_MENU | NO_EXECUTE); UF_MenuSetInput(KP_INVALID); PrintDualTriggerInformation(3); }
/************************************************************************************************ * CRMObjective::CRMObjective * Constructs a random mission objective and fills in the default properties * * inputs: * none * * return: * none * ************************************************************************************************/ CRMObjective::CRMObjective ( CGPGroup* group ) { SetPriority(atoi(group->FindPairValue("priority", "0"))); SetMessage( group->FindPairValue("message",va("Objective %i Completed", GetPriority()) ) ); SetDescription(group->FindPairValue("description",va("Objective %i", GetPriority()) ) ); SetInfo(group->FindPairValue("info",va("Info %i", GetPriority()) ) ); SetTrigger(group->FindPairValue("trigger","")); SetName(group->GetName()); /* const char * soundPath = group->FindPairValue("completed_sound", "" ); if (soundPath) mCompleteSoundID = G_SoundIndex(soundPath); */ mCompleted = false; mOrderIndex = -1; // If no priority was specified for this objective then its active by default. if ( GetPriority ( ) ) { mActive = false; } else { mActive = true; } }
int Controller::OnTrigger(MM::PropertyBase* pProp, MM::ActionType eAct) { if (eAct == MM::BeforeGet) { pProp->Set(trigger_.c_str()); } else if (eAct == MM::AfterSet) { char cmd=0; pProp->Get(trigger_); for (int i=0;i<5;i++) { if (trigger_.compare(TriggerLabels[i])==0) { cmd = TriggerCmd[i]; triggerMode_ = (TriggerType) i; } } SetTrigger(); } return HandleErrors(); }
void Flea3Camera::Configure(Config& config) { // Video Mode SetVideoMode(config.video_mode, config.format7_mode, config.pixel_format, config.width, config.height); // Update CameraInfo here after video mode is changed camera_info_ = GetCameraInfo(camera_); // Frame Rate SetFrameRate(config.fps); // Raw Bayer SetRawBayerOutput(config.raw_bayer_output); // White Balance SetWhiteBalanceRedBlue(config.white_balance, config.auto_white_balance, config.wb_red, config.wb_blue); // Exposure SetExposure(config.exposure, config.auto_exposure, config.exposure_value); SetShutter(config.auto_shutter, config.shutter_ms); SetGain(config.auto_gain, config.gain_db); SetBrightness(config.brightness); SetGamma(config.gamma); // Strobe SetStrobe(config.strobe_control, config.strobe_polarity); // Trigger SetTrigger(config.trigger_source, config.trigger_polarity); // Save this config config_ = config; }
void Timer::SetInterval(time_t newinterval) { ServerInstance->Timers.DelTimer(this); secs = newinterval; SetTrigger(ServerInstance->Time() + newinterval); ServerInstance->Timers.AddTimer(this); }
OSDMenuItem(struct osdmenuitem *desc, const char *name, BMessage *message) : BMenuItem(name, message), fItem(desc) { if (desc->name[0] == '\x0e') SetMarked(true); if (desc->key) SetTrigger(desc->key[0]); };
int Controller::OnTriggerSequence(MM::PropertyBase* pProp, MM::ActionType eAct) { if (eAct == MM::BeforeGet) { pProp->Set(triggerSequence_.c_str()); } else if (eAct == MM::AfterSet) { pProp->Get(triggerSequence_); SetTrigger(); } return HandleErrors(); }
/* Address is in the range 0-f - with the fec0 stripped out */ void AtoDWrite(int Address, int Value) { if (Address == 0) { int timetoconvert; AtoDState.datalatch = Value & 0xff; if (AtoDState.datalatch & 8) timetoconvert = 20000; /* 10 bit conversion, 10 ms */ else timetoconvert = 8000; /* 8 bit conversion, 4 ms */ SetTrigger(timetoconvert,AtoDTrigger); AtoDState.status = (AtoDState.datalatch & 0xf) | 0x80; /* busy, not complete */ } }
Component::Trigger* TriggerManager::CreateTrigger(const Json::Value& node) { auto comp = triggerComponents.Create(); auto repeat = new TriggerRepeat; std::string name = node.get("trigger", "").asString(); auto triggerVolume = Managers().physicsManager->CreateTrigger(std::make_shared<Physics::Shape>(Physics::Shape::Sphere(1.0f))); repeat->triggerVolume = triggerVolume; if (!name.empty()) { triggerEvent::EventStruct eventstruct; repeat->name = node.get("triggerName", "").asString(); repeat->startActive = node.get("triggerActive", false).asBool(); repeat->delay = node.get("triggerDelay", 0).asFloat(); repeat->cooldown = node.get("triggerCooldown", 0).asFloat(); repeat->triggerCharges = node.get("triggerCharges", 0).asInt(); repeat->targetFunction.push_back(node.get("triggerFunction", "").asString()); repeat->collidedEntityUID = node.get("triggerCollidedEntityUID", 0).asInt(); repeat->targetEntityUID = node.get("triggerTargetEntity", 0).asInt(); repeat->owningEntityUID = node.get("triggerOwner", 0).asInt(); eventstruct.m_eventID = node.get("triggerEventStruct_EventID", 0).asInt(); eventstruct.m_shapeID = node.get("triggerEventStruct_ShapeID", 0).asInt(); eventstruct.m_targetID = node.get("triggerEventStruct_TargetID", 0).asInt(); eventstruct.m_scriptID = node.get("triggerEventStruct_ScriptID", 0).asInt(); eventstruct.check[0] = node.get("triggerEventStruct_Check_0", false).asBool(); eventstruct.check[1] = node.get("triggerEventStruct_Check_1", false).asBool(); eventstruct.check[2] = node.get("triggerEventStruct_Check_2", false).asBool(); eventstruct.check[3] = node.get("triggerEventStruct_Check_3", false).asBool(); repeat->eventVector.push_back(eventstruct); repeat->triggered = node.get("triggerTriggered", false).asBool(); repeat->triggerVolume = triggerVolume; } comp->SetTrigger(repeat); return comp; }
void SetupAnimation(int w, int h) { //if (h <= 1080) //{ // _num_stars = 2500; _display_rings = 1; _display_nebulae = 1; //} Width = w / 10; Height = h / 6; GLdouble aspect = ((double)w / (double)h) * 10.0; glShadeModel(GL_FLAT); glViewport(0, 0, (GLint) w, (GLint) h); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(aspect, (GLdouble)w/(GLdouble)h,(GLdouble)nearest, (GLdouble)farthest); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(0.0, 0.0, (GLdouble)(nearest - 20), 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); glFogi(GL_FOG_MODE, GL_LINEAR); // Fog Mode GLfloat fogColor[4]= {0.9f, 0.9f, 0.9f, 1.0f}; // Fog Color glFogfv(GL_FOG_COLOR, fogColor); // Set Fog Color glFogf(GL_FOG_DENSITY, 1.0f); // How Dense Will The Fog Be glHint(GL_FOG_HINT, GL_FASTEST); // Fog Hint Value glFogf(GL_FOG_END, nearest); // Fog Start Depth glFogf(GL_FOG_START, farthest); // Fog End Depth glEnable(GL_FOG); // Enables GL_FOG //camera xyz, the xyz to look at, and the up vector (+y is up) _stars = (_lp_vertex)malloc(_num_stars * sizeof(_vertex)); _rings = (_lp_vertex)malloc(_num_rings * sizeof(_vertex)); _nebulae = (_lp_vertex)malloc(_num_neb * sizeof(_vertex)); _srings = (int*)malloc(_num_rings * sizeof(int)); _sringidx = (int*)malloc(_num_rings * sizeof(int)); LoadTextures(); int i; _lp_vertex _curr = _stars; srand((unsigned)26351024); for (i = 0; i < _num_stars; i++) { _curr->z = nearest + 1; CheckStar(_curr, i); _curr++; } _curr = _rings; for (i = 0; i < _num_rings; i++) { _curr->z = nearest + 1; CheckRing(_curr, i, 1); _curr++; } _curr = _nebulae; for (i = 0; i < _num_neb; i++) { _curr->z = nearest + 1; CheckNebula(_curr, i); _curr++; } SortRings(0); _spin_triggers[0] = SetTrigger(TRIG_SLOWEST, 165); //delta is in frames _spin_triggers[1] = SetTrigger(TRIG_SLOWEST, 200); //delta is in frames _spin_triggers[2] = SetTrigger(TRIG_FASTEST, 1265); //delta is in frames }
void CResourceLink::ScanSection( RES_TYPE restype ) { ADDTOCALLSTACK("CResourceLink::ScanSection"); // Scan the section we are linking to for useful stuff. ASSERT(m_pScript); lpctstr const * ppTable = nullptr; int iQty = 0; switch (restype) { case RES_TYPEDEF: case RES_ITEMDEF: ppTable = CItem::sm_szTrigName; iQty = ITRIG_QTY; break; case RES_CHARDEF: case RES_EVENTS: case RES_SKILLCLASS: ppTable = CChar::sm_szTrigName; iQty = CTRIG_QTY; break; case RES_SKILL: ppTable = CSkillDef::sm_szTrigName; iQty = SKTRIG_QTY; break; case RES_SPELL: ppTable = CSpellDef::sm_szTrigName; iQty = SPTRIG_QTY; break; case RES_AREA: case RES_ROOM: case RES_REGIONTYPE: ppTable = CRegionWorld::sm_szTrigName; iQty = RTRIG_QTY; break; case RES_WEBPAGE: ppTable = CWebPageDef::sm_szTrigName; iQty = WTRIG_QTY; break; case RES_REGIONRESOURCE: ppTable = CRegionResourceDef::sm_szTrigName; iQty = RRTRIG_QTY; break; default: break; } ClearTriggers(); while ( m_pScript->ReadKey(false) ) { if ( m_pScript->IsKeyHead( "DEFNAME", 7 ) ) { m_pScript->ParseKeyLate(); SetResourceName( m_pScript->GetArgRaw() ); } else if ( m_pScript->IsKeyHead( "ON", 2 ) ) { int iTrigger; if ( iQty ) { m_pScript->ParseKeyLate(); iTrigger = FindTableSorted( m_pScript->GetArgRaw(), ppTable, iQty ); if ( iTrigger < 0 ) // unknown triggers ? iTrigger = XTRIG_UNKNOWN; else { TriglistAdd(m_pScript->GetArgRaw()); if ( HasTrigger(iTrigger) ) { DEBUG_ERR(( "Duplicate trigger '%s' in '%s'\n", ppTable[iTrigger], GetResourceName() )); continue; } } } else iTrigger = XTRIG_UNKNOWN; SetTrigger(iTrigger); } } }