Promotic

PmaDataTable - Deatiled object description

See: The PmaDataTable object

Various operations can be performed over values of the PmaDataTable object. For example:
- Offering values (for read and write) into the Web using the XML format. The client requiring data from this Web component is of the PmDataClient type from the licence point of view.
- Saving and setting values by methods: SaveToString, LoadFromString, SaveToFile, LoadFromFile, GetArray, SetArray, etc.
- Finding values by the FindValue method.
- Sorting rows by the Sort method.
- etc.


The PmaDataTable object can be used in various ways:
It is possible, for example, to define columns in the development environment (see the "Columns" tab), define how many rows have to be in the table (see the "DataTable" tab) and then only read and write values in the running application (see the GetCellValue and SetCellValue methods) from this table.
It is also possible to define neither columns nor rows and to create and remove them dynamically in the running application (see the InsertRow, RemoveRow, InsertCol, RemoveCol methods). But adding and removing columns are limited by the fact that thereat even all rows of the table are removed.
It is possible to define columns and rows in the development environment and then to change them dynamically.
Maximum row number depends on PROMOTIC runtime licence and is: PmRtProf: 65535, PmRtFree: 30 and PmRtXX: XX (for example PmRt100: 100).
Maximum number of columns depends on PROMOTIC runtime licence and is: PmRtProf: 65535, PmRtFree: 30 and PmRtXX: XX (for example PmRt100: 100).

"Read only" columns:
Each cell of the table is counted into the application size for the purpose of licencing. But if a column of table in the PmaDataTable object is marked as "Read only", then the cells in this column are not counted into application size. This allows application designers to use this object for storing non-changing configuration values while the number of licenced variables is kept low. From the functional point of view this means that columns marked "Read only" can be written only once. Limitations of individual methods of the PmaDataTable object caused by "Read only" columns are explained in remark of this method.
Each cell is empty at the beginning. The cell is considered empty also if it contains numeric value 0 or an empty string "". New value can be written into such cell. After writing a non-zero value into the "Read only" column the cell is "locked". "Locked cell" becomes a constant and cannot be written again. Other still "unlocked" cells can be written into as needed. Methods that write into multiple cells simultaneously will write the values only into "unlocked cells" while the content of "locked" cells remains unchanged.
If at least one cell is locked in "Read only" column by writing non-empty value, then the whole structure of the table is locked. Then it is no longer possible to add or remove rows or columns or change the structure of the table. The structure and dimensions of the table must be defined and modified before writing first non-empty value into a cell in "Read only" column.

The data representation in the panel:
The connection to values of the table can be defined directly in Pmg objects by the "PP - Data binding to Pma object property" data binding. In the object property enter point of this binding it must be entered manually the following: Item(row,col), where row and col are indexes of the required row and column.
The PmgWTable object can be bound to values of the PmaDataTable object by the information object that can be obtained by the GetInfo method. It means that from the PmaDataTable object it is possible by the GetInfo method to get the object that is then inserted into the PmgWTable by the PmgWTable.FillFromInfo method, for example as follows:
 
VBScriptSelect and copy to clipboard

Dim oTable, oDataTable
Set oTable = pMe.Pm("/Wnd/MyPanel").Items("/MyTab")
Set oDataTable = pMe.Pm("/Data/Params")
oTable.FillFromInfo oDataTable.GetInfo("data"), "bind"
 
Here it is presumed that in the Pma objects tree the PmaPanel object is on the "/Wnd/MyPanel" path and the PmaDataTable object on the "/Data/Params" path. If the "MyPanel" window panel is opened and it contains the Pmg object named "MyTab", then we can call this script. It (see the last line) will fill up the PmgWTable object by data from the PmaDataTable object and they will be bound (bind parameter) so that on each calling the PmgWTable.Draw method the content of the PmgWTable object will be refreshed.
See also:
- PmaData (object)
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.