8.4 Generic URN conventions
urn, stands for Uniform Resource Name, which are used in SDT to designate, select or build objects. This is used throughout SDT for models, GUI, design or experiments.
8.4.1 Format dependent string conversion (urnCb, urnVal)
The specification of callbacks is handled by sdtm.urnCb which follows the rules
-
@fun is translated to the function handle @fun and the callback is executed using fun(obj,evt).
- fun@cmd assumes that fun contains a subfunction cmd and that a handle to it is obtained using fun('@cmd').
- fun(cmd) is translated to {@fun,cmd} and the callback is executed using fun(obj,evt,cmd).
- after transformation to a cell array. When the URN is evaluated made within a function, strings of the form '$var' are replaced by the local variable var in the function calling sdtm.urnCb. For example a=101;cb=sdtm.urnCb('disp($a)');feval(cb{:}).
Vector generation handled by sdtm.urnValG (which is called with the %g format)
-
numeric values are not transformed.
- @log(lmin,lmax,n) uses logspace(lmin,max,n). @ll(min,max,n) uses logspace(log10(lmin),log10(max),n). @lin(min,max,n) uses linspace(lmin,max,n).
- {a,b} is converted to a numeric vector [a,b].
- /str returns 1./val with val the interpretation of str.
Vector generation handled by sdtm.urnValUG (which is called with the %ug format) eases the specification of units by considering the following replacements : nano n by 1e-9, micro u by 1e-6, milli m by 1e-3,unit no replacement, kilo k by 1e3, mega M by 1e6, giga G by 1e9.
Vector generation handled by sdtm.urnValS (which is called with variants of the %s format)
-
%s,g,.,dim transforms to/from a numeric matrix with dim columns.
- %s,s,1 transforms to/from a cell array of strings with 1 row.
8.4.2 Search for graphical objects by name sdth.urn
This is a partial list of ongoing uniformed naming of graphical objects. The naming can be
-
absolute as in cf=sdth.urn('Dock.Id.ci') where there can only be a single Id dock and it contains a main iiplot figure labeled ci
- relative to a graphical object as in ub=sdth.urn('Tab.Channel',gf) where gf can be a figure number, or an SDT handle pointing to feplot, iiplot figure.
- relative to a structure as in Case=sdth.urn('Case 1',model) where one will search the model stack, the case stack, ...
8.4.3 Specification of graphical objects (urnObj)
-
to generate MATLAB objects with sdtm.urnObj commands. Execute sdtm.urnObj in the MATLAB console to display the list and syntax of urnObj commands.
Example : The Dlg syntax is Dlg{Message%s,title%s,type%s}:{T%g} meaning that an urnObj string that begins with Dlg parses the 3 first mandatory arguments as window Message, title and type.
The optional arguments must specify the argument name (here the automatic closing time T) followed by the argument value. Arguments are given between braces and coma separated.
Thus sdtm.urnObj('Dlg{"Job end","error!",error,T5}') opens an error window titled error! with the message Job end and a automatic closing time after 5 seconds.
-
Tog is used to generate uitooggletool objects.
- Push generates uipushtool objects.
- Dlg opens window (info, warning, error,...) with message, title and optional automatic closing time.
- Link{compA,compB,p{properties }} is used to link properties of multiple axes (used in dockId for example.
8.4.4 Report generation
-
sdth.urn('feplot(2).Report'); generates the automated report for the figure.
- sdth.urn('dfrui.figure(102).Report(word)')
- sdth.urn('Dock.Id.ci.Report.QualAllTable')
- sdtroot initProject; sdth.urn('sdtroot.Tab.Project.Report(word)')
8.4.5 String conversion DOE events (urnSig)
Conventions DOE nomenclature
-
fun(Designation) uses function handle @fun to interpret the Designation. The first definition of such a main function is kept until another is used.
- The designations are typically split using column separators :. Thus sdtsys('UrnSig','dt48u:Cst(2):Tri(1,/60,1,k50') considers a sequence of 3 definitions dt48u which sets the time step. Cst(2) for a constant value maintained for 2 seconds, ...
©1991-2024 by SDTools