Beispiel #1
0
void MessageWindow::initialiseComponents()
{
   CEGUI::WindowManager& wm = CEGUI::WindowManager::getSingleton();
   setText("");

   {
      _pMessageWindow = static_cast< CEGUI::DefaultWindow* >(wm.createWindow("TaharezLook/StaticText",""));
      _pMessageWindow->setFont(::bootes::cegui::DynamicFont::GetAsciiFont(8));
      _pMessageWindow->setProperty("FrameEnabled", "false");
      addChildWindow(_pMessageWindow);
   }

   setMinSize(CEGUI::UVector2(CEGUI::UDim(0,MIN_WIDTH), CEGUI::UDim(0,MIN_HEIGHT)));
   setUpdateMode(CEGUI::WUM_VISIBLE); //default
/*
   {
      CEGUI::Size s0   = this->getParentPixelSize();
      CEGUI::Vector2 s = pChild->getMinSize().asAbsolute(s0);
      CEGUI::UDim x(0,0), y(0,0);

      x.d_offset = s.d_x + 30;
      y.d_offset = s.d_y + 60;
      this->setMinSize(CEGUI::UVector2(x,y));
      x.d_offset = (s0.d_width  - x.d_offset) / 2;
      y.d_offset = (s0.d_height - y.d_offset) / 2;
      this->setPosition(CEGUI::UVector2(x,y));
   }
*/
}
Color_Selector::Color_Selector(QWidget *parent) :
    Color_Preview(parent), p(new Private(this))
{
    setUpdateMode(Continuous);
    p->old_color = color();

    connect(this,SIGNAL(clicked()),this,SLOT(showDialog()));
    connect(this,SIGNAL(colorChanged(QColor)),this,SLOT(update_old_color(QColor)));
    connect(p->dialog,SIGNAL(rejected()),this,SLOT(reject_dialog()));
    connect(p->dialog,SIGNAL(colorSelected(QColor)), this, SLOT(accept_dialog()));

    setAcceptDrops(true);
}
Beispiel #3
0
void CCommand::Initialize()
{
    // Set Baud rate
    setRadio(0);
    setSquelch(255);
    setSoundVolume(0);
    setRadio(1);
    setSoundVolume(0);
    setSquelch(255);
    /*
    dbgWin->slotSendSerial("G2?");
    dbgWin->slotSendSerial("G4?");
    dbgWin->slotSendSerial("GE?");
    dbgWin->slotSendSerial("GD?");
    dbgWin->slotSendSerial("GA0?");
    dbgWin->slotSendSerial("GA1?");
    dbgWin->slotSendSerial("GA2?");
    dbgWin->slotSendSerial("GF?");
    */
    sleep(1);
    setUpdateMode(CCommand::eUpdOn);
    /*  NOT NEEDED */
    //dbgWin->slotSendSerial("J730000");
    setRadio(0);
    // Noise blanker is off
    setNoiseBlanker(false);
    setRadio(1);
    setNoiseBlanker(false);

    // Init radio 0 Frequency;

    setRadio(0);
    setModulation(CCommand::eWFM);
    setFilter(CCommand::e230k);
    setFrequency(106500000);
    setSquelch(0);
    setVoiceControl(CCommand::eVSCOff);
    setIFShift(128);

    // Init radio 1 Frequency
    setRadio(1);
    setModulation(CCommand::eFM);
    setFilter(CCommand::e15k);
    setFrequency(145425000);
    setSquelch(0);
    setSoundVolume(0);
    setVoiceControl(CCommand::eVSCOff);
    setIFShift(128);

    /*  NOT NEEDED */

    /* Unknown
    dbgWin->slotSendSerial("J4200");
    dbgWin->slotSendSerial("J4700");
    dbgWin->slotSendSerial("J6700");


    dbgWin->slotSendSerial("JC400");
    dbgWin->slotSendSerial("J7100");
    dbgWin->slotSendSerial("J720000");
    dbgWin->slotSendSerial("JC000");
    */
    // Mute radio before restoring values
    setRadio(0);
    setSoundMute(true);
    setSoundVolume(0);

    /* Unknown
    dbgWin->slotSendSerial("J8001");
    dbgWin->slotSendSerial("J8100");
    dbgWin->slotSendSerial("J8200");
    dbgWin->slotSendSerial("J8300");
    dbgWin->slotSendSerial("JC500");
    */
    setRadio(0);
    setSquelch(255);
    setVoiceControl(CCommand::eVSCOff);
    setRadio(1);
    setSquelch(255);
    setVoiceControl(CCommand::eVSCOff);

    setRadio(0);
    setSoundVolume(0);
    setRadio(1);
    setSoundVolume(0);
    setSquelch(255);
    setRadioMode(CCommand::eBoth);
    //dbgWin->slotSendSerial("JB000");
    setRadio(1);
    setSquelch(255);
    setVoiceControl(CCommand::eVSCOff);

    setRadio(0);
    setSquelch(1);
    setVoiceControl(CCommand::eVSCOff);
    setRadio(1);
    setVoiceControl(CCommand::eVSCOff);
    setSquelch(1);

    setRadio(0);
    setSoundVolume(60);
    setSoundMute(false);
}
Beispiel #4
0
BACIMonitor::BACIMonitor(const ACE_CString& _name, int _callbackID, 
			 MonitorImplementator* _monitorImplementator_p,
			 const ACS::TimeInterval& _triggerTime, const BACIValue& _triggerValue, 
			 const ACS::TimeInterval& _minTriggerTime, const BACIValue& _minTriggerValue, 
			 BACIProperty* _property, const ACS::TimeInterval& _transmitTime,
			 const UpdateMode& _updateMode, 
			 const bool _archivingMonitor,
			 const bool _suspended,
                         const bool _deltaValueAndTimerInteraction,
                         const unsigned int _priority) :

  name_m(_name), callbackID_m(_callbackID), 
  monitorImplementator_mp(_monitorImplementator_p), updateMode_m(mumLast),
  triggerTime_m(0), minTriggerTime_m(_minTriggerTime),
  transmitTime_m(0), userControlledTransmitTime_m(false), lastTime_m(0), 
  minTriggerValue_m(_minTriggerValue), triggerOnValue_m(false), triggerOnValuePercent_m(false),
  property_mp(_property), archivingMonitor_m(_archivingMonitor), 
  suspended_m(_suspended),
  deltaValueAndTimerInteraction_m(_deltaValueAndTimerInteraction),
  priority_m(_priority),
  inDestructionState_m(false),
  destroyed_m(false)
{
  ACS_TRACE("baci::BACIMonitor::BACIMonitor");

  ACS_LOG(0, "baci::BACIMonitor::BACIMonitor",
	  (static_cast<ACE_Log_Priority>(LM_DELOUSE), "Creating monitor '%s' (archiving: %d, triggerTime: %d)", 
	   name_m.c_str(), archivingMonitor_m, (unsigned)_triggerTime));
  if (archivingMonitor_m==true)
      {
      ACS_LOG(0, "baci::BACIMonitor::BACIMonitor",
	      (LM_DEBUG, "Archiver monitor with priority %d", priority_m));
      }

  // VxWorks (should not be as initializer)
  monitorImplementator_mp = 0;
  
  // set update mode
  setUpdateMode(_updateMode);

  // set monitors
  setTriggerTime(_triggerTime);
  setTriggerValue(_triggerValue);

  
  if (getTriggerValue().isNull()==0 && getTriggerValue().noDelta()==false)
      {
      setTriggerOnValue(true);
      }
  if (getTriggerValuePercent().isNull()==0 && getTriggerValuePercent().noDelta()==false)
      {
      setTriggerOnValuePercent(true);
      }
  
  // set transmit_time
  if (_transmitTime!=0)
    {
      userControlledTransmitTime_m = true;
      setTransmitTime(_transmitTime);    // user now handles monitor sync.
    }

  if (archivingMonitor_m==false) 
    {
      property_mp->getComponent()->getCallback(callbackID_m)->setRemoveOnFailure(false);
    }

  monitorImplementator_mp = _monitorImplementator_p;

  // add monitor
  property_mp->addMonitor(this);

}
Beispiel #5
0
void MyApplication::createScene()
{
        setUpdateMode(SimulationEngine::SIMULATE_REAL_TIME_MULTIPLE, 1);

        //// Set to capture frames at 29.97 fps.
        //engine.setUpdateMode(SIMULATE_CONSTANT_CHUNK, 0.0333667);

        // Use feet for this simulation.
        getSimulator()->setGravity(opal::Vec3r(0, -30, 0));
        getSimulator()->setStepSize(gPhysicsStepSize);

        // Make sure we get notified at the end of each step.
        getSimulator()->addPostStepEventHandler(&gPostStepEventHandler);

        Ogre::OverlayManager::getSingleton().getByName("Verve/Debug")->hide();
        Ogre::OverlayManager::getSingleton().getByName("Core/DebugOverlay")->hide();

        // Setup camera.
        getCamera()->setPosition(opal::Point3r(0, 25, 25));
        getCamera()->lookAt(opal::Point3r(0, (opal::real)0.1, 0));
        setCameraMoveSpeed(1);
       
        // Main static arena.
        opal::Blueprint arenaBlueprint;
        opal::loadFile(arenaBlueprint, "../data/blueprints/arena1.xml");
        opal::BlueprintInstance arenaBPInstance;
        getSimulator()->instantiateBlueprint(arenaBPInstance,
                arenaBlueprint, opal::Matrix44r(), 1);
        createPhysicalEntity("staticEnvironment", "Plastic/Gray",
                arenaBPInstance.getSolid("staticEnvironment"));
        createPhysicalEntity("toy1", "Plastic/Green",
                arenaBPInstance.getSolid("toy1"));
        createPhysicalEntity("toy2", "Plastic/Green",
                arenaBPInstance.getSolid("toy2"));
        createPhysicalEntity("toy3", "Plastic/Green",
                arenaBPInstance.getSolid("toy3"));

        // Seesaw.
        opal::Blueprint seesawBP;
        opal::loadFile(seesawBP, "../data/blueprints/seesaw.xml");
        opal::BlueprintInstance seesawBPInstance;
        opal::Matrix44r seesawTransform;
        seesawTransform.translate(8, 0, 0);
        getSimulator()->instantiateBlueprint(seesawBPInstance,
                seesawBP, seesawTransform, 1);
        createPhysicalEntity("seesawSupport", "Plastic/Black",
                seesawBPInstance.getSolid("seesawSupport"));
        createPhysicalEntity("seesawPanel", "Plastic/Orange",
                seesawBPInstance.getSolid("seesawPanel"));

        // Add an initial torque to bring one end of the seesaw to the
        // ground.
        seesawBPInstance.getJoint("seesawHinge")->addTorque(0, 100, 0, true);

        // Merry-go-round.
        createPhysicalEntity("merryGoRound", "Plastic/Yellow",
                arenaBPInstance.getSolid("merryGoRound"));

        // Curtains.
        opal::Blueprint curtainsBP;
        opal::loadFile(curtainsBP, "../data/blueprints/blockCurtain.xml");
        opal::BlueprintInstance curtainsBPInstance;
        opal::Matrix44r curtainsTransform;
        curtainsTransform.rotate(45, 0, 1, 0);
        curtainsTransform.translate(-10, 0, 0);
        getSimulator()->instantiateBlueprint(curtainsBPInstance,
                curtainsBP, curtainsTransform, 1);
        createPhysicalEntity("curtainBase", "Plastic/Red",
                curtainsBPInstance.getSolid("curtainBase"));
        createPhysicalEntity("curtainPiece0", "Plastic/Black",
                curtainsBPInstance.getSolid("curtainPiece0"));
        createPhysicalEntity("curtainPiece1", "Plastic/Black",
                curtainsBPInstance.getSolid("curtainPiece1"));
        createPhysicalEntity("curtainPiece2", "Plastic/Black",
                curtainsBPInstance.getSolid("curtainPiece2"));
        createPhysicalEntity("curtainPiece3", "Plastic/Black",
                curtainsBPInstance.getSolid("curtainPiece3"));
        createPhysicalEntity("curtainPiece4", "Plastic/Black",
                curtainsBPInstance.getSolid("curtainPiece4"));
        createPhysicalEntity("curtainPiece5", "Plastic/Black",
                curtainsBPInstance.getSolid("curtainPiece5"));

        //// Ragdoll.
        //opal::Blueprint ragdollBP;
        //opal::loadFile(ragdollBP, "../data/blueprints/ragdoll.xml");
        //opal::BlueprintInstance ragdollBPInstance;
        //opal::Matrix44r ragdollTransform;
        //ragdollTransform.translate(10, 5, 0);
        //getSimulator()->instantiateBlueprint(ragdollBPInstance,
        //      ragdollBP, ragdollTransform, 2);
        //for (unsigned int i = 0; i < ragdollBPInstance.getNumSolids(); ++i)
        //{
        //      opal::Solid* s = ragdollBPInstance.getSolid(i);
        //      createPhysicalEntity(s->getName(), "Plastic/Red", s);
        //}

        //// TESTING: Simple goal box.
        //opal::Solid* boxSolid = getSimulator()->createSolid();
        //boxSolid->setStatic(false);
        //boxSolid->setSleepiness(0);
        //boxSolid->setPosition(15.5, 10, -7);
        //opal::BoxShapeData data;
        //data.dimensions.set(1.5, 1.5, 1.5);
        //data.material.friction = 0.1;
        //data.material.density = 0.5;
        //boxSolid->addShape(data);
        //createPhysicalEntity("goal box", "Plastic/Green", boxSolid);

        //// TESTING: Make a volume sensor to detect the goal.
        //opal::VolumeSensorData goalSensorData;
        //goalSensorData.solid = gRobot->getChassis();
        //goalSensorData.transform.makeTranslation(0, 0, -2);
        //gGoalSensor = getSimulator()->createVolumeSensor();
        //gGoalSensor->init(goalSensorData);

        //gGoalSensorVolume = getSimulator()->createSolid();
        //gGoalSensorVolume->setStatic(true);
        ////opal::Matrix44r m = gRobot->getChassis()->getTransform();
        ////m.translate(0, 0, -2);
        //opal::Matrix44r m;
        //m.translate(0, 100, 0);
        //gGoalSensorVolume->setTransform(m);
        //opal::BoxShapeData sensorVolumeShape;
        //sensorVolumeShape.dimensions.set(2, 1, 2);
        ////getSimulator()->setupContactGroup(5, false);
        ////sensorVolumeShape.contactGroup = 5;
        //sensorVolumeShape.material.density = 0.01;
        //gGoalSensorVolume->addShape(sensorVolumeShape);
        ////createPhysicalEntityBox("goal sensor", "Translucent/Blue", boxDim,
        ////    gGoalSensorVolume);


        //opal::JointData fixedJointData;
        //fixedJointData.setType(opal::FIXED_JOINT);
        //fixedJointData.solid0 = gRobot->getChassis();
        //fixedJointData.solid1 = gGoalSensorVolume;
        //opal::Joint* fixedJoint = getSimulator()->createJoint();
        //fixedJoint->init(fixedJointData);
         
}