Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ACS
Public
CIM
Pintura
Commits
02af886b
Commit
02af886b
authored
Oct 15, 2019
by
Richard Marston
Browse files
Show dropdown for true / false attributes
parent
99be4b86
Pipeline
#194684
passed with stage
in 1 minute and 10 seconds
Changes
4
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
cimmenu/templates/generateCgmesTemplates.js
View file @
02af886b
...
...
@@ -248,9 +248,7 @@ const selectPrimitiveRenderFunction = function(primitive){
render
=
'
"renderString"
'
;
}
else
if
(
primitive
==
"
Boolean
"
)
{
// TODO: Implementation Required!
console
.
error
(
"
Boolean primitive renderer not implemented!
"
)
render
=
'
"renderString"
'
;
render
=
'
"renderBoolean"
'
;
}
else
if
(
primitive
==
"
Date
"
)
{
console
.
error
(
"
Date primitive renderer not implemented!
"
)
...
...
cimmenu/templates/handlebars/cim_render_boolean.handlebars
0 → 100644
View file @
02af886b
<span
class=
"row-right wide-row floating-panel-value"
>
<select
value=
"
{{
value
}}
"
id=
"
{{
dropdownId
}}
"
type=
"select"
onchange=
"currentCimsvg().updateComponent('
{{
classType
}}
', '
{{
parentRdfid
}}
', '
{{
attribute
}}
', this.value)"
>
<option>
Select
</label>
{{#
eq
value
"True"
}}
<option
selected=
"selected"
value=
"True"
>
True
</label>
{{else}}
<option
value=
"True"
>
True
</label>
{{/
eq
}}
{{#
eq
value
"False"
}}
<option
selected=
"selected"
value=
"False"
>
False
</label>
{{else}}
<option
value=
"False"
>
False
</label>
{{/
eq
}}
</select>
<button
class=
"hiddenbutton"
>
+
</button>
<button
class=
"hiddenbutton"
>
->
</button>
</span>
cimmenu/templates/handlebars/helpers/index.js
View file @
02af886b
...
...
@@ -139,8 +139,7 @@ class aggregateRenderer {
return
templates
.
handlebars_cim_render_string
(
data
)
}
static
renderBoolean
(
data
)
{
// TODO: WRONG!
return
templates
.
handlebars_cim_render_string
(
data
)
return
templates
.
handlebars_cim_render_boolean
(
data
)
}
static
renderInteger
(
data
)
{
// TODO: WRONG!
...
...
@@ -216,13 +215,21 @@ const getAggregateComponentMenuCIM16 = function(details){
export
default
function
(
Handlebars
)
{
Handlebars
.
registerHelper
(
'
neq
'
,
function
neq
(
v1
,
v2
,
options
)
{
Handlebars
.
registerHelper
(
'
neq
'
,
function
(
v1
,
v2
,
options
)
{
if
(
v1
!==
v2
)
{
return
options
.
fn
(
this
);
}
return
options
.
inverse
(
this
);
});
Handlebars
.
registerHelper
(
'
eq
'
,
function
(
v1
,
v2
,
options
)
{
console
.
log
(
"
v1:
"
,
v1
,
"
v2:
"
,
v2
,
"
options:
"
,
options
);
if
(
v1
==
v2
)
{
return
options
.
fn
(
this
);
}
return
options
.
inverse
(
this
);
});
Handlebars
.
registerHelper
(
'
createGridArea
'
,
function
(
column
,
row
,
height
)
{
let
rowStart
=
(
row
+
1
).
toString
();
let
rowEnd
=
(
row
+
1
+
height
).
toString
();
...
...
cimsvg/src/cimsvg.js
View file @
02af886b
...
...
@@ -448,6 +448,7 @@ class cimsvg {
}
else
{
console
.
error
(
"
Failed to parse cim version.
"
);
return
false
;
}
this
.
entsoe
=
entsoe
?
"
_entsoe
"
:
""
;
return
true
;
...
...
@@ -457,7 +458,6 @@ class cimsvg {
if
(
!
this
.
getXmlDoc
())
{
this
.
setXmlDoc
(
cimxml
.
getDOM
(
"
<rdf:RDF
"
+
cimxml
.
xmlns
()
+
"
/>
"
));
}
let
cimParse
=
cimxml
.
moreXmlData
(
fileContents
,
this
.
getXmlDoc
());
if
(
cimParse
)
{
if
(
this
.
rdfFileCount
===
1
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment