Exemplo n.º 1
0
// create table from single record
void SimpleTable::init(Opm::DeckItemConstPtr deckItem,
                       const std::vector<std::string> &columnNames)
{
    createColumns(columnNames);

    if ( (deckItem->size() % numColumns()) != 0)
        throw std::runtime_error("Number of columns in the data file is"
                                 "inconsistent with the ones specified");
    {
        size_t rows = deckItem->size() / numColumns();
        for (size_t rowIdx = 0; rowIdx < rows; rowIdx++) {
            for (size_t colIdx = 0; colIdx < numColumns(); ++colIdx) {
                size_t deckItemIdx = rowIdx*numColumns() + colIdx;
                m_columns[colIdx].push_back( deckItem->getSIDouble(deckItemIdx) );
                m_valueDefaulted[colIdx].push_back( deckItem->defaultApplied(deckItemIdx) );
            }
        }
    }
}
Exemplo n.º 2
0
void gqbTable::createObjects(gqbBrowser *_tablesBrowser,  pgConn *_conn, OID oidVal,  wxTreeItemId parentNode)
{
	createColumns(_conn, _tablesBrowser, parentNode, oidVal);
}