Example #1
0
void ResponseTable::loadFromCSV(QTextStream &srcStream)
{
    quint64 rows, size;
    QString tmp;
    QStringList tmpList;
    srcStream.readLine();
    tmp = srcStream.readLine();
    if ("" != tmp) {
        tmp = tmp.split(QRegExp(";"))[1];
        rows = tmp.toULongLong();
        Resize(rows);
        tmp = srcStream.readLine().split(QRegExp(";"))[1];
        size = tmp.toULongLong();
        _paral = size;
        for(size_t i = 0; i < rows; i++)
        {
            tmpList = srcStream.readLine().split(QRegExp(";"));
            if (1 < tmpList.length()) {
                for(size_t j = 0; j < size; j++)
                {
                    double value;
                    bool IsTrusted;
                    tmp = ExperimentTable::doubleWithDot(tmpList[1 + j]);
                    value = tmp.toDouble();
                    YInfo yi;
                    yi.Value = value;
                    yi.IsTrusted = '1';
                    m_values[i].push_back(yi);
                }
            }
        }
    }
}
QVariantList OperationCatalogModel::resolveValidation(const QString &metaid, const QString& objectid, int sourceParameterIndex)
{
   QVariantList result;
    try {

       Resource resource = mastercatalog()->id2Resource(metaid.toULongLong());
       IIlwisObject obj;
       obj.prepare(objectid.toULongLong());
       if ( obj.isValid() && resource.isValid()){
           QStringList lst = resource["inparameters"].toString().split("|");
           int maxParmCount = lst.last().toInt();
           for(int i = 0; i < maxParmCount; ++i){
               QString parmPrefix = "pin_" + QString::number(i+1) + "_";
               if ( resource.hasProperty(parmPrefix + "validationcondition")){
                   int source = resource[parmPrefix + "validationsource"].toInt();
                   if ( source == sourceParameterIndex){
                       QString condition = resource[parmPrefix + "validationcondition"].toString();
                       if ( condition != sUNDEF){
                           if ( condition.indexOf("columns") == 0){
                               tableCase(obj, condition, i, result);
                           }else if ( condition.indexOf("domain") == 0){
                                domainCase(obj, condition, i, result);
                           }else if ( condition.indexOf("values with") == 0){
                               valueListCase(obj, condition, i, result);
                           }
                       }
                   }
               }
           }
       }
       return result;
   }catch(const ErrorObject& err){
   }
   return result;
}
Example #3
0
void FSHost::eventChannelBridge(QSharedPointer<switch_event_t>event, QString uuid)
{
    QString time;
    time = switch_event_get_header_nil(event.data(), "Caller-Channel-Progress-Time");
    if (time.toULongLong() > 0) _channels.value(uuid).data()->setProgressEpoch(time.toULongLong());
    time = switch_event_get_header_nil(event.data(), "Caller-Channel-Progress-Media-Time");
    if (time.toULongLong() > 0) _channels.value(uuid).data()->setProgressMediaEpoch(time.toULongLong());
}
Example #4
0
QString RyJsBridge::doAction(int action, const QString msg, quint64 groupId){
    qDebug()<<"doAction "<<QString::number(action)<< msg<<"groupId"<<QString::number(groupId);
    RyRuleManager *manager = RyRuleManager::instance();
    QSharedPointer<RyRuleProject> pro;
    QSharedPointer<RyRuleGroup> group;
    QSharedPointer<RyRule> rule;
    switch(action){
    case 0://add local group
        group = manager->addGroupToLocalProject(msg);//暂时只允许添加到本地project
        //emit ruleChanged(0,"success");
        if(!group.isNull()){
            qDebug()<<group->toJSON();
            return group->toJSON();
        }
        break;
    case 1://add rule to group
        rule = manager->addRuleToGroup(msg,groupId);
        if(!rule.isNull()){
            //qDebug()<<QString::number(rule->ruleId());
            //return QString::number(rule->ruleId());
            return rule->toJSON();
        }
        break;
    case 2://add remote project
        pro = manager->addRemoteProject(msg);
        if(!pro.isNull()){
            emit ruleChanged(2,pro->toJson());
            return pro->toJson();
        }
        break;
    case 3://update group
        manager->updateRuleGroup(msg,groupId);
        break;
    case 4://update rule
        manager->updateRule(msg,groupId);
        break;
    case 5://remove group
        manager->removeGroup(msg.toULongLong());
        break;
    case 6://remove rule  (6,ruleId,groupId)
        manager->removeRule(msg.toULongLong(),groupId);
        break;
    case 7://import local config
        pro = manager->addLocalProject(msg);
        if(!pro.isNull()){
            emit ruleChanged(2,pro->toJson());
            return pro->toJson();
        }
        break;
    }
    return "";
}
void ToolPage::convert(int updatedIndex, QString txt) {
    unsigned char buf[32];
    memset(buf, 0, sizeof(buf));
    size_t bufLen;

    switch(updatedIndex) {
    case 0: //Hex
        YubiKeyUtil::qstrHexDecode(buf, &bufLen, txt);
        break;

    case 1: //Modhex
        YubiKeyUtil::qstrModhexDecode(buf, &bufLen, txt);
        break;

    case 2: //Decimal
        QString tmp = QString::number(txt.toULongLong(), 16);
        size_t len = tmp.length();
        if(len % 2 != 0) {
            len++;
        }
        YubiKeyUtil::qstrClean(&tmp, (size_t)len, true);
        YubiKeyUtil::qstrHexDecode(buf, &bufLen, tmp);
        break;
    }

    QString hex = YubiKeyUtil::qstrHexEncode(buf, bufLen);
    QString modhex = YubiKeyUtil::qstrModhexEncode(buf, bufLen);
    bool ok = false;
    qulonglong dec = hex.toULongLong(&ok, 16);

    int hexLen = hex.length();
    int modhexLen = modhex.length();

    ui->converterHexTxt->setText(hex);
    ui->converterModhexTxt->setText(modhex);
    ui->converterDecTxt->setText(QString::number(dec));

    ui->converterHexCopyBtn->setEnabled(hexLen > 0);
    ui->converterModhexCopyBtn->setEnabled(modhexLen > 0);
    ui->converterDecCopyBtn->setEnabled(
            ui->converterDecTxt->text().length() > 0);

    ui->converterHexLenLbl->setText(tr("(%1 chars)").arg(hexLen));
    ui->converterModhexLenLbl->setText(tr("(%1 chars)").arg(modhexLen));

    if(hexLen != 0 && !ok) {
        ui->converterDecErrLbl->setText(tr(TOVERFLOW));
    } else {
        ui->converterDecErrLbl->setText(tr(""));
    }
}
Example #6
0
void UserItem::update(const QString& fileName,
                      const QString& nickname,
                      const QString& speed,
                      const QString& status,
                      const QString& power,
                      const QString& queuePos,
                      const QString& statusString,
                      QIcon& osIcon,
                      const QString& downloadfrom,
                      const QString& downloadto,
                      const QString& actualdownloadposition,
                      const QString& source,
                      const QTime& time) {
    this->fileName = fileName;
    this->status_ = status;
    this->power = power;
    this->queuePos = queuePos.toInt();
    setSpeed( speed, time );

    if ( status_ == QUEUED_SOURCE ) { // queueing? print position
        setText( DownloadItem::STATUS_COL,  statusString + " (" + queuePos + ")" );
    } else {
        setText( DownloadItem::STATUS_COL,  statusString );
    }
    setText( DownloadItem::POWER_COL,  Convert::power( power ) );
    setText( DownloadItem::SOURCES_COL,  nickname  + " (" + source + ")");
    if ( !fileNameSet && !fileName.isEmpty() ) {
        setText( DownloadItem::FILENAME_COL, fileName );
        fileNameSet = true;
    }
    if ( this->icon(DownloadItem::SOURCES_COL).isNull() ) {
        setIcon( DownloadItem::SOURCES_COL, osIcon );
    }
    if(actualdownloadposition != "-1") {
        double dFrom = downloadfrom.toULongLong();
        double dTo = downloadto.toULongLong();
        double dPosition = actualdownloadposition.toULongLong();
        setText(DownloadItem::SIZE_COL, Convert::bytes(dTo - dFrom + 1.0, 2));
        setText(DownloadItem::REMAIN_SIZE_COL, Convert::bytes(dTo - dPosition + 1.0, 2));
        setText(DownloadItem::FINISHED_SIZE_COL, Convert::bytes(dPosition - dFrom, 2));
        if(progressChunk != NULL) {
            updateProgressBar(*progressChunk, dFrom, dTo, dPosition);
        }
    } else {
        setText(DownloadItem::SIZE_COL, "");
        setText(DownloadItem::REMAIN_SIZE_COL, "");
        setText(DownloadItem::FINISHED_SIZE_COL, "");
    }
}
void SyntroZigbeeGateway::loadNodeIDList()
{
	bool ok = false;

	int count = m_settings->beginReadArray(ZIGBEE_DEVICES);

	for (int i = 0; i < count; i++) {
		m_settings->setArrayIndex(i);

		if (!m_settings->contains(ZIGBEE_NODEID))
			continue;

		QString s = m_settings->value(ZIGBEE_ADDRESS).toString();

		quint64 address = s.toULongLong(&ok, 16);

		if (ok) {
			QString nodeID = m_settings->value(ZIGBEE_NODEID).toString();

			if (nodeID.length() > 0) {
				nodeID.truncate(20);
				m_nodeIDs.insert(address, nodeID);
			}
		}
	}

	m_settings->endArray();
}
void FilterTime::onAdd ()
{
	QString const qOp = m_ui->opBox->currentText();
	QString const qItem = m_ui->qFilterLineEdit->text();
	QString const qUnits = m_ui->timeComboBox->comboBox()->currentText();
    onAdd(qOp, qItem.toULongLong(), qUnits);
}
Example #9
0
void HttpEngine::dataCycle(bool bChunked)
{
	bool bOK = true;
	do
	{
		m_nTransfered = 0;
		
		if(bChunked)
		{
			QString line;
			do
			{
				line = readLine();
			}
			while(line.trimmed().isEmpty());
			
			m_nToTransfer = line.toULongLong(0,16);
			if(!m_nToTransfer)
				break;
		}
		
		while(!m_bAbort && (m_nTransfered < m_nToTransfer || !m_nToTransfer))
		{
			if(! (bOK = readCycle()))
			{
				if(m_nToTransfer != 0)
					throw getErrorString(m_pRemote->error());
				break;
			}
		}
	}
	while(bChunked && bOK && !m_bAbort);
}
Soprano::LiteralValue Soprano::LiteralValue::fromString( const QString& value, QVariant::Type type )
{
    switch( type ) {
    case QVariant::Int:
        return LiteralValue( value.toInt() );
    case QVariant::LongLong:
        return LiteralValue( value.toLongLong() );
    case QVariant::UInt:
        return LiteralValue( value.toUInt() );
    case QVariant::ULongLong:
        return LiteralValue( value.toULongLong() );
    case QVariant::Bool:
        return LiteralValue( ( value.toLower() == "true" || value.toLower() == "yes" || value.toInt() != 0 ) );
    case QVariant::Double:
        return LiteralValue( value.toDouble() );
    case QVariant::String:
        return LiteralValue( value );
    case QVariant::Date:
        return LiteralValue( DateTime::fromDateString( value ) );
    case QVariant::Time:
        return LiteralValue( DateTime::fromTimeString( value ) );
    case QVariant::DateTime:
        return LiteralValue( DateTime::fromDateTimeString( value ) );
    case QVariant::ByteArray:
        return LiteralValue( QByteArray::fromBase64( value.toAscii() ) );
    default:
//        qDebug() << "(Soprano::LiteralValue) unknown type: " << type << "storing as string value." << endl;
        return LiteralValue( value );
    }
}
bool AddressDialog::isValid() const
{
    const QString text = m_lineEdit->text();
    bool ok = false;
    text.toULongLong(&ok, 16);
    return ok;
}
bool FreyaPublicRegister::CheckFreyaLibConfig(const QString &filePath, const QString &configKey)
{
    if(configKey.isEmpty())
    {
        return false;
    }
    GetConfigFromFile(filePath);
    if(configKey.toLower() != FreyaCryptogram::CheckSum(filePath))
    {
        QStringList VerList = GetConfig(QStringList()<<FREYALIB_KEY_LIBCONFIG<<FREYALIB_KEY_SUPVER).toStringList();
        if(!VerList.contains(configKey, Qt::CaseInsensitive))
        {
            return false;
        }
    }

    QVariantMap cmdMap = GetConfig(QStringList()<<FREYALIB_KEY_LIBCONFIG<<FREYALIB_KEY_CMDDEF).toMap();
    QMapIterator<QString, QVariant> cmdMapIT(cmdMap);
    while (cmdMapIT.hasNext())
    {
        QString key = cmdMapIT.next().key();
        QString value;
#ifdef QT_DEBUG
        value = cmdMapIT.value().toString();
#endif
        bool ok;
        m_FreyaCmdMap.insert(key.toULongLong(&ok, 16), value);
    }
    return true;
}
Example #13
0
void QCodesysNVTelegram::stringToDataVar(int index,QString variableString)
{
    //variableString.clear();
    //qDebug() << "QCodesysNVTelegram::stringToDataVar: string" << variableString;
    if (index<variableTypeList.length())
    {
        if(variableTypeList[index].varType==QCodesysNVcmpType::_uint8 || variableTypeList[index].varType==QCodesysNVcmpType::_uint16 || variableTypeList[index].varType==QCodesysNVcmpType::_uint32 || variableTypeList[index].varType==QCodesysNVcmpType::_uint64)
        {
            quint64 tempData=variableString.toULongLong();
            setData(index,tempData);
        }
        else if(variableTypeList[index].varType==QCodesysNVcmpType::_int8 || variableTypeList[index].varType==QCodesysNVcmpType::_int16 || variableTypeList[index].varType==QCodesysNVcmpType::_int32 || variableTypeList[index].varType==QCodesysNVcmpType::_int64)
        {
            qint64 tempData=variableString.toLongLong();
            setData(index,tempData);
        }
        else if(variableTypeList[index].varType==QCodesysNVcmpType::_float || variableTypeList[index].varType==QCodesysNVcmpType::_double)
        {
            double tempData=variableString.toDouble();
            setData(index,tempData);
        }
        else
        {

            qDebug() << "QCodesysNVTelegram::stringToDataVar: Wrong datatype (deep, unexpexted bug, in QCodesysNV* classes)";
        }
    }
    else
    {
        qDebug() << "QCodesysNVTelegram::stringToDataVar: length of the variableList is only " << variableTypeList.length() << " but you are trying to handle index " << index;
    }
}
quint64 Choke::getDegree()
{
	QString r;
	CVzHelper::get_vz_config_param("VZ_TOOLS_IOLIMIT", r);

	return r.toULongLong();
}
Example #15
0
    void SetValue(void* Pointer, const QString &Value, int Type)
    {
        if (!Pointer)
            return;

        switch (Type)
        {
            case QMetaType::Char:       *((char*)Pointer)          = Value.isEmpty() ? 0 : Value.at(0).toLatin1(); return;
            case QMetaType::UChar:      *((unsigned char*)Pointer) = Value.isEmpty() ? 0 :Value.at(0).toLatin1();  return;
            case QMetaType::QChar:      *((QChar*)Pointer)         = Value.isEmpty() ? 0 : Value.at(0);            return;
            case QMetaType::Bool:       *((bool*)Pointer)          = ToBool(Value);       return;
            case QMetaType::Short:      *((short*)Pointer)         = Value.toShort();     return;
            case QMetaType::UShort:     *((ushort*)Pointer)        = Value.toUShort();    return;
            case QMetaType::Int:        *((int*)Pointer)           = Value.toInt();       return;
            case QMetaType::UInt:       *((uint*)Pointer)          = Value.toUInt();      return;
            case QMetaType::Long:       *((long*)Pointer)          = Value.toLong();      return;
            case QMetaType::ULong:      *((ulong*)Pointer)         = Value.toULong();     return;
            case QMetaType::LongLong:   *((qlonglong*)Pointer)     = Value.toLongLong();  return;
            case QMetaType::ULongLong:  *((qulonglong*)Pointer)    = Value.toULongLong(); return;
            case QMetaType::Double:     *((double*)Pointer)        = Value.toDouble();    return;
            case QMetaType::Float:      *((float*)Pointer)         = Value.toFloat();     return;
            case QMetaType::QString:    *((QString*)Pointer)       = Value;               return;
            case QMetaType::QByteArray: *((QByteArray*)Pointer)    = Value.toUtf8();      return;
            case QMetaType::QTime:      *((QTime*)Pointer)         = QTime::fromString(Value, Qt::ISODate); return;
            case QMetaType::QDate:      *((QDate*)Pointer)         = QDate::fromString(Value, Qt::ISODate); return;
            case QMetaType::QDateTime:
            {
                QDateTime dt = QDateTime::fromString(Value, Qt::ISODate);
                dt.setTimeSpec(Qt::UTC);
                *((QDateTime*)Pointer) = dt;
                return;
            }
            default: break;
        }
    }
