Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagohm committed Oct 21, 2024
2 parents e144290 + 2790c8e commit 0de6d3b
Show file tree
Hide file tree
Showing 55 changed files with 1,580 additions and 43,794 deletions.
2 changes: 2 additions & 0 deletions api/src/main/kotlin/nebulosa/api/Nebulosa.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import nebulosa.log.loggerFor
import org.koin.core.context.startKoin
import org.slf4j.LoggerFactory
import java.net.ConnectException
import java.util.concurrent.ExecutionException
import java.util.concurrent.ExecutorService

@Command(name = "nebulosa")
Expand Down Expand Up @@ -80,6 +81,7 @@ class Nebulosa : Runnable, AutoCloseable {
val message = when (ex) {
is ConnectException -> "connection refused"
is NumberFormatException -> "invalid number: ${ex.message}"
is ExecutionException -> ex.cause!!.message!!
else -> ex.message!!
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ data class TPPAStartRequest(
@JsonIgnoreProperties("camera", "focuser", "wheel") @JvmField val capture: CameraStartCaptureRequest = CameraStartCaptureRequest.EMPTY,
@JvmField val plateSolver: PlateSolverRequest = PlateSolverRequest.EMPTY,
@JvmField val startFromCurrentPosition: Boolean = true,
@JvmField val compensateRefraction: Boolean = false,
@JvmField val stopTrackingWhenDone: Boolean = true,
@JvmField val stepDirection: GuideDirection = GuideDirection.EAST,
@field:DurationUnit(ChronoUnit.SECONDS) @JvmField val stepDuration: Duration = Duration.ZERO,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,10 @@ data class TPPATask(
@JvmField val alignment: ThreePointPolarAlignment,
) : Task {

private val mount = job.mount
private val request = job.request

override fun run() {
val mount = job.mount
val radius = ATTEMPT_RADIUS * (job.noSolutionAttempts + 1)

val result = alignment.align(
job.savedPath!!, mount.rightAscension, mount.declination, radius,
request.compensateRefraction // TODO: CANCELLATION TOKEN?
)

val result = alignment.align(job.savedPath!!, mount.rightAscension, mount.declination, radius)
job.accept(result)
}

Expand Down
5 changes: 3 additions & 2 deletions api/src/main/kotlin/nebulosa/api/atlas/SkyAtlasUpdateTask.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ class SkyAtlasUpdateTask(
httpClient.newCall(request).execute().use { response ->
if (response.isSuccessful) {
val newestVersion = response.body!!.string().trim()
val currentVersion = preferenceService.getText(VERSION_KEY)

if (newestVersion != preferenceService.getText(VERSION_KEY) || skyObjectEntityRepository.size == 0L) {
if (newestVersion != currentVersion || skyObjectEntityRepository.size == 0L) {
skyObjectEntityRepository.clear()

LOG.i("Sky Atlas database is out of date. downloading...")
LOG.i("Sky Atlas database is out of date. current={}, newest={}", currentVersion, newestVersion)

messageService.sendMessage(SkyAtlasUpdateNotificationEvent.Started)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class PreferenceRepository(private val connection: Database) {
}

fun update(entity: PreferenceEntity) = transaction(connection) {
PreferenceTable.update { entity.mapTo(it, true) }
PreferenceTable.update({ PreferenceTable.key eq entity.key }) { entity.mapTo(it, true) }
}

fun delete(key: String) = transaction(connection) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ data class StarDetectionRequest(
StarDetectorType.SIRIL -> SirilStarDetector(executablePath!!, maxStars)
StarDetectorType.PIXINSIGHT -> {
val runner = startPixInsight(executablePath!!, slot)
PixInsightStarDetector(runner, slot, minSNR, timeout)
PixInsightStarDetector(runner, minSNR, timeout, slot)
}
}

Expand Down
Binary file removed data/catalog.dat
Binary file not shown.
22,624 changes: 0 additions & 22,624 deletions data/eopc04.1962-now.txt

This file was deleted.

19,046 changes: 0 additions & 19,046 deletions data/finals2000A.all

This file was deleted.

1,541 changes: 0 additions & 1,541 deletions data/names.dat

This file was deleted.

Loading

0 comments on commit 0de6d3b

Please sign in to comment.