Wednesday, July 31, 2013

Query List Presentation in GTViewer 14



Overview

GTViewer provides a good deal of control over how the list of Queries is presented to the user under the Query menu.  The ability to group queries has been available for some time, but GTViewer version 14 has provided a new feature to add visual Separator lines between the query items. 

After seeing a customer creatively use a dummy query with the name “---------------------------“ to provide a visual separator between groups of queries, it seemed like a good idea to add support for this functionality directly into the product.   The Query Info section in the .GTM file has recently had its documentation updated, so this post will highlight this section and show how the new Separator feature can be used.

Query Info Section

The Query Info section defines which queries are available to the user under the Query menu in GTViewer.  Each Query Item is specified in the following format:

Query=[query file]

Or
Query=|[query group]

The Query File (.qry) is the compiled query file created for a particular query (with the GTQuery tool in GTData).

Query Groups can be defined for the Desktop version of GTViewer (they will be ignored in other products).  A Query Group will create a group item on the Query menu that will pop up when selected to show the group items.  Grouped items must be sequentially listed and the group name can only be used for one group (you cannot have a two or more group with the same name). 

The difference between grouped menu items and non-grouped items is shown below.  The first example shows a straight list of queries with no grouping:

[Query Info]
Query=query_pole.qry
Query=query_sub.qry
Query=query_ele_cust.qry
Query=query_trans.qry
Query=query_valve.qry
Query=query_gas_meter.qry
Query=query_inter.qry
Query=query_circuit.qry
Query=query_circuit_prompts.qry
Query=query_phases.qry
Query=query_phases_prompts.qry




The second example shows how 4 queries are grouped as “Electric” and 2 queries are grouped as “Gas”:

[Query Info]
Query=query_pole.qry|Electric
Query=query_sub.qry|Electric
Query=query_ele_cust.qry|Electric
Query=query_trans.qry|Electric
Query=query_valve.qry|Gas
Query=query_gas_meter.qry|Gas
Query=query_inter.qry
Query=query_circuit.qry
Query=query_circuit_prompts.qry
Query=query_phases.qry
Query=query_phases_prompts.qry




Note: the Upstream/Downstream Trace menu item is an Application.

The Separator

A feature added in GTViewer version 14, allows the use of a visual separator between Query Items.   Using an entry like one of the following:

Query=Separator

or

Query=Separator|[group name]


These entries will insert a menu separator at that position in the query list.   Menu Groups are supported as well, so if you want to put a separator in a pop up menu for a menu group, just use the Separator entry with a group name.

Example:

[Query Info]
Query=Separator
Query=query_pole.qry|Electric
Query=query_sub.qry|Electric
Query=query_elec_cust.qry|Electric
Query=Separator|Electric
Query=query_trans.qry|Electric
Query=query_valve.qry|Gas
Query|Separator|Gas
Query|query_gas_meter.qry|Gas
Query|query_fiber_term.qry|Fiber
Query|Separator|Fiber
Query|query_fiber_splice.qry|Fiber
Query|Separator
Query|query_inter.qry
Query|Separator
Query=query_circuit.qry
Query=query_circuit_prompts.qry
Query|Separator

 


Note:  the Valve Isolation Trace menu item is an Application.


You can download this post as a .pdf file from here.