-
-
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
87 changed files
with
2,449 additions
and
16,679 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
74 changes: 74 additions & 0 deletions
74
api/src/main/kotlin/nebulosa/api/controllers/FocuserController.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,74 @@ | ||
package nebulosa.api.controllers | ||
|
||
import jakarta.validation.Valid | ||
import jakarta.validation.constraints.NotBlank | ||
import jakarta.validation.constraints.PositiveOrZero | ||
import nebulosa.api.data.responses.FocuserResponse | ||
import nebulosa.api.services.FocuserService | ||
import org.springframework.web.bind.annotation.GetMapping | ||
import org.springframework.web.bind.annotation.PostMapping | ||
import org.springframework.web.bind.annotation.RequestParam | ||
import org.springframework.web.bind.annotation.RestController | ||
|
||
@RestController | ||
class FocuserController( | ||
private val focuserService: FocuserService, | ||
) { | ||
|
||
@GetMapping("attachedFocusers") | ||
fun attachedFocusers(): List<FocuserResponse> { | ||
return focuserService.attachedFocusers() | ||
} | ||
|
||
@GetMapping("focuser") | ||
fun focuser(@RequestParam @Valid @NotBlank name: String): FocuserResponse { | ||
return focuserService[name] | ||
} | ||
|
||
@PostMapping("focuserConnect") | ||
fun connect(@RequestParam @Valid @NotBlank name: String) { | ||
focuserService.connect(name) | ||
} | ||
|
||
@PostMapping("focuserDisconnect") | ||
fun disconnect(@RequestParam @Valid @NotBlank name: String) { | ||
focuserService.disconnect(name) | ||
} | ||
|
||
@PostMapping("focuserMoveIn") | ||
fun moveIn( | ||
@RequestParam @Valid @NotBlank name: String, | ||
@RequestParam @Valid @PositiveOrZero steps: Int, | ||
) { | ||
focuserService.moveIn(name, steps) | ||
} | ||
|
||
@PostMapping("focuserMoveOut") | ||
fun moveOut( | ||
@RequestParam @Valid @NotBlank name: String, | ||
@RequestParam @Valid @PositiveOrZero steps: Int, | ||
) { | ||
focuserService.moveOut(name, steps) | ||
} | ||
|
||
@PostMapping("focuserMoveTo") | ||
fun moveTo( | ||
@RequestParam @Valid @NotBlank name: String, | ||
@RequestParam @Valid @PositiveOrZero steps: Int, | ||
) { | ||
focuserService.moveTo(name, steps) | ||
} | ||
|
||
@PostMapping("focuserAbort") | ||
fun abort(@RequestParam @Valid @NotBlank name: String) { | ||
focuserService.abort(name) | ||
} | ||
|
||
@PostMapping("focuserSyncTo") | ||
fun syncTo( | ||
@RequestParam @Valid @NotBlank name: String, | ||
@RequestParam @Valid @PositiveOrZero steps: Int, | ||
) { | ||
focuserService.syncTo(name, steps) | ||
} | ||
} |
17 changes: 0 additions & 17 deletions
17
api/src/main/kotlin/nebulosa/api/data/converters/HipsSurveyTypeConverter.kt
This file was deleted.
Oops, something went wrong.
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
3 changes: 3 additions & 0 deletions
3
api/src/main/kotlin/nebulosa/api/data/responses/FITSHeaderItemResponse.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.data.responses | ||
|
||
data class FITSHeaderItemResponse(val name: String, val value: String) |
38 changes: 38 additions & 0 deletions
38
api/src/main/kotlin/nebulosa/api/data/responses/FocuserResponse.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,38 @@ | ||
package nebulosa.api.data.responses | ||
|
||
import nebulosa.indi.device.focuser.Focuser | ||
|
||
data class FocuserResponse( | ||
val name: String, | ||
val connected: Boolean, | ||
val moving: Boolean, | ||
val position: Int, | ||
val canAbsoluteMove: Boolean, | ||
val canRelativeMove: Boolean, | ||
val canAbort: Boolean, | ||
val canReverse: Boolean, | ||
val reverse: Boolean, | ||
val canSync: Boolean, | ||
val hasBackslash: Boolean, | ||
val maxPosition: Int, | ||
val hasThermometer: Boolean, | ||
val temperature: Double, | ||
) { | ||
|
||
constructor(focuser: Focuser) : this( | ||
focuser.name, | ||
focuser.connected, | ||
focuser.moving, | ||
focuser.position, | ||
focuser.canAbsoluteMove, | ||
focuser.canRelativeMove, | ||
focuser.canAbort, | ||
focuser.canReverse, | ||
focuser.reverse, | ||
focuser.canSync, | ||
focuser.hasBackslash, | ||
focuser.maxPosition, | ||
focuser.hasThermometer, | ||
focuser.temperature, | ||
) | ||
} |
17 changes: 17 additions & 0 deletions
17
api/src/main/kotlin/nebulosa/api/data/responses/ImageInfoResponse.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,17 @@ | ||
package nebulosa.api.data.responses | ||
|
||
data class ImageInfoResponse( | ||
val camera: String, | ||
val path: String, | ||
val savedAt: Long, | ||
val width: Int, | ||
val height: Int, | ||
val mono: Boolean, | ||
val stretchShadow: Float, | ||
val stretchHighlight: Float, | ||
val stretchMidtone: Float, | ||
val rightAscension: String?, | ||
val declination: String?, | ||
val calibrated: Boolean, | ||
val headers: List<FITSHeaderItemResponse>, | ||
) |
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
Oops, something went wrong.