Skip to content

Commit

Permalink
Merge pull request #827 from luechtdiode/fix/826_incomplete-squad-ass…
Browse files Browse the repository at this point in the history
…ignements

Fix/826 incomplete squad assignements
  • Loading branch information
luechtdiode authored Feb 16, 2024
2 parents 3a8837b + da52b21 commit 53ef802
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ch.seidel</groupId>
<artifactId>KuTu</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>

<inceptionYear>2014</inceptionYear>

Expand Down Expand Up @@ -333,7 +333,7 @@
<dependency>
<groupId>org.simplejavamail</groupId>
<artifactId>simple-java-mail</artifactId>
<version>8.3.1</version>
<version>8.6.2</version>
</dependency>

<dependency>
Expand Down
18 changes: 15 additions & 3 deletions src/main/scala/ch/seidel/kutu/KuTuApp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ object KuTuApp extends JFXApp3 with KutuService with JsonSupport with JwtSupport
setCursor(Cursor.Wait)
try {
handler(event)
} catch {
case e: Throwable =>
logger.error("Unerwarteter Fehler", e)
throw e
}
finally {
setCursor(Cursor.Default)
Expand All @@ -129,6 +133,11 @@ object KuTuApp extends JFXApp3 with KutuService with JsonSupport with JwtSupport
Platform.runLater {
try {
task
} catch {
case e: Throwable =>
logger.error("Unerwarteter Fehler", e)
Platform.runLater(() => PageDisplayer.showErrorDialog("Unerwarteter Fehler")(e))
throw e
}
finally {
setCursor(Cursor.Default)
Expand Down Expand Up @@ -164,14 +173,17 @@ object KuTuApp extends JFXApp3 with KutuService with JsonSupport with JwtSupport
p.success(ret)
}
catch {
case e: Exception => p.failure(e)
case e: Throwable =>
logger.error("Fehler beim Abschliessen von " + title, e)
p.failure(e)
}
finally {
//setCursor(Cursor.Default)
pForm.getDialogStage.close()
}
}
case Failure(error) =>
logger.error("Fehler bei " + title, error)
Platform.runLater {
try {
p.failure(error)
Expand All @@ -186,8 +198,8 @@ object KuTuApp extends JFXApp3 with KutuService with JsonSupport with JwtSupport
timerTask.run()
}
catch {
case e: Exception =>
e.printStackTrace()
case e: Throwable =>
logger.error("Fehler bei " + title, e)
Platform.runLater {
try {
p.failure(e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,14 @@ object RiegenBuilder {
val riegen = kandidatriegen.map(_._2).sortBy(r => r.start.map( dzl.indexOf(_)))
//kandidat.diszipline für die Rotationsberechnung verwenden
val rg = riegen.groupBy(e => e.start).toList.sortBy{d => d._1.map( dzl.indexOf(_))}
val geraete = dzl.foldLeft(rg){(acc, item) =>
acc.find(p => p._1.exists { f => f.equals(item) }) match {
case Some(_) => acc
case _ => acc :+ (Some(item) -> List[Riege]())
val geraete = dzl.foldLeft(rg) { (acc, item) =>
acc.find(p => p._1.exists { f => f.equals(item) }) match {
case Some(_) => acc
case _ => acc :+ (Some(item) -> List[Riege]())
}
}
}.sortBy(geraet => geraet._1.map(g => dzl.indexOf(g)))
.filter(pair => dzlmap.exists(p => pair._1.contains(p._1)))
.sortBy(geraet => geraet._1.map(g => dzl.indexOf(g)))
.map(geraet => (geraet._1, geraet._2, dzlmap(geraet._1.get)))

val startformationen = pickStartformationen(geraete, durchgang, k => (k.einteilung, k.diszipline))
Expand Down Expand Up @@ -136,7 +138,9 @@ object RiegenBuilder {
case Some(_) => acc
case _ => acc :+ (Some(item) -> List[Riege]())
}
}.sortBy(geraet => geraet._1.map(g => dzl.indexOf(g)))
}
.filter(pair => dzlmap.exists(p => pair._1.contains(p._1)))
.sortBy(geraet => geraet._1.map(g => dzl.indexOf(g)))
.map(geraet => (geraet._1, geraet._2, dzlmap(geraet._1.get)))

val startformationen = pickStartformationen(geraete, durchgang, k => (k.einteilung2, k.diszipline2))
Expand Down

0 comments on commit 53ef802

Please sign in to comment.