User Tools

Site Tools


02_user_tutorials:08_technical_features:xparametric-model

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
02_user_tutorials:08_technical_features:xparametric-model [2025/01/24 15:51] – ↷ Page moved from 02_user_tutorials:technical_features:xparametric-model to 02_user_tutorials:08_technical_features:xparametric-model tim202_user_tutorials:08_technical_features:xparametric-model [2025/12/05 09:44] (current) – removed Tim
Line 1: Line 1:
-====== Forward parameters from the command line to a project ====== 
  
- 
-It is possible to forward parameters from the command line to GroIMP using additional parameters beginning with an capital X. 
-This parameter can than be accessed by all models opened. 
-For a model that is suppose to greed the user this additional parameter could be the name, therefore the command line parameter would be ''-Xname="gaetan"''. 
-To access this parameter than in GroIMP the function getProperty of the class Main needs to be called: 
- 
-<code java> 
-import de.grogra.pf.boot.Main; 
- 
-public void sayHi(){ 
-  println("hallo "+Main.getProperty("name")); 
-} 
- 
-</code>  
- 
-This works with multiple parameters and is especially useful in the [[01_user_documentation:user-guide:additional_interfaces:headless|headless mode]]: 
- 
-<code java> 
-import de.grogra.pf.boot.Main; 
-protected void startup() 
-{ 
- super.startup(); 
- if (Main.getProperty("headless") != null) 
- { 
- runLater(null); 
- } 
-} 
- 
- 
-protected void run(Object info) 
-{ 
- println("hallo " + Main.getProperty("name")); 
-} 
-</code> 
- 
-This provides the possibility to forward knowledge/information or the path to specific configuration to a GroIMP model without changing the model. 
- 
-  
02_user_tutorials/08_technical_features/xparametric-model.1737730317.txt.gz · Last modified: 2025/01/24 15:51 by tim2