Tutorial Two

This tutorial covers the complete Tools Demo, except for the PID Emulator and Monitor programs, which were discussed in Part II, “Tutorial One”. The complete source code files for the Tools Demo are shown in Chapter 3, View the Code.

Table of Contents


9. Common Functions for Any Program (in lib/common.g)
9.1. Requiring OS-Specific Libraries - lib_require
9.2. Starting Programs - program_startup
9.3. Starting qserve and nserve - start_qnserves
9.4. Control Button Functionality - start_stop
9.5. Start a Process - start_process, find_on_path
9.6. Handling Terminated Processes - child_died
9.7. Kill a Child Process - kill_child
9.8. Stop Processes - stop_processes
9.9. Sending Messages - send_message, started_died_hook

10. Abstracted Functions
10.1. Linux or QNX (in lib/linux.g, lib/qnx.g)
10.1.1. System Calls - anyos_system
10.1.2. Showing Help - anyos_help
10.2. Linux, QNX 4, or QNX 6 (in lib/linux.g, lib/qnx4.g, lib/qnx6.g)
10.2.1. Process Termination - anyos_find_process
10.2.2. Reassigning Strings - anyos_assign
10.3. QNX 4 or QNX 6 (in lib/qnx4.g, lib/qnx6.g)
10.3.1. Loading Extra Libraries for QNX 4 - anyver_loadlibs, gui_require
10.4. GTK or Photon (in lib/gtk.g, lib/photon.g)
10.4.1. Displaying Text - anygui_show_text
10.4.2. Process Termination - anygui_sigchild
10.4.3. Process Termination - anygui_destroyer
10.4.4. Buttons - .switched_on
10.4.5. Moving the Window - anygui_move_window
10.4.6. Change PID settings in the Monitor - anyos_change_settings
10.4.7. Creating a Message/Dialog Window - anygui_makemsg
10.5. GTK only (in lib/gtk.g)
10.5.1. Buttons - button_messages
10.6. Photon 1.14 or Photon 2 (in lib/qnx4.g, lib/qnx6.g)
10.6.1. Accessing Trend Data - .put_data
10.6.2. Numeric Callbacks - anyver_numeric_callback
10.6.3. Numeric Assignments - anyver_numeric_assign
10.6.4. Numeric Changing Settings - anyver_change_settings
10.7. Photon only (in lib/photon.g)
10.7.1. Buttons - PtLabel.get_text, PtLabel.set_text
10.7.2. Rollovers - PtBasic.rollover, attach_msg

11. PID Emulator and Monitor Functions
11.1. The PID Emulator
11.2. The Monitor in GTK
11.3. The Monitor in Photon
11.3.1. Differences between Tutorial One and Tutorial Two

12. Controller Functions
12.1. Choosing a Controller - the demo.g program
12.2. GTK: the Controller window - create_control_win
12.3. GTK: Building Control Buttons - control_button
12.4. Photon: the Controller window - create_control_win
12.5. Common: The Text Message Display - read_msg and messages.txt
12.6. Common: The Process Status Display - show_names, toggle_raw, .reassign_prog_name, extra_space
12.7. Common: The Data Directory - make_datadir

13. Log Functions
13.1. GTK: the Log window - create_log
13.2. GTK: Configuring and Using gnuplot
13.3. GTK: Preparing Plots - prepare_times, get_recent_data
13.4. Photon: the Log window - create_log
13.5. Photon: Log callbacks - start_logging
13.6. Common: The Cascade TextLogger Configuration File - tl.cfg
13.7. Common: Starting and Stopping the Cascade TextLogger - log_toggle
13.8. Common: Controlling the Cascade TextLogger - send_command

14. History Functions
14.1. GTK: the History Window - create_history, make_toggle_button
14.2. GTK: Interpolator Options Widgets - qry_radio_but, qry_entry
14.3. GTK: Editing Queries - .change_int, allow_entry_values, .assign_values
14.4. GTK: Recording Data - record_data, countdown
14.5. GTK: Setting Up Plots - reset_deadbands, plot_prep
14.6. GTK: Sending Queries - send_query, .get_data
14.7. GTK: Displaying Query Data - show_data, write_minmax, file_add
14.8. GTK: Configuring gnuplot
14.9. GTK: the Deadband Type Window - create_dbtype_win, db_labels, db_options
14.10. Photon: the History Window - HistoryWindow class, .constructor, create_history
14.11. Photon: Recording Data - record_data, countdown
14.12. Photon: Interpolator Options Widgets - PtText.set_sensitive, PtComboBox.set_sensitive
14.13. Photon: Editing Queries - .change_int, .allow_entry_values
14.14. Photon: Sending Queries - send_query, .assign_values, .get_data
14.15. Photon: Displaying Query Data - show_data
14.16. Photon: Setting Up Plots - make_graph, make_CwGraph_points
14.17. Photon: Plots and Deadbands - query_refresh, reset_deadbands, db_prep_query
14.18. Photon: the Deadband Type Window - create_dbtype_win, db_options
14.19. Photon: the DeadbandType class and .constructor method
14.20. Common: The Cascade Historian Configuration File - hist.cfg
14.21. Common: the InterpolatorSettings class and .set_defaults, .set_interpolator methods
14.22. Common: Sending Commands to the Cascade Historian send_hs_command, assign_history, display_hs_info
14.23. Common: the DeadbandSettings class and .set_parms method
14.24. Common: Plot Setup - find_midnite, min_max