Example #16
0
void cLogAnalyser::countActions( const QString &p_qsCountName,
                                 const QString &p_qsActionName,
                                 const QString &p_qsAttribName ) throw()
{
    cTracer  obTracer( &g_obLogger, "cLogAnalyser::countActions",
                       QString( "CountName: \"%1\" ActionName: \"%2\"" ).arg( p_qsCountName ).arg( p_qsActionName ).toStdString() );

    unsigned long ulFailed = 0;
    unsigned long ulOk     = 0;

    pair<tiActionList, tiActionList> paActionsToCount = m_mmActionList.equal_range( p_qsActionName );
    for( tiActionList itAction = paActionsToCount.first; itAction != paActionsToCount.second; itAction++ )
    {
        QString       qsAttribVal = itAction->second.attribute( p_qsAttribName );
        unsigned long ulCount = 0;
        if( qsAttribVal != "" ) ulCount = qsAttribVal.toULongLong();
        if( ulCount == 0 ) ulCount = 1;
        if( itAction->second.result() == cActionResult::OK ) ulOk += ulCount;
        else ulFailed += ulCount;
    }

    if( m_poOC ) m_poOC->addCountAction( p_qsCountName, ulOk, ulFailed );

    obTracer << QString( "Ok: %1 Failed: %2" ).arg( ulOk ).arg( ulFailed ).toStdString();
}
Example #17
0
quint64 CurrencyAdapter::parseAmount(const QString& _amountString) const {
  QString amountString = _amountString.trimmed();
  amountString.remove(',');

  int pointIndex = amountString.indexOf('.');
  int fractionSize;
  if (pointIndex != -1) {
    fractionSize = amountString.length() - pointIndex - 1;
    while (getNumberOfDecimalPlaces() < fractionSize && amountString.right(1) == "0") {
      amountString.remove(amountString.length() - 1, 1);
      --fractionSize;
    }

    if (getNumberOfDecimalPlaces() < fractionSize) {
      return 0;
    }

    amountString.remove(pointIndex, 1);
  } else {
    fractionSize = 0;
  }

  if (amountString.isEmpty()) {
    return 0;
  }

  for (qint32 i = 0; i < getNumberOfDecimalPlaces() - fractionSize; ++i) {
    amountString.append('0');
  }

  return amountString.toULongLong();
}
Example #18
0
unsigned long long FromString<unsigned long long>(const QString& str){
    bool ok = false;
    unsigned long long res = str.toULongLong(&ok);
    if (!ok) {
       throw UException("Cast error");
    }
    return res;
}
Example #19
0
/*!
 * \en 	Sets id for displaying. \_en
 * \ru	Установка id для показа.
 * 	Хранится в стринге для совмесимости с wField. \_ru
 */
