Skip to main content
Definition: LIBS/DataExplorer/PHXDataHistory/PHXDataHistory.odl (line 139) The Data History is the back-end data storage piece of a Data Explorer. It contains no GUI. Inherits from:

Members

Properties

Property suggestedIndependantVar

Definition: LIBS/DataExplorer/PHXDataHistory/PHXDataHistory.odl (line 1)
The name of the suggested independent Variable. Deprecated: (misspelling) Return type: BSTR

Property suggestedIndependentVar

Definition: LIBS/DataExplorer/PHXDataHistory/PHXDataHistory.odl (line 1)
The name of the suggested independent Variable. Return type: BSTR

Property suggestedDependentVars

Definition: LIBS/DataExplorer/PHXDataHistory/PHXDataHistory.odl (line 1)
An array of strings which are the suggested Variable names to use for dependent Variables in plots. Return type: VARIANT

Property suggestedCountFrom

Definition: LIBS/DataExplorer/PHXDataHistory/PHXDataHistory.odl (line 1)
Suggested number to use when showing the runs in a GUI as the first run number. Typically 0 or 1. Has no effect on internal API calls. Return type: long

Property id

Definition: LIBS/DataExplorer/PHXDataHistory/PHXDataHistory.odl (line 178)
IPHXDataExplorerPointer which gives you access to the associated Data Explorer object. Return type: settingRun

Property centerLinkServer

Definition: LIBS/DataExplorer/PHXDataHistory/PHXDataHistory.odl (line 1)
Return type: BSTR

Property centerLinkRunMatrixID

Definition: LIBS/DataExplorer/PHXDataHistory/PHXDataHistory.odl (line 1)
Return type: BSTR

Property centerLinkJobConnector

Definition: LIBS/DataExplorer/PHXDataHistory/PHXDataHistory.odl (line 1)
Return type: BSTR

Property centerLinkQueue

Definition: LIBS/DataExplorer/PHXDataHistory/PHXDataHistory.odl (line 1)
Return type: BSTR

Property dataHistoryToModel

Definition: LIBS/DataExplorer/PHXDataHistory/PHXDataHistory.odl (line 1)
Get or set the Data History to Model object (see _DPHXDataHistoryToModel). Return type: LPDISPATCH

Property warmStartStudyComplete

Definition: LIBS/DataExplorer/PHXDataHistory/PHXDataHistory.odl (line 1)
Gets/Sets warm-start trade study complete flag. Return type: boolean

Property tradeStudyModelFile

Definition: LIBS/DataExplorer/PHXDataHistory/PHXDataHistory.odl (line 1)
Gets/Sets the temp model file name saved for crash recovery of trade studies. This file will be DELETED when datahistory destructs. Return type: BSTR

Public functions

Function addVariable

Adds a Variable to the Data History. All existing runs are appended with a blank value for this Variable. Parameters: Parameters:
  • LPDISPATCH var
Return type: void

Function setNumExpectedRuns

Sets the expected number of runs. Used for informational and GUI purposes. Parameters:
  • numRuns: The expected number of runs.
Parameters:
  • long numRuns
Return type: void

Function startRuns

Identifies that the runs are starting. Return type: void

Function endRuns

Tells the Data History that all runs are now complete. It will pass the data along as an event. Return type: void

Function getNumFailedRuns

Get the number of runs with an Error ID which is not equal to 0. Returns: The number of failed runs. Return type: long

Function getErrorID

Get the error ID for a particular run. Parameters:
  • run: The 0 based index to the run to access.
Returns: The error ID. 0 means success. All other values mean failure. Parameters:
  • long run
Return type: long

Function getErrorMessage

Returns the error message for a particular run. Parameters:
  • run: The 0 based index to the run to access.
Returns: The error message of the run. Parameters:
  • long run
Return type: BSTR

Function setError

Sets the error for a run. Parameters:
  • run: The 0 based index to the run to access.
  • errorID: The error ID. 0 is considered success. All other values are failure.
  • message: The text for the error.
