|
@ -144,7 +144,8 @@ class Inverter { |
|
|
|
|
|
|
|
|
void setQueuedCmdFinished(){ |
|
|
void setQueuedCmdFinished(){ |
|
|
if (!_commandQueue.empty()){ |
|
|
if (!_commandQueue.empty()){ |
|
|
_commandQueue.pop(); // Will destroy CommandAbstract Class Object (?)
|
|
|
// Will destroy CommandAbstract Class Object (?)
|
|
|
|
|
|
_commandQueue.pop(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -153,7 +154,14 @@ class Inverter { |
|
|
if (_commandQueue.empty()){ |
|
|
if (_commandQueue.empty()){ |
|
|
// Fill with default commands
|
|
|
// Fill with default commands
|
|
|
enqueCommand<InfoCommand>(RealTimeRunData_Debug); |
|
|
enqueCommand<InfoCommand>(RealTimeRunData_Debug); |
|
|
//enqueCommand<InfoCommand>(SystemConfigPara);
|
|
|
if (fwVersion == 0) |
|
|
|
|
|
{ // info needed maybe after "one nigth" (=> DC>0 to DC=0 and to DC>0) or reboot
|
|
|
|
|
|
enqueCommand<InfoCommand>(InverterDevInform_All); |
|
|
|
|
|
} |
|
|
|
|
|
if (actPowerLimit == 0xffff) |
|
|
|
|
|
{ // info needed maybe after "one nigth" (=> DC>0 to DC=0 and to DC>0) or reboot
|
|
|
|
|
|
enqueCommand<InfoCommand>(SystemConfigPara); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
return _commandQueue.front().get()->getCmd(); |
|
|
return _commandQueue.front().get()->getCmd(); |
|
|
} |
|
|
} |
|
@ -167,8 +175,6 @@ class Inverter { |
|
|
memset(name, 0, MAX_NAME_LENGTH); |
|
|
memset(name, 0, MAX_NAME_LENGTH); |
|
|
memset(chName, 0, MAX_NAME_LENGTH * 4); |
|
|
memset(chName, 0, MAX_NAME_LENGTH * 4); |
|
|
memset(record, 0, sizeof(RECORDTYPE) * listLen); |
|
|
memset(record, 0, sizeof(RECORDTYPE) * listLen); |
|
|
enqueCommand<InfoCommand>(SystemConfigPara); |
|
|
|
|
|
enqueCommand<InfoCommand>(InverterDevInform_All); |
|
|
|
|
|
initialized = true; |
|
|
initialized = true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -222,7 +228,7 @@ class Inverter { |
|
|
if (getPosByChFld(0, FLD_ALARM_MES_ID) == pos){ |
|
|
if (getPosByChFld(0, FLD_ALARM_MES_ID) == pos){ |
|
|
if (alarmMesIndex < record[pos]){ |
|
|
if (alarmMesIndex < record[pos]){ |
|
|
alarmMesIndex = record[pos]; |
|
|
alarmMesIndex = record[pos]; |
|
|
enqueCommand<InfoCommand>(AlarmUpdate); |
|
|
//enqueCommand<InfoCommand>(AlarmUpdate); // What is the function of AlarmUpdate?
|
|
|
enqueCommand<InfoCommand>(AlarmData); |
|
|
enqueCommand<InfoCommand>(AlarmData); |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
@ -284,17 +290,16 @@ class Inverter { |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
uint32_t getLastTs(void) { |
|
|
uint32_t getLastTs(void) |
|
|
|
|
|
{ |
|
|
DPRINTLN(DBG_VERBOSE, F("hmInverter.h:getLastTs")); |
|
|
DPRINTLN(DBG_VERBOSE, F("hmInverter.h:getLastTs")); |
|
|
return ts; |
|
|
return ts; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void getAssignment() { |
|
|
void getAssignment() |
|
|
DPRINTLN(DBG_DEBUG, F("hmInverter.h:getAssignment")); |
|
|
|
|
|
uint8_t cmd = getQueuedCmd(); |
|
|
|
|
|
switch (cmd) |
|
|
|
|
|
{ |
|
|
{ |
|
|
case RealTimeRunData_Debug: |
|
|
DPRINTLN(DBG_DEBUG, F("hmInverter.h:getAssignment")); |
|
|
|
|
|
// Default assignment;
|
|
|
if (INV_TYPE_1CH == type) |
|
|
if (INV_TYPE_1CH == type) |
|
|
{ |
|
|
{ |
|
|
listLen = (uint8_t)(HM1CH_LIST_LEN); |
|
|
listLen = (uint8_t)(HM1CH_LIST_LEN); |
|
@ -319,6 +324,12 @@ class Inverter { |
|
|
channels = 0; |
|
|
channels = 0; |
|
|
assign = NULL; |
|
|
assign = NULL; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
uint8_t cmd = getQueuedCmd(); |
|
|
|
|
|
switch (cmd) |
|
|
|
|
|
{ |
|
|
|
|
|
case RealTimeRunData_Debug: |
|
|
|
|
|
// Do nothing will use default
|
|
|
break; |
|
|
break; |
|
|
case InverterDevInform_All: |
|
|
case InverterDevInform_All: |
|
|
listLen = (uint8_t)(HMINFO_LIST_LEN); |
|
|
listLen = (uint8_t)(HMINFO_LIST_LEN); |
|
|