4#include <yarp/os/LogStream.h>
18 return fgControl->getCameraDescription(camera);
27 grabberControl =
new yarp::dev::PolyDriver;
30 yarp::os::Property config;
31 config.put(
"device",
"frameGrabber_nwc_yarp");
32 config.put(
"remote",rem.toLatin1().data());
33 config.put(
"local",loc.toLatin1().data());
35 bool opened = grabberControl->open(config);
38 yError() <<
"Cannot open frameGrabber_nwc_yarp device.";
42 grabberControl->view(fgControl);
43 grabberControl->view(DC1394Control);
47 yError() <<
"RemoteGrabber does not have IFrameGrabberControl interface. Cannot proceed.";
53 yWarning() <<
"RemoteGrabber does not have IFrameGrabberControlDC1394 interface, please update yarp.";
59 QVariantList list = taskList.takeFirst();
171 while(keepRunning && taskList.isEmpty()){
173 waitCond.wait(&mutex,200);
178 grabberControl->close();
179 delete grabberControl;
187 QThread::msleep(100);
194 QVariant vaFunc = (int)func;
208 taskList.enqueue(list);
218 QVariant vaFunc = (int)func;
228 taskList.enqueue(list);
237 uint videoModeMaskDC1394 = DC1394Control->getVideoModeMaskDC1394();
238 uint fPSMaskDC1394 = DC1394Control->getFPSMaskDC1394();
239 uint colorCodingMaskDC1394 = DC1394Control->getColorCodingMaskDC1394(DC1394Control->getVideoModeDC1394());
251 uint videoModeDC1394 = DC1394Control->getVideoModeDC1394();
252 uint fPSDC1394 = DC1394Control->getFPSDC1394();
253 uint iSOSpeedDC1394 = DC1394Control->getISOSpeedDC1394();
254 bool operationModeDC1394 = DC1394Control->getOperationModeDC1394();
255 uint colorCodingDC1394 = DC1394Control->getColorCodingDC1394();
256 unsigned int xmax,ymax,xstep,ystep,xoffstep,yoffstep;
257 DC1394Control->getFormat7MaxWindowDC1394(xmax,ymax,xstep,ystep,xoffstep,yoffstep);
258 QSize max = QSize(xmax,ymax);
259 QSize step = QSize(xstep,ystep);
260 QSize
offset = QSize(xoffstep,yoffstep);
262 unsigned int xdim,ydim;
264 DC1394Control->getFormat7WindowDC1394(xdim,ydim,x0,y0);
265 QSize dim = QSize(xdim,ydim);
266 QSize pos = QSize(x0,y0);
268 uint bytesPerPacketDC1394 = DC1394Control->getBytesPerPacketDC1394();
269 bool transmissionDC1394 = DC1394Control->getTransmissionDC1394();
281 bytesPerPacketDC1394,
292 uint videoModeDC1394 = DC1394Control->getVideoModeDC1394();
293 uint colorCodingMaskDC1394 = DC1394Control->getColorCodingMaskDC1394(videoModeDC1394);
295 unsigned int xmax,ymax,xstep,ystep,xoffstep,yoffstep;
296 DC1394Control->getFormat7MaxWindowDC1394(xmax,ymax,xstep,ystep,xoffstep,yoffstep);
297 QSize max = QSize(xmax,ymax);
298 QSize step = QSize(xstep,ystep);
299 QSize
offset = QSize(xoffstep,yoffstep);
301 unsigned int xdim,ydim;
303 DC1394Control->getFormat7WindowDC1394(xdim,ydim,x0,y0);
304 QSize dim = QSize(xdim,ydim);
305 QSize pos = QSize(x0,y0);
307 uint colorCodingDC1394 = DC1394Control->getColorCodingDC1394();
308 uint bytesPerPacketDC1394 = DC1394Control->getBytesPerPacketDC1394();
309 uint fPSMaskDC1394 = DC1394Control->getFPSMaskDC1394();
310 uint fPSDC1394 = DC1394Control->getFPSDC1394();
311 uint iSOSpeedDC1394 = DC1394Control->getISOSpeedDC1394();
314 colorCodingMaskDC1394,
321 bytesPerPacketDC1394,
334 DC1394Control->setDefaultsDC1394();
338 uint bytesPerPacketDC1394 = DC1394Control->getBytesPerPacketDC1394();
339 uint colorCodingMaskDC1394 = DC1394Control->getColorCodingMaskDC1394(DC1394Control->getVideoModeDC1394());
340 DC1394Control->setTransmissionDC1394(
true);
341 bool transmissionDC1394 = DC1394Control->getTransmissionDC1394();
343 loadDefaultDone(bytesPerPacketDC1394,colorCodingMaskDC1394,transmissionDC1394);
353 DC1394Control->setResetDC1394();
357 uint bytesPerPacketDC1394 = DC1394Control->getBytesPerPacketDC1394();
358 uint colorCodingMaskDC1394 = DC1394Control->getColorCodingMaskDC1394(DC1394Control->getVideoModeDC1394());
359 bool transmissionDC1394 = DC1394Control->getTransmissionDC1394();
361 resetDone(bytesPerPacketDC1394,colorCodingMaskDC1394,transmissionDC1394);
370 bool value = arg.at(0).toBool();
371 DC1394Control->setTransmissionDC1394(value);
381 bool value = arg.at(0).toBool();
382 DC1394Control->setPowerDC1394(value);
391 unsigned int xdim=arg.at(0).toUInt();
392 unsigned int ydim=arg.at(1).toUInt();
393 int x0=arg.at(2).toInt();
394 int y0=arg.at(3).toInt();
396 DC1394Control->setFormat7WindowDC1394(xdim,ydim,x0,y0);
406 unsigned int video_mode=arg.at(0).toUInt();
407 DC1394Control->setVideoModeDC1394(video_mode);
417 int value =arg.at(0).toInt();
418 DC1394Control->setColorCodingDC1394(value);
429 int value = arg.at(0).toInt();
430 DC1394Control->setFPSDC1394(value);
442 int value = arg.at(0).toInt();
443 DC1394Control->setISOSpeedDC1394(value);
454 int value = arg.at(0).toUInt();
455 DC1394Control->setBytesPerPacketDC1394(value);
466 int value = arg.at(0).toInt();
467 DC1394Control->setOperationModeDC1394(value);
478 cameraFeature_id_t feature;
480 QObject *ptr = (QObject*)arg.at(0).value<
void*>();
481 int value = arg.at(1).toInt();
482 feature = (cameraFeature_id_t)value;
486 bool bON, bAuto, bHasAuto, bHasManual, bHasOnePush, bHasOnOff;
487 fgControl->getActive(feature, &bON);
488 fgControl->getMode(feature, &mode);
489 fgControl->hasOnOff(feature, &bHasOnOff);
490 fgControl->hasAuto(feature, &bHasAuto);
491 fgControl->hasManual(feature, &bHasManual);
492 fgControl->hasOnePush(feature, &bHasOnePush);
494 fgControl->getFeature(feature, &val);
495 mode == MODE_AUTO ? bAuto = true : bAuto =
false;
517 cameraFeature_id_t feature;
519 QObject *ptr = (QObject*)arg.at(0).value<
void*>();
520 int value = arg.at(1).toInt();
521 feature = (cameraFeature_id_t)value;
531 bool bON, bAuto, bHasAuto, bHasManual, bHasOnePush, bHasOnOff;
532 fgControl->getActive(feature, &bON);
533 fgControl->getMode(feature, &mode);
534 fgControl->hasOnOff(feature, &bHasOnOff);
535 fgControl->hasAuto(feature, &bHasAuto);
536 fgControl->hasManual(feature, &bHasManual);
537 fgControl->hasOnePush(feature, &bHasOnePush);
538 mode == MODE_AUTO ? bAuto = true : bAuto =
false;
542 fgControl->getFeature(feature, &blueVal, &redVal);
544 sliderWBRefreshDone(ptr,bON,bAuto,bHasOnOff,bHasAuto,bHasManual,bHasOnePush,redVal,blueVal);
554 cameraFeature_id_t feature;
555 int value = arg.at(0).toInt();
556 feature = (cameraFeature_id_t)value;
559 double val = arg.at(1).toDouble();
560 bool bRBa = arg.at(2).toBool();
561 bool bPwr = arg.at(3).toBool();
563 FeatureMode mode = bRBa ? MODE_AUTO : MODE_MANUAL;
565 fgControl->setFeature(feature,val);
566 fgControl->setMode(feature,mode);
567 fgControl->setActive(feature,bPwr);
579 cameraFeature_id_t feature;
580 int value = arg.at(0).toInt();
581 feature = (cameraFeature_id_t)value;
584 double redVal = arg.at(1).toDouble();
585 double blueVal = arg.at(2).toDouble();
586 bool bRBa = arg.at(3).toBool();
587 bool bPwr = arg.at(4).toBool();
589 fgControl->setFeature(feature, blueVal, redVal);
591 bRBa ? mode = MODE_AUTO : mode = MODE_MANUAL;
593 fgControl->setMode(feature,mode);
594 fgControl->setActive(feature,bPwr);
607 cameraFeature_id_t feature;
608 QObject *ptr = (QObject*)arg.at(0).value<
void*>();
609 int value = arg.at(1).toInt();
610 feature = (cameraFeature_id_t)value;
612 double val = arg.at(2).toDouble();
614 fgControl->setFeature(feature,val);
626 cameraFeature_id_t feature;
627 QObject *ptr = (QObject*)arg.at(0).value<
void*>();
628 int value = arg.at(1).toInt();
629 feature = (cameraFeature_id_t)value;
631 double redVal = arg.at(2).toDouble();
632 double blueVal = arg.at(3).toDouble();
634 fgControl->setFeature(feature, blueVal,redVal);
646 cameraFeature_id_t feature;
647 QObject *ptr = (QObject*)arg.at(0).value<
void*>();
648 int value = arg.at(1).toInt();
649 feature = (cameraFeature_id_t)value;
651 fgControl->setOnePush(feature);
654 fgControl->getFeature(feature, &val);
666 cameraFeature_id_t feature;
667 QObject *ptr = (QObject*)arg.at(0).value<
void*>();
668 int value = arg.at(1).toInt();
669 feature = (cameraFeature_id_t)value;
674 fgControl->setOnePush(feature);
675 fgControl->getFeature(feature, &blueVal, &redVal);
688 cameraFeature_id_t feature;
689 QObject *ptr = (QObject*)arg.at(0).value<
void*>();
690 int value = arg.at(1).toInt();
691 bool bVal = arg.at(2).toBool();
692 feature = (cameraFeature_id_t)value;
693 FeatureMode mode = bVal ? MODE_AUTO : MODE_MANUAL;
696 fgControl->getActive(feature, &bON);
697 fgControl->setMode(feature, mode);
709 qDebug() <<
"sliderPower";
711 cameraFeature_id_t feature;
712 QObject *ptr = (QObject*)arg.at(0).value<
void*>();
713 int value = arg.at(1).toInt();
714 bool bON = arg.at(2).toBool();
715 feature = (cameraFeature_id_t)value;
717 fgControl->setActive(feature, bON);
719 bool hasAuto, hasManual, hasOnePush;
720 fgControl->hasAuto(feature, &hasAuto);
721 fgControl->hasManual(feature, &hasManual);
722 fgControl->hasOnePush(feature, &hasOnePush);
734 cameraFeature_id_t feature;
735 QObject *ptr = (QObject*)arg.at(0).value<
void*>();
736 int value = arg.at(1).toInt();
737 feature = (cameraFeature_id_t)value;
740 fgControl->hasFeature(feature, &hasFeature);
void sliderPower(QVariantList arg)
void setPowerDC1394Done()
void setFormat7WindowDC1394(QVariantList arg)
void reloadDone(uint, uint, QSize, QSize, QSize, QSize, QSize, uint, uint, uint, uint, uint)
void sliderSetFeatureDC1394Done(QObject *, double)
void setTransmissionDC1394(QVariantList arg)
void sliderWBRefreshDone(QObject *, bool, bool, bool, bool, bool, bool, double, double)
void sliderOnePush(QVariantList arg)
void sliderHasFeatureDone(QObject *, bool)
void setBytesPerPacketDC1394(QVariantList arg)
void setTransmissionDC1394Done()
void setColorCodingDC1394(QVariantList arg)
void sliderWBSetFeatureDC1394Done(QObject *, double, double)
void sliderPropagate(QVariantList arg)
void sliderRefresh(QVariantList arg)
void setOperationModeDC1394(QVariantList arg)
void sliderRadioAuto(QVariantList arg)
void sliderSetFeatureDC1394(QVariantList arg)
void sliderOnePushDone(QObject *, double)
void setPowerDC1394(QVariantList arg)
void setISOSpeedDC1394(QVariantList)
void setISOSpeedDC1394Done()
void sliderRefreshDone(QObject *, bool, bool, bool, bool, bool, bool, double)
void doTask(threadFunction)
void sliderWBSetFeatureDC1394(QVariantList arg)
void setOperationModeDC1394Done()
void loadDefaultDone(uint, uint, bool)
void sliderWBOnePush(QVariantList arg)
void setColorCodingDC1394Done()
void setVideoModeDC1394Done()
void resetDone(uint, uint, bool)
void setFormat7WindowDC1394Done()
void sliderWBRefresh(QVariantList arg)
void setBytesPerPacketDC1394Done()
void initFormatTabDone(uint, uint, uint)
DC1394Thread(char *loc, char *rem, QObject *parent=0)
void sliderPowerDone(QObject *, bool, bool, bool, bool)
void sliderHasFeature(QVariantList arg)
bool getCameraDescription(CameraDescriptor *camera)
void sliderRadioAutoDone(QObject *, bool, bool)
void sliderWBOnePushDone(QObject *, double, double)
void initDone(uint, uint, uint, bool, uint, QSize, QSize, QSize, QSize, QSize, uint, bool)
void setVideoModeDC1394(QVariantList arg)
void sliderWBPropagate(QVariantList arg)
void sliderPropagateDone()
void sliderWBPropagateDone()
void setFPSDC1394(QVariantList arg)
@ _setOperationModeDC1394
@ _setBytesPerPacketDC1394
@ _setFormat7WindowDC1394