diff --git a/pom.xml b/pom.xml index fd44b83..1e9706f 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ 2020.1-SNAPSHOT pom - nxs.ladstatt.sudoku.pom + nxs.ladstatt.sudoku.sudokufx UTF-8 @@ -17,6 +17,7 @@ ${opencv.major.version}.0 /Users/lad/custom-builds/opencv-4.3.0/out/ ${opencv.install.path}share/java/opencv4/opencv-430.jar + 11.0.2 @@ -31,6 +32,26 @@ + + org.openjfx + javafx-base + 11.0.2 + + + org.openjfx + javafx-swing + 11.0.2 + + + org.openjfx + javafx-fxml + 11.0.2 + + + org.openjfx + javafx-controls + 11.0.2 + org.scala-lang scala-library @@ -111,7 +132,6 @@ -language:implicitConversions -unchecked -Xcheckinit - -Xlint:adapted-args -Xlint:constant -Xlint:delayedinit-select @@ -139,8 +159,9 @@ -Ywarn-unused:privates -Ywarn-value-discard -Yrangepos - -P:semanticdb:synthetics:on + + @@ -169,6 +191,7 @@ + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0-M3 + + + + org.apache.maven.plugins + maven-enforcer-plugin + + + enforce-jdk + + enforce + + + + + 3.6.2 + + + 11 + + + + + + + @@ -214,7 +268,6 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0-M3 enforce-opencv diff --git a/sudoku-javafx/pom.xml b/sudoku-javafx/pom.xml index 425dc23..aa62b3f 100644 --- a/sudoku-javafx/pom.xml +++ b/sudoku-javafx/pom.xml @@ -14,23 +14,31 @@ - net.ladstatt.sudoku - sudoku-core + org.scala-lang + scala-library - org.jfxtras - jfxtras-controls - 8.0-r4 + org.openjfx + javafx-base - org.jfxtras - jfxtras-labs - 8.0-r4 + org.openjfx + javafx-controls - org.scala-lang - scala-library + org.openjfx + javafx-swing + + org.openjfx + javafx-fxml + + + + net.ladstatt.sudoku + sudoku-core + + org.scalacheck scalacheck_${scala.major.version} @@ -51,13 +59,7 @@ - - - net.alchim31.maven - scala-maven-plugin - - maven-assembly-plugin @@ -79,12 +81,16 @@ + + net.alchim31.maven + scala-maven-plugin + org.scalatest scalatest-maven-plugin - + diff --git a/sudoku-javafx/src/main/resources/net/ladstatt/sudoku/sudokufx.fxml b/sudoku-javafx/src/main/resources/net/ladstatt/sudoku/sudokufx.fxml index a845fc7..f053854 100644 --- a/sudoku-javafx/src/main/resources/net/ladstatt/sudoku/sudokufx.fxml +++ b/sudoku-javafx/src/main/resources/net/ladstatt/sudoku/sudokufx.fxml @@ -4,7 +4,6 @@ - @@ -25,31 +24,23 @@ - + - + - + - + diff --git a/sudoku-javafx/src/main/scala/net/ladstatt/sudoku/OpenCVJfxUtils.scala b/sudoku-javafx/src/main/scala/net/ladstatt/sudoku/OpenCVJfxUtils.scala index 461c961..4a5933b 100644 --- a/sudoku-javafx/src/main/scala/net/ladstatt/sudoku/OpenCVJfxUtils.scala +++ b/sudoku-javafx/src/main/scala/net/ladstatt/sudoku/OpenCVJfxUtils.scala @@ -2,9 +2,9 @@ package net.ladstatt.sudoku import java.awt.image.BufferedImage import java.io.{ByteArrayInputStream, File} + import javafx.embed.swing.SwingFXUtils import javafx.scene.image.Image - import net.ladstatt.core.CanLog import org.opencv.core.{Mat, MatOfByte, Point} import org.opencv.imgcodecs.Imgcodecs @@ -14,14 +14,14 @@ import scala.concurrent.Future trait OpenCVJfxUtils extends CanLog { - // TODO profile if toImage or toImage2 is faster - def toImage(mat: Mat): Image = { + // TODO profile if toImage or toImage2 is faster + def toImage(mat: Mat): Image = { val byteMat = new MatOfByte() Imgcodecs.imencode(".bmp", mat, byteMat) new Image(new ByteArrayInputStream(byteMat.toArray)) } - def toImage2(matrix: Mat): Image = logWithTimer("frame2",{ + def toImage2(matrix: Mat): Image = logWithTimer("frame2", { val cols = matrix.cols() val rows = matrix.rows() val elemSize = matrix.elemSize() @@ -58,7 +58,7 @@ trait OpenCVJfxUtils extends CanLog { val image = new BufferedImage(cols, rows, lType) image.getRaster.setDataElements(0, 0, cols, rows, data) SwingFXUtils.toFXImage(image, null) - } ) + }) def convert2PolyLinePoints(points: Iterable[Point]): List[java.lang.Double] = { diff --git a/sudoku-javafx/src/main/scala/net/ladstatt/sudoku/SudokuFX.scala b/sudoku-javafx/src/main/scala/net/ladstatt/sudoku/SudokuFX.scala index a8b82e3..daa607d 100644 --- a/sudoku-javafx/src/main/scala/net/ladstatt/sudoku/SudokuFX.scala +++ b/sudoku-javafx/src/main/scala/net/ladstatt/sudoku/SudokuFX.scala @@ -24,7 +24,6 @@ import javafx.scene.image.{Image, ImageView} import javafx.scene.layout.{AnchorPane, FlowPane, VBox} import javafx.scene.paint.Color import javafx.scene.shape.{Circle, Polygon, Polyline, Rectangle} -import jfxtras.labs.scene.control.gauge.linear.SimpleMetroArcGauge import net.ladstatt.core.CanLog import net.ladstatt.opencv.OpenCV import org.opencv.core.{Mat, MatOfPoint, Point} @@ -106,11 +105,6 @@ class SudokuFXController extends Initializable with OpenCVJfxUtils with CanLog w @FXML var mainMenuBar: MenuBar = _ @FXML var modeButtons: ToggleGroup = _ - @FXML var frameNumberGauge: SimpleMetroArcGauge = _ - @FXML var detectionGauge: SimpleMetroArcGauge = _ - @FXML var frameRateGauge: SimpleMetroArcGauge = _ - @FXML var lastDetectionGauge: SimpleMetroArcGauge = _ - @FXML var contourModeChoiceBox: ChoiceBox[Int] = _ @FXML var contourMethodChoiceBox: ChoiceBox[Int] = _ @FXML var contourRatioChoiceBox: ChoiceBox[Int] = _ @@ -268,14 +262,6 @@ class SudokuFXController extends Initializable with OpenCVJfxUtils with CanLog w canvas.getChildren.add(sudokuBorder) canvas.getChildren.addAll(analysisCellBounds.toList.asJava) canvas.getChildren.addAll(analysisCellCorners.toList.asJava) - frameNumberGauge.setMaxValue(5000) - frameNumberGauge.setMinValue(0) - detectionGauge.setMinValue(0) - detectionGauge.setMaxValue(500) - frameRateGauge.setMinValue(0) - frameRateGauge.setMaxValue(60) - lastDetectionGauge.setMinValue(0) - lastDetectionGauge.setMaxValue(81) () } @@ -511,11 +497,8 @@ class SudokuFXController extends Initializable with OpenCVJfxUtils with CanLog w setAnalysisMouseTransparent(false) updateDigitLibraryView(getCurrentSudokuState.library, as[ImageView](numberFlowPane.getChildren.asScala.toSeq)) - frameRateGauge.setValue(Float.float2double(getPerformanceTracker.getAverageFPS)) result match { case success: SSuccess if success.someSolution.isDefined => - detectionGauge.setValue(detectionGauge.getValue + 1) - lastDetectionGauge.setValue(Int.int2double(success.sudokuFrame.detectedCells.length)) updateStatus(mkFps(success.inputFrame.pipeline.start), Color.GREEN) case onlyCorners: SSuccess if onlyCorners.someSolution.isEmpty => updateStatus(mkFps(onlyCorners.inputFrame.pipeline.start), Color.ORANGE)