C# Класс MATLABfromCSharp.MainControl

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Описание методов

ImportToAF() публичный Метод

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.
Результат void

MainControl() публичный Метод

Starts up the Desktop Matlab or attaches to COM-Enabled Matlab. to Com-Enable Matlab use [ enableservice('AutomationServer',true);]
public MainControl ( ) : System
Результат System

checkMatlab() публичный Метод

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.
Результат void

currentDataPrefChanges() публичный Метод

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.
Результат void

getAFData() публичный Метод

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)
Результат void

getAFDatabase() публичный Метод

Returns the AFDatabase that the MainControl is using.
public getAFDatabase ( ) : AFDatabase
Результат AFDatabase

getAttributes() публичный Метод

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
Результат AFAttributes

getPIData() публичный Метод

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)
Результат void

getPIPoints() публичный Метод

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
Результат List

importLog() публичный Метод

Imports a saved file into Matlab.
public importLog ( string path ) : string[]
path string The path to the importe File.
Результат string[]

saveCurrentLog() публичный Метод

Calls the LogSystem.Save method.
public saveCurrentLog ( string filePath ) : void
filePath string The path to where the file will be written.
Результат void

saveMatlabLog() публичный Метод

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.
Результат void

setAFDatabase() публичный Метод

Sets the AFDatabase that the MainControl will use.
public setAFDatabase ( string currentDatabase ) : void
currentDatabase string The name of the AFDatabase.
Результат void

setMainForm() публичный Метод

Give the MainControl access to the MainForm
public setMainForm ( MainForm form ) : void
form MainForm The Main Form
Результат void