Exemplo n.º 1
0
void CameraCanvas::refreshFrame(){
    if(!isSwitchedOn) return;
    if(!hasStreamInput) waitForRealInput();
    loadNewFrame();
    processNewData();   
    
    cv::imshow(this->canvasName, working_matrix);
    cv::imshow(t_str, working_threshold);
    cv::waitKey(1);
    usleep(15);
}
Exemplo n.º 2
0
UsbConsole::UsbConsole( ) : QDialog( )
{
  setupUi(this);
  connect( sendButton, SIGNAL(clicked()), this, SLOT(onCommandLine()));
  connect( commandLine->lineEdit(), SIGNAL(returnPressed()), this, SLOT(onCommandLine()));
  connect( openCloseButton, SIGNAL(clicked()), this, SLOT(onOpenClose()));
  connect( viewList, SIGNAL(activated(QString)), this, SLOT(onView(QString)));
  connect( portList, SIGNAL(activated(QString)), this, SLOT(openDevice(QString)));
  connect( &enumerateTimer, SIGNAL(timeout()), this, SLOT(enumerate()));
  connect(this, SIGNAL(finished(int)), this, SLOT(onFinished()));
  currentView = viewList->currentText();
  
  port = new QextSerialPort("", QextSerialPort::EventDriven);
  connect(port, SIGNAL(readyRead()), this, SLOT(processNewData()));
}
Exemplo n.º 3
0
void BeatController::readAudio()
{
    qint64 len = m_audioInput->bytesReady();

    if(len > m_RecordSize*2){
        char data[m_RecordSize*2];
        const qint16 *data16 = reinterpret_cast<const qint16 *>(&data);
        m_ioDevice->read(data, m_RecordSize*2);
        for(int i = 0; i < m_RecordSize; i++){
            qint16 v = data16[i];
            m_Buffer->write(i, v);
        }
        processNewData();
    }
}
Exemplo n.º 4
0
void Keypad::updateManually()
{
	bool updateNeeded = btnback.isUpdateNeeded() ||
		btnForward.isUpdateNeeded();
	if (!updateNeeded){
		return;
	}
	// clear state change flags
	btnBackChanged = false;
	btnForwardChanged = false;
	// poll buttons, callback will update flags above
	// if needed
	btnback.updateManually();
	btnForward.updateManually();
	if (btnBackChanged || btnForwardChanged){
		processNewData();
	}
}
Exemplo n.º 5
0
PacketUsbSerial::PacketUsbSerial(QString portName)
{
  port = new QextSerialPort(portName, QextSerialPort::EventDriven);
  connect(port, SIGNAL(readyRead()), this, SLOT(processNewData()));
  pkt_started = false;
}