config

package
v0.0.0-...-8924cf8 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// unwrapped config values
	Station          station
	QSODatabase      qsodatabase
	QSOTableview     qsotableview
	UI               ui
	SourceFiles      []sourcefile
	LogbookServices  logbookservices
	ClusterServices  clusterservices
	WorkingDirectory string
	BackupDirectory  string
)
View Source
var (
	Bands []Band
	Modes []Mode
)

Functions

func Copy

func Copy(c *Configuration) error

Copy provides the caller a copy of the current configuration

func ListBandNames

func ListBandNames() []string

ListBandNames returns a list of the bands for displaying to the user

func ListModeNames

func ListModeNames() []string

ListModeNames returns a list of the modes for displaying to the user

func LookupBand

func LookupBand(frequency int) string

LookupBand returns the band name for the frequency passed

func LookupFrequencyRange

func LookupFrequencyRange(band string) (int, int)

LookupFrequency returns the low and high ends of the frequency range for the band name passed

func LookupMode

func LookupMode(mode, submode string) string

LookupMode returns the mode name that matches the mode & submode

func LookupModeSubmode

func LookupModeSubmode(band, mode string) (string, string)

LookupModeSubmode returns the mode & submode based on the mode name mode

func Read

func Read(fname string) error

Read loads application configuration from file fname

func ReadLookupsFromFile

func ReadLookupsFromFile(fname string) error

ReadLookupsFromFile reads lookups from file fname

func Reload

func Reload(c Configuration) error

Reload current configuration from caller provided configuration

func ReloadLookups

func ReloadLookups(l Lookups) error

ReloadLookups current lookups from caller provided lookups

func Write

func Write() error

Write writes application configuration to the same file it was read from

func WriteLookupsToFile

func WriteLookupsToFile() error

WriteLookupsToFile writes lookups to file fname

Types

type Band

type Band struct {
	Band     string
	FreqLow  int
	FreqHigh int
	Visible  bool
}

type Configuration

type Configuration struct {
	Station          station
	QSODatabase      qsodatabase
	QSOTableview     qsotableview
	UI               ui
	SourceFiles      []sourcefile
	LogbookServices  logbookservices
	ClusterServices  clusterservices
	WorkingDirectory string
	BackupDirectory  string
}

Configuration is the application configuration that is serialized/deserialized to file

func (*Configuration) AddSourceFile

func (c *Configuration) AddSourceFile(fname string)

func (*Configuration) RemoveSourceFile

func (c *Configuration) RemoveSourceFile(idx int)

func (*Configuration) Validate

func (c *Configuration) Validate() error

Validate tests the required Configuration fields

type Lookups

type Lookups struct {
	Bands []Band
	Modes []Mode
}

func ReadLookupsFromTQSL

func ReadLookupsFromTQSL(tqslconfigxml string) (Lookups, error)

ReadLookupsFromTQSL returns the lookups from the TQSL config.xml file

type Mode

type Mode struct {
	Mode    string
	Submode string
	Visible bool
}

Jump to

Keyboard shortcuts

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