| | 24 | extern struct mnbd_dlc_cmd_struct g_dlc_cmd; |
| | 25 | extern struct mnbd_dlc_response_struct g_dlc_response; |
| | 26 | |
| | 27 | struct dlc_card_struct |
| | 28 | { |
| | 29 | int numScales; |
| | 30 | int numCellsPerScale[10]; |
| | 31 | }; |
| | 32 | |
| | 33 | dlc_card_struct dlc_card[10]; |
| | 34 | |
| | 35 | int numCells = 0; |
| | 36 | |
| | 37 | void GetCellInfo(int dlcNum) |
| | 38 | { |
| | 39 | int i; |
| | 40 | int cell; |
| | 41 | uint8 cellScale; |
| | 42 | int numScales; |
| | 43 | |
| | 44 | dlc_card[dlcNum].numScales = 0; |
| | 45 | for(i = 0; i < 10; i++) |
| | 46 | { |
| | 47 | dlc_card[dlcNum].numCellsPerScale[i] = 0; |
| | 48 | } |
| | 49 | |
| | 50 | // Get the number of cells from the mainboard |
| | 51 | memset(&g_dlc_cmd, 0, sizeof(g_dlc_cmd)); |
| | 52 | memset(&g_dlc_response, 0, sizeof(g_dlc_response)); |
| | 53 | g_dlc_cmd.cmd_code = DLC_GET_SCALE_INFO; |
| | 54 | if(MnBdRequest(dlcNum + 1, MNBD_REQ_DLC_GET_SCALE_INFO, WAIT_ACK) == OK) |
| | 55 | { |
| | 56 | numCells = g_dlc_response.cmd_response[0]; |
| | 57 | numScales = g_dlc_response.cmd_response[1]; |
| | 58 | |
| | 59 | dlc_card[dlcNum].numScales = 0; |
| | 60 | for(cell = 0; cell < numCells; cell++) |
| | 61 | { |
| | 62 | memset(&g_dlc_cmd, 0, sizeof(g_dlc_cmd)); |
| | 63 | memset(&g_dlc_response, 0, sizeof(g_dlc_response)); |
| | 64 | |
| | 65 | g_dlc_cmd.cmd_code = DLC_GET_CELL_SCALE; |
| | 66 | g_dlc_cmd.cmd_param[0] = cell; |
| | 67 | if(MnBdRequest(dlcNum + 1, MNBD_REQ_DLC_GET_SCALE_INFO, WAIT_ACK) == OK) |
| | 68 | { |
| | 69 | cellScale = g_dlc_response.cmd_response[1]; |
| | 70 | if(cellScale > 0 && cellScale < 11) |
| | 71 | { |
| | 72 | dlc_card[dlcNum].numCellsPerScale[cellScale - 1]++; |
| | 73 | |
| | 74 | if(cellScale > dlc_card[dlcNum].numScales) |
| | 75 | { |
| | 76 | dlc_card[dlcNum].numScales = cellScale; |
| | 77 | } |
| | 78 | } |
| | 79 | } |
| | 80 | |
| | 81 | } |
| | 82 | for(i = 0; i < dlc_card[dlcNum].numScales; i++) |
| | 83 | { |
| | 84 | printf("scale %d has %d cells\r\n", i + 1, dlc_card[dlcNum].numCellsPerScale[i]); |
| | 85 | } |
| | 86 | } |
| | 87 | } |
| | 88 | |
| 59 | | int n = repeat_multi_record - 0x31; |
| 60 | | DEBUG_MSG("Cell wts for scale %d %6.0f %6.0f %6.0f %6.0f\r\n", n + 1, |
| 61 | | REPEAT_MULTI_CELL_WT(n, 0), REPEAT_MULTI_CELL_WT(n, 1), REPEAT_MULTI_CELL_WT(n, 2), REPEAT_MULTI_CELL_WT(n, 3)); |
| 62 | | |
| | 128 | int scaleIndex = repeat_multi_record - 0x31; |
| | 129 | DEBUG_MSG("Cell wts for scale %d - ", scaleIndex + 1); |
| | 130 | int cell; |
| | 131 | for(cell = 0; cell < dlc_card[0].numCellsPerScale[scaleIndex]; cell++) |
| | 132 | { |
| | 133 | DEBUG_MSG(" %6.0f", REPEAT_MULTI_CELL_WT(scaleIndex, cell)); |
| | 134 | } |
| | 135 | DEBUG_MSG("\r\n"); |
| 73 | | Cell wts for scale 1 3665 1335 7289 12839 |
| 74 | | Cell wts for scale 2 14250 11641 -0 0 |
| 75 | | Cell wts for scale 3 0 0 -0 -0 |
| 76 | | Cell wts for scale 1 3665 1335 7288 12838 |
| 77 | | Cell wts for scale 2 14250 11641 0 0 |
| 78 | | Cell wts for scale 3 0 0 -0 -0 |
| 79 | | Cell wts for scale 1 3665 1336 7288 12838 |
| 80 | | Cell wts for scale 2 14249 11641 -0 0 |
| 81 | | Cell wts for scale 3 0 0 -0 -0 |
| 82 | | Cell wts for scale 1 3665 1336 7288 12838 |
| 83 | | Cell wts for scale 2 14250 11642 0 0 |
| 84 | | Cell wts for scale 3 -0 0 -0 -0 |
| | 145 | Cell wts for scale 1 - 0 0 0 0 |
| | 146 | Cell wts for scale 2 - -0 0 0 0 |
| | 147 | Cell wts for scale 3 - 7302 9932 4074 5342 0 0 |
| | 148 | Cell wts for scale 1 - 0 -0 0 0 |
| | 149 | Cell wts for scale 2 - 0 0 0 0 |
| | 150 | Cell wts for scale 3 - 7302 9932 4074 5342 0 0 |