//----------------------------------------------------------------------- // Notifications // NOTE: Subsystem S1 is kept in globals for debug prupose //----------------------------------------------------------------------- void CFuiProbe::NotifyChildEvent(Tag idm,Tag itm,EFuiEvents evn) { switch (idm) { case 'sysb': SystemHandler(evn); return; case 'lsub': sBox.VScrollHandler((U_INT)itm,evn); return; case 'wpid': bPID.VScrollHandler((U_INT)itm,evn); ReplacePID(); return; case 'btn1': pob1.sub = GetSubsystem(pob1.btn); ViewSubsystem(pob1.sub,pob1); return; case 'btn2': pob2.sub = GetSubsystem(pob2.btn); ViewSubsystem(pob2.sub,pob2); return; case 'dpn1': pob1.box.VScrollHandler((U_INT)itm,evn); return; case 'dpn2': pob2.box.VScrollHandler((U_INT)itm,evn); return; case 'bdp1': ReplaceDependent(pob1,pob2); return; case 'bdp2': ReplaceDependent(pob2,pob1); } return; }
//--------------------------------------------------------------------- // Intercept events //--------------------------------------------------------------------- void CFuiCamControl::NotifyChildEvent(Tag idm,Tag itm,EFuiEvents evn) { switch (idm) { case 'sysb': return SystemHandler(evn); //--- Camera pan/rotate left ------ case 'rtlf': return cam->PanLeft(); //--- Camera pan/rotate right ------ case 'rtrt': return cam->PanRight(); //--- Camera pan/rotate up --------- case 'rtup': return cam->PanUp(); //---- Camera pan/rotate down ------ case 'rtdn': return cam->PanDown(); //--- Camera zoom in --------------- case 'zmin': return cam->ZoomRatioIn(); //--- Camera zoom out -------------- case 'zmup': return cam->ZoomRatioOut(); //--- Range in -------------------- case 'rnin': return cam->RangeIn(); //--- Range out ------------------- case 'rnut': return cam->RangeOut(); } return; }
//------------------------------------------------------------------------- // Event notification //------------------------------------------------------------------------- void CFuiListPlan::NotifyChildEvent(Tag idm,Tag itm,EFuiEvents evn) { switch (idm) { case 'sysb': if (EVENT_CLOSEWINDOW == evn) CloseMe(); else SystemHandler(evn); return; //---Scroll event on list of plans --------- case 'allp': allBOX.VScrollHandler((U_INT)itm,evn); return; //---Scroll event on list of maps ---------- case 'chrt': mapBOX.VScrollHandler((U_INT)itm,evn); return; //--- Select a new plan from directory ----- case 'sfpl': SelectPlan(); return; //--- Select a chart ----------------------- case 'smap': SelectChart(); return; } return; }
//------------------------------------------------------------------------- // EVENT notifications from child windows //------------------------------------------------------------------------- void CFuiPlot::NotifyChildEvent(Tag idm,Tag itm,EFuiEvents evn) { if (idm == 'sysb') return SystemHandler(evn); if (idm == 'upr1') return ModifyScale(psc1,1.25); if (idm == 'lwr1') return ModifyScale(psc1,0.8f); if (idm == 'upr2') return ModifyScale(psc2,1.25); if (idm == 'lwr2') return ModifyScale(psc2,0.8f); return; }
//------------------------------------------------------------------------- // EVENT notifications from child windows //------------------------------------------------------------------------- void CFuiWind::NotifyChildEvent(Tag idm,Tag itm,EFuiEvents evn) { if (idm == 'sysb') {SystemHandler(evn); return;} switch (idm) { case 'walt': return; case 'layr': windBOX.VScrollHandler((U_INT)itm,evn); Select(); return; //--- Change altitude ------------------ case 'altp': ModifyAltitude(+100); return; case 'altm': ModifyAltitude(-100); return; //--- Change direction -(by 10)-------- case 'dirp': ModifyDirection(+10); return; case 'dirm': ModifyDirection(-10); return; //--- Change direction -(by 1) -------- case 'diru': ModifyDirection(+1); return; case 'dird': ModifyDirection(-1); return; //--- Change Speed -(by 1) -------- case 'spdp': ModifySpeed(+1); return; case 'spdm': ModifySpeed(-1); return; //--- Change cloud ceil -(by 100) -------- case 'skyp': ChangeCeil(+100); return; case 'skym': ChangeCeil(-100); return; } return ; }
//------------------------------------------------------------------------- // EVENT notifications //------------------------------------------------------------------------- void CFuiSetAir::NotifyChildEvent(Tag idm,Tag itm,EFuiEvents evn) { switch (idm) { case 'sysb': return SystemHandler(evn); case 'crft': airBOX.VScrollHandler((U_INT)itm,evn); if (evn != EVENT_DBLE_CLICK) return; return ChangeAircraft(); //---Change aircraft ---------------------- case 'okok': return ChangeAircraft(); } return; }
//------------------------------------------------------------------------ // Notifications //------------------------------------------------------------------------ void CFuiFuel::NotifyChildEvent(Tag idm,Tag itm,EFuiEvents evn) { switch(idm) { case 'sysb': SystemHandler(evn); return; case 'tank': gBOX.VScrollHandler((U_INT)itm,evn); SelectTank(); return; case 'shcg': return; case 'tots': ChangeTankQTY(0); return; } //----check for detail slider ---------------------------------------- return; }
//------------------------------------------------------------------------- // EVENT notifications from child windows //------------------------------------------------------------------------- void CFuiAxis::NotifyChildEvent(Tag idm,Tag itm,EFuiEvents evn) { if (idm == 'sysb') {SystemHandler(evn); return;} switch (idm) { //---List notification -------------------------- case 'list': axeBOX.VScrollHandler((U_INT)itm,evn); AxeSelect(itm); return; //---Change all axes versus short list ---------- case 'alla': all = (U_CHAR)itm; return; //---Assign the current axe selected ------------ case 'defa': AxeAssign(); return; //---Clear axe from the selected component ------ case 'clra': AxeClear(); return; //--- Invert action ----------------------------- case 'chka': AxeInvert(itm); return; //--- Increment force --------------------------- case 'opr+': AxeForce(+0.01f); return; //--- Decrement force --------------------------- case 'opr-': AxeForce(-0.01f); return; //--- Change neutral value ---------------------- case 'neut': AxeNeutral(); return; //--- Change Hat usage -------------------------- case 'useH': jsm->UseHat(jsp,char(itm)); return; } return ; }
//--------------------------------------------------------------------- // Intercept events //--------------------------------------------------------------------- void CFuiVehOption::NotifyChildEvent(Tag idm,Tag itm,EFuiEvents evn) { switch (idm) { case 'sysb': SystemHandler(evn); return; //--- Autopilot auto land ------------------------- case 'rlnd': mveh->ToggleOPT(VEH_AP_LAND); return; //--- Autopilot autodisconnect --------------------- case 'rdis': mveh->ToggleOPT(VEH_AP_DISC); return; //--- Crash detection ------------------------------ case 'cdet': mveh->ToggleOPT(VEH_D_CRASH); return; //--- Panel help ----------------------------------- case 'help': mveh->ToggleOPT(VEH_PN_HELP); return; //--- Draw smoke ----------------------------------- case 'smbx': mveh->ToggleOPT(VEH_DW_SMOK); return; //--- Draw shadow ----------------------------------- case 'shbx': mveh->ToggleOPT(VEH_DW_SHAD); return; //--- Draw position --------------------------------- case 'psbx': mveh->ToggleOPT(VEH_DW_VPOS); return; //--- Draw aero vectors ----------------------------- case 'aebx': mveh->ToggleOPT(VEH_DW_AERO); return; } return; }
//----------------------------------------------------------------------- // Notifications //----------------------------------------------------------------------- void CFuiMBROS::NotifyChildEvent(Tag idm,Tag itm,EFuiEvents evn) { switch (idm) { case 'sysb': SystemHandler(evn); return; //--- Zoom is changing ------------------ case 'zsld': ChangeZoom(); return; //--- A new selection is occuring ------- case 'olst': oBOX.VScrollHandler((U_INT)itm,evn); NewSelection(); return; //--- The ZB option is modified --------- case 'zbop': ChangeZB(); return; } return; }
//----------------------------------------------------------------------- // Notifications //----------------------------------------------------------------------- void CFuiTBROS::NotifyChildEvent(Tag idm,Tag itm,EFuiEvents evn) { int gnd = globals->tcm->GetGroundType(); bool nok = (0 == Type) || (lock); switch (idm) { case 'sysb': SystemHandler(evn); return; case 'xlst': if (nok) return; sel = 1; aBOX->VScrollHandler((U_INT)itm,evn); GetSelection(); return; case 'wlok': lock ^= 1; RefreshOPT(); return; case 'wbt1': if (1 == state) ChangeTile(gnd); if (2 == state) PatchTexture(); return; case 'zbtn': RestoreTile(gnd); return; case 'obtn': obtn ^= 1; gBox->SetChildText('obtn',ObjBTN[obtn]); globals->noOBJ += btnLOK[obtn]; return; case 'abtn': abtn ^= 1; gBox->SetChildText('abtn',AptBTN[abtn]); globals->noAPT += btnLOK[abtn]; return; } return; }
//10 02 target src lengh cl cn pid subid devid [...data...] 10 03 //10 02 target src lengh cl cn pid subid descid1 descid2 entry format [...data...] 10 03 Uint8 UsbFrameProcess(Uint8 *pFrame) { C29ID Id; uint8_t buffer [32] = {0}; uint8_t i; if (GetByte(pFrame, USBIDX_CMDNUM) == CN_DESC) { // descriptor if (GetByte(pFrame, USBIDX_TARGET) != CANNODE_MCB) { // X,Y,Z, MotorNP, descriptor Id.field.CmdClass = GetByte(pFrame, USBIDX_CMDCL); Id.field.CmdNum = GetByte(pFrame, USBIDX_CMDNUM); Id.field.Dest = GetByte(pFrame, USBIDX_TARGET); Id.field.Src = GetByte(pFrame, USBIDX_SRC); for (i=0; i< GetByte(pFrame, USBIDX_LEN); i++) { buffer[i] = GetByte(pFrame, USBIDX_PID+i); } StartECanTxTask(Id, buffer, i, 28); // convey descriptor to X,Y,Z axis }else { UsbDescCmdHandler(pFrame); } } else { switch (GetByte(pFrame, USBIDX_CMDNUM)) { case CN_MESSAGE: // intended fall through case CN_SYSTEM: switch (GetByte(pFrame, USBIDX_TARGET)) { case CANNODE_MCB: AnswerBios_MCB(pFrame); break; case CANNODE_REFLECTOR: AnswerBios_Reflector(pFrame); break; case CANNODE_NOSEPIECE: AnswerBios_Nosepiece(pFrame); break; case CANNODE_RLTL: AnswerBios_RLTL(pFrame); break; case CANNODE_LIGHTCTRL: AnswerBios_Lightctrl(pFrame); break; case CANNODE_ALL: AnswerBios_MCB(pFrame); AnswerBios_Reflector(pFrame); AnswerBios_Nosepiece(pFrame); AnswerBios_RLTL(pFrame); AnswerBios_Lightctrl(pFrame); // intended fall through, no break default: Id.field.CmdClass = GetByte(pFrame, USBIDX_CMDCL); Id.field.CmdNum = GetByte(pFrame, USBIDX_CMDNUM); Id.field.Dest = GetByte(pFrame, USBIDX_TARGET); Id.field.Src = GetByte(pFrame, USBIDX_SRC); for (i=0; i< GetByte(pFrame, USBIDX_LEN); i++) buffer[i] = GetByte(pFrame, USBIDX_PID+i); StartECanTxTask(Id, buffer, i, 28);// convey direct command break; } break; case CN_CHANGER: switch (GetByte(pFrame, USBIDX_TARGET)) { case CANNODE_REFLECTOR: ChangerHandler_Reflector(pFrame); break; case CANNODE_NOSEPIECE: ChangerHandler_Nosepiece(pFrame); break; case CANNODE_RLTL: ChangerHandler_RLTL(pFrame); break; case CANNODE_ALL: ChangerHandler_Reflector(pFrame); ChangerHandler_Nosepiece(pFrame); ChangerHandler_RLTL(pFrame); // intended fall through default: Id.field.CmdClass = GetByte(pFrame, USBIDX_CMDCL); Id.field.CmdNum = GetByte(pFrame, USBIDX_CMDNUM); Id.field.Dest = GetByte(pFrame, USBIDX_TARGET); Id.field.Src = GetByte(pFrame, USBIDX_SRC); for (i=0; i< GetByte(pFrame, USBIDX_LEN); i++) buffer[i] = GetByte(pFrame, USBIDX_PID+i); StartECanTxTask(Id, buffer, i, 28);// convey direct command break; } break; case CN_SERVO: if (GetByte(pFrame, USBIDX_TARGET) == CANNODE_LIGHTCTRL) servoHandler_Lightctrl(pFrame); break; case CN_AXIS: // since MCB has no axis small nodes, forward to CAN bus Id.field.CmdClass = GetByte(pFrame, USBIDX_CMDCL); Id.field.CmdNum = GetByte(pFrame, USBIDX_CMDNUM); Id.field.Dest = GetByte(pFrame, USBIDX_TARGET); Id.field.Src = GetByte(pFrame, USBIDX_SRC); for (i=0; i< GetByte(pFrame, USBIDX_LEN); i++) buffer[i] = GetByte(pFrame, USBIDX_PID+i); StartECanTxTask(Id, buffer, i, 28);// convey direct command break; case CN_GEMINI: if (GetByte(pFrame, USBIDX_TARGET) == CANNODE_MCB) SystemHandler(pFrame); break; case CN_DLD: DLD_Handler(pFrame); break; default : break; } } return GetByte(pFrame, USBIDX_LEN) + 9; }