void CBlockVariableCounter::Init() { AddInput(0, _T("~")); AddInput(0, _T("Start")); AddInput(0, _T("Step")); AddOutput(_T("Next"), 0); AddOutput(_T("Overflow"), 0); }
AudioPortIn::AudioPortIn() : oLeft("audio input left"), oRight("audio input right") { SetName("AudioPortIn"); AddOutput( oLeft ); AddOutput( oRight ); }
DR_UCtCVCrv::DR_UCtCVCrv(const SL_Ptr<DR_DCtSolver>& pSolver, const SL_Ptr<DR_StPoint>& pStCV, const SL_Ptr<DR_StCrv>& pStCrv, size_t nIndex) :DR_UCt(pSolver), m_pStCV(pStCV), m_pStCrv(pStCrv), m_nIndex(nIndex) { AddOutput(m_pStCV.GetTarget()); AddOutput(m_pStCrv.GetTarget()); }
evdevDevice::evdevDevice(const std::string& devnode) : m_devfile(devnode) { // The device file will be read on one of the main threads, so we open in non-blocking mode. m_fd = open(devnode.c_str(), O_RDWR | O_NONBLOCK); int ret = libevdev_new_from_fd(m_fd, &m_dev); if (ret != 0) { // This useally fails because the device node isn't an evdev device, such as /dev/input/js0 m_initialized = false; close(m_fd); return; } m_name = StripSpaces(libevdev_get_name(m_dev)); // Controller buttons (and keyboard keys) int num_buttons = 0; for (int key = 0; key < KEY_MAX; key++) if (libevdev_has_event_code(m_dev, EV_KEY, key)) AddInput(new Button(num_buttons++, key, m_dev)); // Absolute axis (thumbsticks) int num_axis = 0; for (int axis = 0; axis < 0x100; axis++) if (libevdev_has_event_code(m_dev, EV_ABS, axis)) { AddAnalogInputs(new Axis(num_axis, axis, false, m_dev), new Axis(num_axis, axis, true, m_dev)); num_axis++; } // Force feedback if (libevdev_has_event_code(m_dev, EV_FF, FF_PERIODIC)) { for (auto type : {FF_SINE, FF_SQUARE, FF_TRIANGLE, FF_SAW_UP, FF_SAW_DOWN}) if (libevdev_has_event_code(m_dev, EV_FF, type)) AddOutput(new ForceFeedback(type, m_dev)); } if (libevdev_has_event_code(m_dev, EV_FF, FF_RUMBLE)) { AddOutput(new ForceFeedback(FF_RUMBLE, m_dev)); } // TODO: Add leds as output devices m_initialized = true; m_interesting = num_axis >= 2 || num_buttons >= 8; }
void QmitkAbstractTrackingDeviceWidget::TestConnectionFinished(bool connected, QString output) { m_TestConnectionWorkerThread->quit(); AddOutput(output.toStdString()); MITK_INFO << "Test connection: " << connected; this->setEnabled(true); }
void QmitkTrackingDeviceConfigurationWidget::AutoScanPorts() { this->setEnabled(false); AddOutput("<br>Scanning..."); m_ScanPortsWorkerThread->start(); emit ProgressStarted(); }
QmitkTrackingDeviceConfigurationWidget::QmitkTrackingDeviceConfigurationWidget(QWidget* parent, Qt::WindowFlags f) : QWidget(parent, f) { //initialize worker thread m_TestConnectionWorker = new QmitkTrackingDeviceConfigurationWidgetConnectionWorker(); m_ScanPortsWorker = new QmitkTrackingDeviceConfigurationWidgetScanPortsWorker(); m_ScanPortsWorkerThread = new QThread(); m_TestConnectionWorkerThread = new QThread(); //initializations m_Controls = NULL; CreateQtPartControl(this); CreateConnections(); m_MTCalibrationFile = ""; m_AdvancedUserControl = true; //initialize a few UI elements this->m_TrackingDeviceConfigurated = false; AddOutput("<br>NDI Polaris selected"); //Polaris is selected by default m_Controls->m_trackingDeviceChooser->setCurrentIndex(0); m_Controls->m_TrackingSystemWidget->setCurrentIndex(0); //reset a few things ResetOutput(); //restore old UI settings LoadUISettings(); }
status_t BMediaClient::RegisterOutput(BMediaOutput* output) { output->ConnectionRegistered(this, ++fLastID); AddOutput(output); return B_OK; }
svlFilterImageCenterFinder::svlFilterImageCenterFinder() : svlFilterBase(), Smoothing(0.0), ThresholdLevel(10), MassRatio(50), LinkHorizontally(false), LinkVertically(true), EllipseFittingEnabled(false), EllipseFittingDrawEllipse(false), EllipseFittingSlices(32), EllipseFittingMode(0), EllipseFittingEdgeThreshold(100), EllipseFittingErrorThreshold(18), EllipseMaskEnabled(false), EllipseMaskSlices(32), EllipseMaskTransitionStart(0), EllipseMaskTransitionEnd(0), EllipseMargin(0), MaskImage(0), TransitionImage(0) { AddInput("input", true); AddInputType("input", svlTypeImageRGB); AddInputType("input", svlTypeImageRGBStereo); AddOutput("output", true); SetAutomaticOutputType(true); }
svlFilterImageExposureCorrection::svlFilterImageExposureCorrection() : svlFilterBase(), Brightness(0.0), Contrast(0.0), Gamma(0.0) { CreateInterfaces(); AddInput("input", true); AddInputType("input", svlTypeImageRGB); AddInputType("input", svlTypeImageRGBStereo); AddInputType("input", svlTypeImageRGBA); AddInputType("input", svlTypeImageRGBAStereo); AddInputType("input", svlTypeImageMono8); AddInputType("input", svlTypeImageMono8Stereo); // Might be added in the future // AddInputType("input", svlTypeImageMono16); // AddInputType("input", svlTypeImageMono16Stereo); // AddInputType("input", svlTypeImageMono32); // AddInputType("input", svlTypeImageMono32Stereo); AddOutput("output", true); SetAutomaticOutputType(true); }
Sum::Sum() : i1("input 1"), i2("input 2"), oSum("sum") { AddInput(i1); AddInput(i2); AddOutput(oSum); }
svlFilterImageBlobTracker::svlFilterImageBlobTracker() : svlFilterBase(), OutputBlobs(0) { AddInput("blobsmap", true); AddInputType("blobsmap", svlTypeImageMono32); AddInputType("blobsmap", svlTypeImageMono32Stereo); AddInput("blobs", false); AddInputType("blobs", svlTypeBlobs); AddOutput("blobsmap", true); SetAutomaticOutputType(true); AddOutput("blobs", false); SetOutputType("blobs", svlTypeBlobs); }
HRESULT STDMETHODCALLTYPE CGraphConnector::GetCreateOutputFilter( IBaseFilter **OutputFilter ) { CheckPointer(OutputFilter,E_POINTER); HRESULT hr = AddOutput(); *OutputFilter = NULL; if( hr != S_OK ) return hr; return m_pOutputFilter[m_nNumOutputs-1]->NonDelegatingQueryInterface( __uuidof( IBaseFilter ), (void**)OutputFilter ); }
void svlFilterSplitter::AddOutputCommand(const svlFilterSplitter::OutputInfo & output) { if (AddOutput(output.name, output.threadcount, output.buffersize) != SVL_OK) { CMN_LOG_CLASS_INIT_ERROR << "AddOutputCommand: the splitter already has an output of the same name (\"" << output.name << "\")" << std::endl; } }
CMyFilter1::CMyFilter1() : svlFilterBase() // Call baseclass' constructor { // AddInput("input", true); // Create synchronous input connector AddInputType("input", svlTypeImageRGB); // Set sample type for input connector // AddOutput("output", true); // Create synchronous ouput connector SetAutomaticOutputType(true); // Set output sample type the same as input sample type }
Noise::Noise() : oOut("output") { AddOutput(oOut); random = 0.f; noise = 0.f; /* Generate a new random seed from system time - do this once in your constructor */ srand( time(0) ); }
svlFilterSourceVideoFile::svlFilterSourceVideoFile() : svlFilterSourceBase(false), // manual timestamp management OutputImage(0), FirstTimestamp(-1.0), NativeFramerate(-1.0) { CreateInterfaces(); AddOutput("output", true); SetAutomaticOutputType(false); }
Device::Device(const XINPUT_CAPABILITIES& caps, u8 index) : m_index(index), m_subtype(caps.SubType) { ZeroMemory(&m_state_out, sizeof(m_state_out)); ZeroMemory(&m_current_state_out, sizeof(m_current_state_out)); // XInputGetCaps seems to always claim all capabilities are supported // but I will leave all this stuff in, incase m$ fixes xinput up a bit // get supported buttons for (int i = 0; i != sizeof(named_buttons)/sizeof(*named_buttons); ++i) { // Guide button is never reported in caps if ((named_buttons[i].bitmask & caps.Gamepad.wButtons) || ((named_buttons[i].bitmask & XINPUT_GAMEPAD_GUIDE) && haveGuideButton)) AddInput(new Button(i, m_state_in.Gamepad.wButtons)); } // get supported triggers for (int i = 0; i != sizeof(named_triggers)/sizeof(*named_triggers); ++i) { //BYTE val = (&caps.Gamepad.bLeftTrigger)[i]; // should be max value / MSDN lies if ((&caps.Gamepad.bLeftTrigger)[i]) AddInput(new Trigger(i, (&m_state_in.Gamepad.bLeftTrigger)[i], 255 )); } // get supported axes for (int i = 0; i != sizeof(named_axes)/sizeof(*named_axes); ++i) { //SHORT val = (&caps.Gamepad.sThumbLX)[i]; // xinput doesn't give the range / MSDN is a liar if ((&caps.Gamepad.sThumbLX)[i]) { const SHORT& ax = (&m_state_in.Gamepad.sThumbLX)[i]; // each axis gets a negative and a positive input instance associated with it AddInput(new Axis(i, ax, -32768)); AddInput(new Axis(i, ax, 32767)); } } // get supported motors for (int i = 0; i != sizeof(named_motors)/sizeof(*named_motors); ++i) { //WORD val = (&caps.Vibration.wLeftMotorSpeed)[i]; // should be max value / nope, more lies if ((&caps.Vibration.wLeftMotorSpeed)[i]) AddOutput(new Motor(i, (&m_state_out.wLeftMotorSpeed)[i], 65535)); } ClearInputState(); }
void QmitkTrackingDeviceConfigurationWidget::TrackingDeviceChanged() { const std::string currentDevice = this->GetCurrentDeviceName(); //show the correspondig widget m_Controls->m_TrackingSystemWidget->setCurrentIndex(m_DeviceToWidgetIndexMap[currentDevice]); //reset output ResetOutput(); AddOutput("<br>"); AddOutput(currentDevice); AddOutput(" selected"); QmitkAbstractTrackingDeviceWidget* widget = GetWidget(currentDevice); if (widget == nullptr || !widget->IsDeviceInstalled()) { AddOutput("<br>ERROR: not installed!"); } emit TrackingDeviceSelectionChanged(); }
void QmitkTrackingDeviceConfigurationWidget::AutoScanPortsFinished(int PolarisPort, int AuroraPort, QString result, int PortTypePolaris, int PortTypeAurora) { m_ScanPortsWorkerThread->quit(); #ifdef WIN32 if((PortTypePolaris!=-1)||(PortTypeAurora!=-1)) {MITK_WARN << "Port type is specified although this should not be the case for Windows. Ignoring port type.";} #else //linux systems if (PortTypePolaris!=-1) {m_Controls->portTypePolaris->setCurrentIndex(PortTypePolaris);} if (PortTypeAurora!=-1) {m_Controls->portTypeAurora->setCurrentIndex(PortTypeAurora);} #endif m_Controls->m_portSpinBoxPolaris->setValue(PolarisPort); m_Controls->m_portSpinBoxAurora->setValue(AuroraPort); AddOutput(result.toStdString()); this->setEnabled(true); emit ProgressFinished(); }
mitk::TrackingDevice::Pointer QmitkTrackingDeviceConfigurationWidget::ConstructTrackingDevice() { mitk::TrackingDevice::Pointer returnValue; //#### Step 1: configure tracking device: if (m_Controls->m_trackingDeviceChooser->currentIndex()==0)//NDI Polaris { if(m_Controls->m_radioPolaris5D->isChecked()) //5D Tracking { //not yet in the open source part so we'll only get NULL here. returnValue = ConfigureNDI5DTrackingDevice(); } else //6D Tracking { returnValue = ConfigureNDI6DTrackingDevice(); returnValue->SetType(mitk::NDIPolaris); } } else if (m_Controls->m_trackingDeviceChooser->currentIndex()==1)//NDI Aurora { returnValue = ConfigureNDI6DTrackingDevice(); returnValue->SetType(mitk::NDIAurora); } else if (m_Controls->m_trackingDeviceChooser->currentIndex()==2)//ClaronTechnology MicronTracker 2 { mitk::ClaronTrackingDevice::Pointer newDevice = mitk::ClaronTrackingDevice::New(); if(this->m_MTCalibrationFile=="") AddOutput("<br>Warning: Calibration file is not set!"); else { //extract path from calibration file and set the calibration dir of the device std::string path = itksys::SystemTools::GetFilenamePath(m_MTCalibrationFile); newDevice->SetCalibrationDir(path); } returnValue = newDevice; } else if (m_Controls->m_trackingDeviceChooser->currentIndex()==3) { // Create the Tracking Device this->m_OptitrackDevice = mitk::OptitrackTrackingDevice::New(); returnValue = ConfigureOptitrackTrackingDevice(); returnValue->SetType(mitk::NPOptitrack); } else if (m_Controls->m_trackingDeviceChooser->currentIndex()==4) //Virtual Tracker { // Create the Virtual Tracking Device returnValue = mitk::VirtualTrackingDevice::New(); } return returnValue; }
svlFilterCapFramerate::svlFilterCapFramerate() : svlFilterBase(), TimeForLastFrame(0.0) { AddInput("input", true); AddInputType("input", svlTypeImageRGB); AddInputType("input", svlTypeImageRGBA); AddInputType("input", svlTypeImageRGBStereo); AddInputType("input", svlTypeImageRGBAStereo); AddInputType("input", svlTypeImageMono8); AddInputType("input", svlTypeImageMono8Stereo); AddInputType("input", svlTypeImageMono16); AddInputType("input", svlTypeImageMono16Stereo); AddInputType("input", svlTypeImageMono32); AddInputType("input", svlTypeImageMono32Stereo); AddInputType("input", svlTypeImage3DMap); AddInputType("input", svlTypeCUDAImageRGB); AddInputType("input", svlTypeCUDAImageRGBA); AddInputType("input", svlTypeCUDAImageRGBStereo); AddInputType("input", svlTypeCUDAImageRGBAStereo); AddInputType("input", svlTypeCUDAImageMono8); AddInputType("input", svlTypeCUDAImageMono8Stereo); AddInputType("input", svlTypeCUDAImageMono16); AddInputType("input", svlTypeCUDAImageMono16Stereo); AddInputType("input", svlTypeCUDAImageMono32); AddInputType("input", svlTypeCUDAImageMono32Stereo); AddInputType("input", svlTypeCUDAImage3DMap); AddInputType("input", svlTypeMatrixInt8); AddInputType("input", svlTypeMatrixInt16); AddInputType("input", svlTypeMatrixInt32); AddInputType("input", svlTypeMatrixInt64); AddInputType("input", svlTypeMatrixUInt8); AddInputType("input", svlTypeMatrixUInt16); AddInputType("input", svlTypeMatrixUInt32); AddInputType("input", svlTypeMatrixUInt64); AddInputType("input", svlTypeMatrixFloat); AddInputType("input", svlTypeMatrixDouble); AddInputType("input", svlTypeTransform3D); AddInputType("input", svlTypeTargets); AddInputType("input", svlTypeText); AddInputType("input", svlTypeBlobs); AddOutput("output", true); SetAutomaticOutputType(true); }
svlFilterImageColorSegmentation::svlFilterImageColorSegmentation() : svlFilterBase(), OutputImage(0) { AddInput("input", true); AddInputType("input", svlTypeImageRGB); AddInputType("input", svlTypeImageRGBStereo); AddOutput("output", true); // Calculate Square Root Look-up Table Normalized to 0-255 const unsigned int len = 3 * 255 * 255; const unsigned int maxval = static_cast<unsigned int>(sqrt(static_cast<float>(len))); NormSqrtLUT.SetSize(len); for (unsigned int i = 0; i < len; i ++) { NormSqrtLUT[i] = 255 * static_cast<unsigned int>(sqrt(static_cast<float>(i))) / maxval; } }
virtual void run() { #ifdef _XBOX XSetThreadProcessor(GetCurrentThread(), _processorNo); #endif Thread::yield(); LOG(0, "&& AsyncLoader @%d: started\n", CurrentProcessorNo()); while (!_terminated) { _mutex.lock(); _current = NULL; PopFront(_current); _mutex.unlock(); if (_current == NULL) { LOG(0, "&& AsyncLoader @%d: idle\n", CurrentProcessorNo()); _queueReady.wait(); continue; } LOG(0, "&& AsyncLoader @%d: pick-up '%s'\n", CurrentProcessorNo(), _current->getName().c_str()); try { _current->prepare(true); } catch (...) { LOG(0, "&& AsyncLoader @%d: Terminated due to an exception.\n", CurrentProcessorNo()); #ifdef _XBOX XLaunchNewImage( XLAUNCH_KEYWORD_DASH_ARCADE, 0 ); return; #endif } LOG(0, "&& AsyncLoader @%d: output '%s'\n", CurrentProcessorNo(), _current->getName().c_str()); AddOutput(_current); } LOG(0, "&& AsyncLoader @%d: terminated\n", CurrentProcessorNo()); }
svlFilterImageWindow::svlFilterImageWindow() : svlFilterBase(), FullScreenFlag(false), PositionSetFlag(false), IsVisible(true), Thread(0), ThreadProc(0), WindowManager(0), EventHandler(0) { CreateInterfaces(); AddInput("input", true); AddInputType("input", svlTypeImageRGB); AddInputType("input", svlTypeImageRGBStereo); AddOutput("output", true); SetAutomaticOutputType(true); }
KeyboardMouse::KeyboardMouse(const LPDIRECTINPUTDEVICE8 kb_device, const LPDIRECTINPUTDEVICE8 mo_device) : m_kb_device(kb_device) , m_mo_device(mo_device) { m_kb_device->Acquire(); m_mo_device->Acquire(); m_last_update = GetTickCount(); ZeroMemory(&m_state_in, sizeof(m_state_in)); ZeroMemory(m_state_out, sizeof(m_state_out)); ZeroMemory(&m_current_state_out, sizeof(m_current_state_out)); // KEYBOARD // add keys for (u8 i = 0; i < sizeof(named_keys)/sizeof(*named_keys); ++i) AddInput(new Key(i, m_state_in.keyboard[named_keys[i].code])); // add lights for (u8 i = 0; i < sizeof(named_lights)/sizeof(*named_lights); ++i) AddOutput(new Light(i)); // MOUSE // get caps DIDEVCAPS mouse_caps; ZeroMemory( &mouse_caps, sizeof(mouse_caps) ); mouse_caps.dwSize = sizeof(mouse_caps); m_mo_device->GetCapabilities(&mouse_caps); // mouse buttons for (u8 i = 0; i < mouse_caps.dwButtons; ++i) AddInput(new Button(i, m_state_in.mouse.rgbButtons[i])); // mouse axes for (unsigned int i = 0; i < mouse_caps.dwAxes; ++i) { const LONG& ax = (&m_state_in.mouse.lX)[i]; // each axis gets a negative and a positive input instance associated with it AddInput(new Axis(i, ax, (2==i) ? -1 : -MOUSE_AXIS_SENSITIVITY)); AddInput(new Axis(i, ax, -(2==i) ? 1 : MOUSE_AXIS_SENSITIVITY)); } // cursor, with a hax for-loop for (unsigned int i=0; i<4; ++i) AddInput(new Cursor(!!(i&2), (&m_state_in.cursor.x)[i/2], !!(i&1))); }
mitk::TrackingDevice::Pointer QmitkMicronTrackerWidget::ConstructTrackingDevice() { mitk::ClaronTrackingDevice::Pointer newDevice = mitk::ClaronTrackingDevice::New(); if (this->m_MTCalibrationFile.empty()) //if configuration file for MicronTracker is empty: load default { mitk::ClaronTrackingDevice::Pointer tempDevice = mitk::ClaronTrackingDevice::New(); m_MTCalibrationFile = tempDevice->GetCalibrationDir(); Poco::Path myPath = Poco::Path(m_MTCalibrationFile.c_str()); m_Controls->m_MTCalibrationFile->setText("Calibration File: " + QString(myPath.getFileName().c_str())); } if (!this->m_MTCalibrationFile.empty()) { //extract path from calibration file and set the calibration dir of the device std::string path = itksys::SystemTools::GetFilenamePath(m_MTCalibrationFile); newDevice->SetCalibrationDir(path); } else AddOutput("<br>Warning: Calibration file is not set!"); return static_cast<mitk::TrackingDevice::Pointer>(newDevice); }
QmitkTrackingDeviceConfigurationWidget::QmitkTrackingDeviceConfigurationWidget(QWidget* parent, Qt::WindowFlags f) : QWidget(parent, f) , m_Controls(nullptr) , m_TrackingDevice(nullptr) , m_DeviceToWidgetIndexMap() { //initializations CreateQtPartControl(this); CreateConnections(); RefreshTrackingDeviceCollection(); //initialize a few UI elements AddOutput("<br>First Element selected"); //Order from Collection List //reset a few things ResetOutput(); //restore old UI settings LoadUISettings(); }
Filter12dB::Filter12dB() : iIn("input"), oOut("output"), pFreq("frequency"), pFilterType("filter type") { AddInput(iIn); AddOutput(oOut); AddParameter( pFreq ); AddParameter( pFilterType ); // wartosci domyslne pFilterType.SetText( "lp" ); pFreq.Bound( 50, 0.75 * Module::sampleRate, 1 ); pFreq.SetValue( 1000 ); xn = yn = xn_1 = xn_2 = yn_1 = yn_2 = 0; Q = 1; }
QmitkTrackingDeviceConfigurationWidget::QmitkTrackingDeviceConfigurationWidget(QWidget* parent, Qt::WindowFlags f) : QWidget(parent, f) { //initialize worker thread m_TestConnectionWorker = new QmitkTrackingDeviceConfigurationWidgetConnectionWorker(); m_ScanPortsWorker = new QmitkTrackingDeviceConfigurationWidgetScanPortsWorker(); m_ScanPortsWorkerThread = new QThread(); m_TestConnectionWorkerThread = new QThread(); m_Controls = NULL; CreateQtPartControl(this); CreateConnections(); m_MTCalibrationFile = ""; //reset a few things ResetOutput(); AddOutput("<br>NDI Polaris selected"); this->m_TrackingDeviceConfigurated = false; m_AdvancedUserControl = true; }