C# Class MATLABfromCSharp.MainControl

Afficher le fichier Open project: osisoft/PI-to-MATLAB-Utility Class Usage Examples

Méthodes publiques

Méthode Description
ImportToAF ( string path, string workspaceVariableName, string AFName ) : void

Gets value from Matlab and writes it to AF.

Will not write, if the Attribute is read-only. A Matlab Variable Name must be input.

MainControl ( ) : System

Starts up the Desktop Matlab or attaches to COM-Enabled Matlab. to Com-Enable Matlab use [ enableservice('AutomationServer',true);]

checkMatlab ( bool showDialog ) : void

Checks to see if Matlab is still open and asks to Reload the logged data and reopens matlab.

currentDataPrefChanges ( bool timestamp, int datapref, string format ) : void

Passes the Data Preferences from the MainForm to the AFAccess.

getAFData ( string server_database, string attName, string MatlabName, string searchPath, string start, string end, bool edit ) : void

Accesses the AFServer to get data.

getAFDatabase ( ) : AFDatabase

Returns the AFDatabase that the MainControl is using.

getAttributes ( string path ) : AFAttributes

Uses the Element Path to access the Attributes.

The AFTreeView is implemented with ToolTipText is the path to the selected Element.

getPIData ( string point, string server, string MatlabName, string start, string end, bool edit ) : void

Get the Data from PIServer using AFSDK.

getPIPoints ( PISystem sys, PIServer serv ) : List

Accesses the PIServer to get the PIPoints that are available.

importLog ( string path ) : string[]

Imports a saved file into Matlab.

saveCurrentLog ( string filePath ) : void

Calls the LogSystem.Save method.

saveMatlabLog ( string filePath ) : void

Not implemented. Future use: writes a matlab that imports the same data.

setAFDatabase ( string currentDatabase ) : void

Sets the AFDatabase that the MainControl will use.

setMainForm ( MainForm form ) : void

Give the MainControl access to the MainForm

Method Details

ImportToAF() public méthode

Gets value from Matlab and writes it to AF.
Will not write, if the Attribute is read-only. A Matlab Variable Name must be input.
public ImportToAF ( string path, string workspaceVariableName, string AFName ) : void
path string The path to the Element to search with.
workspaceVariableName string The variable name in Matlab being used.
AFName string The attribute name in AF being written to.
Résultat void

MainControl() public méthode

Starts up the Desktop Matlab or attaches to COM-Enabled Matlab. to Com-Enable Matlab use [ enableservice('AutomationServer',true);]
public MainControl ( ) : System
Résultat System

checkMatlab() public méthode

Checks to see if Matlab is still open and asks to Reload the logged data and reopens matlab.
public checkMatlab ( bool showDialog ) : void
showDialog bool Whether to show a dialog with yes or no.
Résultat void

currentDataPrefChanges() public méthode

Passes the Data Preferences from the MainForm to the AFAccess.
public currentDataPrefChanges ( bool timestamp, int datapref, string format ) : void
timestamp bool true: exports the timestamp to Matlab.
datapref int Integer for Attribute.GetValues; 0(raw), negative(sampling), positive(profiled sampling)
format string String representation of the Data Preferences.
Résultat void

getAFData() public méthode

Accesses the AFServer to get data.
public getAFData ( string server_database, string attName, string MatlabName, string searchPath, string start, string end, bool edit ) : void
server_database string The string of the server and database 'server'-'database'
attName string Name of the Attribute.
MatlabName string Variable name to be used in Matlab workspace.
searchPath string The path to the Element.
start string The time at which data will start being imported from.
end string The time when data will stop being imported.
edit bool true: Adds the log input into the LogSystem (generally true)
Résultat void

getAFDatabase() public méthode

Returns the AFDatabase that the MainControl is using.
public getAFDatabase ( ) : AFDatabase
Résultat AFDatabase

getAttributes() public méthode

Uses the Element Path to access the Attributes.
The AFTreeView is implemented with ToolTipText is the path to the selected Element.
public getAttributes ( string path ) : AFAttributes
path string The pathway to the Element
Résultat AFAttributes

getPIData() public méthode

Get the Data from PIServer using AFSDK.
public getPIData ( string point, string server, string MatlabName, string start, string end, bool edit ) : void
point string The name of the PIPoint.
server string The PIServer
MatlabName string The name of the variable to be used for Matlab.
start string The time to start taking data from.
end string The time to stop taking data from.
edit bool true: Adds the log to the LogSystem (generally true)
Résultat void

getPIPoints() public méthode

Accesses the PIServer to get the PIPoints that are available.
public getPIPoints ( PISystem sys, PIServer serv ) : List
sys PISystem The current PISystem
serv PIServer The current PIServer
Résultat List

importLog() public méthode

Imports a saved file into Matlab.
public importLog ( string path ) : string[]
path string The path to the importe File.
Résultat string[]

saveCurrentLog() public méthode

Calls the LogSystem.Save method.
public saveCurrentLog ( string filePath ) : void
filePath string The path to where the file will be written.
Résultat void

saveMatlabLog() public méthode

Not implemented. Future use: writes a matlab that imports the same data.
public saveMatlabLog ( string filePath ) : void
filePath string The path to where the file will be written.
Résultat void

setAFDatabase() public méthode

Sets the AFDatabase that the MainControl will use.
public setAFDatabase ( string currentDatabase ) : void
currentDatabase string The name of the AFDatabase.
Résultat void

setMainForm() public méthode

Give the MainControl access to the MainForm
public setMainForm ( MainForm form ) : void
form MainForm The Main Form
Résultat void