alpaca

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ALPACA_DISCOVERY_VERSION = 1
)

Variables

This section is empty.

Functions

func DiscoverServer added in v0.0.4

func DiscoverServer(tries int) (string, int32, error)

Discover any alpaca servers. returns IP as string and port

func IsRunningLocal added in v0.0.4

func IsRunningLocal(port int32) string

checks if server is on localhost. returns IP or empty string

Types

type AlignmentMode

type AlignmentMode int32
const (
	AlignmentAltAz AlignmentMode = iota
	AlignmentPolar
	AlignmentGermanPolar
)

type Alpaca

type Alpaca struct {
	ClientId uint32

	ErrorNumber  int    // last error
	ErrorMessage string // last error
	// contains filtered or unexported fields
}

func NewAlpaca

func NewAlpaca(clientid uint32, ip string, port int32) *Alpaca

func (*Alpaca) GetBool

func (a *Alpaca) GetBool(device string, id uint32, api string) (bool, error)

func (*Alpaca) GetFloat64

func (a *Alpaca) GetFloat64(device string, id uint32, api string) (float64, error)

func (*Alpaca) GetInt32

func (a *Alpaca) GetInt32(device string, id uint32, api string) (int32, error)

func (*Alpaca) GetListUint32

func (a *Alpaca) GetListUint32(device string, id uint32, api string) ([]uint32, error)

func (*Alpaca) GetNextTransactionId

func (a *Alpaca) GetNextTransactionId() uint32

Each Alpaca call should have a monotonically incrementing transactionId

func (*Alpaca) GetString

func (a *Alpaca) GetString(device string, id uint32, api string) (string, error)

func (*Alpaca) GetStringList

func (a *Alpaca) GetStringList(device string, id uint32, api string) ([]string, error)

func (*Alpaca) Put

func (a *Alpaca) Put(device string, id uint32, api string, form map[string]string) error

type AlpacaDiscoveryMessage added in v0.0.4

type AlpacaDiscoveryMessage struct {
	Fixed    []byte // must be 'alpacadiscovery'
	Version  byte
	Reserved []byte
}

func NewAlpacaDiscoveryMessage added in v0.0.4

func NewAlpacaDiscoveryMessage(version int) *AlpacaDiscoveryMessage

func (*AlpacaDiscoveryMessage) Bytes added in v0.0.4

func (a *AlpacaDiscoveryMessage) Bytes() []byte

func (AlpacaDiscoveryMessage) String added in v0.0.5

func (a AlpacaDiscoveryMessage) String() string

type AlpacaResponseMessage added in v0.0.4

type AlpacaResponseMessage struct {
	AlpacaPort uint16 `json:"AlpacaPort"`
}

type AxisType

type AxisType int
const (
	AxisAzmRa AxisType = iota
	AxisAltDec
	AxisTertiary
)

type Telescope

type Telescope struct {
	Id       uint32
	Tracking TrackingMode
	// contains filtered or unexported fields
}

func NewTelescope

func NewTelescope(id uint32, tm TrackingMode, alpaca *Alpaca) *Telescope

func (*Telescope) GetAlignmentMode

func (t *Telescope) GetAlignmentMode() (AlignmentMode, error)

func (*Telescope) GetAltitude

func (t *Telescope) GetAltitude() (float64, error)

func (*Telescope) GetAxisRates

func (t *Telescope) GetAxisRates(axis AxisType) (map[string]float64, error)

Returns the `Maximum` & `Minimum` rate (deg/sec) that the given axis can move

func (*Telescope) GetAzimuth

func (t *Telescope) GetAzimuth() (float64, error)

func (*Telescope) GetAzmAlt

func (t *Telescope) GetAzmAlt() (float64, float64, error)

Get Azmiuth / Altitude as degrees (double)

func (*Telescope) GetCanFindHome

func (t *Telescope) GetCanFindHome() (bool, error)

func (*Telescope) GetCanPark

