4.12. Using the database to store the library of widgets and projects
All the data of the VCA conception should be stored in the DB. This would allow flexibly to distribute and use the VCA data, choosing the most suitable database from the list of supported by the OpenSCADA. The projections of the main tables we'll write as follows:
- Libs( ID, NAME, DSCR, DB_TBL, ICO ) - Libraries of widgets <ID>.
ID - identifier;
NAME - name;
DSCR - description;
DB_TBL - DB with widgets;
ICO - coded (Base64) image of the icon of the library.
- LibWigets( ID, ICO, PARENT, PROC, PROC_PER, USER, GRP, PERMIT, ATTRS, DBV) - Widgets <ID> of the library.
ID - identifier;
ICO - coded (Base64) image of the icon of the widget.
PARENT - address of the basic widget /wlb_originals/wdg_Box ;
PROC - internal script and script language of the widget;
PROC_PER - frequency of the computation of the script of the widget;
USER - owner of the widget;
GRP - users group of the widget;
PERMIT - rights of access to the widget;
ATTRS - list of attributes of the widget, modified by the user;
DBV - DB version.
- LibWidgetIO( IDW, IDC, ID, IO_VAL, SELF_FLG, CFG_TMPL, CFG_VAL ) - Work attributes <ID> of the widget <IDW>.
IDW - identifier of the widget;
IDC - child widget identifier;
ID - identifier of the IO;
IO_VAL - value of the attribute;
SELF_FLG - internal flags of the IO;
CFG_TMPL - template of the configuration element based on this attribute;
CFG_VAL - value of the configuration element (link, constant ...).
- LibWidgetUserIO( IDW, IDC, ID, NAME, IO_TP, IO_VAL, SELF_FLG, CFG_TMPL, CFG_VAL ) - User attributes <ID> of the widget <IDW>.
IDW - identifier of the widget;
IDC - child widget identifier;
ID - identifier of the IO;
NAME - name of the IO;
IO_TP - type and main flags of the IO;
IO_VAL - value of the IO;
SELF_FLG - internal flags of the IO;
CFG_TMPL - template of the configuration element based on this attribute;
CFG_VAL - value of the configuration element (link, constant ...).
- LibWidgetIncl( IDW, ID, PARENT, ATTRS, USER, GRP, PERMIT, DBV ) - Included into the container <IDW> widgets <ID>.
IDW - identifier of the widget;
ID - Identifier of the copy of the embedded widget;
PARENT - address of the basic widget /wlb_originals/wdg_Box ;
ATTRS - list of attributes of the widget, modified by the user;
USER - owner of the widget;
GRP - users group of the widget;
PERMIT - rights of access to the widget;
DBV - DB version.
- LibWidgetMime( ID, MIME, DATA ) - Audio, video, media and other resources of widgets of the library.
ID - identifier of the resource.
MIME - Mime data type of the resource (in the format - <mimeType;Size>).
DATA - Resource data coded with Base64.
- Project( ID, NAME, DSCR, DB_TBL, ICO, USER, GRP, PERMIT, PER, FLGS, DBV ) - Projects of visualization interfaces <ID>.
ID - identifier of the project;
NAME - name of the project;
DSCR - description of the project;
DB_TBL - Database with project pages.
ICO - coded (Base64) image of the icon of the project;
USER - owner of the project;
GRP - users group of the project;
PERMIT - rights of access to the project;
PER - frequency of the computation of the project;
FLGS - flags of the project;
DBV - DB version.
- ProjPage( OWNER, ID, ICO, PARENT, PROC, PROC_PER, USER, GRP, PERMIT, FLGS, ATTRS ) - The pages <ID> which are hold in the project/page OWNER>.
OWNER - project/page - owner of the page (in the format - "/AGLKS/so/1/gcadr")
ID - identifier of the page;
ICO - coded (Base64) image of the icon of the page;
PARENT - address of the basic widget of the page in the format: /wlb_originals/wdg_Box ;
PROC - internal script and script language of the page;
PROC_PER - frequency of the computation of the script of the widget;
USER - owner of the page;
GRP - users group pf the page;
PERMIT - rights of access to the page;
FLGS - flags of the page;
ATTRS - list of attributes of the widget, modified by the user.
- ProjSess( IDW, ID, IO_VAL ) - Project table <IDW> for data storage of the sessions, performing project.
IDW - the full path of the element of the project;
ID - attribute of the element;
IO_VAL - value of the element.
- ProjPageIO( IDW, ID, IO_VAL, SELF_FLG, CFG_TMPL, CFG_VAL ) - Working attributes of the pages. The structure actually corresponds to the table LibWidgetIO.
- ProjPageUserIO( IDW, ID, NAME, IO_TP, IO_VAL, SELF_FLG, CFG_TMPL, CFG_VAL ) - User attributes of the pages. The structure actually corresponds to the table LibWidgetUserIO.
- ProjPageWIncl( IDW, ID, PARENT, ATTRS, USER, GRP, PERMIT ) - Enabled widgets on the page. The structure actually corresponds to the table LibWidgetIncl.