From OpenSCADAWiki
Jump to: navigation, search

1 Subsystem "User interfaces" (SYS.UI)

1.1 Module QTStarter

The module object (SYS.UI.QTStarter)

  • Array sensors() — get all available sensors of the Qt mobility, returns "false" if no sensor is available.

1.2 Module UI.VCAEngine

User object model of the module VCAEngine.

Object "Session" ( this.ownerSess() )

  • string user( ) — current session user.
  • int alrmQuietance( int quit_tmpl, string wpath = "", bool ret = false ) — quiets of the violations wpath with the template quit_tmpl. If wpath is empty string then the global quietance makes. Into the string wpath, by symbol ';', can be enumerated addresses of several widgets. When set the ret, the quietance return is performed.
  • int reqTm( ) — last request time in seconds from the epoch of 1/1/1970.
  • string reqUser( ) — last request user.
  • string reqLang( ) — last request language.
  • int userActTm( ) — last user action time in seconds from the epoch of 1/1/1970.
  • bool uiCmd( string cmd, string prm, string src ) — sends a UI command of the pages managing, that is: "open", "next", "prev"; for more details see in the events section. This function must be in the priority of using to the pages managing before the direct writing to the page attributes "pgOpen" and "pgOpenSrc" due it is single method of the correct work with the linked pages.

Object "Widget" (this)

  • TCntrNodeObj ownerSess( ) — session object for the current widget.
  • TCntrNodeObj ownerPage( ) — parent page object for the current widget.
  • TCntrNodeObj ownerWdg( bool base = false ) — parent widget object for the current widget. If set base then returns the parent page objects also.
  • TCntrNodeObj wdgAdd( string wid, string wname, string parent ) — adds the new widget wid with the name wname and based on the library widget parent.
//Adds the new widget, based at the text primitive
nw = this.wdgAdd("nw", "New widget", "/wlb_originals/wdg_Text");
nw.attrSet("geomX", 50).attrSet("geomY", 50);
  • bool wdgDel( string wid ) — deletes the widget wid.
  • TCntrNodeObj wdgAt( string wid, bool byPath = false ) — attaches to child or global widget, by the path byPath. In the case of global connection, you can use absolute or relative path to the widget. For starting point of the absolute address acts the root object of the module "VCAEngine", which means the first element of the absolute address is session identifier, which is ignored. The relative address takes the countdown from the current widget. Special element of the relative address is an element of parent node "..".
  • Array attrList() — list of the widget attributes.
  • bool attrPresent( string attr ) — checks to presence fact of the attribute attr of the widget.
  • ElTp attr( string attr, bool fromSess = false ) — value of the attribute attr of the widget or from the session fromSess. For missing attributes will be return empty string.
  • TCntrNodeObj attrSet( string attr, ElTp vl, bool toSess = false ) — sets the value vl to the attribute attr of the widget or to the session, by toSess. The object is returned for the function concatenation.
  • string link( string attr, bool prm = false ) — link for the widget attribute attr. At set prm requests the link for the attributes block (parameter), represented by the attribute.
  • string linkSet( string attr, string vl, bool prm = false ) — sets the link for the widget attribute attr. At set prm, sets the link for the attributes block (parameter), represented by the attribute.
//Sets the link to the parameter for the eight trend
this.linkSet("el8.name", "prm:/LogicLev/experiment/Pi", true);
  • string {resource,mime}( string addr, string MIME = "" ) — resource object by the address addr (the direct link to the resource or the widget attribute contained the link) with the MIME, from the session table or the source. It is designed for the resource objects edition and that substitution to this session's context, for example, images SVG.
  • int {resourceSet,mimeSet}( string addr, string data, string MIME = "" ) — sets the resource object to data with MIME by the address addr.
  • int messDebug( string mess ); int messInfo( string mess ); int messNote( string mess ); int messWarning( string mess ); int messErr( string mess ); int messCrit( string mess ); int messAlert( string mess ); int messEmerg( string mess ); — formats of the program message mess with the category — the widget path.

Object "Widget" of the primitive "Document" (this)

  • string getArhDoc( int nDoc) — text of the archive document to "nDoc" depth (0-{aSize-1}).