Parameters:
  • long run
  • long errorID
  • BSTR message
Return type: void

Function getNumRuns

Returns the number of runs currently in the matrix. Returns: The total number of runs. Return type: long

Function getNumVariables

Returns the number of Variables currently in the matrix. Returns: The number of variables. Return type: long

Function setResult

Sets the result for a run. Parameters:
  • index: Either a 0 based index to the Variable, or the name of a Variable.
  • run: The 0 based index to the run to access.
  • value: The value of the Variable for this run.
  • valid: Whether this value is valid.
  • modified: Whether this value’s modified flag is set.
Parameters:
  • VARIANT index
  • long run
  • VARIANT value
  • boolean valid
  • boolean modified
Return type: void

Function getValue

Gets the value of a Variable for a particular run. Parameters:
  • index: Either a 0 based index to the Variable, or the name of a Variable.
  • run: The 0 based index to the run to access.
Returns: The value of the variable. Parameters:
  • VARIANT index
  • long run
Return type: VARIANT

Function isValid

Returns whether the valid flag is set for a Variable for a particular run. Parameters:
  • index: Either a 0 based index to the Variable, or the name of a Variable.
  • run: The 0 based index to the run to access.
Returns: True if the variable is valid, else false. Parameters:
  • VARIANT index
  • long run
Return type: boolean

Function isModified

Returns whether the modified flag is set on a Variable for a particular run. Parameters:
  • index: Either a 0 based index to the Variable, or the name of a Variable.
  • run: The 0 based index to the run to access.
Returns: True if the modified flag is true, else false. Parameters:
  • VARIANT index
  • long run
Return type: boolean

Function toCSVFile

Writes a CSV file of all the data in the Data History. Parameters:
  • fileName: The file to write.
  • variablesInRows: If true, variables will be in rows. If false, they will be in columns.
  • includeFailed: Whether to include failed runs in the output.
Parameters:
  • BSTR fileName
  • [optional] VARIANT variablesInRows
  • [optional] VARIANT includeFailed
Return type: void

Function toXML

Writes the Data History contents to an XML string. Parameters:
  • includeRunData:
Returns: The XML string. Parameters:
  • [optional] VARIANT includeRunData
Return type: BSTR

Function toXMLFile

Writes the Data History contents to an XML file. Parameters:
  • fileName: The file to write. It will be overwritten if it exists, or created if it doesn’t.
  • includeRunData:
Parameters:
  • BSTR fileName
  • [optional] VARIANT includeRunData
Return type: void

Function fromXML

Tells the Data History to load its state from the XML string passed in. Parameters:
  • xmlStr: The XML string to read.
  • root: The node ID of the node to begin reading at. This is useful if you are loading a larger document which contains a Data History node as a child.
Parameters:
  • BSTR xmlStr
  • [optional] VARIANT root
Return type: void

Function fromXMLFile

Tells the Data History to load its state from the XML file passed in. Parameters:
  • fileName: The name of the file to read.
  • root: The node ID of the node to begin reading at. This is useful if you are loading a larger document which contains a Data History node as a child.
Parameters:
  • BSTR fileName
  • [optional] VARIANT root
Return type: void

Function toCSV

Returns a CSV string of all the data in the Data History. Parameters:
  • variablesInRows: If true, variables will be in rows. If false, they will be in columns.
  • includeFailed: Whether to include failed runs in the output.
Returns: The string of comma-seperated values. Parameters:
  • [optional] VARIANT variablesInRows
  • [optional] VARIANT includeFailed
Return type: BSTR

Function getNumNonEmptyRuns

Returns the number of runs which have at least one piece of data filled in. Returns: The number of runs that contain data. Return type: long

Function getVariable

Gets the IDHVariable object for a particular Variable. Parameters:
  • index: Either a 0 based index to the Variable, or the name of a Variable.
Returns: An IDispatch* to the IDHVariable object. Parameters:
  • VARIANT index
Return type: IDispatch *