func (t *Telescope) GetCanPark() (bool, error)

func (*Telescope) GetCanSlew

func (t *Telescope) GetCanSlew() (bool, error)

func (*Telescope) GetCanSlewAltAz

func (t *Telescope) GetCanSlewAltAz() (bool, error)

func (*Telescope) GetCanSlewAltAzAsync

func (t *Telescope) GetCanSlewAltAzAsync() (bool, error)

func (*Telescope) GetCanSlewAsync

func (t *Telescope) GetCanSlewAsync() (bool, error)

func (*Telescope) GetConnected

func (t *Telescope) GetConnected() (bool, error)

func (*Telescope) GetDeclination

func (t *Telescope) GetDeclination() (float64, error)

func (*Telescope) GetDescription

func (t *Telescope) GetDescription() (string, error)

func (*Telescope) GetName

func (t *Telescope) GetName() (string, error)

func (*Telescope) GetRaDec

func (t *Telescope) GetRaDec() (float64, float64, error)

Get RA/DEC as hours/degrees (double)

func (*Telescope) GetRightAscension

func (t *Telescope) GetRightAscension() (float64, error)

func (*Telescope) GetSiteLatitude added in v0.0.3

func (t *Telescope) GetSiteLatitude() (float64, error)

func (*Telescope) GetSiteLongitude added in v0.0.3

func (t *Telescope) GetSiteLongitude() (float64, error)

func (*Telescope) GetSlewing added in v0.0.3

func (t *Telescope) GetSlewing() (bool, error)

func (*Telescope) GetSupportedActions

func (t *Telescope) GetSupportedActions() ([]string, error)

func (*Telescope) GetTargetAltitude added in v0.0.3

func (t *Telescope) GetTargetAltitude() (float64, error)

func (*Telescope) GetTargetDeclination added in v0.0.3

func (t *Telescope) GetTargetDeclination() (float64, error)

func (*Telescope) GetTracking added in v1.0.0

func (t *Telescope) GetTracking() (TrackingMode, error)

func (*Telescope) GetUTCDate added in v0.0.3

func (t *Telescope) GetUTCDate() (time.Time, error)

func (*Telescope) PutAbortSlew

func (t *Telescope) PutAbortSlew() error

func (*Telescope) PutMoveAxis

func (t *Telescope) PutMoveAxis(axis AxisType, rate int) error

func (*Telescope) PutSiteLatitude

func (t *Telescope) PutSiteLatitude(lat float64) error

func (*Telescope) PutSiteLongitude

func (t *Telescope) PutSiteLongitude(long float64) error

func (*Telescope) PutSlewToCoordinates

func (t *Telescope) PutSlewToCoordinates(ra float64, dec float64) error

func (*Telescope) PutSlewToCoordinatestAsync

func (t *Telescope) PutSlewToCoordinatestAsync(ra float64, dec float64) error

func (*Telescope) PutSlewToTargetAsync added in v0.0.3

func (t *Telescope) PutSlewToTargetAsync() error

func (*Telescope) PutSyncToCoordinates

func (t *Telescope) PutSyncToCoordinates(ra float64, dec float64) error

func (*Telescope) PutSyncToTarget added in v0.0.3

func (t *Telescope) PutSyncToTarget() error

func (*Telescope) PutTargetDeclination added in v0.0.3

func (t *Telescope) PutTargetDeclination(long float64) error

func (*Telescope) PutTargetRightAscension added in v0.0.3

func (t *Telescope) PutTargetRightAscension(long float64) error

func (*Telescope) PutTracking added in v1.0.0

func (t *Telescope) PutTracking(tracking TrackingMode) error

func (*Telescope) PutUTCDate

func (t *Telescope) PutUTCDate(date time.Time) error

type TrackingMode added in v1.0.0

type TrackingMode int
const (
	NotTracking TrackingMode = iota
	Alt_Az
	EQ_North
	EQ_South
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL