コード例 #1
0
ファイル: Server.cpp プロジェクト: dicarlo/mw_core
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;
}
コード例 #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;
}
コード例 #3
0
ファイル: Client.cpp プロジェクト: banken/core
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;
}
コード例 #4
0
ファイル: Client.cpp プロジェクト: mworks/mworks
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;
}