Changeset 113 in tmcsimulator for branches


Ignore:
Timestamp:
10/14/2017 09:18:40 AM (9 years ago)
Author:
jtorres
Message:

LinuxVM non-segfaulting FEPSimulator - checkpoint

Location:
branches/FEPSimulator
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/FEPSimulator/DataPacker.cpp

    r80 r113  
    11#include "DataPacker.h"; 
     2#include <stdio.h> 
    23 
    34unsigned char * DataPacker::msg; 
     
    78    DataPacker packer; 
    89    msg = packer.staticDataPack(station); 
    9     pos = packer.dynamicDataPack(station, 5, pos);     
     10/*    pos = packer.dynamicDataPack(station, 5, pos);     
    1011    pos = packer.dynamicDataPack(station, 6, pos); 
    1112    pos = packer.dynamicDataPack(station, 7, pos); 
     
    1920    // will need to check if queue override is enabled (Currently, no queue 
    2021    // ldsMap[i].dataPack[16-1] = ; 
    21  
     22*/ 
    2223    // byte 23: MAINLINE total volume 
    2324    msg[23 - 1] = station->MlTotVol; 
     
    3031            packer.chksum(msg, station->length - 1 - 1); 
    3132     
    32     /* 
    3333    for (int j = 0; j < station->length; j++) { 
    3434        printf("%02X", msg[j]); 
    3535    } 
    3636    printf("\n"); 
    37     */ 
     37 
     38    return msg;  
    3839} 
    3940 
  • branches/FEPSimulator/FEPSim.cpp

    r86 r113  
    88} 
    99 
    10 FEPSim::~FEPSim() { 
    11  
     10FEPSim::~FEPSim() {  
    1211} 
    1312 
    1413void FEPSim::handleCallResponse(void *response) { 
    15     // Failed RPC Call 
    16     if (response == NULL) { 
    17         clnt_perror(clnt, "RPC call failed"); 
     14    // Failed RPC Call  
     15    if (response == NULL) { clnt_perror(clnt, "RPC call failed"); 
    1816    } 
    1917    // Successful RPC Call 
    20     else { 
    21         cout << "Successful RPC call to ATMS..." << endl; 
     18    else { cout << "Successful RPC call to ATMS..." << endl; 
    2219    } 
    2320} 
     
    5855        fepReply.answers.size = 1; 
    5956        fepReply.answers.fep_answer_list_u.shortp.count = 1; 
    60  
     57         
    6158        // construct a shortanswer for each station in line 
    6259        for (int j = 0; j < lines.at(i)->lds.size(); j++) { 
     
    6865            fsa.msg.message[0] = 0x0d; 
    6966            fsa.msg.message[1] = 0x0a; 
    70             for (int k = 0; k < ldsMap.at(index)->length; k++) 
     67            for (int k = 0; k < ldsMap.at(index)->length; k++) { 
     68                printf("Adding: %d %02X\n", k, ldsMap.at(index)->dataPack[k]);   
    7169                fsa.msg.message[2 + k] = ldsMap.at(index)->dataPack[k]; 
     70            } 
    7271            int aa = ldsMap.at(index)->length; 
    7372            fsa.msg.message[2 + aa] = 0x0d; 
    7473            fsa.msg.message[3 + aa] = 0xff; 
    75  
    76             // info 
     74   // info 
    7775            fsa.info.poll_error_count = 0; 
    7876            fsa.info.poll_user_info1 = ldsMap.at(index)->drop; // drop number 
     
    8280 
    8381            fepReply.answers.fep_answer_list_u.shortp.answers[0] = fsa; 
    84  
    8582            // send out data 
    8683            printf("Transferring line=%d, lds_drop_no=%d...\n", lines.at(i)->lineNum, ldsMap.at(index)->drop); 
  • branches/FEPSimulator/build/Debug/GNU-MacOSX/Main.o.d

    r101 r113  
    11build/Debug/GNU-MacOSX/Main.o: Main.cpp FEPSim.h fep.h NetworkReader.h \ 
    2   network.h tinyxml/tinyxml.h tinyxml/tinystr.h DataPacker.h 
     2 network.h tinyxml/tinyxml.h tinyxml/tinystr.h DataPacker.h 
    33 
    44FEPSim.h: 
Note: See TracChangeset for help on using the changeset viewer.