Skip to content

Commit

Permalink
reboot stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
ofTheo committed Sep 6, 2010
1 parent f303aa2 commit 5629731
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
1 change: 1 addition & 0 deletions CaptureApp/bin/data/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
mySettingsFile.xml
controlCapture.xml
controlDecode.xml
reboot.sh
6 changes: 3 additions & 3 deletions CaptureApp/src/captureApp/captureApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,12 @@ void captureApp::setupOsc(){
void captureApp::update(){
panel.update();

//printf("time is %i %i\n", ofGetHours(), ofGetMinutes());

if( panel.getValueB("bRestart") ){
if( panel.getValueI("restartHour") == ofGetHours() ){
if( panel.getValueI("restartMinute") == ofGetMinutes() ){
system("shutdown -r now");
printf("shutting down now!\n");

system(ofToDataPath("reboot.sh").c_str());
}
}
}
Expand Down
1 change: 1 addition & 0 deletions VisualizationApp/bin/data/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
appSettings.xml
reboot.sh
22 changes: 21 additions & 1 deletion VisualizationApp/src/testApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,14 @@ void testApp::setupControlPanel(){
panel.addToggle("convert to png after load", "bConvertToPng", true);
panel.addToggle("auto change face", "bAutoChange", false);
panel.addSlider("change face time", "changeTime", 28.2, 8.0, 60.0, false);


panel.addChartPlotter("fps", guiStatVarPointer("app fps", &appFps, GUI_VAR_FLOAT, true, 2), 200, 80, 200, 8, 100);

panel.addToggle("restart at 3.00am", "bRestart", false);
panel.addSlider("restart hour", "restartHour", 3, 1, 23, true);
panel.addSlider("restart minute", "restartMinute", 0, 0, 59, true);

panel.addToggle("player mode", "toggle_mode", false);

//--------- animation params
Expand Down Expand Up @@ -182,6 +187,8 @@ void testApp::setupControlPanel(){

panel.loadSettings("appSettings.xml");

panel.setValueB("toggle_mode", false);

//Particle::globalOffset.set(0, 1. / 3, 2. / 3);

}
Expand Down Expand Up @@ -483,6 +490,16 @@ void testApp::eventsIn(eventStruct &dataIn){

//--------------------------------------------------------------------------
void testApp::update() {

if( panel.getValueB("bRestart") ){
if( panel.getValueI("restartHour") == ofGetHours() ){
if( panel.getValueI("restartMinute") == ofGetMinutes() ){
printf("shutting down now!\n");

system(ofToDataPath("reboot.sh").c_str());
}
}
}

float slowMomentum = panel.getValueF("slowMomentum");
if(isSlow)
Expand Down Expand Up @@ -522,7 +539,6 @@ void testApp::update() {
aberration = panel.getValueF("aberration");
aperture = panel.getValueF("aperture");

bTogglePlayer = panel.getValueB("toggle_mode");

panel.clearAllChanged();

Expand All @@ -533,6 +549,10 @@ void testApp::update() {
}

// END CONTROL PANEL

//DO NOT CHANGE THIS MOFO - YEAH YOU :)
bTogglePlayer = false;//panel.getValueB("toggle_mode");


if (!panel.getValueB("bFreezeParticles"))
SP.update();
Expand Down

0 comments on commit 5629731

Please sign in to comment.