Esempio n. 1
0
void SequenceInfo::updateCommonStatisticsLayout() {
    ADVSequenceWidget *wgt = annotatedDnaView->getSequenceWidgetInFocus();
    CHECK(wgt != NULL, );
    ADVSequenceObjectContext *ctx = wgt->getActiveSequenceContext();
    SAFE_POINT(ctx != NULL, tr("Sequence context is NULL"), );
    SAFE_POINT(ctx->getAlphabet() != NULL, tr("Sequence alphbet is NULL"), );

    int availableSpace = getAvailableSpace(ctx->getAlphabet()->getType());

    QString statsInfo = QString("<table cellspacing=%1>").arg(COMMON_STATISTICS_TABLE_CELLSPACING);
    statsInfo += formTableRow(CAPTION_SEQ_REGION_LENGTH, getFormattedLongNumber(currentCommonStatistics.length), availableSpace);
    if (ctx->getAlphabet()->isNucleic()) {
        statsInfo += formTableRow(CAPTION_SEQ_GC_CONTENT, QString::number(currentCommonStatistics.gcContent, 'f', 2) + "%", availableSpace);
        statsInfo += formTableRow(CAPTION_SEQ_MOLAR_WEIGHT, QString::number(currentCommonStatistics.molarWeight, 'f', 2) + " Da", availableSpace);
        statsInfo += formTableRow(CAPTION_SEQ_MOLAR_EXT_COEF, QString::number(currentCommonStatistics.molarExtCoef) + " I/mol", availableSpace);
        statsInfo += formTableRow(CAPTION_SEQ_MELTING_TM, QString::number(currentCommonStatistics.meltingTm, 'f', 2) + " C", availableSpace);

        statsInfo += formTableRow(CAPTION_SEQ_NMOLE_OD, QString::number(currentCommonStatistics.nmoleOD260, 'f', 2), availableSpace);
        statsInfo += formTableRow(CAPTION_SEQ_MG_OD, QString::number(currentCommonStatistics.mgOD260, 'f', 2), availableSpace);
    } else if (ctx->getAlphabet()->isAmino()) {
        statsInfo += formTableRow(CAPTION_SEQ_MOLECULAR_WEIGHT, QString::number(currentCommonStatistics.molecularWeight, 'f', 2), availableSpace);
        statsInfo += formTableRow(CAPTION_SEQ_ISOELECTIC_POINT, QString::number(currentCommonStatistics.isoelectricPoint, 'f', 2), availableSpace);
    }

    statsInfo += "</table>";

    statisticLabel->setText(statsInfo);
}
void FileManager_impl::query (CF::Properties& fileSysProperties)
    throw (CORBA::SystemException, CF::FileSystem::UnknownFileSystemProperties)
{
    TRACE_ENTER(FileManager_impl);

    CF::Properties unknownProps;

    // Lock the mount table shared to allow others to access the file system,
    // but prevent changes to the mount table itself.
    boost::shared_lock<boost::shared_mutex> lock(mountsLock);
    if (fileSysProperties.length () == 0) {
        LOG_TRACE(FileManager_impl, "Query all properties (SIZE, AVAILABLE_SPACE)");
        fileSysProperties.length(2);
        fileSysProperties[0].id = CORBA::string_dup("SIZE");
        CORBA::ULongLong size = getSize();
        size += getCombinedProperty(CF::FileSystem::SIZE);
        fileSysProperties[0].value <<= size;
        fileSysProperties[1].id = CORBA::string_dup("AVAILABLE_SPACE");
        CORBA::ULongLong available = getAvailableSpace();
        available += getCombinedProperty(CF::FileSystem::AVAILABLE_SPACE);
        fileSysProperties[1].value <<= available;
    } else {
        for (CORBA::ULong index = 0; index < fileSysProperties.length(); ++index) {
            if (strcmp (fileSysProperties[index].id, CF::FileSystem::SIZE) == 0) {
                CORBA::ULongLong size = getSize();
                size += getCombinedProperty(CF::FileSystem::SIZE);
                fileSysProperties[index].value <<= size;
            } else if (strcmp(fileSysProperties[index].id, CF::FileSystem::AVAILABLE_SPACE) == 0) {
                CORBA::ULongLong available = getAvailableSpace();
                available += getCombinedProperty(CF::FileSystem::AVAILABLE_SPACE);
                fileSysProperties[index].value <<= available;
            } else {
                CORBA::ULong count = unknownProps.length();
                unknownProps.length(count+1);
                unknownProps[count] = fileSysProperties[index];
            }
        }
    }

    if (unknownProps.length() > 0) {
        throw CF::FileSystem::UnknownFileSystemProperties(unknownProps);
    }

    TRACE_EXIT(FileManager_impl)
}