model

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StaleContactDelete = time.Hour * 12
	POINT              = "point"
	UNIT               = "unit"
	CONTACT            = "contact"
	MaxTrackPoints     = 5000
)

Variables

This section is empty.

Functions

func DistBea

func DistBea(lat1, lon1, lat2, lon2 float64) (float64, float64)

func GetClass

func GetClass(msg *cot.CotMessage) string

func MakeChatMessage

func MakeChatMessage(c *ChatMessage) *cotproto.TakMessage

Types

type Chat

type Chat struct {
	From     string         `json:"from"`
	UID      string         `json:"uid"`
	Messages []*ChatMessage `json:"messages"`
}

type ChatMessage

type ChatMessage struct {
	ID       string    `json:"message_id"`
	Time     time.Time `json:"time"`
	Parent   string    `json:"parent"`
	Chatroom string    `json:"chatroom"`
	From     string    `json:"from"`
	FromUID  string    `json:"from_uid"`
	ToUID    string    `json:"to_uid"`
	Direct   bool      `json:"direct"`
	Text     string    `json:"text"`
}

func MsgToChat

func MsgToChat(m *cot.CotMessage) *ChatMessage

func (*ChatMessage) String

func (m *ChatMessage) String() string

type ChatMessages added in v0.18.0

type ChatMessages struct {
	Chats    map[string]*Chat
	Contacts sync.Map
	// contains filtered or unexported fields
}

func NewChatMessages added in v0.18.0

func NewChatMessages(myUID string) *ChatMessages

func (*ChatMessages) Add added in v0.18.0

func (m *ChatMessages) Add(msg *ChatMessage)

type Contact added in v0.12.5

type Contact struct {
	UID          string `json:"uid"`
	Callsign     string `json:"callsign"`
	Team         string `json:"team"`
	Role         string `json:"role"`
	Takv         string `json:"takv"`
	Notes        string `json:"notes"`
	FilterGroups string `json:"filterGroups"`
}

type DigitalPointer

type DigitalPointer struct {
	Lat  float64 `json:"lat"`
	Lon  float64 `json:"lon"`
	Name string  `json:"name"`
}

type Feed added in v0.12.3

type Feed struct {
	UID    string `xml:"uid"    yaml:"uid"`
	Active bool   `xml:"active" yaml:"active,omitempty"`
	Alias  string `xml:"alias"  yaml:"alias"`
	Typ    string `xml:"type"   yaml:"type,omitempty"`

	Address             string  `xml:"address"             yaml:"address,omitempty"`
	Path                string  `xml:"path"                yaml:"path,omitempty"`
	PreferredMacAddress string  `xml:"preferredMacAddress" yaml:"preferredMacAddress,omitempty"`
	Port                int     `xml:"port"                yaml:"port,omitempty"`
	RoverPort           int     `xml:"roverPort"           yaml:"roverPort,omitempty"`
	IgnoreEmbeddedKLV   bool    `xml:"ignoreEmbeddedKLV"   yaml:"ignoreEmbeddedKLV,omitempty"`
	Protocol            string  `xml:"protocol"            yaml:"protocol,omitempty"`
	Source              string  `xml:"source"              yaml:"source,omitempty"`
	Timeout             int     `xml:"timeout"             yaml:"timeout,omitempty"`
	Buffer              int     `xml:"buffer"              yaml:"buffer,omitempty"`
	RtspReliable        string  `xml:"rtspReliable"        yaml:"rtspReliable,omitempty"`
	Thumbnail           string  `xml:"thumbnail"           yaml:"thumbnail,omitempty"`
	Classification      string  `xml:"classification"      yaml:"classification,omitempty"`
	Latitude            float64 `xml:"latitude"            yaml:"latitude,omitempty"`
	Longitude           float64 `xml:"longitude"           yaml:"longitude,omitempty"`
	Fov                 string  `xml:"fov"                 yaml:"fov,omitempty"`
	Heading             string  `xml:"heading"             yaml:"heading,omitempty"`
	Range               string  `xml:"range"               yaml:"range,omitempty"`
	User                string  `yaml:"user"`
	Scope               string  `yaml:"scope"`
}

func (*Feed) ToFeed2 added in v0.12.3

func (f *Feed) ToFeed2() *Feed2

type Feed2 added in v0.12.3

type Feed2 struct {
	UID       string  `json:"uid,omitempty"     yaml:"uid"`
	Active    bool    `json:"active"            yaml:"active"`
	Alias     string  `json:"alias,omitempty"   yaml:"alias"`
	URL       string  `json:"url,omitempty"     yaml:"url"`
	Latitude  float64 `json:"lat,omitempty"     yaml:"lat,omitempty"`
	Longitude float64 `json:"lon,omitempty"     yaml:"lon,omitempty"`
	Fov       string  `json:"fov,omitempty"     yaml:"fov,omitempty"`
	Heading   string  `json:"heading,omitempty" yaml:"heading,omitempty"`
	Range     string  `json:"range,omitempty"   yaml:"range,omitempty"`
	User      string  `json:"-"                 yaml:"user"`
	Scope     string  `yaml:"scope"`
}