Function createVariable

Creates a new IDHVariable object so that you can fill it in and pass it to addVariable. Returns: An IDispatch* to a newly created IDHVariable object. Return type: IDispatch *

Function isRunning

Returns true if the running flag is set. Returns: True if running flag is set, else false. Return type: boolean

Function getNumExpectedRuns

Returns the number of runs expected for this Trade Study. Returns: The number of expected runs. Return type: long

Function getRunName

Returns the human readable name for a particular run. Usually this is blank, but can be used for things like Design Histories and snapshots. Parameters:
  • runNum: The 0 based index to the run to access.
Returns: The name of the particular run. Parameters:
  • long runNum
Return type: BSTR

Function setRunName

Sets the name of a run. This name typically will show up in the run header for the Table View and is only used for Snapshots and Design Histories. Parameters:
  • runNum: The 0 based index to the run to access.
  • name: The name of the run.
Parameters:
  • long runNum
  • BSTR name
Return type: void

Function insertRun

Inserts a blank run. Parameters:
  • insertBefore: The 0 based index to the run to reference. May be -1 to insert at the end. Usually -1 is not needed because setValue call will add runs automatically as necessary.
Parameters:
  • long insertBefore
Return type: void

Function deleteRun

Deletes all the data for a numbered run. Parameters:
  • run: The 0 based index to the run to delete.
Parameters:
  • long run
Return type: void

Function deleteVariable

Deletes a Variable from the Data History Parameters:
  • index: Either a 0 based index to the Variable, or the name of a Variable.
Parameters:
  • VARIANT index
Return type: void

Function getFormattedValue

Returns the value of a Variable for a run formatted according to the Variable’s formatting mode. Parameters:
  • index: Either a 0 based index to the Variable, or the name of a Variable.
  • run: The 0 based index to the run to access.
Returns: The formatted value of the variable. Parameters:
  • VARIANT index
  • long run
Return type: BSTR

Function setFormattedResult

Sets the result for a run using formatted string text. Parameters:
  • index: Either a 0 based index to the Variable, or the name of a Variable.
  • run: The 0 based index to the run to access.
  • value: The value of the Variable for this run, as a formatted string.
  • valid: Whether this value is valid.
  • modified: Whether this value’s modified flag is set.
Parameters:
  • VARIANT index
  • long run
  • BSTR value
  • boolean valid
  • boolean modified
Return type: void

Function getNumCustomVars

Returns the number of Variables which are marked as Custom Variables. Returns: The number of custom variables. Return type: long

Function getUniqueID

Gets an ID that uniquely identifies this Data History with the current running process. Is not unique across multiple processes. Returns: The unique ID for this DataHistory object. Return type: long

Function getVariableValues

Gets all the values of a variable as an array of variants. Parameters:
  • index: The 0 based index or name of the variable to query.
Parameters:
  • VARIANT index
Return type: VARIANT

Function createDesignVariable

Creates a design variable with the same properties and data as the specified variable. Parameters:
  • index: The 0 based index of the variable to copy.
Returns: The index of the newly created variable. Parameters:
  • VARIANT index
Return type: long

Function addVariableAt

Adds a Variable to the Data History. All existing runs are appended with a blank value for this Variable. Parameters:
  • var: Pass in a filled in IDHVariable object from a previous call to createVariable().
  • location: The 0 based index of where to put the variable. Data History will enforce that variables are grouped first by design variables, then non-design variables.
Parameters:
  • LPDISPATCH var
  • long location
Return type: void

Function setVariableValues

Sets all values of a variable as a chunk. Parameters:
  • index: Variable ID (0-based index).
  • run: Run ID (0-based index).
  • values: Array of values.
  • valid: Whether values are valid.
  • modified: Whether values should appear as modified.
Parameters:
  • VARIANT index
  • long run
  • VARIANT values
  • boolean valid
  • boolean modified
Return type: void

Function isHighlighted

Check highlight state. Parameters:
  • run: Run ID (0-based index).
