thermferm/server.c

changeset 219
ae720212accc
parent 217
2922d439ff63
child 223
14700edd2a67
equal deleted inserted replaced
218:311a293b3e46 219:ae720212accc
1266 } 1266 }
1267 1267
1268 } else if (val && (strcmp(kwd, (char *)"PROF_STATE") == 0)) { 1268 } else if (val && (strcmp(kwd, (char *)"PROF_STATE") == 0)) {
1269 for (i = 0; i < 5; i++) { 1269 for (i = 0; i < 5; i++) {
1270 if (strcmp(val, PROFSTATE[i]) == 0) { 1270 if (strcmp(val, PROFSTATE[i]) == 0) {
1271 unit->prof_state = i; 1271 switch (i) {
1272 case PROFILE_OFF: if (unit->prof_state == PROFILE_DONE)
1273 unit->prof_state = PROFILE_OFF;
1274 break;
1275 case PROFILE_PAUSE: if (unit->prof_state == PROFILE_RUN)
1276 unit->prof_state = PROFILE_PAUSE;
1277 else if (unit->prof_state == PROFILE_PAUSE)
1278 unit->prof_state = PROFILE_RUN;
1279 break;
1280 case PROFILE_RUN: if (unit->prof_state == PROFILE_OFF) {
1281 unit->prof_state = PROFILE_RUN;
1282 unit->prof_started = time(NULL);
1283 unit->prof_paused = 0;
1284 }
1285 break;
1286 case PROFILE_DONE: break; /* Command is illegal */
1287 case PROFILE_ABORT: if ((unit->prof_state == PROFILE_RUN) || (unit->prof_state == PROFILE_PAUSE)) {
1288 unit->prof_state = PROFILE_OFF;
1289 unit->prof_started = 0;
1290 }
1291 break;
1292 }
1272 break; 1293 break;
1273 } 1294 }
1274 } 1295 }
1275 1296
1276 } else if (val && (strcmp(kwd, (char *)"TEMP_SET_MIN") == 0)) { 1297 } else if (val && (strcmp(kwd, (char *)"TEMP_SET_MIN") == 0)) {

mercurial