// --------------------------------------------------------- // Reset input mode to default input mode when language changed // --------------------------------------------------------- // void CGSPenInputModel::ResetDefaultInputMode() { switch(iInputLanguage) { case ELangPrcChinese: { if (InputMode() != EPinyin) { SetInputMode(EPinyin); } } break; case ELangHongKongChinese: { if (InputMode() != EStroke) { SetInputMode(EStroke); } } break; case ELangTaiwanChinese: { if (InputMode() != EZhuyin) { SetInputMode(EZhuyin); } } break; default: break; } }
void AFPSGPlayerController::openInGameMenu() { //GEngine->AddOnScreenDebugMessage(-1, 10.0f, FColor::Yellow, "AFPSGPlayerController::openPauseMenu"); //Dont open/close the in game menu if it is disabled if (inGameMenuIsDisabled) return; //If in game menu is open, close it if (inGameMenuIsOpen) { inGameMenuIsOpen = false; bShowMouseCursor = false; //Set input to only accept game input (keyboard, mouse). Also turn on movement and look input FInputModeGameOnly inputMode; SetInputMode(inputMode); SetIgnoreLookInput(false); SetIgnoreMoveInput(false); //Remove the in game menu HUD from the screen FPSGUtility::destroyUserWidget(&HUDInGameMenu); //Set all other widgets to visible if they should be on screen if (HUDAlive != NULL && HUDDead != NULL && HUDInGameLeaderboard != NULL) { HUDAlive->SetVisibility(ESlateVisibility::SelfHitTestInvisible); HUDDead->SetVisibility(ESlateVisibility::SelfHitTestInvisible); HUDInGameLeaderboard->SetVisibility(ESlateVisibility::SelfHitTestInvisible); } } else { inGameMenuIsOpen = true; bShowMouseCursor = true; //Set input to accept UI input aswell as game input. Also turn of movement and look input FInputModeGameAndUI inputMode; inputMode.SetLockMouseToViewport(true); SetInputMode(inputMode); SetIgnoreLookInput(true); SetIgnoreMoveInput(true); //Set all other widgets to hidden if they are on the screen if (HUDAlive != NULL && HUDDead != NULL && HUDInGameLeaderboard != NULL) { HUDAlive->SetVisibility(ESlateVisibility::Hidden); HUDDead->SetVisibility(ESlateVisibility::Hidden); HUDInGameLeaderboard->SetVisibility(ESlateVisibility::Hidden); } //Create the in game menu HUD if (HUDInGameMenu == NULL) { HUDInGameMenu = FPSGUtility::createUserWidget(this, HUDInGameMenuTemplate, true); } } }
static void k2400_UpdateReadings (int panel, void *dev) { gpibioPtr my_dev = dev; k2400Ptr smu = my_dev->device; acqchanPtr acqchan = smu->source->acqchan; short statusbyte; char rsp[256]; int control, dim, bg, mode, m; if (smu->operate) { if (utilG.acq.status == ACQ_BUSY) Delay(.05); if (!util_TakingData() || !(smu->source->acqchan->acquire || smu->measure->acquire)) { gpibio_GetStatusByte (dev, &statusbyte); if (statusbyte & K2400_SRE_READINGDONE) { //k2400_In (dev, rsp); //Scan (rsp, "%s>%f,%f", &smu->source->acqchan->reading, // &smu->measure->reading); } //if (statusbyte & K2400_SRE_READYFORTRIGGER) //k2400_Out (dev, "H0X", .02); } time(&present); if(difftime(present, past) >= delay) { k2400_GetReadings(acqchan); time(&past); } //if (expG.acqstatus != utilG.acq.status) { m = GetPanelMenuBar (panel); dim = (util_TakingData() && smu->source->inlist && (utilG.exp == EXP_SOURCE)); if (dim) { mode = VAL_INDICATOR; bg = VAL_PANEL_GRAY;} else { mode = VAL_HOT; bg = VAL_WHITE;} SetCtrlAttribute (panel, K2400_SOURCE, ATTR_CTRL_MODE, mode); SetCtrlAttribute (panel, K2400_SOURCE, ATTR_TEXT_BGCOLOR, bg); SetInputMode (panel, K2400_OPERATE, !dim); SetInputMode (panel, K2400_SELECT, !dim); SetInputMode (panel, K2400_SENSE, !dim); SetMenuBarAttribute (m, K2400MENUS_FILE_LOAD, ATTR_DIMMED, dim); } k2400_CheckforProblems (my_dev); SetCtrlVal (panel, K2400_OVERLIMIT, smu->overLimit); control = GetActiveCtrl (panel); if (util_TakingData() || (control != K2400_SOURCE)) SetCtrlVal (panel, K2400_SOURCE, smu->source->acqchan->reading); SetCtrlVal (panel, K2400_MEASURE, smu->measure->reading); } }
void acquire_UpdateDataFileInfo (void) { SetInputMode (acqG.p.setup, ACQSETUP_FILENAME, !util_TakingData()); SetInputMode (acqG.p.setup, ACQSETUP_FILEEXT, !util_TakingData()); SetInputMode (acqG.p.setup, ACQSETUP_SAVEAS, !util_TakingData()); SetCtrlVal (acqG.p.setup, ACQSETUP_FILENAME, dataFile.name); SetCtrlVal (acqG.p.setup, ACQSETUP_FILEEXT, dataFile.ext); acquire_DataFileMakePath(); SetCtrlVal (acqG.p.setup, ACQSETUP_FILEPATH, dataFile.path); }
void ScreenOptionsManageProfiles::Init() { ScreenOptions::Init(); SetNavigation( NAV_THREE_KEY_MENU ); SetInputMode( INPUTMODE_SHARE_CURSOR ); }
void AShooterDemoSpectator::SetPlayer( UPlayer* InPlayer ) { Super::SetPlayer( InPlayer ); // Build menu only after game is initialized ShooterDemoPlaybackMenu = MakeShareable( new FShooterDemoPlaybackMenu() ); ShooterDemoPlaybackMenu->Construct( Cast< ULocalPlayer >( Player ) ); // Create HUD if this is playback if (GetWorld() != nullptr && GetWorld()->DemoNetDriver != nullptr && !GetWorld()->DemoNetDriver->IsServer()) { if (GEngine != nullptr && GEngine->GameViewport != nullptr) { DemoHUD = SNew(SShooterDemoHUD) .PlayerOwner(this); GEngine->GameViewport->AddViewportWidgetContent(DemoHUD.ToSharedRef()); } } FActorSpawnParameters SpawnInfo; SpawnInfo.Owner = this; SpawnInfo.Instigator = Instigator; SpawnInfo.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; PlaybackSpeed = 2; FInputModeGameAndUI InputMode; InputMode.SetWidgetToFocus(DemoHUD); SetInputMode(InputMode); }
void AFPSGPlayerController::BeginPlay() { Super::BeginPlay(); FInputModeGameOnly inputMode; SetInputMode(inputMode); }
void ACavemanController::CloseInventory() { bIsInventoryOpen = false; InventoryWidget->SetVisibility(ESlateVisibility::Collapsed); bShowMouseCursor = false; FInputModeGameOnly Mode; SetInputMode(Mode); }
void DHT22Error(void) { int loop; // KILL interrup TMR0IE=0; SetIOChange(CurrentIOPin,0); CurrentIOCycle=IO_CYCLE_END; SetInputMode(CurrentIOPin); }
void ACavemanController::OpenInventory() { bIsInventoryOpen = true; InventoryWidget->SetVisibility(ESlateVisibility::Visible); bShowMouseCursor = true; InventoryWidget->OnInteractionDokFinished.Broadcast(); FInputModeGameAndUI Mode; Mode.SetWidgetToFocus(InventoryWidget->GetCachedWidget()); SetInputMode(Mode); }
static void k213_UpdateReadings (int panel, void *dev) { gpibioPtr my_dev = dev; k213Ptr quadsrc = my_dev->device; unsigned short statusbyte; char rsp[256]; int control, dim, bg, mode, m, active_panel, port; for (port = 0; port < 4; port++) { if (!util_TakingData() || !quadsrc->port[port].src->acqchan->acquire) k213_GetPortLevel (port+1, dev); } if (expG.acqstatus != utilG.acq.status) { m = GetPanelMenuBar (panel); for (port = 0; port < 4; port++) { dim = (util_TakingData() && quadsrc->port[port].src->inlist && (utilG.exp == EXP_SOURCE)); if (dim) { mode = VAL_INDICATOR; bg = VAL_PANEL_GRAY;} else { mode = VAL_HOT; bg = VAL_WHITE;} SetCtrlAttribute (quadsrc->port[port].panel, K213PORT_DISPLAY, ATTR_CTRL_MODE, mode); SetCtrlAttribute (quadsrc->port[port].panel, K213PORT_DISPLAY, ATTR_TEXT_BGCOLOR, bg); SetInputMode (quadsrc->port[port].panel, K213PORT_AUTORANGE, !dim); SetInputMode (quadsrc->port[port].panel, K213PORT_RANGE, !dim); } SetMenuBarAttribute (m, K213MENUS_FILE_LOAD, ATTR_DIMMED, dim); } k213_CheckforProblems (my_dev); active_panel = GetActivePanel(); control = GetActiveCtrl (active_panel); for (port = 0; port < 4; port++) { if (util_TakingData() || (control != K213PORT_DISPLAY)) SetCtrlVal (quadsrc->port[port].panel, K213PORT_DISPLAY, quadsrc->port[port].src->acqchan->reading); } }
bool HeeksCADapp::InputLength(const wxChar* prompt, const wxChar* value_name, double &value) { if(m_input_uses_modal_dialog) { HDialog dlg(m_frame); wxBoxSizer *sizerMain = new wxBoxSizer(wxVERTICAL); wxStaticText *static_label = new wxStaticText(&dlg, wxID_ANY, prompt); sizerMain->Add( static_label, 0, wxALL | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, dlg.control_border ); CLengthCtrl* value_control = new CLengthCtrl(&dlg); dlg.AddLabelAndControl(sizerMain, value_name, value_control); sizerMain->Add( dlg.MakeOkAndCancel(wxHORIZONTAL), 0, wxALL | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, dlg.control_border ); dlg.SetSizer( sizerMain ); sizerMain->SetSizeHints(&dlg); sizerMain->Fit(&dlg); value_control->SetFocus(); if(dlg.ShowModal() == wxID_OK) { value = value_control->GetValue(); return true; } return false; } else { CInputMode* save_mode = input_mode_object; CLengthInput length_input(prompt, value_name, value); SetInputMode(&length_input); OnRun(); SetInputMode(save_mode); if(CLengthInput::m_success)value = length_input.m_value; return CLengthInput::m_success; } }
int DoStatisticsCallback(int panel, int control, int event, void *callbackData, int eventData1, int eventData2) { int i; channelPtr chan; if (event == EVENT_COMMIT) { GetCtrlIndex (panel, STATISTICS_CHANNELS, &i); chan = channellist_GetItem (i); chanfunc_CalcStatistics (chan); SetInputMode (panel, STATISTICS_SAVE, ((StringLength (chan->note) + StringLength(chanfunc.note)) < 255)); } return 0; }
int SaveStatisticsCallback(int panel, int control, int event, void *callbackData, int eventData1, int eventData2) { int i; channelPtr chan; if (event == EVENT_COMMIT) { GetCtrlIndex (panel, STATISTICS_CHANNELS, &i); chan = channellist_GetItem (i); if ((StringLength (chan->note) + StringLength(chanfunc.note)) < 255) { Fmt (chan->note, "%s[a]<\n%s", chanfunc.note); SetInputMode (panel, control, FALSE); } } return 0; }
// Create the control bool CLTGUIEditCtrl::Create(ILTClient *pLTClient, const CFontInfo& Font, const CLTGUIEditCtrl_create& cs) { LTASSERT((cs.nMaxLength > 0 && cs.nMaxLength <= kMaxLength),"CLTGUIEditCtrl::Create() invalid buffer length"); if (!pLTClient || !Font.m_nHeight || cs.nMaxLength <= 0) return false; m_pLTClient = pLTClient; g_pLTBase = pLTClient; m_pCommandHandler = cs.pCommandHandler; m_pszValue = cs.pszValue; m_bPreventEmptyString = cs.bPreventEmptyString; if (cs.nMaxLength <= kMaxLength) SetMaxLength(cs.nMaxLength); else SetMaxLength(kMaxLength); if (!SetFont(Font)) { return false; } // Add the string if (cs.pszValue) { SetText(cs.pszValue); } DrawPrimSetRGBA(m_Caret, 0xFF, 0xFF, 0xFF, 0xFF); DrawPrimSetRGBA(m_Frame[0], 0x00, 0x00, 0x00, 0x7F); DrawPrimSetRGBA(m_Frame[1], 0xFF, 0xFF, 0xFF, 0x7F); DrawPrimSetRGBA(m_Frame[2], 0xFF, 0xFF, 0xFF, 0x7F); DrawPrimSetRGBA(m_Frame[3], 0x00, 0x00, 0x00, 0x7F); m_bUseFrame = cs.bUseFrame; EnableCaret(cs.bUseCaret, cs.fCaretTime, cs.argbCaretColor); SetInputMode(cs.eMode); m_Text.SetGlowParams(cs.bGlowEnable,cs.fGlowAlpha,cs.vGlowSize); CLTGUICtrl::Create(cs); return true; }
void ScreenOptionsMaster::Init() { vector<RString> asLineNames; split( LINE_NAMES, ",", asLineNames ); if( asLineNames.empty() ) { LuaHelpers::ReportScriptErrorFmt("\"%s:LineNames\" is empty.", m_sName.c_str()); } if( FORCE_ALL_PLAYERS ) { FOREACH_PlayerNumber( pn ) GAMESTATE->JoinPlayer( pn ); } if( NAVIGATION_MODE == "toggle" ) SetNavigation( PREFSMAN->m_iArcadeOptionsNavigation? NAV_TOGGLE_THREE_KEY:NAV_TOGGLE_FIVE_KEY ); else if( NAVIGATION_MODE == "menu" ) SetNavigation( NAV_THREE_KEY_MENU ); SetInputMode( StringToInputMode(INPUT_MODE) ); // Call this after enabling players, if any. ScreenOptions::Init(); vector<OptionRowHandler*> OptionRowHandlers; for( unsigned i = 0; i < asLineNames.size(); ++i ) { RString sLineName = asLineNames[i]; RString sRowCommands = LINE(sLineName); Commands cmds; ParseCommands( sRowCommands, cmds, false ); OptionRowHandler *pHand = OptionRowHandlerUtil::Make( cmds ); if( pHand == NULL ) { LuaHelpers::ReportScriptErrorFmt("Invalid OptionRowHandler \"%s\" in \"%s:Line:%s\".", cmds.GetOriginalCommandString().c_str(), m_sName.c_str(), sLineName.c_str()); } else { OptionRowHandlers.push_back( pHand ); } } InitMenu( OptionRowHandlers ); }
static void k213_UpdateControls (int panel, gpibioPtr dev) { k213Ptr quadsrc = dev->device; int port; k213_GetStatus (dev); for (port = 0; port < 4; port++) { SetCtrlVal (quadsrc->port[port].panel, K213PORT_DISPLAY, quadsrc->port[port].src->acqchan->reading); SetCtrlVal (quadsrc->port[port].panel, K213PORT_AUTORANGE, quadsrc->port[port].autorange); SetCtrlVal (quadsrc->port[port].panel, K213PORT_RANGE, quadsrc->port[port].range); SetInputMode (quadsrc->port[port].panel, K213PORT_RANGE, !quadsrc->port[port].autorange); if (quadsrc->port[port].autorange || (quadsrc->port[port].range == 3)) { quadsrc->port[port].src->min = -10.0; quadsrc->port[port].src->max = 10.0; } else { switch (quadsrc->port[port].range) { case 0: quadsrc->port[port].src->min = -0.0; quadsrc->port[port].src->max = 0.0; break; case 1: quadsrc->port[port].src->min = -1.0; quadsrc->port[port].src->max = 1.0; break; case 2: quadsrc->port[port].src->min = -5.0; quadsrc->port[port].src->max = 5.0; break; } } if (quadsrc->port[port].autorange) { quadsrc->port[port].src->ranges.autoscale = 1; quadsrc->port[port].src->ranges.temprange = quadsrc->range; } else { quadsrc->port[port].src->ranges.autoscale = 0; quadsrc->port[port].src->ranges.temprange[0] = quadsrc->range[quadsrc->port[port].range]; } SetCtrlAttribute (quadsrc->port[port].panel, K213PORT_DISPLAY, ATTR_MIN_VALUE, quadsrc->port[port].src->min); SetCtrlAttribute (quadsrc->port[port].panel, K213PORT_DISPLAY, ATTR_MAX_VALUE, quadsrc->port[port].src->max); } }
BaseApp::BaseApp() { m_bDisableSubPixelBlits = false; m_bCheatMode = false; m_memUsed = m_texMemUsed = 0; g_isLoggerInitted = true; m_bInitted = false; m_bConsoleVisible = false; m_bManualRotation = false; SetFPSVisible(false); m_bIsInBackground = false; SetInputMode(INPUT_MODE_NORMAL); m_version = "No default Version"; // this is over written by network messages that come from IOS and Android. For other platforms (like windows), it will remain this. m_touchTracker.resize(C_MAX_TOUCHES_AT_ONCE); ClearError(); g_isBaseAppInitted = true; }
void ACavemanController::CloseCrafts() { AMyCharacter_FirstTry* LeCaveman = Cast<AMyCharacter_FirstTry>(GetCharacter()); LeCaveman->bIsCraftingWindowOpen = false; LeCaveman->bIsFireMainMenuEnabled = false; LeCaveman->bIsFireStartingWindowEnabled = false; CraftWidget->SetVisibility(ESlateVisibility::Collapsed); bShowMouseCursor = false; FInputModeGameOnly Mode; SetInputMode(Mode); if (bIsCookingFireEnabled) { bIsCookingFireEnabled = false; } }
void InitStatisticsCallback(int menubar, int menuItem, void *callbackData, int panel) { int i; channelPtr chan; chanfunc.p = LoadPanel (0, "chanfncu.uir", STATISTICS); util_InitClose (chanfunc.p, STATISTICS_CLOSE, FALSE); SetPanelPos (chanfunc.p, 100, 100); channellist_Copy (chanfunc.p, STATISTICS_CHANNELS); chan = channellist_GetSelection(); chanfunc_CalcStatistics (chan); SetInputMode (chanfunc.p, STATISTICS_SAVE, ((StringLength (chan->note) + StringLength(chanfunc.note)) < 255)); InstallPopup (chanfunc.p); }
void ACavemanController::OpenCrafts(bool WillOpenMainCraft, bool IsMainFire) { AMyCharacter_FirstTry* LeCaveman = Cast<AMyCharacter_FirstTry>(GetCharacter()); LeCaveman->bIsCraftingWindowOpen = true; CraftWidget->SetVisibility(ESlateVisibility::Visible); CraftWidget->OnInventoryOpened.Broadcast(); bShowMouseCursor = true; CraftWidget->OnInteractionDokFinished.Broadcast(); FInputModeGameAndUI Mode; Mode.SetWidgetToFocus(CraftWidget->GetCachedWidget()); SetInputMode(Mode); if (WillOpenMainCraft) { CraftWidget->ShowCraftingDel.Broadcast(); CraftWidget->HideStartingFire.Broadcast(); CraftWidget->HideMainFire.Broadcast(); } else { CraftWidget->HideCraftingDel.Broadcast(); if (IsMainFire) { CraftWidget->ShowMainFire.Broadcast(); CraftWidget->HideStartingFire.Broadcast(); } else { CraftWidget->HideMainFire.Broadcast(); CraftWidget->ShowStartingFire.Broadcast(); } } }
void K2400MeasureSetupCallback(int menubar, int menuItem, void *callbackData, int panel) { int p; acqchanPtr measure = callbackData; p = LoadPanel (0, "k2400u.uir", K2400_MEAS); SetPanelPos (p, VAL_AUTO_CENTER, VAL_AUTO_CENTER); util_InitClose (p, K2400_MEAS_CLOSE, FALSE); SetCtrlVal (p, K2400_MEAS_LABEL, measure->channel->label); SetCtrlVal (p, K2400_MEAS_COEFF, measure->coeff); SetCtrlVal (p, K2400_MEAS_ACQ, measure->acquire); SetCtrlVal (p, K2400_MEAS_NOTE, measure->note); SetCtrlAttribute(p, K2400_MEAS_LABEL, ATTR_CALLBACK_DATA, measure); SetCtrlAttribute(p, K2400_MEAS_COEFF, ATTR_CALLBACK_DATA, measure); SetCtrlAttribute(p, K2400_MEAS_ACQ, ATTR_CALLBACK_DATA, measure); SetCtrlAttribute(p, K2400_MEAS_NOTE, ATTR_CALLBACK_DATA, measure); SetInputMode (p, K2400_MEAS_ACQ, !util_TakingData()); devPanel_Add (p, measure, k2400_Meas_UpdateReadings); InstallPopup (p); }
static void k2400_UpdateControls (int panel, gpibioPtr dev) { char s_text[20], m_text[20]; k2400Ptr smu = dev->device; double absmax; k2400_GetMachineStatus (dev); k2400_GetMeasurementParameters (dev); //k2400_GetReadings(smu->source->acqchan); SetCtrlVal (panel, K2400_SOURCE, smu->source->acqchan->reading); SetCtrlVal (panel, K2400_MEASURE, smu->measure->reading); SetCtrlVal (panel, K2400_OPERATE, smu->operate); SetInputMode (panel, K2400_SOURCE, smu->operate); SetInputMode (panel, K2400_MEASURE, smu->operate); SetCtrlVal (panel, K2400_SELECT, smu->src.current); SetCtrlVal (panel, K2400_SENSE, smu->sense); if (smu->src.current) { Fmt (s_text, "A"); Fmt (m_text, "V"); } else { Fmt (s_text, "V"); Fmt (m_text, "A"); } SetCtrlVal (panel, K2400_SOURCETEXT, s_text); SetCtrlVal (panel, K2400_MEASURETEXT, m_text); SetCtrlAttribute (panel, K2400_SOURCE_I_RANGE, ATTR_VISIBLE, smu->src.current); SetCtrlAttribute (panel, K2400_SOURCE_V_RANGE, ATTR_VISIBLE, !smu->src.current); if (smu->src.current) { SetCtrlIndex (panel, K2400_SOURCE_I_RANGE, smu->src.rangeC); GetCtrlVal (panel, K2400_SOURCE_I_RANGE, &smu->source->max); } else { SetCtrlIndex (panel, K2400_SOURCE_V_RANGE, smu->src.rangeV); GetCtrlVal (panel, K2400_SOURCE_V_RANGE, &smu->source->max); } smu->source->min = -smu->source->max; SetCtrlAttribute (panel, K2400_SOURCE, ATTR_MIN_VALUE, smu->source->min); SetCtrlAttribute (panel, K2400_SOURCE, ATTR_MAX_VALUE, smu->source->max); SetCtrlVal (panel, K2400_DELAY, smu->src.delay); SetCtrlAttribute (panel, K2400_MEAS_I_RANGE, ATTR_VISIBLE, !smu->src.current); SetCtrlAttribute (panel, K2400_MEAS_V_RANGE, ATTR_VISIBLE, smu->src.current); SetCtrlVal (panel, K2400_LEVEL, k2400_GetCompLevel (dev)); if (smu->src.current) { SetCtrlIndex (panel, K2400_MEAS_V_RANGE, smu->meas.range); GetCtrlVal (panel, K2400_MEAS_V_RANGE, &absmax); } else { SetCtrlIndex (panel, K2400_MEAS_I_RANGE, smu->meas.range); GetCtrlVal (panel, K2400_MEAS_I_RANGE, &absmax); } SetCtrlAttribute (panel, K2400_LEVEL, ATTR_MIN_VALUE, -absmax); SetCtrlAttribute (panel, K2400_LEVEL, ATTR_MAX_VALUE, absmax); SetCtrlVal (panel, K2400_FILTER, smu->meas.filter); SetCtrlVal (panel, K2400_INTTIME, smu->meas.inttime); }
void exp_UpdateGeneralPanel (void) { SetInputMode (acqG.p.setup, ACQSETUP_GEN_POINTS, !util_TakingData()); }
static void chanfunc_CalcStatistics (channelPtr chan) { double mean, std_dev, variance, rms, moment, median, mode, min, max; int err, order, min_i, max_i, intervals; char newnote[256]; Fmt (chanfunc.note, ""); err = MaxMin1D (chan->readings, chan->pts, &max, &max_i, &min, &min_i); SetInputMode (chanfunc.p, STATISTICS_MIN, !err); SetCtrlVal (chanfunc.p, STATISTICS_MIN, min); SetInputMode (chanfunc.p, STATISTICS_MAX, !err); SetCtrlVal (chanfunc.p, STATISTICS_MAX, max); if (err == NoErr) { Fmt (chanfunc.note, "%s<Min: %f[e2p5]\n", min); Fmt (chanfunc.note, "%s[a]<Max: %f[e2p5]\n", max); } err = Mean (chan->readings, chan->pts, &mean); SetInputMode (chanfunc.p, STATISTICS_MEAN, !err); SetCtrlVal (chanfunc.p, STATISTICS_MEAN, mean); if (err == NoErr) Fmt (chanfunc.note, "%s[a]<Mean: %f[e2p5]\n", mean); err = StdDev (chan->readings, chan->pts, &mean, &std_dev); SetInputMode (chanfunc.p, STATISTICS_STDDEV, !err); SetCtrlVal (chanfunc.p, STATISTICS_STDDEV, std_dev); if (err == NoErr) Fmt (chanfunc.note, "%s[a]<StdDev: %f[e2p5]\n", std_dev); err = Variance (chan->readings, chan->pts, &mean, &variance); SetInputMode (chanfunc.p, STATISTICS_VAR, !err); SetCtrlVal (chanfunc.p, STATISTICS_VAR, variance); if (err == NoErr) Fmt (chanfunc.note, "%s[a]<Variance: %f[e2p5]\n", variance); err = RMS (chan->readings, chan->pts, &rms); SetInputMode (chanfunc.p, STATISTICS_RMS, !err); SetCtrlVal (chanfunc.p, STATISTICS_RMS, rms); if (err == NoErr) Fmt (chanfunc.note, "%s[a]<RMS: %f[e2p5]\n", rms); GetCtrlVal (chanfunc.p, STATISTICS_ORDER, &order); err = Moment (chan->readings, chan->pts, order, &moment); SetInputMode (chanfunc.p, STATISTICS_MOMENT, !err); SetInputMode (chanfunc.p, STATISTICS_ORDER, !err); SetCtrlVal (chanfunc.p, STATISTICS_MOMENT, moment); if (err == NoErr) Fmt (chanfunc.note, "%s[a]<Moment: %f[e2p5] (order: %i)\n", moment, order); err = Median (chan->readings, chan->pts, &median); SetInputMode (chanfunc.p, STATISTICS_MEDIAN, !err); SetCtrlVal (chanfunc.p, STATISTICS_MEDIAN, median); if (err == NoErr) Fmt (chanfunc.note, "%s[a]<Median: %f[e2p5]\n", median); GetCtrlVal (chanfunc.p, STATISTICS_INTERVAL, &intervals); err = Mode (chan->readings, chan->pts, min, max, intervals, &mode); SetInputMode (chanfunc.p, STATISTICS_INTERVAL, !err); SetInputMode (chanfunc.p, STATISTICS_MODE, !err); SetCtrlVal (chanfunc.p, STATISTICS_INTERVAL, intervals); SetCtrlVal (chanfunc.p, STATISTICS_MODE, mode); if (err == NoErr) Fmt (chanfunc.note, "%s[a]<Mode: %f[e2p5] (intervals: %i)\n", mode, intervals); }