diff --git a/server/views/scope.ejs b/server/views/scope.ejs
index 1e23d8f..d1425da 100644
--- a/server/views/scope.ejs
+++ b/server/views/scope.ejs
@@ -97,6 +97,7 @@
initTimer : 3,
onGoingTimer : 0,
boothId : null,
+ nbError : 0,
pictureId : 0
}
@@ -184,6 +185,24 @@
}, 500)
}
+ function BOB_showError () {
+ BOB_var_context.nbError += 1
+ $('#idViewCountdown').fadeIn()
+ $('#idViewCountdown').css('fontSize', '3em')
+ if (BOB_var_context.nbError >= 3) {
+ BOB_var_context.nbError = 0
+ $('#idViewCountdown').html("Oulala, le bobinoscope se sent pas
très bien
Revenez plus tard !")
+ setTimeout(function () {
+ $('#idViewCountdown').fadeOut(500, function() {
+ $('#idViewTrigger').fadeIn();
+ })
+ }, 5000)
+ } else {
+ $('#idViewCountdown').html("Oops ! Un problème de pellicule ...
On recommence")
+ BOB_var_context.onGoingTimer = BOB_var_context.initTimer
+ setTimeout(BOB_countdown, 4000)
+ }
+ }
function BOB_takeThe1Pictures() {
$.get('/booth/dslr/takepicture/'+BOB_var_context.boothId+'/'+BOB_var_context.pictureId, function(pResponse) {
@@ -195,14 +214,15 @@
// });
// return;
// }
- $('#idViewCountdown').html("Oops ! Un problème de pellicule
On Recommence !!!");
- $('#idViewCountdown').css('fontSize', '14em')
- } else {
- BOB_var_context.pictureId += 1
+ BOB_showError()
+ return
}
+ BOB_var_context.pictureId += 1
+ BOB_var_context.nbError = 0
+
if( BOB_var_context.pictureId < 4 ) {
- BOB_var_context.onGoingTimer = BOB_var_context.initTimer;
+ BOB_var_context.onGoingTimer = BOB_var_context.initTimer
BOB_countdown();
} else {
$('#idViewCountdown').fadeOut(500, function() {
diff --git a/tools/tools-gphoto2.js b/tools/tools-gphoto2.js
index 117a066..1e57864 100644
--- a/tools/tools-gphoto2.js
+++ b/tools/tools-gphoto2.js
@@ -24,12 +24,14 @@ function execGphoto2 (pArgs, pMore, pCallback) {
}
exec(`gphoto2 ${args}`, more, function (pErr, pStdout, pStderr) {
if (pErr) {
- console.log(`[!] Please install gphoto2`.red)
- console.log(`sudo apt-get install gphoto2`.bgMagenta)
- console.log(`[-] Bobinoscope will close in 10 seconds...`)
- setTimeout(function () {
- process.exit(1)
- }, 10000)
+ // console.log(`[!] Please install gphoto2`.red)
+ // console.log(`sudo apt-get install gphoto2`.bgMagenta)
+ // console.log(`[-] Bobinoscope will close in 10 seconds...`)
+ // console.log('[!]', pErr)
+ callback(pErr)
+ // setTimeout(function () {
+ // process.exit(1)
+ // }, 10000)
return
}
let error = null