- Main Page
- Namespaces
- Classes
- Files
- Related Pages

# /Users/fpy/titan-1-5-MBARI/Mers/Executives/DeductiveController/Rtapi/MR/Stub/MR_callback_stub.cpp

    00001
    00002 //
    00003 // Copyright (c) 2004           Model-based Embedded and Robotic Systems Group
    00004 // All Rights Reserved          Massachusetts Institute of Technology
    00005 //
    00006 // This software is provided as is. Model-based Embedded and Robotic Systems
    00007 // (MERS) group does not assume any responsibility.
    00008 //
    00009 // Organization:        Model-based Embedded and Robotic Systems Group
    00010 //                                      Massachusetts Institute of Technology
    00011 //
    00013
    00014 #include <cstdio>
    00015 #include "MR_callback_stub.h"
    00016
    00018
    00019 using namespace Mers::Executives::DeductiveController::Rtapi::MR::Stub;
    00020 using Mers::Utils::Containers::intList;
    00021
    00023
    00024 // A simple (dummy) class implementing the MR_callback interface
    00025 void MR_callback_stub::process_next_control_cmd(const intList &commands) {
    00026         int type, variable = 0, value = 0;
    00027         printf("SCL callback: retrieved commands: ");
    00028         type = commands.front();
    00029         if(type == 0) {
    00030                 printf("No Command\n");
    00031         } else if(type == 1) {
    00032                 intList::const_iterator const_it = commands.begin();
    00033                 variable = *++const_it;
    00034                 value = *++const_it;
    00035                 printf("%d %d\n", variable, value);
    00036         } else if(type == 2) {
    00037                 printf("Error generating RP\n");
    00038         } else {
    00039                 printf("Unknown data!\n");
    00040         }
    00041 }