Programmer Guide/Shell Items/Graph/GRAPH Item Attributes: Difference between revisions

From STX Wiki
Jump to navigationJump to search
 
(24 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
==GRAPH Item Attributes==
{{Graph Item}}
[[Category:Graph Item]]
This chapter describes the attributes of {{STX}} [[Programmer_Guide/Shell_Items/Graph|graph shell items]]. Like with all types of {{STX}} shell items, the respective attributes may be retrieved like this:


The graph shell item has the following attributes.
#s := set '$#graphItem[!CURSORLIMIT]'


====!CURSORLIMIT====
==!CURSORLIMIT==


The <code>!CURSORLIMIT</code> attribute returns either <code>view</code> if the cursors are limited to the view or <code>range</code> if the cursors may exist outside the view. You can set the cursor limit value using the shell command <code>SET graph CURSORMODE</code>.
The <code>!CURSORLIMIT</code> attribute returns either <code>view</code> if the cursors are limited to the view or <code>range</code> if the cursors may exist outside the view. You can set the cursor limit value using the shell command [[Programmer_Guide/Shell_Items/Graph/SET_GRAPH#CURSORMODE|<code>SET graph CURSORMODE</code>]].


====!CURSORMODE====
==!CURSORMODE==


The <code>!CURSOR</code>MODE attribute returns '0' if both cursors are off, '1' if cursor one is on, '2' if cursor 2 is on, and '3' if both cursor 1 and 2 are on. See the graph item command <code>CURSORMODE</code> for more details.
The <code>!CURSORMODE</code> attribute returns <code>0</code> if both cursors are off, <code>1</code> if cursor one is on, <code>2</code> if cursor 2 is on, and <code>3</code> if both cursor 1 and 2 are on. See the graph item command [[Programmer_Guide/Shell_Items/Graph/SET_GRAPH#CURSORMODE|<code>SET graph CURSORMODE</code>]] for details.


====!DISPLAY====
==!DISPLAY==


The <code>!DISPLAY</code> attribute returns the name of the display item the graph is contained in.
The <code>!DISPLAY</code> attribute returns the name of the display item the graph is contained in.


====!FUNCTIONS====
==!FUNCTIONS==


The <code>!FUNCTIONS</code> attribute returns the number of functions displayed in the graph.
The <code>!FUNCTIONS</code> attribute returns the number of functions displayed in the graph.


====!INDEX====
==!INDEX==


The <code>!INDEX</code> attribute returns the index of the graph item in the containing display item
The <code>!INDEX</code> attribute returns the index of the graph item in the containing display item


====!INPUTS====
==!INPUTS==


The <code>!INPUTS</code> attribute returns the number of Y data inputs attached to the graph.
The <code>!INPUTS</code> attribute returns the number of Y data inputs attached to the graph.


If the <code>!INPUTS</code> attribute is called with an index as it's parameter like this:
If the <code>!INPUTS</code> attribute is called with an index as its argument then the type of function used for the input is returned (e.g. <code>spectrogram</code>), or an asterisk, if no input is defined for that index:


<code>$#graph[!inputs,$#i]</code>
#type := $#graph[!inputs,$#i]


then the type of function used for the input is returned (e.g. spectrogram).
==!MODE==
 
====!MODE====


The <code>!MODE</code> attribute returns the current mode the graph is in. This is one of the following:
The <code>!MODE</code> attribute returns the current mode the graph is in. This is one of the following:


<code>overview</code> - the graph is displaying the view as a metasegment within the whole range<br>
{| class="keinrahmen"
<code>view</code> - the graph is currently displaying part of the complete range<br>
|-
<code>range</code> - the graph is displaying the complete range
| <code>overview</code> || the graph is displaying the view as a metasegment within the whole range
 
|-
====!ORIENTATION====
| <code>view</code> || the graph is currently displaying part of the complete range
 
|-
Get <code>!ORIENTATION</code> attribute gets the current orientation of the graph. See <code>ORIENTATION</code> for parameter details.
| <code>range</code> || the graph is displaying the complete range
 
|}
 
 
====!RANGE====
 
The <code>!RANGE</code> attribute returns the minimum and maximum values displayable on the axis in this graph. The returned string is a blank separated list of values. Note that the <code>zmin</code> and <code>zmax</code> values are only returned if the graph has a z-axis (i.e. a Waterfall graph):
 
<code>xmin xmax ymin ymax [ zmin zmax ]</code>
 
====!SEGMENT====


The <code>!SEGMENT</code> attribute gets information about metagsegments. There are three ways to use the !SEGMENT attribute.
==!ORIENTATION==


1) Calling the <code>!SEGMENT</code> attribute without parameters like this:
Get <code>!ORIENTATION</code> attribute gets the current orientation of the graph. See [[Programmer_Guide/Shell_Items/Graph/SET_GRAPH#Connecting_graph_inputs|<code>SET graph ORIENTATION</code>]] for parameter details.


<code>$#graph[!SEGMENT]</code>
==!RANGE==


returns the number of metasegments.
The <code>!RANGE</code> attribute returns the minimum and maximum values displayable on the axis in this graph. The returned string is a blank separated list of values. Note that the <code>z<sub>min</sub></code> and <code>z<sub>max</sub></code> values are only returned if the graph has a z-axis (i.e. a Waterfall graph):


2) Calling the <code>!SEGMENT</code> attribute with an index as it's parameter like this:
x<sub>min</sub> x<sub>max</sub> y<sub>min</sub> y<sub>max</sub> [ z<sub>min</sub> z<sub>max</sub> ]


<code>$#graph[!SEGMENT,$#index]</code>
==!SEGMENT==


will retrieve the following information:
The <code>!SEGMENT</code> attribute retrieves information about metagsegments in the graph. There are two ways to use the <code>!SEGMENT</code> attribute.


idx id sel resmov xmin xmax ymin ymax
=== Without arguments ===


where
Without further arguments, the <code>!SEGMENT</code> attribute returns the number of metasegments in the graph:


idx - the temporary index
#n := $#graph[!SEGMENT]
id - the permanent id
sel - 0 if the metasegment is not selected, and one otherwise
resmov - 1 if the metasegment has been moved since it was last set and 0 otherwise
xmin, xmax - the position of the left and right of the metasegment in x range values
ymin, ymax - the position of the top and bottom of the metasegment in y range values


3) Calling the <code>!SEGMENT</code> attribute with an id as the parameter like this:
=== With a segment index or segment ID as its argument ===


<code>$#graph[!segment,SegID1]</code>
#n := $#graph[!segment,<var>segmentIndex</var>]
#n := $#graph[!segment,<var>segmentID</var>]


will return a string in the following format:
When called with the index or the ID of a segment as its argument, the <code>!SEGMENT</code> attribute will return the following information for the segment whose respective numerical index is <var>segmentIndex</var> or whose name is (<var>segmentID</var>):


<code>idx id sel resmov xmin xmax ymin ymax</code>
idx id sel resmov x<sub>min</sub> x<sub>max</sub> y<sub>min</sub> y<sub>max</sub>


See 2) for details.
{| class="keinrahmen"
|-
| <code>idx</code> || the temporary index
|-
| <code>id</code> || the permanent id
|-
| <code>sel</code> || 1 or 0 indicating if the metasegment is selected (1) or not (0)
|-
| <code>resmov</code> || 1 or 0 indicating if the metasegment has been moved since it was last set programmatically (1) or not (0).
|-
| <code>x<sub>min</sub></code>, <code>x<sub>max</sub></code> || the position of the left and right edge of the metasegment in x range values
|-
| <code>y<sub>min</sub></code>, <code>y<sub>max</sub></code> || the position of the top and bottom edge of the metasegment in y range values
|}


Note that is should not be numbers, because numbers are used by the index query function.
#s := $#graph[!SEGMENT,$#index]
readvar #s #idx #id #sel #resmov #xmin #xmax #ymin #ymax
#s := $#graph[!SEGMENT,segmentSusan]
readvar #s #idx #id #sel #resmov #xmin #xmax #ymin #ymax


====!VIEW====
==!VIEW==


The <code>!VIEW</code> attribute returns the area of the full range which is currently being displayed. The returned string as the following format:
The <code>!VIEW</code> attribute returns the area of the full range which is currently being displayed. The returned string has the following format:


<code>xmin xmax ymin ymax [ zmin zmax ]</code>
x<sub>min</sub> x<sub>max</sub> y<sub>min</sub> y<sub>max</sub> [ z<sub>min</sub> z<sub>max</sub> ]


If the graph has not been zoomed, the <code>!VIEW</code> and <code>!RANGE</code> values are identical.
If the graph has not been zoomed, the <code>!VIEW</code> and [[Programmer_Guide/Shell_Items/Graph/GRAPH_Item_Attributes#.21RANGE|<code>!RANGE</code>]] values are identical.

Latest revision as of 14:45, 9 November 2017

Graph Item
INTRODUCTION NEW SET ATTRIBUTES MESSAGES EXAMPLES

This chapter describes the attributes of STx graph shell items. Like with all types of STx shell items, the respective attributes may be retrieved like this:

#s := set '$#graphItem[!CURSORLIMIT]'

!CURSORLIMIT

The !CURSORLIMIT attribute returns either view if the cursors are limited to the view or range if the cursors may exist outside the view. You can set the cursor limit value using the shell command SET graph CURSORMODE.

!CURSORMODE

The !CURSORMODE attribute returns 0 if both cursors are off, 1 if cursor one is on, 2 if cursor 2 is on, and 3 if both cursor 1 and 2 are on. See the graph item command SET graph CURSORMODE for details.

!DISPLAY

The !DISPLAY attribute returns the name of the display item the graph is contained in.

!FUNCTIONS

The !FUNCTIONS attribute returns the number of functions displayed in the graph.

!INDEX

The !INDEX attribute returns the index of the graph item in the containing display item

!INPUTS

The !INPUTS attribute returns the number of Y data inputs attached to the graph.

If the !INPUTS attribute is called with an index as its argument then the type of function used for the input is returned (e.g. spectrogram), or an asterisk, if no input is defined for that index:

#type := $#graph[!inputs,$#i]

!MODE

The !MODE attribute returns the current mode the graph is in. This is one of the following:

overview the graph is displaying the view as a metasegment within the whole range
view the graph is currently displaying part of the complete range
range the graph is displaying the complete range

!ORIENTATION

Get !ORIENTATION attribute gets the current orientation of the graph. See SET graph ORIENTATION for parameter details.

!RANGE

The !RANGE attribute returns the minimum and maximum values displayable on the axis in this graph. The returned string is a blank separated list of values. Note that the zmin and zmax values are only returned if the graph has a z-axis (i.e. a Waterfall graph):

xmin xmax ymin ymax [ zmin zmax ]

!SEGMENT

The !SEGMENT attribute retrieves information about metagsegments in the graph. There are two ways to use the !SEGMENT attribute.

Without arguments

Without further arguments, the !SEGMENT attribute returns the number of metasegments in the graph:

#n := $#graph[!SEGMENT]

With a segment index or segment ID as its argument

#n := $#graph[!segment,segmentIndex]
#n := $#graph[!segment,segmentID]

When called with the index or the ID of a segment as its argument, the !SEGMENT attribute will return the following information for the segment whose respective numerical index is segmentIndex or whose name is (segmentID):

idx id sel resmov xmin xmax ymin ymax
idx the temporary index
id the permanent id
sel 1 or 0 indicating if the metasegment is selected (1) or not (0)
resmov 1 or 0 indicating if the metasegment has been moved since it was last set programmatically (1) or not (0).
xmin, xmax the position of the left and right edge of the metasegment in x range values
ymin, ymax the position of the top and bottom edge of the metasegment in y range values
#s := $#graph[!SEGMENT,$#index]
readvar #s #idx #id #sel #resmov #xmin #xmax #ymin #ymax

#s := $#graph[!SEGMENT,segmentSusan]
readvar #s #idx #id #sel #resmov #xmin #xmax #ymin #ymax

!VIEW

The !VIEW attribute returns the area of the full range which is currently being displayed. The returned string has the following format:

xmin xmax ymin ymax [ zmin zmax ]

If the graph has not been zoomed, the !VIEW and !RANGE values are identical.

Navigation menu

Personal tools