Canvas MFD framework: Difference between revisions

Line 57: Line 57:
* style - style hash
* style - style hash


===ArrowElement===
===HighlightElement===
An SVG element that is made visible or hidden to indicate that an element is selected, rather than highlighting the text.
An SVG element that is made visible or hidden to indicate that an element is selected, rather than highlighting the text.


Line 84: Line 84:
Additional methods:
Additional methods:
* setValues(values_array) sets the values of the element to values_array
* setValues(values_array) sets the values of the element to values_array
===PointerElement===
An SVG element that moves horizontally or vertically depending on the value set.
In the SVG file, this will have the name [pagename][name].  [pagename][name] will be shifted linearly in the x axis (or y axis if vertical=1) such that when value >= maxVal it is shifted by scalePx.
Constructor:  new : func (pagename, svg, name, minVal, maxVal, scalePx, vertical=0, value=0, style=nil)
* pagename - the name of the page this belongs to, as referenced by the MFD.  This is the prefix for the SVG elements themselves.
* svg - reference the svg Group element that contains the element.
* name - name of the element.  In the SVG file this will be [pagename][name].
* minVal - minimum value to clamp to
* maxVal - maximum value to clamp to
* scalePx - scale. 
* vertical - whether the element should be shifted horizontally or vertically.
* value - initial value
* style - style hash
===RotatingElement===
An SVG element that rotates around an axis depending on the value set.
In the SVG file, this will have the name [pagename][name].  [pagename][name] will be rotated around the centerOffset point.
Constructor:  new : func (pagename, svg, name, minVal, maxVal, rangeDeg, centerOffset, value=0, style=nil)
* pagename - the name of the page this belongs to, as referenced by the MFD.  This is the prefix for the SVG elements themselves.
* svg - reference the svg Group element that contains the element.
* name - name of the element.  In the SVG file this will be [pagename][name].
* minVal - minimum value to clamp to
* maxVal - maximum value to clamp to
* rangeDeg - degrees to rotate clockwise when value >= maxVal. 
* centerOffset - Array [x,y] indicating the offset for the rotation.
* value - initial value
* style - style hash


===DataEntryElement===
===DataEntryElement===