Commit 7a7985c1 authored by jouke's avatar jouke
Browse files

Allow copyDefaults on templates, particularly the hypocotyl template

parent 5796b940
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -170,7 +170,7 @@ int main(int argc, char **argv) {
			<< "\n";
		//construct origin
		const Coordinate ori(0, 0, 0);
		ORIGIN = new SimulaConstant<Coordinate>("origin", nullptr, ori,0);
		ORIGIN = new SimulaConstant<Coordinate>("origin", nullptr, ori,0.);
		//load file
		std::cout << ANSI_Black
			<< "Running OpenSimRoot \n\tbuilt on " << __DATE__
@@ -200,6 +200,7 @@ int main(int argc, char **argv) {
		setRandomSeed(seed);
		//signal object generators that they can start updating
		ObjectGenerator::startUpdating();
		ORIGIN->updateAll(0);//run the copyDefaults etc.
		//run the export modules which drive the model.
		std::cout << ANSI_Black << "\nRunning modules: " << std::flush;
#if _WIN32 || _WIN64
+1 −2
Original line number Diff line number Diff line
@@ -401,8 +401,7 @@ void Database::updateRecursively(const Time &t){
		//call children to update
		for (Database::Table::const_iterator it(data.begin()) ; it!=data.end() ; ++it){
			SimulaBase* probe(it->second);
			if (probe->getName().find( "Template" , 0 ) != std::string::npos) continue;
			//if (probe->getName().find( "template" , 0 ) != std::string::npos) continue;
			//if (probe->getName().find( "Template" , 0 ) != std::string::npos) continue;
			if(probe->hasChildren()){
				probe->getChildren()->updateRecursively(t);
			}
+1 −1
Original line number Diff line number Diff line
@@ -183,7 +183,7 @@ void SimulaBase::registerSignalingHook(){
void SimulaBase::updateAll(const Time& t){
	Time st,et;
	SimulaTimeDriven::getGlobalTimeStepInfo(st,et);
	if(st>0. && t<st) st=t;
	if(st<0. || t<st) st=t;
	if(st>Database::updatedAll+TIMEERROR && !Database::updateAllLock){
		Database::updateAllLock=true;
		ORIGIN->getChildren()->updateRecursively(st);