//--------------------------------------------------------------------------- bool TRig::openOak(void) { EOakStatus status; unsigned int rate = 100; if(isOakOpen()) return true; if(oak_device.isEmpty()) { qDebug("Empty path to HID device"); return false; } if(!checkOak(openDevice(oak_device.toStdString(), oakHandle))) return false; if(!checkOak(getDeviceInfo(oakHandle, oakDevInfo))) return false; else if(oakDevInfo.numberOfChannels < 4) { qDebug("Inclinometer should have 4 channels found %d", oakDevInfo.numberOfChannels); closeOak(); return false; } // Set the report Mode if(!checkOak(setReportMode(oakHandle, eReportModeAfterSampling, true))) //if(!checkOak(setReportMode(oakHandle, eReportModeFixedRate, true))) //if(!checkOak(setReportMode(oakHandle, eReportModeAfterChange, true))) return false; // Set the report rate // This parameter will only be regarded if Report Mode = 2 (fixed rate) if(!checkOak(setReportRate(oakHandle, rate, true))) return false; // Set the sample rate if(!checkOak(setSampleRate(oakHandle, rate, true))) //if(!checkOak(setSampleRate(oakHandle, rate * 2, true))) return false; // get channel 3 (zenith angle) info status = getChannelInfo(oakHandle, 2, oakChannelInfo[0]); // get channel 4 (azimuth angle) info if(status == eOakStatusOK) status = getChannelInfo(oakHandle, 3, oakChannelInfo[1]); if(!checkOak(status)) return false; return true; }
void QYoutubeChat::connect() { if( channelName_ == "" ) return; if( isShowSystemMessages() ) emit newMessage( new QChatMessage( YOUTUBE_SERVICE, YOUTUBE_USER, "Connecting to " + channelName_ + "...", "", this ) ); getChannelInfo(); }
void ds2406Menu( LOW_network &inNet) { bool keepLooping = true; while ( keepLooping) { hlp_printDashline(); printf( "PIO DS2406 device menu\n"); printf( "\n"); printf( " <g> Get DS2406 devices\n"); printf( " <s> Search all DS2406 devices\n"); printf( " <a> Search alarming DS2406 devices\n"); printf( "\n"); printf( " <c> Get search conditions of DS2406 devices\n"); printf( " <v> Set search conditions of DS2406 devices\n"); printf( " <i> Get channel info of DS2406 devices\n"); printf( " <l> Loop get channel info of DS2406 devices\n"); printf( " <r> Reset latches of DS2406 devices\n"); printf( "\n"); printf( " <q> Back to main menu\n"); int key = hlp_getMenuKey( "gsacvilrq"); LOW_devDS2406::devDS2406PtrVec_t allPDevs = inNet.getDevices<LOW_devDS2406>(); try { switch( key ) { case 'g': hlp_getDevices<LOW_devDS2406>( inNet); break; case 's': hlp_searchDevices<LOW_devDS2406>( inNet, false); break; case 'a': hlp_searchDevices<LOW_devDS2406>( inNet, true); break; case 'i': getChannelInfo( hlp_selectDevices( allPDevs), false); break; case 'c': getSearchCondition( hlp_selectDevices( allPDevs)); break; //case 'v': setSearchCondition( hlp_selectDevices( allPDevs)); break; case 'l': getChannelInfo( hlp_selectDevices( allPDevs), true); break; case 'r': resetLatches( hlp_selectDevices( allPDevs)); break; case 'q': keepLooping=false; break; } } catch( LOW_exception ex) { ex.logException(); } } }
void QFunStreamChat::connect() { if( channelName_ == "" ) return; lastMessageId_ = 0; smiles_.clear(); if( isShowSystemMessages() ) emit newMessage( new QChatMessage( FUNSTREAM_SERVICE, FUNSTREAM_USER, "Connecting to " + channelName_ + "...", "", this ) ); getChannelInfo(); }
void LLVoiceChannelGroup::handleError(EStatusType status) { std::string notify; switch(status) { case ERROR_CHANNEL_LOCKED: case ERROR_CHANNEL_FULL: notify = "VoiceChannelFull"; break; case ERROR_NOT_AVAILABLE: //clear URI and credentials //set the state to be no info //and activate if ( mRetries > 0 ) { mRetries--; mIsRetrying = TRUE; mIgnoreNextSessionLeave = TRUE; getChannelInfo(); return; } else { notify = "VoiceChannelJoinFailed"; mRetries = DEFAULT_RETRIES_COUNT; mIsRetrying = FALSE; } break; case ERROR_UNKNOWN: default: break; } // notification if (!notify.empty()) { LLNotificationPtr notification = LLNotificationsUtil::add(notify, mNotifyArgs); // echo to im window gIMMgr->addMessage(mSessionID, LLUUID::null, SYSTEM_FROM, notification->getMessage()); } LLVoiceChannel::handleError(status); }
void LLVoiceChannel::activate() { if (callStarted()) { return; } // deactivate old channel and mark ourselves as the active one if (sCurrentVoiceChannel != this) { // mark as current before deactivating the old channel to prevent // activating the proximal channel between IM calls LLVoiceChannel* old_channel = sCurrentVoiceChannel; sCurrentVoiceChannel = this; mCallDialogPayload["old_channel_name"] = ""; if (old_channel) { mCallDialogPayload["old_channel_name"] = old_channel->getSessionName(); old_channel->deactivate(); } } if (mState == STATE_NO_CHANNEL_INFO) { // responsible for setting status to active getChannelInfo(); } else { setState(STATE_CALL_STARTED); } LLVoiceClient::getInstance()->addObserver(this); //do not send earlier, channel should be initialized, should not be in STATE_NO_CHANNEL_INFO state sCurrentVoiceChannelChangedSignal(this->mSessionID); }
// // FUNCTION: WndProc(HWND, unsigned, WORD, LONG) // // PURPOSE: Processes messages for the main window. // // WM_COMMAND - process the application menu // WM_PAINT - Paint the main window // WM_DESTROY - post a quit message and return // // LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { int wmId, wmEvent; POINT point; switch (message) { case WM_SHOWGUI: createGUI(hWnd); break; case WM_TRAYICON: switch((UINT)lParam) { case WM_LBUTTONDOWN: if (allowTrayMenu) SendMessage(hWnd,WM_SHOWMENU,2,0); SetForegroundWindow(hWnd); break; case WM_RBUTTONDOWN: if (allowTrayMenu) SendMessage(hWnd,WM_SHOWMENU,1,0); SetForegroundWindow(hWnd); break; } break; case WM_COPYDATA: { COPYDATASTRUCT *pc = (COPYDATASTRUCT *)lParam; LOG_DEBUG("URL request: %s",pc->lpData); if (pc->dwData == WM_PLAYCHANNEL) { ChanInfo info; servMgr->procConnectArgs((char *)pc->lpData,info); chanMgr->findAndPlayChannel(info,false); } //sys->callLocalURL((const char *)pc->lpData,servMgr->serverHost.port); } break; case WM_GETPORTNUMBER: { int port; port=servMgr->serverHost.port; ReplyMessage(port); } break; case WM_SHOWMENU: { SetForegroundWindow(hWnd); bool skipMenu=false; allowTrayMenu = false; // check for notifications if (currNotify & ServMgr::NT_UPGRADE) { if (servMgr->downloadURL[0]) { if ((sys->getTime()-seenNewVersionTime) > (60*60)) // notify every hour { if (MessageBox(hWnd,"A newer version of PeerCast is available, press OK to upgrade.","PeerCast",MB_OKCANCEL|MB_APPLMODAL|MB_ICONEXCLAMATION) == IDOK) sys->getURL(servMgr->downloadURL); seenNewVersionTime=sys->getTime(); skipMenu=true; } } } if (!skipMenu) { GetCursorPos(&point); HMENU menu; switch (wParam) { case 1: menu = GetSubMenu(trayMenu,0); addAllChannelsMenu(GetSubMenu(menu,0)); addRelayedChannelsMenu(GetSubMenu(menu,1)); break; case 2: menu = GetSubMenu(ltrayMenu,0); addAllChannelsMenu(menu); break; } if (!TrackPopupMenu(menu,TPM_RIGHTALIGN,point.x,point.y,0,hWnd,NULL)) { LOG_ERROR("Can`t track popup menu: %d",GetLastError()); } PostMessage(hWnd,WM_NULL,0,0); } allowTrayMenu = true; } break; case WM_CREATE: if (showGUI) createGUI(hWnd); break; case WM_COMMAND: wmId = LOWORD(wParam); wmEvent = HIWORD(wParam); if ((wmId >= INFO_CMD) && (wmId < INFO_CMD+MAX_CHANNELS)) { int c = wmId - INFO_CMD; chanInfo = getChannelInfo(c); chanInfoIsRelayed = false; DialogBox(hInst, (LPCTSTR)IDD_CHANINFO, hWnd, (DLGPROC)ChanInfoProc); return 0; } if ((wmId >= URL_CMD) && (wmId < URL_CMD+MAX_CHANNELS)) { int c = wmId - URL_CMD; chanInfo = getChannelInfo(c); if (chanInfo.url.isValidURL()) sys->getURL(chanInfo.url); return 0; } if ((wmId >= PLAY_CMD) && (wmId < PLAY_CMD+MAX_CHANNELS)) { int c = wmId - PLAY_CMD; chanInfo = getChannelInfo(c); chanMgr->findAndPlayChannel(chanInfo,false); return 0; } if ((wmId >= RELAY_CMD) && (wmId < RELAY_CMD+MAX_CHANNELS)) { int c = wmId - RELAY_CMD; chanInfo = getChannelInfo(c); chanMgr->findAndPlayChannel(chanInfo,true); return 0; } // Parse the menu selections: switch (wmId) { case ID_POPUP_SHOWMESSAGES_PEERCAST: flipNotifyPopup(ID_POPUP_SHOWMESSAGES_PEERCAST,ServMgr::NT_PEERCAST); break; case ID_POPUP_SHOWMESSAGES_BROADCASTERS: flipNotifyPopup(ID_POPUP_SHOWMESSAGES_BROADCASTERS,ServMgr::NT_BROADCASTERS); break; case ID_POPUP_SHOWMESSAGES_TRACKINFO: flipNotifyPopup(ID_POPUP_SHOWMESSAGES_TRACKINFO,ServMgr::NT_TRACKINFO); break; case ID_POPUP_ABOUT: case IDM_ABOUT: DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About); break; case ID_POPUP_SHOWGUI: case IDM_SETTINGS_GUI: case ID_POPUP_ADVANCED_SHOWGUI: { createGUI(hWnd); break; } case ID_POPUP_YELLOWPAGES: sys->getURL("http://yp.peercast.org/"); break; case ID_POPUP_ADVANCED_VIEWLOG: showHTML("viewlog.html"); break; case ID_POPUP_ADVANCED_SAVESETTINGS: servMgr->saveSettings(iniFileName.cstr()); break; case ID_POPUP_ADVANCED_INFORMATION: showHTML("index.html"); break; case ID_FIND_CHANNELS: case ID_POPUP_ADVANCED_ALLCHANNELS: case ID_POPUP_UPGRADE: sys->callLocalURL("admin?cmd=upgrade",servMgr->serverHost.port); break; case ID_POPUP_ADVANCED_RELAYEDCHANNELS: case ID_POPUP_FAVORITES_EDIT: showHTML("relays.html"); break; case ID_POPUP_ADVANCED_BROADCAST: showHTML("broadcast.html"); break; case ID_POPUP_SETTINGS: showHTML("settings.html"); break; case ID_POPUP_CONNECTIONS: showHTML("connections.html"); break; case ID_POPUP_HELP: sys->getURL("http://www.peercast.org/help.php"); break; case ID_POPUP_EXIT_CONFIRM: case IDM_EXIT: DestroyWindow(hWnd); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } break; case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } return 0; }
bool FORTE_GET_CHAN_INFO::init(){ SINT32 retCode = getChannelInfo(); return retCode == 0; }
MccUSBDAQDevice::MccUSBDAQDevice(ORBManager* orb_manager, std::string DeviceName, std::string Address, unsigned short ModuleNumber, int boardNum_, int numADChans_) : STI_Device(orb_manager, DeviceName, Address, ModuleNumber), boardNum(boardNum_), numADChans(numADChans_) { //constants for the usb daq physical device UDStat = 0; // DataValue = 0; Options = DEFAULTOPTION; // cbw software revision number RevLevel = (float)CURRENTREVNUM; if (driverMutex != 0) { driverMutex->lock(); // Declare UL Revision Level UDStat = cbDeclareRevision(&RevLevel); /* Initiate error handling Parameters: PRINTALL :all warnings and errors encountered will be printed DONTSTOP :program will continue even if error occurs. Note that STOPALL and STOPFATAL are only effective in Windows applications, not Console applications. */ cbErrHandling (DONTPRINT, DONTSTOP); //must come before evaluating ranges //Set whether single-ended or differential. int errorCode = cbSetConfig(BOARDINFO, boardNum, 0, BINUMADCHANS, numADChans); //Check setting errorCode = cbGetConfig (BOARDINFO, boardNum, 0, BINUMADCHANS, &numADChans); //numADChans == 0 occurs when the usb daq is not connected. if (numADChans == 0) { initialized = false; return; } //Get the number of DA outs cbGetConfig (BOARDINFO, boardNum, 0, BINUMDACHANS, &numDAChans); driverMutex->unlock(); } if (numDAChans == 0) { initialized = false; return; } getChannelInfo(); if (!availableADInRanges.empty()) ADInRange = availableADInRanges.begin()->first; else ADInRange = BIP10VOLTS; //set it to something to avoid complaints. Will be ignored if (!availableDAOutRanges.empty()) DAOutRange = availableDAOutRanges.begin()->first; else DAOutRange = UNI5VOLTS; //set it to something to avoid complaints. Will be ignored }
RecordedChannelInfo FileSource::getChannelInfo (int channel) const { return getChannelInfo (activeRecord, channel); }
// // FUNCTION: WndProc(HWND, unsigned, WORD, LONG) // // PURPOSE: Processes messages for the main window. // // WM_COMMAND - process the application menu // WM_PAINT - Paint the main window // WM_DESTROY - post a quit message and return // // LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { int wmId, wmEvent; POINT point; char buf[1024]; if(message == g_iTaskbarCreated) // for PCRaw (tray icon) loadIcons(hInst, hWnd); switch (message) { case WM_SHOWGUI: createGUI(hWnd); break; case WM_TRAYICON: switch((UINT)lParam) { case WM_LBUTTONDOWN: if (allowTrayMenu) SendMessage(hWnd,WM_SHOWMENU,2,0); SetForegroundWindow(hWnd); break; case WM_RBUTTONDOWN: if (allowTrayMenu) SendMessage(hWnd,WM_SHOWMENU,1,0); SetForegroundWindow(hWnd); break; case WM_LBUTTONDBLCLK: createGUI(hWnd); break; } break; case WM_COPYDATA: { COPYDATASTRUCT *pc = (COPYDATASTRUCT *)lParam; LOG_DEBUG("URL request: %s",pc->lpData); if (pc->dwData == WM_PLAYCHANNEL) { ChanInfo info; servMgr->procConnectArgs((char *)pc->lpData,info); chanMgr->findAndPlayChannel(info,false); } //sys->callLocalURL((const char *)pc->lpData,servMgr->serverHost.port); } break; case WM_GETPORTNUMBER: { int port; port=servMgr->serverHost.port; ReplyMessage(port); } break; case WM_SHOWMENU: { if (servMgr->saveGuiPos) { CheckMenuItem(trayMenu, ID_POPUP_SAVE_GUI_POS, MF_CHECKED|MF_BYCOMMAND); } else { CheckMenuItem(trayMenu, ID_POPUP_SAVE_GUI_POS, MF_UNCHECKED|MF_BYCOMMAND); } SetForegroundWindow(hWnd); bool skipMenu=false; allowTrayMenu = false; // check for notifications if (currNotify & ServMgr::NT_UPGRADE) { if (servMgr->downloadURL[0]) { if ((sys->getTime()-seenNewVersionTime) > (60*60)) // notify every hour { if (MessageBox(hWnd,"A newer version of PeerCast is available, press OK to upgrade.","PeerCast",MB_OKCANCEL|MB_APPLMODAL|MB_ICONEXCLAMATION) == IDOK) sys->getURL(servMgr->downloadURL); seenNewVersionTime=sys->getTime(); skipMenu=true; } } } if (!skipMenu) { RECT rcWnd; HMENU menu; UINT flg = 0; SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWnd, 0); GetCursorPos(&point); if (point.x < rcWnd.left) { point.x = rcWnd.left; flg |= TPM_LEFTALIGN; } if (point.x > rcWnd.right) { point.x = rcWnd.right; flg |= TPM_RIGHTALIGN; } if (point.y < rcWnd.top) { point.y = rcWnd.top; flg |= TPM_TOPALIGN; } if (point.y > rcWnd.bottom) { point.y = rcWnd.bottom; flg |= TPM_BOTTOMALIGN; } if (flg == 0) { flg = TPM_RIGHTALIGN; } switch (wParam) { case 1: menu = GetSubMenu(trayMenu,0); addAllChannelsMenu(GetSubMenu(menu,0)); addRelayedChannelsMenu(GetSubMenu(menu,1)); break; case 2: menu = GetSubMenu(ltrayMenu,0); addAllChannelsMenu(menu); break; } if (!TrackPopupMenu(menu,flg,point.x,point.y,0,hWnd,NULL)) { LOG_ERROR("Can`t track popup menu: %d",GetLastError()); } PostMessage(hWnd,WM_NULL,0,0); } allowTrayMenu = true; } break; case WM_CREATE: if (showGUI) createGUI(hWnd); break; case WM_COMMAND: wmId = LOWORD(wParam); wmEvent = HIWORD(wParam); if ((wmId >= INFO_CMD) && (wmId < INFO_CMD+MAX_CHANNELS)) { int c = wmId - INFO_CMD; chanInfo = getChannelInfo(c); chanInfoIsRelayed = false; if (winDistinctionNT) DialogBox(hInst, (LPCTSTR)IDD_CHANINFO, hWnd, (DLGPROC)ChanInfoProc); else { HWND WKDLG; //JP-Patch WKDLG = CreateDialog(hInst, (LPCTSTR)IDD_CHANINFO, hWnd, (DLGPROC)ChanInfoProc); //JP-Patch ShowWindow(WKDLG,SW_SHOWNORMAL); //JP-Patch } return 0; } if ((wmId >= URL_CMD) && (wmId < URL_CMD+MAX_CHANNELS)) { int c = wmId - URL_CMD; chanInfo = getChannelInfo(c); if (chanInfo.url.isValidURL()) sys->getURL(chanInfo.url); return 0; } if ((wmId >= PLAY_CMD) && (wmId < PLAY_CMD+MAX_CHANNELS)) { int c = wmId - PLAY_CMD; chanInfo = getChannelInfo(c); chanMgr->findAndPlayChannel(chanInfo,false); return 0; } if ((wmId >= RELAY_CMD) && (wmId < RELAY_CMD+MAX_CHANNELS)) { int c = wmId - RELAY_CMD; chanInfo = getChannelInfo(c); chanMgr->findAndPlayChannel(chanInfo,true); return 0; } // Parse the menu selections: switch (wmId) { case ID_POPUP_SHOWMESSAGES_PEERCAST: flipNotifyPopup(ID_POPUP_SHOWMESSAGES_PEERCAST,ServMgr::NT_PEERCAST); break; case ID_POPUP_SHOWMESSAGES_BROADCASTERS: flipNotifyPopup(ID_POPUP_SHOWMESSAGES_BROADCASTERS,ServMgr::NT_BROADCASTERS); break; case ID_POPUP_SHOWMESSAGES_TRACKINFO: flipNotifyPopup(ID_POPUP_SHOWMESSAGES_TRACKINFO,ServMgr::NT_TRACKINFO); break; case ID_POPUP_ABOUT: case IDM_ABOUT: DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About); break; case ID_POPUP_SHOWGUI: case IDM_SETTINGS_GUI: case ID_POPUP_ADVANCED_SHOWGUI: { createGUI(hWnd); break; } case ID_POPUP_YELLOWPAGES: sys->getURL("http://yp.peercast.org/"); break; case ID_POPUP_YELLOWPAGES1: sprintf(buf, "http://%s",servMgr->rootHost.cstr()); sys->getURL(buf); break; case ID_POPUP_YELLOWPAGES2: sprintf(buf, "http://%s",servMgr->rootHost2.cstr()); sys->getURL(buf); break; case ID_POPUP_ADVANCED_VIEWLOG: showHTML("viewlog.html"); break; case ID_POPUP_ADVANCED_SAVESETTINGS: servMgr->saveSettings(iniFileName.cstr()); break; case ID_POPUP_ADVANCED_INFORMATION: showHTML("index.html"); break; case ID_FIND_CHANNELS: case ID_POPUP_ADVANCED_ALLCHANNELS: case ID_POPUP_UPGRADE: sys->callLocalURL("admin?cmd=upgrade",servMgr->serverHost.port); break; case ID_POPUP_ADVANCED_RELAYEDCHANNELS: case ID_POPUP_FAVORITES_EDIT: showHTML("relays.html"); break; case ID_POPUP_ADVANCED_BROADCAST: showHTML("broadcast.html"); break; case ID_POPUP_SETTINGS: showHTML("settings.html"); break; case ID_POPUP_CONNECTIONS: showHTML("connections.html"); break; case ID_POPUP_HELP: sys->getURL("http://www.peercast.org/help.php"); break; case ID_POPUP_SAVE_GUI_POS: if (servMgr->saveGuiPos) { servMgr->saveGuiPos = false; CheckMenuItem(trayMenu, ID_POPUP_SAVE_GUI_POS, MF_UNCHECKED|MF_BYCOMMAND); } else { servMgr->saveGuiPos = true; CheckMenuItem(trayMenu, ID_POPUP_SAVE_GUI_POS, MF_CHECKED|MF_BYCOMMAND); } peercastInst->saveSettings(); break; case ID_POPUP_KEEP_DOWNSTREAMS: if (servMgr->keepDownstreams) { servMgr->keepDownstreams = false; CheckMenuItem(trayMenu, ID_POPUP_KEEP_DOWNSTREAMS, MF_UNCHECKED|MF_BYCOMMAND); } else { servMgr->keepDownstreams = true; CheckMenuItem(trayMenu, ID_POPUP_KEEP_DOWNSTREAMS, MF_CHECKED|MF_BYCOMMAND); } //peercastInst->saveSettings(); break; case ID_POPUP_EXIT_CONFIRM: case IDM_EXIT: DestroyWindow(hWnd); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } break; case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } return 0; }
void MoodBoxServer::getChannelInfo(Callback callback, qint32 channelId) { getChannelInfo(callback, QVariant(), channelId); }