Jump to content

command line option to override ig_config?


photo

Recommended Posts

Posted

Hi,

I'm pretty sure this exists but can't put my hand on it in the doc:

Is there any way to pass IG/CIGI/DIS options in the command line in the launch script to override any settings in the ig_config.xml?

Thanks!

Posted

Hello! 

At the moment you can only override the following parameters:

-ig_config "path/to/ig_config.xml"

-cigi_host "127.0.0.1"
-cigi_send_port 8899
-cigi_recv_port 8899

-dis_address "127.255.255.255"
-dis_multicast 1/0
-dis_site_id 11
-dis_exercise_id 22
-dis_app_id 33
-dis_port 3000

Let me know if you need any additional parameters.

Thanks!

  • Like 2
  • 5 months later...
Posted

Hi, would it be possible to add something for the default view ID and the default database too?

Thanks!

Posted

Hello! 

No, there are no such built-in commands. but you can define them by yourself


int getCommandArg(const char *arg_name, int default_value)
{
	Engine *engine = Engine::get();
	for (int i = 0; i < engine->getNumArgs() - 1; i++)
	{
		const char *name = engine->getArg(i);
		if (name[0] == '-')
		{
			name++;
			if (!strcmp(name, arg_name))
			{
				return engine->getArgi(i + 1);
			}
		}
	}

	return default_value;
}


int AppSystemLogic::init()
{
//.....
	
	int default_view = getCommandArg("default_view", ig_manager->getCurrentView());
	// change config value
	ig_manager->getConfig()->setValue("IG.default_view_id", default_view);
	// or directly apply
	ig_manager->setCurrentView(default_view);
	
	int default_database = getCommandArg("default_database", ig_manager->getCurrentDatabaseID());
	// change config value
	ig_manager->getConfig()->setValue("IG.autoload_database", default_database);
	// or directly apply
	ig_manager->loadDatabase(default_database);

	return 1;
}

 

×
×
  • Create New...