Commit 1064f198 authored by jouke's avatar jouke
Browse files

Minor code change in copy defaults moving the copy operation to the

constructor rather than later.
parent 9979b34b
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -28,11 +28,7 @@ ObjectGenerator(pSB)
{}

void CopyDefaultParameters::initialize(const Time &t){
//do nothing
}

void CopyDefaultParameters::generate(const Time &tt){
	Time t=pSB->getStartTime();
	//Time t=pSB->getStartTime();
	//find default parameter section
	std::string pathToDefaults("../defaults");
	SimulaBase* defaults=pSB->existingChild("copyDefaultsFrom");
@@ -40,6 +36,7 @@ void CopyDefaultParameters::generate(const Time &tt){
		defaults->get(pathToDefaults);
	defaults=pSB->existingPath(pathToDefaults);
	if(defaults){
		//std::cout<<std::endl<<"Copying from "<<defaults->getName()<<" to "<<pSB->getName()<<std::endl;
		//for each object in that section, check if it is there, and if not copy it
		SimulaBase::List list;
		defaults->getAllChildren(list,t);
@@ -57,6 +54,10 @@ void CopyDefaultParameters::generate(const Time &tt){
	pSB->stopUpdatefunction();
}

void CopyDefaultParameters::generate(const Time &tt){
	//do nothing
}



//the maker function for instantiation of the class