コード例 #1
0
ファイル: helpers.cpp プロジェクト: Max13/Pulse-Qt
void    killall(QSettings &set)
{
    qint64  svcPid(set.value(QStringLiteral("svc/pid")).toLongLong());
    qint64  appPid(set.value(QStringLiteral("app/pid")).toLongLong());

    myKill(svcPid, SIGTERM);
    myKill(appPid, SIGTERM);
    qDebug() << "-> Killed running Svc and App";
}
コード例 #2
0
ファイル: personality_0.cpp プロジェクト: ChapResearch/ChapR
//
// matchStateProcess() - the matchmode callback that is used by matchmode to do
//		  whatever needs to be done with the state changes during
//		  match mode.  The NEW state that was just entered is
//		  passed to the callback routine.
//
//	NOTE: this routine is handed the "rock" that was given to it to, so that
//		it could be handed back during callbacks.
//
//	NOTE: Processing of the MM_OFF state needs to be "idempotent" - it should
//		be callable any number of times.
//
bool Personality_0::matchStateProcess(mmState mmState, void *rock)
{
     switch(mmState) {
     case MM_OFF:
	  enabled = false;	// ensure we are always disabled when in OFF state
	  mode = MODE_AUTO; 
	  break;

     case MM_AUTO_PREP:		// prepare for autonomous - allow the standard "true" to be returned
	  mode = MODE_AUTO;	//   because we don't wait for anything to get going in autonomous
	  break;

     case MM_AUTO_START:
          beeper.beep();
	  enabled = true;
	  break;

     case MM_AUTO_END:		// autonomous is ending
	  myKill((BT *)rock);	// this does the end program falling sound too
	  break;

     case MM_TELEOP_PREP:      	// prepare for teleop
	  mode = MODE_TELEOP;		// Note that this does the start program rising sound too
	  myTeleopStart((BT*)rock);	// also turns OFF enabled
	  return(false);		// return false to cause wait for button press to start teleop

     case MM_TELEOP_START:	// teleop is starting
          beeper.beep();
	  enabled = true;
	  break;

     case MM_ENDGAME_START:	// endgame (within teleop) is starting
          beeper.beep();
	  break;

     case MM_TELEOP_END:	// teleop is ending
	  // FALL THROUGH to next case - 'cause we need to kill the program at the end of Teleop

     case MM_KILL:		// the match as been killed
	  myKill((BT*)rock);	// kill any running program
	  break;

     default:
	  // we don't need MM_ENDGAME_END at this point
	  break;
     }

     return(true);
}
コード例 #3
0
ファイル: personality_0.cpp プロジェクト: ChapResearch/ChapR
//
// Kill() - called when someone presses the "kill" button (the power button)
//
void Personality_0::Kill(BT *bt)
{
  // it is the Kill() that will turn matchmode active, so process all kills when enabled

  if(isMatchEnabled()) {
	  MatchKillProcess((void *)bt);
  } else {
	  myKill(bt);
  }
}