Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Navigation and Screen Hierarchy in SCADA Systems
📖 Scenario: You are working on a SCADA system interface. The system has multiple screens showing different parts of a factory. You need to organize these screens in a hierarchy so operators can navigate easily.
🎯 Goal: Build a simple screen hierarchy using a dictionary where each screen points to its child screens. Then create a function to navigate from one screen to its child screens.
📋 What You'll Learn
Create a dictionary called screen_hierarchy with exact screen names and their child screens
Add a variable called current_screen to hold the starting screen
Write a function called get_child_screens that takes a screen name and returns its child screens
Print the child screens of the current_screen
💡 Why This Matters
🌍 Real World
SCADA systems use screen hierarchies to organize complex factory data so operators can find information quickly and safely.
💼 Career
Understanding navigation and screen hierarchy is essential for SCADA developers and operators to build and use efficient control interfaces.
Progress0 / 4 steps
1
Create the screen hierarchy dictionary
Create a dictionary called screen_hierarchy with these exact entries: 'Main': ['Overview', 'Settings'], 'Overview': ['Temperature', 'Pressure'], 'Settings': ['Network', 'Display'], 'Temperature': [], 'Pressure': [], 'Network': [], 'Display': []
SCADA systems
Hint
Use a dictionary with keys as screen names and values as lists of child screens.
2
Set the current screen variable
Create a variable called current_screen and set it to the string 'Main'
SCADA systems
Hint
Set current_screen exactly to 'Main'.
3
Write a function to get child screens
Write a function called get_child_screens that takes a parameter screen and returns the list of child screens from screen_hierarchy for that screen
SCADA systems
Hint
Use the dictionary get method to return child screens or an empty list if none.
4
Print the child screens of the current screen
Write a print statement that prints the result of calling get_child_screens with current_screen
A. DetailScreen should be a child of MainScreen directly
B. Children key should be "parent" instead
C. Children must be a list; change "children": "AlarmScreen" to "children": ["AlarmScreen"]
D. Remove the children key from AlarmScreen
Solution
Step 1: Identify data type error in children key
Children must be a list (array), but "AlarmScreen" is a string here.
Step 2: Correct the children value to a list
Wrap "AlarmScreen" in brackets to make it a list: ["AlarmScreen"].
Final Answer:
Children must be a list; change "children": "AlarmScreen" to "children": ["AlarmScreen"] -> Option C
Quick Check:
Children = list, not string [OK]
Hint: Children always use square brackets [] [OK]
Common Mistakes:
Using string instead of list for children
Confusing children with parent key
Changing unrelated keys
5. You want to design a SCADA screen hierarchy where MainScreen has two children: AlarmScreen and StatusScreen. AlarmScreen further has a child DetailScreen. Which JSON configuration correctly represents this hierarchy?