state

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package state implements state type for Container-Lab and instruments. Basic package, no dependencies (standard lib only).

Index

Constants

This section is empty.

Variables

View Source
var (
	// StateAbbr - a mapping of State -> Abbreviation (default String method return value)
	StateAbbr = map[State]string{
		0: "NA",
		1: "IN",
		2: "WU",
		3: "SB",
		4: "MS",
	}
	// StateNames - a mapping of State -> Name
	StateNames = map[State]string{
		0: "Undefined",
		1: "Idle",
		2: "WarmUp",
		3: "Standby",
		4: "Measure",
	}
)

Functions

This section is empty.

Types

type State

type State uint

State - instrument state enum

const (
	// Undefined state represented by uint 0
	Undefined State = iota
	// Idle state represented by uint 1
	Idle
	// WarmUp state represented by uint 2
	WarmUp
	// Standby state represented by uint 3
	Standby
	// Measure state represented by uint 4
	Measure
)

func FromAbbr

func FromAbbr(expr string) (State, error)

FromAbbr - get state number from abbreviation

func FromName

func FromName(expr string) (State, error)

FromName - get state number from name

func (State) String

func (s State) String() string

String converts a numeric state into its abbreviated string repr

func (State) StringLong

func (s State) StringLong() string

StringLong converts a numeric state into its verbose string repr

Jump to

Keyboard shortcuts

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