mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-09 21:53:40 +00:00
Fix #4195. Forgot to add UI for contains selector.
This commit is contained in:
@@ -489,6 +489,8 @@ class BIMFacet(PropertyGroup):
|
|||||||
("<=", "lesser than or equal to", ""),
|
("<=", "lesser than or equal to", ""),
|
||||||
(">", "greater than", ""),
|
(">", "greater than", ""),
|
||||||
("<", "less than", ""),
|
("<", "less than", ""),
|
||||||
|
("*=", "contains", ""),
|
||||||
|
("!*=", "does not contain", ""),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ class ImportFilterQueryTransformer(lark.Transformer):
|
|||||||
new2.pset = arg["pset"]
|
new2.pset = arg["pset"]
|
||||||
if "comparison" in arg:
|
if "comparison" in arg:
|
||||||
new2.comparison = arg["comparison"]
|
new2.comparison = arg["comparison"]
|
||||||
######################################################################
|
|
||||||
def facet(self, args):
|
def facet(self, args):
|
||||||
return args[0]
|
return args[0]
|
||||||
|
|
||||||
@@ -169,8 +169,7 @@ class ImportFilterQueryTransformer(lark.Transformer):
|
|||||||
|
|
||||||
def property(self, args):
|
def property(self, args):
|
||||||
pset, prop, comparison, value = args
|
pset, prop, comparison, value = args
|
||||||
#return {"type": "property", "pset": pset, "name": prop, "value": f"{comparison}{value}"}
|
return {"type": "property", "pset": pset, "name": prop, "comparison": comparison, "value": f"{value}"}
|
||||||
return {"type": "property", "pset": pset, "name": prop, "comparison" : comparison, "value": f"{value}"}
|
|
||||||
|
|
||||||
def classification(self, args):
|
def classification(self, args):
|
||||||
comparison, value = args
|
comparison, value = args
|
||||||
@@ -189,19 +188,24 @@ class ImportFilterQueryTransformer(lark.Transformer):
|
|||||||
return {"type": "query", "name": keys, "value": f"{comparison}{value}"}
|
return {"type": "query", "name": keys, "value": f"{comparison}{value}"}
|
||||||
|
|
||||||
def comparison(self, args):
|
def comparison(self, args):
|
||||||
if args[0].data == "equals":
|
if args[0].data == "not":
|
||||||
return "="
|
comparison = args[1].data
|
||||||
elif args[0].data == "morethanequalto":
|
is_not = "!"
|
||||||
return ">="
|
|
||||||
elif args[0].data == "lessthanequalto":
|
|
||||||
return "<="
|
|
||||||
elif args[0].data == "morethan":
|
|
||||||
return ">"
|
|
||||||
elif args[0].data == "lessthan":
|
|
||||||
return "<"
|
|
||||||
else:
|
else:
|
||||||
return "!="
|
comparison = args[0].data
|
||||||
#return "" if args[0].data == "equals" else "!="
|
is_not = ""
|
||||||
|
|
||||||
|
return (
|
||||||
|
is_not
|
||||||
|
+ {
|
||||||
|
"equals": "=",
|
||||||
|
"morethanequalto": ">=",
|
||||||
|
"lessthanequalto": "<=",
|
||||||
|
"morethan": ">",
|
||||||
|
"lessthan": "<",
|
||||||
|
"contains": "*=",
|
||||||
|
}[comparison]
|
||||||
|
)
|
||||||
|
|
||||||
def keys(self, args):
|
def keys(self, args):
|
||||||
return self.value(args)
|
return self.value(args)
|
||||||
|
|||||||
Reference in New Issue
Block a user