|
|
@@ -12,21 +12,14 @@
|
|
|
// Task Object attrs - like xsd element attrs of type (int value, other object)
|
|
|
|
|
|
#define DBG_OBJ_LEVEL 3
|
|
|
-
|
|
|
-#include "const_calc.h" //attributes avialable to calculate
|
|
|
+#define idObject1__DISABLE
|
|
|
+#define idObject2__DISABLE
|
|
|
+//#define idObject3__DISABLE
|
|
|
|
|
|
|
|
|
-const int DB_OBJ_MAX = 10; // Object list -> Conf -> Attr
|
|
|
-int DB_OBJ_IDX = 0;
|
|
|
+#include "const_calc.h" //attributes avialable to calculate
|
|
|
+#include "calc_db_conf__const__variables.h"
|
|
|
|
|
|
-//int DB_OBJ[DB_OBJ_MAX][4]; // idObj => { firstConf, lastConf, firstAttr, lastAttr }
|
|
|
-int DB_OBJ[DB_OBJ_MAX][4]; // idObj => { firstConf, lastConf, firstAttr, lastAttr }
|
|
|
-const int DB_CONF_MAX = 50; // Conf list
|
|
|
-int DB_CONF_IDX = 0;
|
|
|
-int DB_CONF[DB_CONF_MAX]; // idType
|
|
|
-const int DB_ATTR_MAX = 100; // Attr list
|
|
|
-int DB_ATTR_IDX = 0;
|
|
|
-int DB_ATTR[DB_ATTR_MAX][3]; // { relIdxConf, value, idObj }
|
|
|
|
|
|
#include "calc_db.h"
|
|
|
#include "calc_db_conf.h"
|
|
|
@@ -40,8 +33,11 @@ int calcLoopCounterDBG = 0;
|
|
|
const int TOTAL_ATTRS = 7;
|
|
|
int obj1[TOTAL_ATTRS];
|
|
|
int obj2[TOTAL_ATTRS];
|
|
|
+int obj3[TOTAL_ATTRS];
|
|
|
+
|
|
|
int idObject1 = 0;
|
|
|
int idObject2 = 0;
|
|
|
+int idObject3 = 0;
|
|
|
|
|
|
void setup() {
|
|
|
Serial.begin(115200);
|
|
|
@@ -59,43 +55,38 @@ void setup() {
|
|
|
// char inputBuf[1];
|
|
|
// char inputChar;
|
|
|
|
|
|
- int PIN_NR = 0;
|
|
|
- int LVL_MIN = 1;
|
|
|
- int LVL_MAX = 2;
|
|
|
- int LVL_VAL = 3;
|
|
|
- int DELTA = 4;
|
|
|
- int MAX_DELTA = 5;
|
|
|
- int SWING = 6;
|
|
|
- obj1[PIN_NR] = 9; // const
|
|
|
- obj1[LVL_MIN] = 150; // const
|
|
|
- obj1[LVL_MAX] = 200; // const
|
|
|
- obj1[LVL_VAL] = 150; // var, default = 150
|
|
|
- obj1[DELTA] = 0; // var, default 0
|
|
|
- obj1[MAX_DELTA] = 10; // var, default = 10
|
|
|
- obj1[SWING] = 8; // var, default = 8
|
|
|
-
|
|
|
- obj2[PIN_NR] = 10; // const
|
|
|
- obj2[LVL_MIN] = 150; // const
|
|
|
- obj2[LVL_MAX] = 200; // const
|
|
|
- obj2[LVL_VAL] = 150; // var, default = 150
|
|
|
- obj2[DELTA] = 0; // var, default 0
|
|
|
- obj2[MAX_DELTA] = 10; // var, default = 10
|
|
|
- obj2[SWING] = 30; // var, default = 8
|
|
|
+
|
|
|
+
|
|
|
|
|
|
+
|
|
|
+ #include "calc_db_conf__setup__idObject1__variables.h"
|
|
|
+ #include "calc_db_conf__setup__idObject2__variables.h"
|
|
|
+ #include "calc_db_conf__setup__idObject3__variables.h"
|
|
|
+
|
|
|
calc__db_init();
|
|
|
#include "calc_db_conf__setup__idObject1.h"
|
|
|
+
|
|
|
#include "calc_db_conf__setup__idObject2.h"
|
|
|
-
|
|
|
- calc__DBG_OBJ(idObject1);
|
|
|
- calc__DBG_OBJ(idObject2);
|
|
|
+ #include "calc_db_conf__setup__idObject3.h"
|
|
|
+
|
|
|
+ #if not(defined(idObject1__DISABLE))
|
|
|
+ calc__DBG_OBJ(idObject1);
|
|
|
+ #endif
|
|
|
+ #if not(defined(idObject2__DISABLE))
|
|
|
+ calc__DBG_OBJ(idObject2);
|
|
|
+ #endif
|
|
|
+ #if not(defined(idObject3__DISABLE))
|
|
|
+ calc__DBG_OBJ(idObject3);
|
|
|
+ #endif
|
|
|
}
|
|
|
|
|
|
void loop() {
|
|
|
-
|
|
|
+ Serial.println("\n[LOOP]");
|
|
|
+ //#include "calc_db_conf__setup__variables.h"
|
|
|
+
|
|
|
//debugign changes that occurs to test calculation
|
|
|
- calc__DBG_OBJ(idObject1);
|
|
|
|
|
|
#include "loop.h"
|
|
|
Serial.println("Test calc db: End");
|
|
|
- delay(500);
|
|
|
+ delay(3500);
|
|
|
}
|