Restructure assets to top-level package and add Reset Map button

- Move assets from internal/assets to top-level assets/ package for clean embed directive
- Consolidate all static files in single location (assets/static/)
- Remove duplicate static file locations to maintain single source of truth
- Add Reset Map button to map controls with full functionality
- Implement resetMap() method to return map to calculated origin position
- Store origin in this.mapOrigin for reset functionality
- Fix go:embed pattern to work without parent directory references

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ole-Morten Duesund 2025-08-24 00:57:49 +02:00
commit 1425f0a018
20 changed files with 263 additions and 2139 deletions

View file

@ -20,12 +20,12 @@ const (
// Message represents a Beast format message
type Message struct {
Type byte
Timestamp uint64 // 48-bit timestamp in 12MHz ticks
Signal uint8 // Signal level (RSSI)
Data []byte // Mode S data
Type byte
Timestamp uint64 // 48-bit timestamp in 12MHz ticks
Signal uint8 // Signal level (RSSI)
Data []byte // Mode S data
ReceivedAt time.Time
SourceID string // Identifier for the source receiver
SourceID string // Identifier for the source receiver
}
// Parser handles Beast binary format parsing
@ -146,7 +146,7 @@ func (msg *Message) GetSignalStrength() float64 {
if msg.Signal == 0 {
return -50.0 // Minimum detectable signal
}
return float64(msg.Signal)*(-50.0/255.0)
return float64(msg.Signal) * (-50.0 / 255.0)
}
// GetICAO24 extracts the ICAO 24-bit address from Mode S messages
@ -154,11 +154,11 @@ func (msg *Message) GetICAO24() (uint32, error) {
if msg.Type == BeastModeAC {
return 0, errors.New("Mode A/C messages don't contain ICAO address")
}
if len(msg.Data) < 4 {
return 0, errors.New("insufficient data for ICAO address")
}
// ICAO address is in bytes 1-3 of Mode S messages
icao := uint32(msg.Data[1])<<16 | uint32(msg.Data[2])<<8 | uint32(msg.Data[3])
return icao, nil
@ -178,10 +178,10 @@ func (msg *Message) GetTypeCode() (uint8, error) {
if df != 17 && df != 18 { // Extended squitter
return 0, errors.New("not an extended squitter message")
}
if len(msg.Data) < 5 {
return 0, errors.New("insufficient data for type code")
}
return (msg.Data[4] >> 3) & 0x1F, nil
}
}