Skip to content

Commit

Permalink
pulling @rwcarlsen's work in refactoring our output paradigm. i added…
Browse files Browse the repository at this point in the history
… a small tweak to allow for backwards compatability with analysis tools
  • Loading branch information
gidden committed Feb 21, 2013
2 parents f6c396c + e98ca5c commit cccbd2e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 39 deletions.
36 changes: 8 additions & 28 deletions src/Models/Facility/EnrichmentFacility/EnrichmentFacility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "GenericResource.h"
#include "Material.h"
#include "Timer.h"
#include "EventManager.h"

#include <sstream>
#include <limits>
Expand All @@ -22,8 +23,6 @@ using namespace boost;
using boost::lexical_cast;
using namespace enrichment;

// initialize table member
table_ptr EnrichmentFacility::table_ = table_ptr(new Table("Enrichment"));
int EnrichmentFacility::entry_ = 0;

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down Expand Up @@ -287,39 +286,20 @@ enrichment::Assays EnrichmentFacility::getAssays(mat_rsrc_ptr rsrc)
return Assays(feed_assay(),product_assay,tails_assay());
}

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EnrichmentFacility::define_table()
{
// declare the state id columns and add it to the table
table_->addField("ENTRY","INTEGER");
table_->addField("ID","INTEGER");
table_->addField("Time","INTEGER");
table_->addField("Natural_Uranium","REAL");
table_->addField("SWU","REAL");
agent_table->setPrimaryKey("ENTRY");
// we've now defined the table
table_->tableDefined();
}

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EnrichmentFacility::recordEnrichment(double natural_u, double swu)
{
LOG(LEV_DEBUG1, "EnrFac") << name() << " has enriched a material:";
LOG(LEV_DEBUG1, "EnrFac") << " * Amount: " << natural_u;
LOG(LEV_DEBUG1, "EnrFac") << " * SWU: " << swu;

if ( !table_->defined() ) define_table();

data an_entry(++entry_), an_id(ID()), time_data(TI->time()),
nat_u_data(natural_u), swu_data(swu);
entry u_entry("ENTRY",an_entry), id("ID",an_id), time("Time",time_data),
natl_u("Natural_Uranium",nat_u_data), swu_req("SWU",swu_data);
// construct row
row aRow;
aRow.push_back(u_entry), aRow.push_back(id), aRow.push_back(time),
aRow.push_back(natl_u), aRow.push_back(swu_req);
// add the row
table_->addRow(aRow);
EM->newEvent("Enrichments")
->addVal("ENTRY", ++entry_)
->addVal("ID", ID())
->addVal("Time", TI->time())
->addVal("Natural_Uranium", natural_u)
->addVal("SWU", swu)
->record();
}

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down
7 changes: 0 additions & 7 deletions src/Models/Facility/EnrichmentFacility/EnrichmentFacility.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "FacilityModel.h"

#include "MatBuff.h"
#include "Table.h"
#include "Transaction.h"
#include "Enrichment.h"

Expand Down Expand Up @@ -198,10 +197,6 @@ class EnrichmentFacility : public FacilityModel
*/
void processOutgoingMaterial();

/**
*/
void define_table();

/**
*/
void recordEnrichment(double natural_u, double swu);
Expand All @@ -220,8 +215,6 @@ class EnrichmentFacility : public FacilityModel

MatBuff inventory_;

static table_ptr table_;

static int entry_;

/// A list of orders to be processed on the Tock
Expand Down
4 changes: 0 additions & 4 deletions src/Testing/CycamoreUnitTestDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@

#include <gtest/gtest.h>

#include "BookKeeper.h"
#include "Env.h"
#include "Logger.h"

int main(int argc, char* argv[]) {
// turn normal logging off, we will test it
BI->turnLoggingOff();

// tell ENV the path between the cwd and the cyclus executable
std::string path = Env::pathBase(argv[0]);
Env::setCyclusRelPath(path);
Expand Down

0 comments on commit cccbd2e

Please sign in to comment.