func (*Feed2) ToFeed added in v0.12.3

func (f *Feed2) ToFeed() *Feed

func (*Feed2) WithScope added in v0.16.0

func (f *Feed2) WithScope(scope string) *Feed2

func (*Feed2) WithUser added in v0.12.4

func (f *Feed2) WithUser(user string) *Feed2

type Item

type Item struct {
	// contains filtered or unexported fields
}

func FromMsg

func FromMsg(msg *cot.CotMessage) *Item

func (*Item) GetCallsign

func (i *Item) GetCallsign() string

func (*Item) GetClass

func (i *Item) GetClass() string

func (*Item) GetLanLon

func (i *Item) GetLanLon() (float64, float64)

func (*Item) GetLastSeen

func (i *Item) GetLastSeen() time.Time

func (*Item) GetMsg

func (i *Item) GetMsg() *cot.CotMessage

func (*Item) GetScope added in v0.16.3

func (i *Item) GetScope() string

func (*Item) GetTrack added in v0.14.0

func (i *Item) GetTrack() []*Pos

func (*Item) GetType added in v0.14.7

func (i *Item) GetType() string

func (*Item) GetUID

func (i *Item) GetUID() string

func (*Item) HasMission added in v0.15.0

func (i *Item) HasMission(name string) bool

func (*Item) IsOld

func (i *Item) IsOld() bool

func (*Item) IsOnline

func (i *Item) IsOnline() bool

func (*Item) IsSend

func (i *Item) IsSend() bool

func (*Item) SetLocal

func (i *Item) SetLocal(local bool)

func (*Item) SetOffline

func (i *Item) SetOffline()

func (*Item) SetOnline

func (i *Item) SetOnline()

func (*Item) SetSend added in v0.14.7

func (i *Item) SetSend(send bool)

func (*Item) String

func (i *Item) String() string

func (*Item) ToWeb

func (i *Item) ToWeb() *WebUnit

func (*Item) Update

func (i *Item) Update(msg *cot.CotMessage)

type Pos

type Pos struct {
	Time  time.Time
	Lat   float64
	Lon   float64
	Alt   float64
	Speed float64
	Track float64
	Ce    float64
}

func NewPos added in v0.12.5

func NewPos(lat, lon float64) *Pos

func NewPosFull added in v0.17.0

func NewPosFull(lat, lon, alt, speed, track float64) *Pos

func (*Pos) GetAlt added in v0.17.0

func (p *Pos) GetAlt() float64

func (*Pos) GetCe added in v0.17.0

func (p *Pos) GetCe() float64

func (*Pos) GetCoord added in v0.17.0

func (p *Pos) GetCoord() (float64, float64)

func (*Pos) GetLat added in v0.17.0

func (p *Pos) GetLat() float64

func (*Pos) GetLon added in v0.17.0

func (p *Pos) GetLon() float64

func (*Pos) GetSpeed added in v0.17.0

func (p *Pos) GetSpeed() float64

func (*Pos) GetTrack added in v0.17.0

func (p *Pos) GetTrack() float64

type VideoConnections added in v0.12.3

type VideoConnections struct {
	XMLName xml.Name `xml:"videoConnections"`
	Feeds   []*Feed  `xml:"feed"`
}

type VideoConnections2 added in v0.14.0

type VideoConnections2 struct {
	XMLName xml.Name `json:"-"`
	Feeds   []*Feed2 `json:"feeds" xml:"feed"`
}

type WebUnit

type WebUnit struct {
	UID            string    `json:"uid"`
	Callsign       string    `json:"callsign"`
	Category       string    `json:"category"`
	Scope          string    `json:"scope"`
	Team           string    `json:"team"`
	Role           string    `json:"role"`
	Time           time.Time `json:"time"`
	LastSeen       time.Time `json:"last_seen"`
	StaleTime      time.Time `json:"stale_time"`
	StartTime      time.Time `json:"start_time"`
	SendTime       time.Time `json:"send_time"`
	Type           string    `json:"type"`
	Lat            float64   `json:"lat"`
	Lon            float64   `json:"lon"`
	Hae            float64   `json:"hae"`
	Speed          float64   `json:"speed"`
	Course         float64   `json:"course"`
	Sidc           string    `json:"sidc"`
	TakVersion     string    `json:"tak_version"`
	Device         string    `json:"device"`
	Status         string    `json:"status"`
	Battery        uint32    `json:"battery"`
	Text           string    `json:"text"`
	Color          string    `json:"color"`
	Icon           string    `json:"icon"`
	ParentCallsign string    `json:"parent_callsign"`
	ParentUID      string    `json:"parent_uid"`
	Local          bool      `json:"local"`
	Send           bool      `json:"send"`
	Missions       []string  `json:"missions"`
}

func (*WebUnit) ToMsg

func (w *WebUnit) ToMsg() *cot.CotMessage

Jump to

Keyboard shortcuts

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