|
@@ -12,6 +12,7 @@
|
|
|
#include"EV.h"
|
|
|
#include"BoatModule.h"
|
|
|
#include"debug.h"
|
|
|
+#define DEFAULT_PREFIX 0x01
|
|
|
COP* OP;
|
|
|
//在alarmCheck之外的地方发生了alarm,是否使用alarmCallback回调
|
|
|
#define USE_NORMAL_ALARMCHECK FALSE
|
|
@@ -83,6 +84,10 @@ OperatorNode* OperatorNode::setTimes(long delayTime, long stableTime, long trigg
|
|
|
}
|
|
|
OperatorNode* OperatorNode::setParams(const char* paramString){
|
|
|
if (paramString != NULL) {
|
|
|
+ if (this->params.length > 0 && this->params.get(0) != NULL && this->params.get(0)[0] == DEFAULT_PREFIX) {
|
|
|
+ //default节点的参数已经设置成OP名称,不能被覆盖
|
|
|
+ return this;
|
|
|
+ }
|
|
|
this->params.parse(paramString, ';');
|
|
|
}
|
|
|
|
|
@@ -728,7 +733,11 @@ OperatorNode* COP::select(const char* name)
|
|
|
EV->postAlarmLog(alarmText);
|
|
|
return NULL;
|
|
|
}
|
|
|
- node->setParams(name);
|
|
|
+ static char tmpName[MAX_NAME_LEN];
|
|
|
+ tmpName[0] = DEFAULT_PREFIX;
|
|
|
+ tmpName[1] = ';';
|
|
|
+ strcat(tmpName + 2, name);
|
|
|
+ node->params.parse(tmpName,';');
|
|
|
}
|
|
|
return node;
|
|
|
}
|