Returns: True if hightlighted, false otherwise. Parameters:
  • long run
Return type: boolean

Function highlight

Highlight or unhighlight a run. ?> setting this will reset your highlighted items to just this item, or in the case of unhighlighting it will unhighlight all items. Parameters:
  • run: Run ID (0-based index).
  • highlight: True to highlight, false to remove highlight.
  • handleEvent: Handle highlight event in the listener.
Parameters:
  • long run
  • boolean highlight
  • boolean handleEvent
Return type: void

Function getNumDesignVariables

Returns the number of Variables which are marked as Design Variables. Returns: The number of design variables. Return type: long

Function setTradeStudySetup

Sets the trade study XML setup data. Parameters:
  • setup: The XML string to set up the trade study.
Parameters:
  • BSTR setup
Return type: void

Function getTradeStudySetup

Gets the trade study setup, in XML form, used for generating the data. Returns: The XML representaion of the trady study setup. Return type: BSTR

Function setTradeStudyType

Sets the trade study type that generated the data (“DOE”, “PAT”, etc). Parameters:
  • type: The type of trade study.
Parameters:
  • BSTR type
Return type: void

Function getTradeStudyType

Gets the trade study type that generated the data (“DOE”, “PAT”, etc). Returns: The type of trade study. Return type: BSTR

Function setShortVariableNames

Sets a flag that determines if variables will be returned in long or short form. Parameters:
  • shortenVariableNames: True to shorten variable names.
Parameters:
  • boolean shortenVariableNames
Return type: void

Function setRunValues

Sets all values of a variable as a chunk. Parameters:
  • run: Run ID (0-based index).
  • values: Array of values.
  • valid: Whether values are valid.
  • modified: Whether values should appear as modified.
Parameters:
  • long run
  • VARIANT values
  • BOOL valid
  • BOOL modified
Return type: void

Function getFailedRunIndexes

Gets an array which contains all the indexes of runs which have errors. Returns: An array of long values. Return type: VARIANT

Function toXMLSaveContext

Writes the Data History contents to an XML file. Parameters:
  • saveContext: Context to use when loading this file, used for storing large files and other data contained in the save file but not directly in the XML.
  • includeRunData:
Parameters:
  • LPDISPATCH saveContext
  • [optional] VARIANT includeRunData
Return type: void

Function fromXMLSaveContext

Tells the Data History to load its state from the XML file passed in. Parameters:
  • saveContext: Context to use when loading this file, used for storing large files and other data contained in the save file but not directly in the XML.
  • root: The node ID of the node to begin reading at. This is useful if you are loading a larger document which contains a Data History node as a child.
Parameters:
  • LPDISPATCH saveContext
  • [optional] VARIANT root
Return type: void

Function getCompletedRunIndices

Gets an array which contains all the indices of runs which completed Returns: An array of long values. Return type: VARIANT

Function isRunComplete

Gets whether the run is complete or not Parameters:
  • run: Run ID (0-based index).
Returns: Whether the run has completed or not Parameters:
  • long run
Return type: boolean

Function addCheckpoint

Add a warm start checkpoint to the cache Parameters:
  • name: name for the checkpoint
  • value: value for the checkpoint
Parameters:
  • long runNumber
  • BSTR value
Return type: void

Function getNumCheckpoints

Gets the number of warm start checkpoints available Returns: the number of warm start checkpoints available Return type: long

Function getCheckpointValue

Gets the wam start checkpoint’s value, the caller is responsible for releasing the BSTR memory. Parameters:
  • checkpointIndex: Checkpoint Index (0-based index)
Returns: the checkpoint value Parameters:
  • long checkpointIndex
Return type: BSTR

Function getCheckpointRunNumber

Gets the warm start checkpoint’s run number Parameters:
  • checkpointIndex: Checkpoint Index (0-based index)
Returns: the checkpoint run number Parameters:
  • long checkpointIndex
Return type: long

Function setUniqueID

Sets an ID that uniquely identifies this Data History. Parameters:
  • identifier: The unique ID for this DataHistory object.
