Consider 5 types of configurations that cascade upon each other, similar to CSS.
1 Library Default Settings
- Contains defaults for ALL settings, built into the library.
- Is library code.
- Is necessary.
- Example: Phoenix by default launches itself on a 1024x768 window.
2 Machine Specific Settings
- Overrides 1, applies to all Phoenix applications ran on the containing machine.
- Is a file residing in a system directory.
- Is optional.
- Example use case: The CAVE machines require a specific resolution and aspect ratio.
3 User Specific Settings
- Overrides 2, applies to all Phoenix applications ran on the containing machine by the current user.
- Is a file residing in the current user's directory.
- Is optional.
- Example use case: I am color blind and require Protanopia (Red-Green) color blind mode for all applications I run.
4 Application Default Settings
- Overrides 3, applies to a particular Phoenix application.
- Is application code.
- Is optional.
- Example use case: PLI viewer should only run on a Window, not an HMD.
5 Application Custom Settings
- Overrides 4, applies to a particular copy of a Phoenix application.
- Is a file residing in the application directory.
- Is optional (but auto-generated on launch if requested by 1/2/3/4).
- Example use case: I really know what I'm doing and I want to test the PLI viewer with an HMD.
Cascading:
Setting Type | Effect | Cascaded Result |
---|---|---|
Library Default | {a: 1, b: 2, c: 3} | {a: 1, b: 2, c: 3} |
Machine | {a: 42} | {a: 42, b: 2 , c: 3} |
User | {b: 63} | {a: 42, b: 63, c: 3} |
Application Default | {c: 84} | {a: 42, b: 63, c: 84} |
Application Custom | {a: 105, c: 126} | {a: 105, b: 63, c: 126} |