From OpenSCADAWiki
Jump to: navigation, search

Database using to store libraries of widgets and projects

Storing data widgets, widget libraries and projects is implemented in DB, accessible by OpenSCADA. The database is organized according to the data belonging to the library-project. That is, a separate library-project is stored in a separate group of database tables. The list of widget libraries is stored in the index table of libraries called "VCALibs" and the "Libs" structure, and the list of projects in the index table "VCAPrjs" and the structure "Projs". An instance of these tables is created in each database where the data of this module is stored. The tables belonging to the widget library and the project include the following:

  • "{DB_TBL}" — table of widgets belonging to the library (structure "LibWigets"), or pages belonging to the project (structure "ProjPages");
  • "{DB_TBL}_io" — table of working properties of widgets and nested widgets of the library (structure "LibWidgetIO") or properties of project pages (structure "ProjPageIO");
  • "{DB_TBL}_uio" — table of user properties of widgets and nested widgets of the library (structure "LibWidgetUserIO") or user properties of project pages (structure "ProjPageUserIO");
  • "{DB_TBL}_incl" — table of widgets, included in widgets-containers, of the library (structure "LibWidgetIncl") or the project (structure "ProjPageWIncl");
  • "{DB_TBL}_mime" — table of library resources and its widgets (structure "LibWidgetMime"), or the project and its pages (structure "ProjMime");
  • "{DB_TBL}_stls" — table of values of styled parameters of the project (structure "PrjStlsIO");
  • "{DB_TBL}_stl" — old-deprecated table of values of styled parameters of the project (structure "PrjStlIO");
  • "{DB_TBL}_ses" — table of data for the project execution mode, that is, sessions (the structure of "PrjSesIO").

At.png {DB_TBL} is currently formed in the way "wlb_{ID}" for libraries and "prj_{ID}" for the projects, and the separate field DB_TBL of the tables "Libs", "Projs" is deprecated and will be removed in the OpenSCADA 1.0 release!

Projections (structures) of basic tables are as follows:

  • Libs(ID, NAME, DSCR, DB_TBL, ICO) — libraries of the widgets ID.
ID — identifier;
NAME — name;
DSCR — description;
DB_TBL (DEPRECATED) — root of the tables of DB with the widgets;
ICO — encoded (Base64) image of the icon of the library.
  • LibWigets(ID, ICO, PARENT, PROC, PROC_PER, ATTRS, TIMESTAMP) — widgets ID of the library.
ID — identifier;
ICO — encoded (Base64) image of the icon of the widget.
PARENT — address of the basic widget, in the view /wlb_originals/wdg_Box;
PROC — internal procedure and procedure language of the widget;
PROC_PER — period of the computation of the widget procedure;
ATTRS — list of attributes of the widget, modified by the user.
TIMESTAMP — time-stamp of the last modification.
  • LibWidgetIO(IDW, ID, IDC, IO_VAL, SELF_FLG, CFG_TMPL, CFG_VAL) — work attributes ID of the widget IDW of the child widget IDC.
IDW — identifier of the widget;
ID — identifier of the attribute;
IDC — child widget identifier;
IO_VAL — value of the attribute;
SELF_FLG — internal flags of the attribute;
CFG_TMPL — template of the configuration element based on this attribute;
CFG_VAL — value of the configuration element (link, constant ...).
  • LibWidgetUserIO(IDW, ID, IDC, NAME, IO_TP, IO_VAL, SELF_FLG, CFG_TMPL, CFG_VAL) — user attributes ID of the widget IDW of the child widget IDC.
IDW — identifier of the widget;
ID — identifier of the attribute;
IDC — child widget identifier;
NAME — name of the attribute;
IO_TP — type and main flags of the attribute;
IO_VAL — value of the attribute;
SELF_FLG — internal flags of the attribute;
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) — included into the container IDW widgets ID.
IDW — identifier of the widget;
ID — identifier of the included widget instance;
PARENT — address of the basic widget, in the view /wlb_originals/wdg_Box;
ATTRS — list of attributes of the widget, modified by the user.
  • LibWidgetMime(ID, MIME, DATA) — audio, video, media and other resources of the widgets ID of the library.
ID — identifier of the resource.
MIME — MIME of the resource, in the format — "{MIME};{Size}".
DATA — resource data, encoded with Base64.
  • Projs(ID, NAME, DSCR, DB_TBL, ICO, USER, GRP, PERMIT, PER, FLGS, STYLE) — projects ID of the visualization interface.
ID — identifier of the project;
NAME — name of the project;
DSCR — description of the project;
DB_TBL (DEPRECATED) — root of the tables of DB with the pages;
ICO — encoded (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 — period of the project computation;
FLGS — flags of the project;
STYLE — typical style of the project.
  • ProjPages(OWNER, ID, ICO, PARENT, PROC, PROC_PER, FLGS, ATTRS, TIMESTAMP) — 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 — encoded (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 procedure and procedure language of the page;
PROC_PER — period of the computation of the widget procedure;
FLGS — flags of the page;
ATTRS — list of attributes of the widget, modified by the user;
TIMESTAMP — time-stamp of the last modification.
  • ProjPageIO(IDW, ID, IDC, IO_VAL, SELF_FLG, CFG_TMPL, CFG_VAL) — working attributes of the pages. The structure actually corresponds to the table "LibWidgetIO".
  • ProjPageUserIO(IDW, ID, IDC, 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) — widgets, included on the page. The structure actually corresponds to the table "LibWidgetIncl".
  • ProjMime(ID, MIME, DATA) — audio, video, media and other resources of the project pages. The structure actually corresponds to the table "LibWidgetMime".
  • PrjStls(SID, ID, VAL) — the value VAL of the field ID of the style IDS of the project.
IDS — identifier of the style;
ID — identifier of the style's field;
VAL — value of the style field.
  • PrjStl(ID, V_0, V_1, V_2, V_3, V_4, V_5, V_6, V_7, V_8, V_9) — value of the style's field ID of the project.
ID — identifier of the style's field;
V_{N} — value of the style's field for the style N.
  • ProjSess(IDW, ID, IO_VAL) — project table IDW for data storage of the sessions, performing the project.
IDW — full path of the project element;
ID — attribute of the element;
IO_VAL — value of the element.