Beispiel #1
0
Eraser::Eraser( QObject *parent ) :
    SAbstractDiscEraser( parent )
{
    p = new EraserPrivate;

    p->detector = new SDiscDetector( this );
    p->process = new QProcess( this );
        p->process->setProcessChannelMode( QProcess::MergedChannels );

    p->timer = new QTimer( this );


#ifdef Q_OS_WIN32
    QDir dir( SDesktopFunctions::binaryPath() );
        dir.cdUp();

    p->command = dir.path() + "/cdrtools/dvd+rw-format.exe";
    p->command.replace( "/" , "\\" );
#else
    p->command = "dvd+rw-format";
#endif


    connect( p->timer       , SIGNAL(timeout())                 , SLOT(processOnOutput()) );
    connect( p->process     , SIGNAL(finished(int))             , SLOT(stopTimer())       );
    connect( p->process     , SIGNAL(readyReadStandardOutput()) , SLOT(processOnOutput()) );
    connect( p->process     , SIGNAL(readyReadStandardError())  , SLOT(processOnError())  );
    connect( p->detector    , SIGNAL(accepted())                , SLOT(step_2())          );
    connect( p->detector    , SIGNAL(rejected())                , SLOT(stopTimer())       );
}
Beispiel #2
0
void walk_call_1 (void)
{
  if ((PORTB == 4)&(state != 2))
  {                                   /*******************************/
    step_2();                         /** Red_led_1 comes faster    **/
    step_3();                         /*******************************/
    state = 1;
  }
}
Beispiel #3
0
AudioCdRecord::AudioCdRecord( QObject *parent )
    : SAbstractAudioBurner( parent )
{
    p = new AudioCdRecordPrivate;

    p->process = new QProcess( this );
        p->process->setProcessChannelMode( QProcess::MergedChannels );

    p->detector = new SDiscDetector( this );

    p->timer   = new QTimer( this );
    p->clock   = new QTimer( this );

    connect( p->timer           , SIGNAL(timeout())                   , SLOT(processOnOutput()) );
    connect( p->clock           , SIGNAL(timeout())                   , SLOT(clockJobs())       );
    connect( p->process         , SIGNAL(finished(int))               , SLOT(stopTimer())       );
    connect( p->process         , SIGNAL(readyReadStandardOutput())   , SLOT(processOnOutput()) );
    connect( p->process         , SIGNAL(readyReadStandardError())    , SLOT(processOnError())  );
    connect( p->detector        , SIGNAL(accepted())                  , SLOT(step_2())          );
    connect( p->detector        , SIGNAL(rejected())                  , SLOT(stopTimer())       );

    reset();
}
Beispiel #4
0
int main (void)
{
  DDRB = 7;                       /** Put PB0, PB1 and PB2 in Output**/

  DDRC = 47;            /** Put PC0, PC1, PC2, PC3 and PC5 in Output**/

  DDRD = 1<<PD2;                  /***********************************/
  DDRD |= 1<<PD3;                 /***********************************/
  PORTD = 1<<PD2;                 /**                               **/
  PORTD |= 1<<PD3;                /**                               **/
  EIMSK = 1<<INT0;                /**  Required to use interrupt    **/
  EIMSK |= 1<<INT1;               /**                               **/
  MCUCR = 1<<ISC01 | 1<<ISC00;    /**                               **/
  MCUCR |= 1<<ISC11 | 1<<ISC10;   /***********************************/
  sei();                          /***********************************/

  while(1)
  {
    if (state != 2)
    {
      state = 0;
      step_1();
    }
    if (state == 1)
    {
      step_4();
      step_5();
      step_6();
    }
    else
    {
      if(state != 2)
      {
        step_2();
        step_3();
      }
    }
    if (state != 1)
    {
      state = 0;
      step_4();

    }
    if (state == 2)
    {

      step_1();
      step_2();
      step_3();
    }
    else
    {
      if(state !=1)
      {
        step_5();
        step_6();
      }
    }
  }
  return 0;

}