Focal Point Basics Jobsheets

Set Visible and Possible Sites

Purpose:

This jobsheet sets the sites whose hazards are visible (or which are possible to select as visible) in the console and spatial display for the default, common settings

Tasks:

  1. Override Background: When configuring Hazard Services files in the Localization Perspective in the following jobsheets, a best practice is to create a user override first and then promote to site when the change has been tested and is complete. When creating user overrides for Hazard Services python files, you can right click on the base version of the file to create an incremental override using "Create Override File ..." or create an absolute override (i.e. full copy) of the file using "Copy To". Because it is also a best practice to only modify the minimum necessary to limit maintenance problems in future versions, the "Create Override File ..." incremental override is typically best for this approach; however, there are some situations configuring small files where it can be easier to start with a copy and trim to what you need. For the few xml files in Hazard Services configuration, there is no incremental override.
  2. In the Localization Perspective, navigate to the Settings sub-directory under the Hazard Services folder.
  3. Navigate further to the config sub-directory
  4. Double click on CommonSettings.py to show the available versions
  5. Create a user override version if none exists (user override is best practice for testing changes):
    1. If there is only a BASE version: right click on BASE and select Create Override File, then select User. The Create Override File creates an incremental override and is best for making relatively confined changes (as opposed to Copy To which creates copies everything from the base file to user). 
    2. If there is another version (e.g. SITE) you wish to use: right click on that file and select Copy To, then select User
    3. Note: making user overrides can take 10-20 seconds on some machines.
  6. Double click on the User version of CommonSettings.py to open it for editing
  7. If you just created this SITE file, you need to insert the basic namespace structure for the file. Copy-paste the following code into your file:
     
    CommonSettings= {
        "visibleSites": [],
        "possibleSites": [],
    }
    1. Note that this creates a placeholder for the possible and visible sites variables we wish to edit
  8. Enter in the default visible sites for your site and your neighboring sites (note you must include your own local site) using the following information   
    1. Sites are entered as quoted, three-letter, uppercase values, such as "LWX", within the square brackets to the right of "visibleSites"
    2. Use commas to separate multiple sites, such as ["LWX","RLX"] (spaces are OK to use after commas, before new quoted site IDs if desired)
    3. Any site entered in "visibleSites" here will have their hazards visible by the default settings, but may be hidden through the settings GUI at any time
  9. Enter in the default possible sites using the following information
    1. Every "visible" site must also have an entry here in "possibleSites". Visible sites is a subset of possible sites
    2. Use the same syntax rules as visibleSites to enter quoted, three-letter, upper-case site values in the square brackets, using commas to separate multiple sites if needed
    3. Any site entered in "possibleSites" will have their hazards available for easy display in the settings GUIs, even if they are not marked "visible" by default
  10. (No action in this step) An example override following the above steps, which uses "LWX" and "RLX" as possible sites, but only "LWX" visible by default, is shown below
     
    # EXAMPLE OVERRIDE FOR COMPARISON
    CommonSettings= {
        "visibleSites": ["LWX"], # Only LWX visible in default settings
        "possibleSites": ["LWX", "RLX"], # RLX is also possible to select for display
    }
  11. Double-check for Python syntax mistakes, even though this is a fairly simple override . Use the following tips:
    1. Bracketing: Be sure that each pair of [ ] and { } brackets have matching opening and closing symbols
    2. Quote Marks: Make sure your site entries use MATCHING quotation marks (don't mix single or double quotes for a single value) and have opening and closing marks around them. Also, commas separating multiple values should NOT be included in the quotes
    3. Colons/Commas: There is a colon (:) after each of the keys in this CommonSettings dictionary, which in this case are "visibleSites": and "possibleSites":, but before their values... ALSO a comma after EVERY LINE on which a key:value pair appears (at the end of the lines)
    4. Spelling: Be sure your site IDs are spelled correctly, also check for other typos in any non-commented text you might have typed in
  12. When finished, save the file by hitting Ctrl+S, or selecting Save from the File menu. Click OK to merge. Close the Merge tab, and click Yes twice on the popup windows.
  13. Review, test, and (if desired) promote the file to the appropriate localization level.

To see changes implemented:

  • No restarts needed, except for closing and reloading the settings dialogue if open

New behavior to expect:

  • The settings GUI (SETUP icon in Console -> Manage Settings -> Edit/Filter) will reflect your new options (see "Hazards Filter" tab) as long as your current setting does not contain its own overrides for possible/visible sites
  • Hazards for any sites newly marked "visible" should appear in the console and spatial display and will have their checkbox selected in the settings GUI.