Commit cb1789aa authored by David's avatar David

Fixing timeout issue

parent d9c89fb4
......@@ -2,12 +2,12 @@ package `is`.kow.deskscreen.camera
import `is`.kow.deskscreen.MainController
import `is`.kow.deskscreen.TransitionsController
import `is`.kow.deskscreen.utils.Util
import com.github.thomasnield.rxkotlinfx.doOnNextFx
import com.github.thomasnield.rxkotlinfx.observeOnFx
import com.hopding.jrpicam.RPiCamera
import io.reactivex.Observable
import io.reactivex.schedulers.Schedulers
import javafx.embed.swing.SwingFXUtils
import javafx.event.ActionEvent
import javafx.scene.image.Image
import mu.KotlinLogging
......@@ -54,8 +54,7 @@ class CameraController : Controller() {
.map {
val timeout = 5
//Handles the timer countdown
//TODO: why did this never show up?
//gimme a timer countdown
logger.debug("Right before starting range timeout")
Observable.intervalRange(0, timeout.toLong() + 1, 0, 1, TimeUnit.SECONDS)
.map {
......@@ -74,11 +73,11 @@ class CameraController : Controller() {
val bf = camera
?.setRotation(270)
?.setDateTimeOn()
?.setTimeout(timeout)
?.setTimeout(timeout * 1000) //This timeout is in milliseconds
?.setFullPreviewOn()
?.takeBufferedStill()!!
//lets just convert it directly
SwingFXUtils.toFXImage(bf, null)
Util.toFXImage(bf, null)
} else {
//load the cat picture WHY WON'T YOU LOAD MY KITTY
val stream = this.javaClass.getResourceAsStream("/imagery/MaineCoon-cropped.jpeg")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment