pulsegenui

package module
v0.0.0-...-45ff573 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2022 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

Embedded function generator with display and keys Produces 128x64 bitmap and recieves commands from 4x4 keypad. Virtual or real

Index

Constants

View Source
const (
	CMDBTN_0            = "0"
	CMDBTN_1            = "1"
	CMDBTN_2            = "2"
	CMDBTN_3            = "3"
	CMDBTN_4            = "4"
	CMDBTN_5            = "5"
	CMDBTN_6            = "6"
	CMDBTN_7            = "7"
	CMDBTN_8            = "8"
	CMDBTN_9            = "9"
	CMDBTN_ONOFF        = "onoff"
	CMDBTN_DECIMALPOINT = "."
	CMDBTN_UP           = "up"
	CMDBTN_DOWN         = "down"
	CMDBTN_BACK         = "back"
	CMDBTN_OK           = "ok"
	CMDBTN_RELEASE      = ""
)

For not using magic strings

View Source
const (
	PAGE_REGS = iota
	PAGE_LOHI
	PAGE_SERVO
	PAGE_MAXCOUNT //THE LAST
)
View Source
const (
	LISTITEM_REG_PWMC = iota
	LISTITEM_REG_PWMR
	LISTITEM_REG_PWM
	LISTITEM_REG_MAXCOUNT //THE LAST
)
View Source
const (
	LISTITEM_LOHI_SCALE_NANO = iota
	LISTITEM_LOHI_SCALE_MICRO
	LISTITEM_LOHI_SCALE_MILLI
	LISTITEM_LOHI_SCALE_UNIT
	LISTITEM_LOHI_HI
	LISTITEM_LOHI_LO
	LISTITEM_LOHI_MAXCOUNT
)
View Source
const (
	SCALETIME_NANO  = 1
	SCALETIME_MICRO = 1000
	SCALETIME_MILLI = 1000000
	SCALETIME_UNIT  = 1000000000
)
View Source
const (
	SERVOPRESET_0 = 0.0
	SERVOPRESET_1 = -90
	SERVOPRESET_2 = -80
	SERVOPRESET_3 = -50
	SERVOPRESET_4 = -20
	SERVOPRESET_5 = 20
	SERVOPRESET_6 = 50
	SERVOPRESET_7 = 80
	SERVOPRESET_8 = 85
	SERVOPRESET_9 = -90
)
View Source
const (
	SERVOSWINGTIME = 3500 //How many milliseconds to edge to edge
	SERVOMINANGLE  = -90.0
	SERVOMAXANGLE  = 90.0
)
View Source
const (
	GAUGEY      = 53
	GAUGEHEIGHT = 35 + 5
)
View Source
const FLOATFORMATSTRING = "%.5f"

Variables

This section is empty.

Functions

This section is empty.

Types

type PulsGenUi

type PulsGenUi struct {
	//Simulate bool //Important when testing
	Bitmap chan gomonochromebitmap.MonoBitmap
	Cmd    chan string //Key pressesses. This gadget takes only one press per time
	RfCmd  chan PulseHardwareCommand

	//---- status composed to status bar -----
	SignalOut bool //Is feeding actively
	//--- Sub page status ---
	Page UiPageNumber

	StatusRegs  UiPageRegs
	StatusLoHi  UiPageLoHi
	StatusServo UiPageServo
	// contains filtered or unexported fields
}

func (*PulsGenUi) Run

func (p *PulsGenUi) Run()

Keeps running Is actively updating only by input

TODO capture

type PulseHardwareCommand

type PulseHardwareCommand struct {
	OutputEnabled bool
	Rf            govattu.RfPulseSettings
}

func (PulseHardwareCommand) String

func (a PulseHardwareCommand) String() string

type RegsListItem

type RegsListItem int

type UiPageLoHi

type UiPageLoHi struct {
	Scale         int64 // 1=nano, 1000=micro 1000 000=milli,  1000 000 000 s
	Lo            float64
	Hi            float64
	SelectedField int
	Edit          bool
	EditedValue   string //Decimal points need to store
}

func (*UiPageLoHi) StartEdit

func (p *UiPageLoHi) StartEdit()

func (*UiPageLoHi) StoreEdit

func (p *UiPageLoHi) StoreEdit()

type UiPageNumber

type UiPageNumber int

type UiPageRegs

type UiPageRegs struct {
	Registers govattu.RfSettings

	SelectedField RegsListItem
	Edit          bool //active editing
	EditValue     uint32
}

func (*UiPageRegs) StartEdit

func (p *UiPageRegs) StartEdit()

func (*UiPageRegs) StoreEdit

func (p *UiPageRegs) StoreEdit()

type UiPageServo

type UiPageServo struct {
	Angle float32
}

func (*UiPageServo) LimitAngle

func (p *UiPageServo) LimitAngle(minAngle float32, maxAngle float32)

Jump to

Keyboard shortcuts

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