|
|
@ -16,7 +16,7 @@ const CTX = { |
|
|
return CTX.__io |
|
|
return CTX.__io |
|
|
}, |
|
|
}, |
|
|
inProgress: 0, |
|
|
inProgress: 0, |
|
|
testPath: '/tmp/bobinoscope-test.jpg' |
|
|
|
|
|
|
|
|
testPath: path.join(CFG.output, 'bobinoscope-test.jpg') |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
booth.init() |
|
|
booth.init() |
|
|
@ -32,7 +32,9 @@ setGamepad() |
|
|
router.get('/dslr/takepicture/:boothId/:pictId', function (req, res, next) { |
|
|
router.get('/dslr/takepicture/:boothId/:pictId', function (req, res, next) { |
|
|
// return res.json({})
|
|
|
// return res.json({})
|
|
|
gphoto2.takeOnePicture(req.params.boothId, req.params.pictId, function (pErr) { |
|
|
gphoto2.takeOnePicture(req.params.boothId, req.params.pictId, function (pErr) { |
|
|
res.json({ error: pErr, data: null }) |
|
|
|
|
|
|
|
|
let error = typeof pErr === 'string' ? pErr : JSON.stringigy(pErr) |
|
|
|
|
|
if (pErr) console.error(pErr) |
|
|
|
|
|
res.json({ error: error, data: null }) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
@ -78,7 +80,7 @@ router.get('/print/:pictId', function (req, res, next) { |
|
|
// TEST
|
|
|
// TEST
|
|
|
|
|
|
|
|
|
router.get('/test/takepicture', function (req, res, next) { |
|
|
router.get('/test/takepicture', function (req, res, next) { |
|
|
let tmpPict = '/tmp/bobinoscope-test.tmp.jpg' |
|
|
|
|
|
|
|
|
let tmpPict = path.join(CFG.output, 'bobinoscope-test.tmp.jpg') |
|
|
gphoto2.__takeOnePicture(tmpPict, function (pErr) { |
|
|
gphoto2.__takeOnePicture(tmpPict, function (pErr) { |
|
|
if (pErr) return res.status(500).send(pErr) |
|
|
if (pErr) return res.status(500).send(pErr) |
|
|
gm(tmpPict) |
|
|
gm(tmpPict) |
|
|
@ -92,7 +94,7 @@ router.get('/test/takepicture', function (req, res, next) { |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
router.get('/test/takepicture/result', function (req, res, next) { |
|
|
router.get('/test/takepicture/result', function (req, res, next) { |
|
|
res.sendFile('/tmp/bobinoscope-test.jpg') |
|
|
|
|
|
|
|
|
res.sendFile(path.join(CFG.output, 'bobinoscope-test.jpg')) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
router.setSocketIo = function (pIo) { |
|
|
router.setSocketIo = function (pIo) { |
|
|
|