我正在编写一个与Tridiums Niagara Framework版本4.3一起使用的自定义模块,而我尝试设置的defaultValue给出以下错误:
“类”或“接口”预期错误。
我尝试了几种不同的方法来设置它,并且错误仍然存在。我从头开始尝试并得到相同的错误。
package com.lgelectronics.lge;
import javax.baja.nre.annotations.Facet;
import javax.baja.nre.annotations.NiagaraProperty;
import javax.baja.nre.annotations.NiagaraType;
import javax.baja.sys.*;
@NiagaraType
@NiagaraProperty
(
name = "Schedule",
type = "Baja:Boolean",
flags = Flags.SUMMARY,
defaultValue = "False"
)
@NiagaraProperty
(
name = "OccupiedCoolingSetPoint",
type = "Baja:Double",
flags = Flags.SUMMARY,
facets=
{
@Facet(name = "BFacets.UNITS", value = "BUnit.getUnit(\"fahrenheit\")"),
@Facet(name = "BFacets.PRECISION", value = "BInteger.make(1)"),
@Facet(name = "BFacets.MIN", value = "BDouble.make(0D)"),
@Facet(name = "BFacets.MAX", value = "BDouble.make(100D)")
},
defaultValue = "BDouble.make(\"74.0\")"
)
@NiagaraProperty
(
name = "UnOccupiedCoolingSetPoint",
type = "Baja:Double",
flags = Flags.SUMMARY,
facets=
{
@Facet(name = "BFacets.UNITS", value = "BUnit.getUnit(\"fahrenheit\")"),
@Facet(name = "BFacets.PRECISION", value = "BInteger.make(1)"),
@Facet(name = "BFacets.MIN", value = "BDouble.make(0D)"),
@Facet(name = "BFacets.MAX", value = "BDouble.make(100D)")
},
defaultValue = "BDouble.make(\"85.0\")"
)
@NiagaraProperty
(
name = "OccupiedHeatingSetPoint",
type = "Baja:Double",
flags = Flags.SUMMARY,
facets=
{
@Facet(name = "BFacets.UNITS", value = "BUnit.getUnit(\"fahrenheit\")"),
@Facet(name = "BFacets.PRECISION", value = "BInteger.make(1)"),
@Facet(name = "BFacets.MIN", value = "BDouble.make(0D)"),
@Facet(name = "BFacets.MAX", value = "BDouble.make(100D)")
},
defaultValue = "BDouble.make(\"70.0\")"
)
@NiagaraProperty
(
name = "UnOccupiedHeatingSetPoint",
type = "Baja:Double",
flags = Flags.SUMMARY,
facets=
{
@Facet(name = "BFacets.UNITS", value ="BUnit.getUnit(\"fahrenheit\")"),
@Facet(name = "BFacets.PRECISION", value = "BInteger.make(1)"),
@Facet(name = "BFacets.MIN", value = "BDouble.make(0D)"),
@Facet(name = "BFacets.MAX", value = "BDouble.make(100D)")
},
defaultValue = "BDouble.make(\"55.0\")"
)
public class BSchedule extends BComponent {
}
我希望defaultValue行上不会出现“类”或“接口”预期错误。
答案 0 :(得分:0)
您的语法有问题,应使用以下语法。
defaultValue = "BDouble.make(55.0)",
查看完整示例,
@NiagaraProperty(
name = "delayTime",
type = "baja:Double",
defaultValue = "BDouble.make(500)",
facets = {
@Facet(name = "BFacets.MIN", value = "BDouble.make(0)"),
@Facet(name = "BFacets.MAX", value = "BDouble.make(2000)"),
@Facet(name = "BFacets.UX_FIELD_EDITOR", value = "BString.make(\"midi:RangeSlider\")")
}
)