//-----------------------------------------------------------------------------
///
/// \brief  Arbiter for signals from Qt Interface
///
/// \date   20151129
/// \author Maximilian Seesslen <mes@seesslen.net>
///
//-----------------------------------------------------------------------------


//---Includes------------------------------------------------------------------


#include <lepto/log.h>
#include <biwak/linux/boardgui.h>
#include "arbiter.h"
#include <QObject>
#include <biwak/button.hpp>


//---Implementation------------------------------------------------------------


CArbiter::CArbiter( CBoardGui *boardGui)
{
   connect ( boardGui, SIGNAL( signalInputChanged( int, int ) ),
             this, SLOT( slotInputChanged( int, int ) ) );

   return;
};


CArbiter::~CArbiter( )
{
   return;
}


void CArbiter::slotInputChanged( int extiIndex, int state )
{
#if 0
   CButton *button;

   lHint << "Arbiter! " << extiIndex;

   button=pf.getButtonByPinIndex(extiIndex);

   if( button )
   {
      button->setValue(state);
      if(state)
         callInterrupt( (EInterrupt) ( (int)eInterruptExti0 + extiIndex) );
   }
   else
      lHint << "Problem: can't find button";

#endif

   return;
}


//---fin-----------------------------------------------------------------------
