diff --git a/src/template/Makefile b/src/template/Makefile index 5b9c38ec4..6259b6fca 100644 --- a/src/template/Makefile +++ b/src/template/Makefile @@ -11,6 +11,7 @@ TEMPLATES += top/iocApp/src/_APPNAME_Main.cpp TEMPLATES += top/exampleApp/Makefile TEMPLATES += top/exampleApp/Db/Makefile +TEMPLATES += top/exampleApp/Db/circle.db TEMPLATES += top/exampleApp/Db/dbExample1.db TEMPLATES += top/exampleApp/Db/dbExample2.db TEMPLATES += top/exampleApp/Db/_APPNAME_Version.db diff --git a/src/template/top/exampleApp/Db/Makefile b/src/template/top/exampleApp/Db/Makefile index 679bba60c..978810d20 100644 --- a/src/template/top/exampleApp/Db/Makefile +++ b/src/template/top/exampleApp/Db/Makefile @@ -4,6 +4,7 @@ include $(TOP)/configure/CONFIG # ADD MACRO DEFINITIONS BELOW HERE # Install databases, templates & substitutions like this +DB += circle.db DB += dbExample1.db DB += dbExample2.db DB += _APPNAME_Version.db diff --git a/src/template/top/exampleApp/Db/circle.db b/src/template/top/exampleApp/Db/circle.db new file mode 100644 index 000000000..5e792c81b --- /dev/null +++ b/src/template/top/exampleApp/Db/circle.db @@ -0,0 +1,72 @@ +record(ao, "$(user):circle:step") { + field(VAL , "1.0") + field(DRVL, "0.0") + field(DRVH, "359") + field(PINI, "YES") +} + +record(ao, "$(user):circle:period") { + field(VAL , "1.0") + field(PINI, "YES") + field(OUT , "$(user):circle:tick.ODLY NPP") +} + +record(calc, "$(user):circle:angle") { + field(PINI, "RUNNING") # bootstrap + field(INPA, "$(user):circle:angle NPP") + field(INPB, "$(user):circle:step NPP") + field(INPD, "360") + field(DESC, "Angle") + field(EGU , "deg") + field(LOLO, "45") + field(LOW , "135") + field(HIGH, "225") + field(HIHI, "315") + field(LLSV, "MAJOR") + field(LSV , "MINOR") + field(HSV , "MINOR") + field(HHSV, "MAJOR") + field(CALC, "C:=A+B;(C>=D)?C-D:C") + field(FLNK, "$(user):circle:x") + field(PREC, "3") + info(Q:group, { + "$(user):circle":{"angle": {+channel:"VAL"}}, + "$(user):line":{"a": {+channel:"VAL"}} + }) + alias("$(user):line:a") +} + +record(calc, "$(user):circle:x") { + field(INPA, "$(user):circle:angle NPP") + field(CALC, "cos(A*PI/180)") + field(TSEL, "$(user):circle:angle.TIME") + field(FLNK, "$(user):circle:y") + field(PREC, "3") + info(Q:group, { + "$(user):circle":{"x": {+channel:"VAL"}} + }) +} + +record(calc, "$(user):circle:y") { + field(INPA, "$(user):circle:angle NPP") + field(CALC, "sin(A*PI/180)") + field(TSEL, "$(user):circle:angle.TIME") + field(PREC, "3") + field(FLNK, "$(user):line:b") + info(Q:group, { + "$(user):circle":{"y": {+channel:"VAL", +trigger:"*"}} + }) +} + +record(ai, "$(user):line:b") { + field(INP, "$(user):line:a NPP") + field(FLNK, "$(user):circle:tick") + info(Q:group, { + "$(user):line":{"b": {+channel:"VAL", +trigger:"*"}} + }) +} + +record(calcout, "$(user):circle:tick") { + field(ODLY, "1.0") + field(OUT , "$(user):circle:angle.PROC CA") # loop +} diff --git a/src/template/top/exampleApp/Db/user.substitutions b/src/template/top/exampleApp/Db/user.substitutions index 9eb54e4e5..f9a20e84b 100644 --- a/src/template/top/exampleApp/Db/user.substitutions +++ b/src/template/top/exampleApp/Db/user.substitutions @@ -1,5 +1,9 @@ # Example substitutions file +file "db/circle.db" { + { user = "_USER_" } +} + file "db/dbExample1.db" { { user = "_USER_" } }