model

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	POINT            = "point"
	UNIT             = "unit"
	CONTACT          = "contact"
	MAX_TRACK_POINTS = 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 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"`
}

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  `yaml:"uid" json:"uid,omitempty"`
	Alias     string  `yaml:"alias" json:"alias,omitempty"`
	Url       string  `yaml:"url" json:"url,omitempty"`
	Latitude  float64 `yaml:"lat,omitempty" json:"lat,omitempty"`
	Longitude float64 `yaml:"lon,omitempty" json:"lon,omitempty"`
	Fov       string  `yaml:"fov,omitempty" json:"fov,omitempty"`
	Heading   string  `yaml:"heading,omitempty" json:"heading,omitempty"`
	Range     string  `yaml:"range,omitempty" json:"range,omitempty"`
	User      string  `yaml:"user"`
}

func (*Feed2) ToFeed added in v0.12.3

func (f *Feed2) ToFeed() *Feed

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 FromMsgLocal

func FromMsgLocal(msg *cot.CotMessage, send bool) *Item

func (*Item) GetCallsign

func (i *Item) GetCallsign() string

func (*Item) GetClass

func (i *Item) GetClass() string

func (*Item) GetCotType

func (i *Item) GetCotType() 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) GetStartTime

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

func (*Item) GetUID

func (i *Item) GetUID() string

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, send bool)

func (*Item) SetOffline

func (i *Item) SetOffline()

func (*Item) SetOnline

func (i *Item) SetOnline()

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)

func (*Item) UpdateFromWeb

func (i *Item) UpdateFromWeb(w *WebUnit, m *cot.CotMessage)

type Messages

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

func NewMessages

func NewMessages(myUid string) *Messages

func (*Messages) Add

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

type Pos

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

func NewPos added in v0.12.5

func NewPos(lat, lon float64) *Pos

func (*Pos) Get added in v0.12.5

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

type VideoConnections added in v0.12.3

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

type WebUnit

type WebUnit struct {
	Uid            string    `json:"uid"`
	Callsign       string    `json:"callsign"`
	Category       string    `json:"category"`
	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"`
	Status         string    `json:"status"`
	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"`
}

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