void
wCatalogEditor::setValue(QString newvalue)
{
	if(vValue==newvalue) return;
	vValue = newvalue;
	if(label) label->setText(displayValue(newvalue.toULongLong()));
	emit valueChanged(value());
}
Example #20
0
void DfxmlByteRun::setOffset(const QString &offset)
{
	bool ok;
	m_offset = offset.toULongLong(&ok, 10);
	if (!ok) {
		qDebug() << "Invalid offset:" << offset;
		m_offset = 0;
	}
}
Example #21
0
void DfxmlByteRun::setSize(const QString &size)
{
	bool ok;
	m_size = size.toULongLong(&ok, 10);
	if (!ok) {
		qDebug() << "Invalid len:" << size;
		m_size = 0;
	}
}
Example #22
0
static bool parseArguments(const QStringList &args, QString *errorMessage)
{
    int argNumber = 0;
    const int count = args.size();
    const QChar dash = QLatin1Char('-');
    const QChar slash = QLatin1Char('/');
    for (int i = 1; i < count; i++) {
        QString arg = args.at(i);
        if (arg.startsWith(dash) || arg.startsWith(slash)) { // option
            arg.remove(0, 1);
            if (arg == QLatin1String("help") || arg == QLatin1String("?")) {
                optMode = HelpMode;
            } else if (arg == QLatin1String("qtcreator")) {
                optMode = ForceCreatorMode;
            } else if (arg == QLatin1String("default")) {
                optMode = ForceDefaultMode;
            } else if (arg == QLatin1String("register")) {
                optMode = RegisterMode;
            } else if (arg == QLatin1String("unregister")) {
                optMode = UnregisterMode;
            } else if (arg == QLatin1String("wow")) {
                optIsWow = true;
            } else if (arg == QLatin1String("nogui")) {
                noguiMode = true;
            } else {
                *errorMessage = QString::fromLatin1("Unexpected option: %1").arg(arg);
                return false;
            }
            } else { // argument
                bool ok = false;
                switch (argNumber++) {
                case 0:
                    argProcessId = arg.toULong(&ok);
                    break;
                case 1:
                    argWinCrashEvent = arg.toULongLong(&ok);
                    break;
                }
                if (!ok) {
                    *errorMessage = QString::fromLatin1("Invalid argument: %1").arg(arg);
                    return false;
                }
            }
        }
    switch (optMode) {
    case HelpMode:
    case RegisterMode:
    case UnregisterMode:
        break;
    default:
        if (argProcessId == 0) {
            *errorMessage = QString::fromLatin1("Please specify the process-id.");
            return false;
        }
    }
    return true;
}
Example #23
0
bool XmlParser::characters( const QString &ch )
{
    if ( important ) {
        if ( parsingUser ) {
            parseUserInfo(ch);
        } else {
            if ( currentTag == TAG_STATUS_ID && entry.id == Q_UINT64_C(0) ) {
                entry.id = ch.toULongLong();
            } else if ( currentTag == TAG_USER_TEXT && entry.text.isNull() ) {
                entry.originalText = ch;
                entry.originalText.replace( "&lt;", "<" );
                entry.originalText.replace( "&gt;", ">" );
                entry.text = textToHtml( entry.originalText );
            } else if ( currentTag == TAG_USER_TIMESTAMP && entry.timestamp.isNull() ) {
                entry.timestamp = toDateTime( ch ); //utc
                /* It's better to leave UTC timestamp alone; Additional member localTime is added to store local time when
         user's system supports timezones. */
                entry.localTime = entry.timestamp.addSecs( timeShift ); //now - utc
            } else if ( currentTag == TAG_INREPLYTO_STATUS_ID && entry.inReplyToStatusId == 0) {
                if( !ch.trimmed().isEmpty() ) {
                    /* In reply to status id exists and is not empty; Hack for dealing with tags that are opened and closed
           at the same time, e.g. <in_reply_to_screen_name/>  */
                    entry.hasInReplyToStatusId = true;
                    entry.inReplyToStatusId = ch.toULongLong();
                }
            } else if ( currentTag == TAG_INREPLYTO_SCREEN_NAME && entry.hasInReplyToStatusId ) {
                /* When hasInReplyToStatusId is true, inReplyToScreenName should be present, but it won't hurt to check it again
         just in case */
                if( !ch.trimmed().isEmpty() ) {
                    entry.inReplyToScreenName = ch;
                }
            } else if ( currentTag == TAG_FAVORITED && !favoritedSet ) {
                if ( ch.compare("false") == 0 )
                    entry.favorited = false;
                else
                    entry.favorited = true;
                favoritedSet = true;
            }
        }
    }

    return true;
}
Example #24
0
void Widget::toULongLongFunction()
{
    //! [79]
    QString str = "FF";
    bool ok;

    quint64 hex = str.toULongLong(&ok, 16);    // hex == 255, ok == true
    quint64 dec = str.toULongLong(&ok, 10);    // dec == 0, ok == false
    //! [79]
}
QString MasterCatalogModel::id2type(const QString &id) const
{
    bool ok;
    quint64 objid = id.toULongLong(&ok);
    if ( ok){
        IlwisTypes tp = mastercatalog()->id2type(objid);
        return TypeHelper::type2name(tp);
    }
    return "";
}
//------------------------------------------------------------------------------
// Name: on_unsignedInput_textEdited(const QString &s)
// Desc:
//------------------------------------------------------------------------------
void DialogInputValue::on_unsignedInput_textEdited(const QString &s) {
	bool ok;
	yad64::reg_t value = s.toULongLong(&ok, 10);

	if(!ok) {
		value = 0;
	}
	QString temp;
	ui->hexInput->setText(yad64::v1::format_pointer(value));
	ui->signedInput->setText(temp.sprintf(SNUM_FMT, value));
}
Example #27
0
void WorkflowModel::selectOperation(const QString& id)
{
    IOperationMetaData op;
    op.prepare(id.toULongLong());
    if ( op.isValid()){
        _selectedOperation.clear();
        _selectedOperation.append(new IlwisObjectModel(op->resource(),this));
    }
    emit selectionChanged();

}
Example #28
0
void WorkflowModel::addConditionFlow(int operationIdFrom, const QString &conditionIdTo, int testIndex, int inParameterIndex, int outParmIndex, int rectFrom, int rectTo)
{
    try {
        if ( _workflow.isValid()){

            _workflow->addConditionFlow(operationIdFrom, conditionIdTo.toULongLong(), testIndex, inParameterIndex, outParmIndex, rectFrom, rectTo);
               emit validChanged();
        }
    }
    catch(const ErrorObject&){}
}
bool DrawerOperation::getViewId(const QString& sview){
    bool ok;
    _viewid = sview.toULongLong(&ok);
	auto manager = layerManager();
	bool isUndef = isNumericalUndef(_viewid);
    if ( !ok || isUndef || manager == 0){
             kernel()->issues()->log(TR("Illegal viewer identified:") + sview) ;
            return false;
    }
    return true;
}
void MasterCatalogModel::deleteObject(const QString &id)
{
    bool ok;
    quint64 objid = id.toULongLong(&ok);
    Resource resource = mastercatalog()->id2Resource(objid);
    IIlwisObject obj;
    obj.prepare(resource);
    if ( !obj.isValid())
        return;
    obj->remove();
}