The CxTrend object contains the following methods:
The AboutBox method displays an About dialog box for the control.
AboutBox()
The AddSeriesDialog method calls the Series dialog box where you can add a new series to your trend.
AddSeriesDialog()
The Cancel method closes an object and TheView.
Cancel()
ClearNoteSelection deselects every note label in a Trend Tool.
ClearNoteSelection()
The DeleteAllSeries method removes all series from a trend.
DeleteAllSeries()
The DeleteSeries method deselects trend(s) from a check list that was created by using the Microsoft ListView control.
DeleteSeries()as Boolean
This method returns a Boolean value.
Returns the configured (XML) axis index number for a given displayed axis index number.
DisplayedToConfiguredAxis() As Integer
The EditAxesDialog method calls the Axis Configuration dialog where you can edit an axis in the trend.
EditAxesDialog() As Boolean
Returns true if saved.
The EditSeriesDialog method calls the Series dialog box where you can edit a series in the trend.
EditSeriesDialog()
Returns 1 if refresh; 2 if restart recommended.
The Export method exports the contents of the grid to a temporary CSV file and opens the file with the default spreadsheet viewer for the user to view and save to disk.
See also Exporting Trends.
Export()
The ExportAsImage method allows export of an image of a trend.
See also Exporting Trends.
ExportAsImage(ByVal nImageType As Long, ByVal path As String, ByVal canOverwrite As Boolean)As Boolean
| Parameter | Required | Description |
|---|---|---|
|
nImageType |
Yes |
File type of image as number. The only allowable values are:
|
|
path |
Yes |
Target destination of exported image. |
|
canOverwrite |
Yes |
Overwrites image at target destination (true) or does not overwrite image at target destination (false) and returns false. |
Example
|
Sub ButtonTool1_EventClick() Dim This : Set This = ButtonTool1 Dim success success = Trend1.X.ExportAsImage (0, "C:\My\Path\Downloads\asdf.jpeg", True) If Not (success) Then msgbox "save asdf.jpeg failed" End If success = Trend1.X.ExportAsImage (1, "C:\My\Path\Downloads\asdf.png", True) If Not (success) Then msgbox "save asdf.png failed" End If success = Trend1.X.ExportAsImage (2, C:\My\Path\Downloads\asdf.bmp", False) If Not (success) Then msgbox "save asdf.bmp failed" End If
End Sub |
The GetAlarmLimitInfoXml method returns an XML string of the trend’s alarm limit configuration.
GetAlarmLimitInfoXml() As String
The GetAxisById method returns the configured (XML) axis index number for a given axis ID number.
GetAxisById()
GetDisplayedNotes returns an array of DisplayNote objects that are currently displayed in the view window of the Trend Tool.
GetDisplayedNotes() As Variant
Returns an array of DisplayNote objects that are currently displayed on the Trend Tool.
The GetSelectedAlarmLimitSeries method returns an index of series currently selected to have its alarm limits displayed.
GetSelectedAlarmLimitSeries() As Short
The GetSelectedNote method returns the SITE.SERVICE~NOTENUMBER of the currently selected note label. A note's database key with no preceding zeroes makes up NOTENUMBER.
GetSelectedNote() As String
This method returns the SITE.SERVICE~NOTENUMBER of the selected note. If no note is selected, the method returns an empty string.
The GetTemplateXml method returns properties in XML format without Point Tag specifiers.
GetTemplateXml() As String
The GetValuesAtTime method returns the value of a series at a time slice.
GetValuesAtTime(DATE TimeSlice)
| Parameter | Required | Description |
|---|---|---|
| DATE | Yes | The date of the time slice. |
| TimeSlice | Yes | Value, date, and time of a plotted point. |
The Maximize method maximizes the trend. When entering maximization mode, the Maximize parameter value passed in is "True." When exiting maximization mode, the Maximize parameter value passed in is "False."
Maximize()
| Parameter | Required | Description |
|---|---|---|
| True | Yes | Value passed in when entering maximization mode. |
| False | Yes | Value passed in when exiting maximization mode. |
The Print method prints the contents of the control, grid, or viewer. When this method is called, the Print dialog box is shown to allow configuration.
Print()
The PrintToDefaultPrinter method prints a trend grid to the default printer.
PrintToDefaultPrinter()
The ReadFromFile method reads the trend from a file.
ReadFromFile(FileName As String) As Boolean
| Parameter | Required | Description |
|---|---|---|
| FileName | Yes | Name of the file from which the trend will be read. |
The Refresh method refreshes the contents of the control from the Current Value Service (CVS).
Refresh()
For objects, the Restart method stops and restarts Run mode. For TheFrame/TheView, the Restart method restarts TheView with new site, service, and facility information, if applicable. See also RestartSoft.
Restart()
The ScrollBackward method scrolls the data window backward through trend time.
ScrollBackward()
The ScrollForward method scrolls the data window forward through trend time.
ScrollForward()
SelectNote selects a note item in the Trend Tool. Both this method and the Note Feed Tool method SetSelection must be called in order for a Trend Tool and a Note Feed Tool to synchronize. This method fires this tool's EventNoteSelected event.
SelectNote(NoteTag As String, SelectionState As Boolean)
| Parameter | Required | Description |
|---|---|---|
| NoteTag | Yes | Returns the unique identifier of the selected note in the format SITE.SERVICE~NOTENUMBER. |
| SelectionState | Yes | Returns a Boolean value that indicates that a note label is selected (True) or cleared (False). |
This method returns a Boolean value that indicates that selection was successful (True) or unsuccessful (False).
The SetAlarmLimitInfoXml method sets the trend’s alarm limit configuration XML string.
SetAlarmLimitInfoXml (NewXml As String)
| Parameter | Required | Description |
|---|---|---|
|
NewXml |
Yes |
Sets new XML string of alarm limit configurations. |
The SetMaximizedCheck method sets the check next to the Maximized context menu item.
SetMaximizedCheck(MaximizedCheck As Boolean)
| Parameter | Required | Description |
|---|---|---|
|
MaximizedCheck |
Yes |
Sets the check next to the Maximized context menu. |
The SetSelectedAlarmLimitSeries method changes or sets the series for which to display alarm limits.
SetSelectedAlarmLimitSeries (NewIndex As Short)
| Parameter | Required | Description |
|---|---|---|
|
NewIndex |
Yes |
Sets the index to the new series to display alarm limits. |
The UseCygNetMaximize method uses the CygNet version of maximize instead of ProEssentials.
UseCygNetMaximize()
The WriteToFile method writes the trend to a file.
WriteToFile(FileName As String) As Boolean
| Parameter | Required | Description |
|---|---|---|
| FileName | Yes | Name of the file to which the trend will be written. |