Corrected effeciency of state machine in load control object.

This commit is contained in:
skarg
2007-02-22 22:09:19 +00:00
parent 58d23afc4e
commit f36425de09
+6
View File
@@ -377,6 +377,8 @@ void Load_Control_State_Machine(int object_index)
switch (Load_Control_State[object_index]) { switch (Load_Control_State[object_index]) {
case SHED_REQUEST_PENDING: case SHED_REQUEST_PENDING:
if (Load_Control_Request_Written[object_index]) {
Load_Control_Request_Written[object_index] = false;
/* request to cancel using default values? */ /* request to cancel using default values? */
switch (Requested_Shed_Level[object_index].type) { switch (Requested_Shed_Level[object_index].type) {
case BACNET_SHED_TYPE_PERCENT: case BACNET_SHED_TYPE_PERCENT:
@@ -398,11 +400,15 @@ void Load_Control_State_Machine(int object_index)
} }
if (Load_Control_State[object_index] == SHED_INACTIVE) if (Load_Control_State[object_index] == SHED_INACTIVE)
break; break;
}
if (Start_Time_Property_Written[object_index]) {
Start_Time_Property_Written[object_index] = false;
/* request to cancel using wildcards in start time? */ /* request to cancel using wildcards in start time? */
if (datetime_wildcard(&Start_Time[object_index])) { if (datetime_wildcard(&Start_Time[object_index])) {
Load_Control_State[object_index] = SHED_INACTIVE; Load_Control_State[object_index] = SHED_INACTIVE;
break; break;
} }
}
/* cancel because current time is after start time + duration? */ /* cancel because current time is after start time + duration? */
Update_Current_Time(&Current_Time); Update_Current_Time(&Current_Time);
datetime_copy(&End_Time[object_index], &Start_Time[object_index]); datetime_copy(&End_Time[object_index], &Start_Time[object_index]);