Ejemplo n.º 1
0
bool Server::openExperiment(const std::string &expPath) {
	namespace bf = boost::filesystem;
	
    ExperimentPackager packer;
	
	Data experiment(packer.packageExperiment(bf::path(expPath, bf::native)));
	if(experiment.isUndefined()) {
		merror(M_SERVER_MESSAGE_DOMAIN, 
			   "Failed to create a valid packaged experiment.");
		return false; 		
	}
	shared_ptr<Event> new_experiment(new Event(GlobalSystemEventVariable->getCodecCode(), 
												 experiment));
	GlobalBufferManager->putIncomingNetworkEvent(new_experiment);
	
	return true;
}
Ejemplo n.º 2
0
bool Server::openExperiment(const std::string &expPath) {
	namespace bf = boost::filesystem;
	
    ExperimentPackager packer;
	
    Datum experiment(packer.packageExperiment(bf::path(expPath)));
	if(experiment.isUndefined()) {
		merror(M_SERVER_MESSAGE_DOMAIN, 
			   "Failed to create a valid packaged experiment.");
		return false; 		
	}
	shared_ptr<Event> new_experiment(new Event(RESERVED_SYSTEM_EVENT_CODE, 
												 experiment));
	putEvent(new_experiment);
	
	return true;
}
Ejemplo n.º 3
0
bool Client::sendExperiment(const std::string &expPath) {
	namespace bf = boost::filesystem;
    if(!remoteConnection->isConnected()) { return false; }
    ExperimentPackager packer;
	
	Data experiment(packer.packageExperiment(bf::path(expPath, bf::native)));
	if(experiment.isUndefined()) {
		merror(M_CLIENT_MESSAGE_DOMAIN, 
			   "Failed to create a valid packaged experiment.");
		
		// send an update that the experiment load failed
		shared_ptr<Event> experimentStateEvent = EventFactory::currentExperimentState();
		buffer_manager->putEvent(experimentStateEvent);
			
		return false; 		
	}
	system_event_variable->setValue(experiment);
	
    return true;
}
Ejemplo n.º 4
0
bool Client::sendExperiment(const std::string &expPath) {
	namespace bf = boost::filesystem;
    if(!remoteConnection->isConnected()) { return false; }
    ExperimentPackager packer;
	
    Datum packaged_experiment(packer.packageExperiment(bf::path(expPath)));
	if(packaged_experiment.isUndefined()) {
		merror(M_CLIENT_MESSAGE_DOMAIN, 
			   "Failed to create a valid packaged experiment.");
		
		// send an update that the experiment load failed
		shared_ptr<Event> experimentStateEvent = SystemEventFactory::currentExperimentState();
		putEvent(experimentStateEvent);
			
		return false; 		
	}
    
    shared_ptr<Event> experiment_event(new Event(RESERVED_SYSTEM_EVENT_CODE, packaged_experiment));
    putEvent(experiment_event);
	
    return true;
}