-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
242 changed files
with
6,030 additions
and
1,324 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 4 additions & 18 deletions
22
api/src/main/kotlin/nebulosa/api/atlas/SatelliteRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,18 @@ | ||
package nebulosa.api.atlas | ||
|
||
import io.objectbox.Box | ||
import io.objectbox.query.QueryBuilder.StringOrder.CASE_INSENSITIVE | ||
import io.objectbox.query.QueryBuilder.StringOrder.CASE_SENSITIVE | ||
import io.objectbox.query.QueryCondition | ||
import nebulosa.api.repositories.BoxRepository | ||
import org.springframework.beans.factory.annotation.Qualifier | ||
import org.springframework.stereotype.Component | ||
|
||
@Component | ||
class SatelliteRepository(@Qualifier("satelliteBox") override val box: Box<SatelliteEntity>) : BoxRepository<SatelliteEntity>() { | ||
|
||
fun search(text: String? = null, groups: List<SatelliteGroupType> = emptyList()): List<SatelliteEntity> { | ||
val builder = box.query() | ||
.also { if (!text.isNullOrBlank()) it.contains(SatelliteEntity_.name, text, CASE_INSENSITIVE) } | ||
fun search(text: String? = null, groups: Iterable<SatelliteGroupType> = emptyList()): List<SatelliteEntity> { | ||
val groupCondition = or(groups.map { SatelliteEntity_.groups.containsElement(it.name, CASE_SENSITIVE) }) | ||
val condition = and(if (text.isNullOrBlank()) null else SatelliteEntity_.name.containsInsensitive(text), groupCondition) | ||
|
||
if (groups.isNotEmpty()) { | ||
var condition: QueryCondition<SatelliteEntity> = SatelliteEntity_.groups.containsElement(groups[0].name, CASE_SENSITIVE) | ||
|
||
for (i in 1 until groups.size) { | ||
condition = condition.or(SatelliteEntity_.groups.containsElement(groups[i].name, CASE_SENSITIVE)) | ||
} | ||
|
||
builder.apply(condition) | ||
} | ||
|
||
return builder | ||
.build() | ||
.use { it.findLazy() } | ||
return (condition?.let(box::query) ?: box.query()).build().use { it.findLazy() } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
api/src/main/kotlin/nebulosa/api/beans/converters/angle/DeclinationDeserializer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
package nebulosa.api.beans.converters.angle | ||
|
||
class DeclinationDeserializer : AngleDeserializer(true) | ||
class DeclinationDeserializer : AngleDeserializer(false) |
3 changes: 3 additions & 0 deletions
3
api/src/main/kotlin/nebulosa/api/beans/converters/angle/DegreesDeserializer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package nebulosa.api.beans.converters.angle | ||
|
||
class DegreesDeserializer : AngleDeserializer(false, defaultValue = 0.0) |
20 changes: 20 additions & 0 deletions
20
api/src/main/kotlin/nebulosa/api/calibration/CalibrationFrameProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package nebulosa.api.calibration | ||
|
||
interface CalibrationFrameProvider { | ||
|
||
fun findBestDarkFrames( | ||
name: String, temperature: Double, width: Int, height: Int, | ||
binX: Int, binY: Int = binX, exposureTimeInMicroseconds: Long = 0L, | ||
gain: Double = 0.0, | ||
): List<CalibrationFrameEntity> | ||
|
||
fun findBestFlatFrames( | ||
name: String, width: Int, height: Int, | ||
binX: Int, binY: Int = binX, filter: String? = null | ||
): List<CalibrationFrameEntity> | ||
|
||
fun findBestBiasFrames( | ||
name: String, width: Int, height: Int, | ||
binX: Int, binY: Int = binX, gain: Double = 0.0, | ||
): List<CalibrationFrameEntity> | ||
} |
Oops, something went wrong.