Exemplo n.º 1
0
void MainWindow::loadSettings(){
    setFullScreen(false);
    setHideMenu(false);

    QSettings settingsNative;

    resize(settingsNative.value("size", QSize(320, 480 + ui.menuBar->height())).toSize());
    move(settingsNative.value("pos",    QPoint(0, 0)).toPoint());

    int red = settingsNative.value("backgroundRed",     240).toInt();
    int green = settingsNative.value("backgroundGreen", 240).toInt();
    int blue = settingsNative.value("backgroundBlue",   240).toInt();
    QColor backgroundColor = QColor(red, green, blue);

    red = settingsNative.value("canvasRed",     255).toInt();
    green = settingsNative.value("canvasGreen", 255).toInt();
    blue = settingsNative.value("canvasBlue",   255).toInt();
    QColor canvasColor = QColor(red, green, blue);

    red = settingsNative.value("infoRed",     0).toInt();
    green = settingsNative.value("infoGreen", 0).toInt();
    blue = settingsNative.value("infoBlue",   0).toInt();
    QColor infoColor = QColor(red, green, blue);

    setBackgroundColor(backgroundColor);
    setCanvasColor(canvasColor);
    setInfoColor(infoColor);

    updateBackgroundColor();
    updateCanvasColor();
    updateInfoColor();

    QSettings settings(Constants::SETTINGS_FOLDER + "/" + Constants::PLAYER_SETTINGS_FILE, QSettings::IniFormat);

    setWidth(settings.value("width",             320).toInt());
    setHeight(settings.value("height",           480).toInt());
    setScale(settings.value("scale",             100).toInt());
    setFps(settings.value("fps",                 60).toInt());
    setOrientation(static_cast<Orientation>(settings.value("orientation", ePortrait).toInt()));
    setDrawInfos(settings.value("drawInfos",     false).toBool());
    setAutoScale(settings.value("autoScale",     false).toBool());
    setAlwaysOnTop(settings.value("alwaysOnTop", false).toBool());

    checkLoadedSettings();

    updateFps();
    updateDrawInfos();
    updateAlwaysOnTop();
    updateAutoScale();
    updateOrientation();
    updateResolution();
}
Exemplo n.º 2
0
void PersonListView::onDefineColor()
{
    
    QAbstractItemModel* abs_model = model();
    PersonListModel* model = dynamic_cast<PersonListModel*>(abs_model);
    
    if(model != NULL) {
        QColor old_color = model->getColor();
        QColor new_color = QColorDialog::getColor(old_color, this);
        model->setColor(new_color);
        updateBackgroundColor(new_color);
    }
}
Exemplo n.º 3
0
void XlinkPreview::colorSelected()
{
    if(!isConnected()) return;

    auto state = State::getInstance();

    switch(state->getSelectedPen()) {
    case 0: updateBackgroundColor(); break;
    case 1: updateMulticolor1(); break;
    case 2: updateMulticolor2(); break;
    case 3: updateForegroundColor(); break;
    }
}
Exemplo n.º 4
0
CameraPub::CameraPub()
  : Display()
  , camera_trigger_name_("camera_trigger")
  , nh_()
  , new_caminfo_(false)
  , force_render_(false)
  , trigger_activated_(false)
  , last_image_publication_time_(0)
  , caminfo_ok_(false)
  , video_publisher_(0)
{
  topic_property_ = new RosTopicProperty("Image Topic", "",
      QString::fromStdString(ros::message_traits::datatype<sensor_msgs::Image>()),
      "sensor_msgs::Image topic to publish to.", this, SLOT(updateTopic()));

  namespace_property_ = new StringProperty("Display namespace", "",
      "Namespace for this display.", this, SLOT(updateDisplayNamespace()));

  camera_info_property_ = new RosTopicProperty("Camera Info Topic", "",
      QString::fromStdString(ros::message_traits::datatype<sensor_msgs::CameraInfo>()),
      "sensor_msgs::CameraInfo topic to subscribe to.", this, SLOT(updateTopic()));

  queue_size_property_ = new IntProperty( "Queue Size", 2,
      "Advanced: set the size of the incoming message queue.  Increasing this "
      "is useful if your incoming TF data is delayed significantly from your"
      " image data, but it can greatly increase memory usage if the messages are big.",
                                          this, SLOT(updateQueueSize()));
  queue_size_property_->setMin(1);

  frame_rate_property_ = new FloatProperty("Frame Rate", -1,
      "Sets target frame rate. Set to < 0 for maximum speed, set to 0 to stop, you can "
      "trigger single images with the /rviz_camera_trigger service.",
                                           this, SLOT(updateFrameRate()));
  frame_rate_property_->setMin(-1);

  background_color_property_ = new ColorProperty("Background Color", Qt::black,
      "Sets background color, values from 0.0 to 1.0.",
                                           this, SLOT(updateBackgroundColor()));
}