#include "modelbahn.h" #include "interface.h" // ************************************************************************** // * // * I N T E R F A C E (gateway to different devices) // * // ************************************************************************** Interface::Interface() { name[0] = 0; host[0] = 0; flags = 0; type = INTF_T_OFF_UNKNOWN; needs_update = true; }; Interface::~Interface() { }; void Interface::Connect () { debug ("Interface (%s) Connect to %s **** VIRTUAL NOT IMPLEMENTED ****", name, host); }; void Interface::Disconnect() { debug ("Interface (%s) Disconnect **** VIRTUAL NOT IMPLEMENTED ****", name); }; void Interface::PowerOnOff(int onoff) { debug ("Interface (%s) PowerOnOff %d **** VIRTUAL NOT IMPLEMENTED ****", name, onoff); }; /* * Turnout: * this function will check if the interface has not set any output within the past 100ms. For this we * will save the current time in the value turnouttime. */ void Interface::SetTurnout(Turnout *t, int active, int outputactive) { debug ("Interface (%s) SetTurnout Addr:%d Acitve:%d Output:%d **** VIRTUAL NOT IMPLEMENTED ****", name, t->addr, active, outputactive); }; // // Locomotive // void Interface::SetLocoSpeed(Locomotive *l, int step) { debug ("Interface (%s) SetLocoSpeed Addr:%d Speed:%d **** VIRTUAL NOT IMPLEMENTED ****", name, l->addr, step); }; void Interface::SetLocoFunction(Locomotive *l, int func, int value) { debug ("Interface (%s) SetLocoFunction Addr:%d Func:%d:%d **** VIRTUAL NOT IMPLEMENTED ****", name, l->addr, func, value); }; // // if update is needed return 1 // int Interface::Loop() { int ret = 0; flags &= ~(INTF_F_CONNECTED | INTF_F_POWER | INTF_F_STOP | INTF_F_SHORT_CIRCUIT | INTF_F_PROGRAMMING); if (needs_update) { ret = 1; needs_update = 0; } return ret; }; bool Interface::IsConnected() { debug ("Interface (%s) IsConnected **** VIRTUAL NOT IMPLEMENTED ****", name); return false; } bool Interface::IsPoweron() { debug ("Interface (%s) IsPoweron **** VIRTUAL NOT IMPLEMENTED ****", name); return false; } bool Interface::IsSortCircuit() { debug ("Interface (%s) IsSortCircuit **** VIRTUAL NOT IMPLEMENTED ****", name); return false; } bool Interface::IsProgramminnMode() { debug ("Interface (%s) IsProgramminnMode **** VIRTUAL NOT IMPLEMENTED ****", name); return false; } bool Interface::IsEmergencyStop() { debug ("Interface (%s) IsEmergencyStop **** VIRTUAL NOT IMPLEMENTED ****", name); return false; }