Ejemplo n.º 1
0
 void
 onEntityResolution(void)
 {
   m_gps_eid = resolveEntity(m_args.elabel_gps);
   m_imu_eid = resolveEntity(m_args.elabel_imu);
   m_yaw_eid = resolveEntity(m_args.elabel_yaw);
 }
Ejemplo n.º 2
0
        void
        onEntityResolution(void)
        {
          try
          {
            m_gps_eid = resolveEntity(m_args.elabel_gps);
          }
          catch (...)
          {
            m_gps_eid = 0;
          }

          try
          {
            m_imu_eid = resolveEntity(m_args.elabel_imu);
          }
          catch (...)
          {
            m_imu_eid = 0;
          }

          try
          {
            m_yaw_eid = resolveEntity(m_args.elabel_yaw);
          }
          catch (...)
          {
            m_yaw_eid = 0;
          }
        }
Ejemplo n.º 3
0
void HTML::decodeStr(QString* str)
{
    int index = 0;
    QChar decodedChar;
    QStringList res;
    QRegExp entityParser("(&([a-zA-Z]+);)",Qt::CaseInsensitive);
    QRegExp directCharParser("(&#([0-9]+);)",Qt::CaseInsensitive);


    qDebug() << "Checking" << *str;
    while (index > -1) {
        index = directCharParser.indexIn(*str,index+1);
        res = directCharParser.capturedTexts();
        if (index != -1) {
            decodedChar = QChar(directCharParser.cap(2).toInt());
            str->replace(res.at(1), decodedChar);
            qDebug() << *str;
        }
    }

    index = 0;
    while((index = entityParser.indexIn(*str,index)) != -1)
    {
        index++;
        decodedChar = resolveEntity(entityParser.cap(2));
        qDebug() << "Decoding in " << entityParser.cap(1) << ":" << entityParser.cap(2) << " to " << decodedChar << "(" << decodedChar.isNull()<<")";
        if (!decodedChar.isNull()) {
            qDebug() << "Replacing in " << entityParser.cap(1) << ":" << entityParser.cap(2) << " to " << decodedChar;
            str->replace(entityParser.cap(1),QString(decodedChar));
        }
    }

}
Ejemplo n.º 4
0
bool  QXmlDefaultHandler_QtDShell::__override_resolveEntity(const QString&  publicId0, const QString&  systemId1, QXmlInputSource*&  ret2, bool static_call)
{
    if (static_call) {
        return QXmlDefaultHandler::resolveEntity((const QString& )publicId0, (const QString& )systemId1, (QXmlInputSource*& )ret2);
    } else {
        return resolveEntity((const QString& )publicId0, (const QString& )systemId1, (QXmlInputSource*& )ret2);
    }
}
Ejemplo n.º 5
0
 void
 onEntityResolution(void)
 {
   try
   {
     m_sound_speed_eid = resolveEntity(m_args.sound_speed_elabel);
   }
   catch (...)
   {
     inf(DTR("dynamic sound speed corrections are disabled"));
     m_sound_speed = m_args.sound_speed_def;
   }
 }
Ejemplo n.º 6
0
 void
 onEntityResolution(void)
 {
   for (unsigned i = 0; i < c_servo_count; ++i)
   {
     try
     {
       m_pos_id[i] = resolveEntity(m_args.elabel_posi[i]);
     }
     catch (...)
     {
       m_pos_id[i] = 0;
     }
   }
 }
Ejemplo n.º 7
0
void HTML::encodeStr(QString* str)
{
    QChar c;
    QString encodedChar;

    for(int pos=0; pos<str->size(); pos++)
    {
        c = str->at(pos);
        encodedChar = resolveEntity(c.unicode());
        if (!encodedChar.isNull())
        {
            str->remove(pos, 1);
            str->insert(pos, QString("&%1;").arg(encodedChar.toLower()));
            pos += encodedChar.size() + 2;
        }
    }
}
Ejemplo n.º 8
0
      void
      consume(const IMC::EntityActivationState* msg)
      {
        if (m_plan != NULL)
        {
          std::string id;

          try
          {
            id = resolveEntity(msg->getSourceEntity());
          }
          catch (...)
          {
            return;
          }

          if (!m_plan->onEntityActivationState(id, msg))
          {
            std::string error = String::str(DTR("failed to activate %s: %s"),
                                            id.c_str(), msg->error.c_str());

            if (m_args.actfail_abort)
            {
              onFailure(error);
              changeMode(IMC::PlanControlState::PCS_READY, error, false);
            }
            else
            {
              err("%s", error.c_str());
            }
          }
        }

        if (msg->getSourceEntity() == m_eid_imu)
        {
          if (msg->state == IMC::EntityActivationState::EAS_ACTIVE)
            m_imu_enabled = true;
          else
            m_imu_enabled = false;
        }
      }