@@ -1,2 +1,2 | |||||
1 | 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters |
|
1 | 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters | |
2 | f97721719ddb7e088956d5fd3cffb0f9587a041b header/lfr_common_headers |
|
2 | e01ac8bd125a79a7af38b0e3ba0330f5be1a3c92 header/lfr_common_headers |
@@ -103,6 +103,8 void merge_fbins_masks( void ); | |||||
103 | int set_sy_lfr_fbins( ccsdsTelecommandPacket_t *TC ); |
|
103 | int set_sy_lfr_fbins( ccsdsTelecommandPacket_t *TC ); | |
104 |
|
104 | |||
105 | // TC_LFR_LOAD_PARS_FILTER_PAR |
|
105 | // TC_LFR_LOAD_PARS_FILTER_PAR | |
|
106 | int check_sy_lfr_rw_k( ccsdsTelecommandPacket_t *TC, int offset, int* pos, float* value ); | |||
|
107 | int check_all_sy_lfr_rw_k( ccsdsTelecommandPacket_t *TC, int *pos, float*value ); | |||
106 | int check_sy_lfr_filter_parameters( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ); |
|
108 | int check_sy_lfr_filter_parameters( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ); | |
107 |
|
109 | |||
108 | // KCOEFFICIENTS |
|
110 | // KCOEFFICIENTS |
@@ -64,7 +64,7 option(FSW_debug_tch "?" OFF) | |||||
64 | set(SW_VERSION_N1 "3" CACHE STRING "Choose N1 FSW Version." FORCE) |
|
64 | set(SW_VERSION_N1 "3" CACHE STRING "Choose N1 FSW Version." FORCE) | |
65 | set(SW_VERSION_N2 "2" CACHE STRING "Choose N2 FSW Version." FORCE) |
|
65 | set(SW_VERSION_N2 "2" CACHE STRING "Choose N2 FSW Version." FORCE) | |
66 | set(SW_VERSION_N3 "0" CACHE STRING "Choose N3 FSW Version." FORCE) |
|
66 | set(SW_VERSION_N3 "0" CACHE STRING "Choose N3 FSW Version." FORCE) | |
67 |
set(SW_VERSION_N4 " |
|
67 | set(SW_VERSION_N4 "3" CACHE STRING "Choose N4 FSW Version." FORCE) | |
68 |
|
68 | |||
69 | if(FSW_verbose) |
|
69 | if(FSW_verbose) | |
70 | add_definitions(-DPRINT_MESSAGES_ON_CONSOLE) |
|
70 | add_definitions(-DPRINT_MESSAGES_ON_CONSOLE) |
@@ -796,19 +796,6 unsigned char acquisitionTimeIsValid( un | |||||
796 | } |
|
796 | } | |
797 | } |
|
797 | } | |
798 |
|
798 | |||
799 | // printf("coarseTime = %x, fineTime = %x\n", |
|
|||
800 | // coarseTime, |
|
|||
801 | // fineTime); |
|
|||
802 |
|
||||
803 | // printf("[ret = %d] *** acquisitionTime = %f, Reference = %f", |
|
|||
804 | // ret, |
|
|||
805 | // acquisitionTime / 65536., |
|
|||
806 | // timecodeReference / 65536.); |
|
|||
807 |
|
||||
808 | // printf(", Min = %f, Max = %f\n", |
|
|||
809 | // acquisitionTimeRangeMin / 65536., |
|
|||
810 | // acquisitionTimeRangeMax / 65536.); |
|
|||
811 |
|
||||
812 | return ret; |
|
799 | return ret; | |
813 | } |
|
800 | } | |
814 |
|
801 |
@@ -1332,6 +1332,115 int set_sy_lfr_fbins( ccsdsTelecommandPa | |||||
1332 | //*************************** |
|
1332 | //*************************** | |
1333 | // TC_LFR_LOAD_PAS_FILTER_PAR |
|
1333 | // TC_LFR_LOAD_PAS_FILTER_PAR | |
1334 |
|
1334 | |||
|
1335 | int check_sy_lfr_rw_k( ccsdsTelecommandPacket_t *TC, int offset, int* pos, float* value ) | |||
|
1336 | { | |||
|
1337 | float rw_k; | |||
|
1338 | int ret; | |||
|
1339 | ||||
|
1340 | ret = LFR_SUCCESSFUL; | |||
|
1341 | rw_k = INIT_FLOAT; | |||
|
1342 | ||||
|
1343 | copyFloatByChar( (unsigned char*) &rw_k, (unsigned char*) &TC->dataAndCRC[ offset ] ); | |||
|
1344 | ||||
|
1345 | *pos = offset; | |||
|
1346 | *value = rw_k; | |||
|
1347 | ||||
|
1348 | if (rw_k < MIN_SY_LFR_RW_K) | |||
|
1349 | { | |||
|
1350 | ret = WRONG_APP_DATA; | |||
|
1351 | } | |||
|
1352 | ||||
|
1353 | return ret; | |||
|
1354 | } | |||
|
1355 | ||||
|
1356 | int check_all_sy_lfr_rw_k( ccsdsTelecommandPacket_t *TC, int *pos, float*value ) | |||
|
1357 | { | |||
|
1358 | int ret; | |||
|
1359 | ||||
|
1360 | ret = LFR_SUCCESSFUL; | |||
|
1361 | ||||
|
1362 | //**** | |||
|
1363 | //**** | |||
|
1364 | // RW1 | |||
|
1365 | ret = check_sy_lfr_rw_k( TC, DATAFIELD_POS_SY_LFR_RW1_K1, pos, value ); // K1 | |||
|
1366 | if (ret == LFR_SUCCESSFUL) // K2 | |||
|
1367 | { | |||
|
1368 | ret = check_sy_lfr_rw_k( TC, DATAFIELD_POS_SY_LFR_RW1_K2, pos, value ); | |||
|
1369 | } | |||
|
1370 | if (ret == LFR_SUCCESSFUL) // K3 | |||
|
1371 | { | |||
|
1372 | ret = check_sy_lfr_rw_k( TC, DATAFIELD_POS_SY_LFR_RW1_K3, pos, value ); | |||
|
1373 | } | |||
|
1374 | if (ret == LFR_SUCCESSFUL) // K4 | |||
|
1375 | { | |||
|
1376 | ret = check_sy_lfr_rw_k( TC, DATAFIELD_POS_SY_LFR_RW1_K4, pos, value ); | |||
|
1377 | } | |||
|
1378 | ||||
|
1379 | //**** | |||
|
1380 | //**** | |||
|
1381 | // RW2 | |||
|
1382 | if (ret == LFR_SUCCESSFUL) // K1 | |||
|
1383 | { | |||
|
1384 | ret = check_sy_lfr_rw_k( TC, DATAFIELD_POS_SY_LFR_RW2_K1, pos, value ); | |||
|
1385 | } | |||
|
1386 | if (ret == LFR_SUCCESSFUL) // K2 | |||
|
1387 | { | |||
|
1388 | ret = check_sy_lfr_rw_k( TC, DATAFIELD_POS_SY_LFR_RW2_K2, pos, value ); | |||
|
1389 | } | |||
|
1390 | if (ret == LFR_SUCCESSFUL) // K3 | |||
|
1391 | { | |||
|
1392 | ret = check_sy_lfr_rw_k( TC, DATAFIELD_POS_SY_LFR_RW2_K3, pos, value ); | |||
|
1393 | } | |||
|
1394 | if (ret == LFR_SUCCESSFUL) // K4 | |||
|
1395 | { | |||
|
1396 | ret = check_sy_lfr_rw_k( TC, DATAFIELD_POS_SY_LFR_RW2_K4, pos, value ); | |||
|
1397 | } | |||
|
1398 | ||||
|
1399 | //**** | |||
|
1400 | //**** | |||
|
1401 | // RW3 | |||
|
1402 | if (ret == LFR_SUCCESSFUL) // K1 | |||
|
1403 | { | |||
|
1404 | ret = check_sy_lfr_rw_k( TC, DATAFIELD_POS_SY_LFR_RW3_K1, pos, value ); | |||
|
1405 | } | |||
|
1406 | if (ret == LFR_SUCCESSFUL) // K2 | |||
|
1407 | { | |||
|
1408 | ret = check_sy_lfr_rw_k( TC, DATAFIELD_POS_SY_LFR_RW3_K2, pos, value ); | |||
|
1409 | } | |||
|
1410 | if (ret == LFR_SUCCESSFUL) // K3 | |||
|
1411 | { | |||
|
1412 | ret = check_sy_lfr_rw_k( TC, DATAFIELD_POS_SY_LFR_RW3_K3, pos, value ); | |||
|
1413 | } | |||
|
1414 | if (ret == LFR_SUCCESSFUL) // K4 | |||
|
1415 | { | |||
|
1416 | ret = check_sy_lfr_rw_k( TC, DATAFIELD_POS_SY_LFR_RW3_K4, pos, value ); | |||
|
1417 | } | |||
|
1418 | ||||
|
1419 | //**** | |||
|
1420 | //**** | |||
|
1421 | // RW4 | |||
|
1422 | if (ret == LFR_SUCCESSFUL) // K1 | |||
|
1423 | { | |||
|
1424 | ret = check_sy_lfr_rw_k( TC, DATAFIELD_POS_SY_LFR_RW4_K1, pos, value ); | |||
|
1425 | } | |||
|
1426 | if (ret == LFR_SUCCESSFUL) // K2 | |||
|
1427 | { | |||
|
1428 | ret = check_sy_lfr_rw_k( TC, DATAFIELD_POS_SY_LFR_RW4_K2, pos, value ); | |||
|
1429 | } | |||
|
1430 | if (ret == LFR_SUCCESSFUL) // K3 | |||
|
1431 | { | |||
|
1432 | ret = check_sy_lfr_rw_k( TC, DATAFIELD_POS_SY_LFR_RW4_K3, pos, value ); | |||
|
1433 | } | |||
|
1434 | if (ret == LFR_SUCCESSFUL) // K4 | |||
|
1435 | { | |||
|
1436 | ret = check_sy_lfr_rw_k( TC, DATAFIELD_POS_SY_LFR_RW4_K4, pos, value ); | |||
|
1437 | } | |||
|
1438 | ||||
|
1439 | ||||
|
1440 | ||||
|
1441 | return ret; | |||
|
1442 | } | |||
|
1443 | ||||
1335 | int check_sy_lfr_filter_parameters( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ) |
|
1444 | int check_sy_lfr_filter_parameters( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ) | |
1336 | { |
|
1445 | { | |
1337 | int flag; |
|
1446 | int flag; | |
@@ -1344,12 +1453,19 int check_sy_lfr_filter_parameters( ccsd | |||||
1344 | float sy_lfr_pas_filter_shift; |
|
1453 | float sy_lfr_pas_filter_shift; | |
1345 | float sy_lfr_sc_rw_delta_f; |
|
1454 | float sy_lfr_sc_rw_delta_f; | |
1346 | char *parPtr; |
|
1455 | char *parPtr; | |
|
1456 | int *datafield_pos; | |||
|
1457 | float *rw_k; | |||
1347 |
|
1458 | |||
1348 | flag = LFR_SUCCESSFUL; |
|
1459 | flag = LFR_SUCCESSFUL; | |
1349 | sy_lfr_pas_filter_tbad = INIT_FLOAT; |
|
1460 | sy_lfr_pas_filter_tbad = INIT_FLOAT; | |
1350 | sy_lfr_pas_filter_shift = INIT_FLOAT; |
|
1461 | sy_lfr_pas_filter_shift = INIT_FLOAT; | |
1351 | sy_lfr_sc_rw_delta_f = INIT_FLOAT; |
|
1462 | sy_lfr_sc_rw_delta_f = INIT_FLOAT; | |
1352 | parPtr = NULL; |
|
1463 | parPtr = NULL; | |
|
1464 | datafield_pos = NULL; | |||
|
1465 | rw_k = NULL; | |||
|
1466 | ||||
|
1467 | *datafield_pos = LFR_DEFAULT_ALT; | |||
|
1468 | *rw_k = INIT_FLOAT; | |||
1353 |
|
1469 | |||
1354 | //*************** |
|
1470 | //*************** | |
1355 | // get parameters |
|
1471 | // get parameters | |
@@ -1429,7 +1545,26 int check_sy_lfr_filter_parameters( ccsd | |||||
1429 |
|
1545 | |||
1430 | //********************* |
|
1546 | //********************* | |
1431 | // sy_lfr_sc_rw_delta_f |
|
1547 | // sy_lfr_sc_rw_delta_f | |
1432 | // nothing to check, no default value in the ICD |
|
1548 | if (flag == LFR_SUCCESSFUL) | |
|
1549 | { | |||
|
1550 | if ( sy_lfr_sc_rw_delta_f < MIN_SY_LFR_SC_RW_DELTA_F ) | |||
|
1551 | { | |||
|
1552 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_SC_RW_DELTA_F + DATAFIELD_OFFSET, sy_lfr_sc_rw_delta_f ); | |||
|
1553 | flag = WRONG_APP_DATA; | |||
|
1554 | } | |||
|
1555 | } | |||
|
1556 | ||||
|
1557 | //************ | |||
|
1558 | // sy_lfr_rw_k | |||
|
1559 | if (flag == LFR_SUCCESSFUL) | |||
|
1560 | { | |||
|
1561 | flag = check_all_sy_lfr_rw_k( TC, datafield_pos, rw_k ); | |||
|
1562 | if (flag != LFR_SUCCESSFUL) | |||
|
1563 | { | |||
|
1564 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, *datafield_pos + DATAFIELD_OFFSET, *rw_k ); | |||
|
1565 | } | |||
|
1566 | } | |||
|
1567 | ||||
1433 |
|
1568 | |||
1434 | return flag; |
|
1569 | return flag; | |
1435 | } |
|
1570 | } |
General Comments 0
You need to be logged in to leave comments.
Login now