Parameters:
  • long identifier
Return type: void

Function getNumCompletedRuns

Retrieves the number of completed runs for the current trade study. Returns: The number of completed runs for the current trade study Return type: long

Function getCompletedRunData

Gets runIDs, error IDs, error messages, and variable values for completed runs of only design variables unless allVariables param is set to true. ?> If the PHXDataHistoryEvents::dataChanged event is fired with a runIndex of -1, the completed-run list is purged and reconstructed. Therefore the next call to this method should restart startSequenceNumber with 0. ?> If a startSequenceNumber is given that is greater than the number of items in the completed-run list (out of range), this method will act as if a startSequenceNumber of 0 had been given. Parameters:
  • runIDs: array of longs, runIDs that have recently completed.
  • errorIDs: array of longs, error IDs for each corresponding run in runIDs.
    0 indicates success, all other values indicate failure.
  • errorMessages: array of strings, error messages for each corresponding run in runIDs.
  • variableValues: multi-dimensional array of VARIANTs, variable values. First index is for each run in runIDs and the second index is for each variable.
  • endSequenceNumber: index of the last avalable completed run. Will be -1 if there are no completed runs avalable.
  • startSequenceNumber: index in the completed-run list to begin fetching from. Defaults to 0, the start of the list.
  • maxLength: maximum number of completed runs to fetch. Defaults to requesting all available runs.
  • allVariables: flag if true will result in run data returned for all variables else only design variable data will be returned
Returns: next startSequenceNumber to use in next call to getCompletedRunData. This value may be greater than (startSequenceNumber + runs) if a given run completed multiple times due to re-runs. Parameters:
  • [out] VARIANT * runIDs
  • [out] VARIANT * errorIDs
  • [out] VARIANT * errorMessages
  • [out] VARIANT * variableValues
  • [out] LONG * endSequenceNumber
  • [in, defaultvalue(0)] ULONG startSequenceNumber
  • [in, defaultvalue(0xFFFFFFFF)] ULONG maxLength
  • [in, defaultvalue(FALSE)] boolean allVariables
Return type: ULONG

Function getHighlightedRuns

Retrieve the set of currently highlighted run indices Returns: the set of currently highlighted run indices as an array of integers Return type: VARIANT

Function setHighlightedRuns

Specify the set of currently highlighted run indices. ?> This will overwrite the existing highlighted runs. Parameters:
  • selectedRunIndices: the set of run indices to highlight, specified by either a single integer, numeric string, array of integers, or array of numeric strings. Specifying an empty or null value will remove all highlighted run indices.
Exceptions:
  • COM: exception thrown if passed non-numeric types or arrays of non-numeric types.
Parameters:
  • VARIANT selectedRunIndices
Return type: void

Function addVariableStructs

Sets the results for a run. This method will add variables to the DataHistory if they are not already present File variables are not supported, their value cannot be represented in a DataHistoryVariableStruct Parameters:
  • dhVarStructs: SAFEARRAY of DataHistoryVariableStructs to add
  • run: The 0 based index to the run to set.
Parameters:
  • VARIANT dhVarStructs
  • long run
Return type: void

Private functions

Function fromCenterLink

Parameters:
  • BSTR serverName
  • BSTR runMatrixID
  • BSTR userName
  • BSTR password
Return type: void

Function setUsernamePassword

Parameters:
  • BSTR username
  • BSTR password
Return type: void

Function setResultAsFile

Parameters:
  • VARIANT index
  • long run
  • boolean valid
  • boolean modified
  • BSTR tempFileName
  • BSTR tempFileDir
Return type: void

Function getDatabaseFile

Return type: BSTR

Function setDatabaseFile

Parameters:
  • BSTR filename
Return type: void

Function removeAutosave

Return type: void

Function getVariable2

Parameters:
  • VARIANT index
Return type: IDispatch *

Function getVariableTempDir

Parameters:
  • VARIANT index
Return type: BSTR