model

package
v0.0.0-...-d6b8a38 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NumTotalBytes 1回の受信に含まれるバイト数
	NumTotalBytes = 1604
	// NumADBytes AD値と解釈するために必要なバイト数
	NumADBytes = 2
	// SumCheckCodeSize サムチェックコードを示すバイト列の長さ
	SumCheckCodeSize = 4
	// SumCheckCodeAvailableSize サムチェックコードを示すバイト列のうち下位2ビットのみ有効
	SumCheckCodeAvailableSize = 2
	// NumChannels チャンネル数
	NumChannels = 16
	// NumAvailableChs 実際に利用可能なチャンネル数(16種類のうち1~8のみが利用可能)
	NumAvailableChs = 8
	// NumPoints 1回の受信で1つのチャンネルが取得できる信号の数
	NumPoints = 50
	// NumPntsSumCheck 先頭の何ポイントまでの値をサムチェックに用いるか
	NumPntsSumCheck = 10
)
View Source
const (
	// パラメータを分割するカンマの数
	NumSeparator = 9
)

Variables

This section is empty.

Functions

func SignalHeader

func SignalHeader() []string

SignalHeader returns the CSV Header for raw signal

Types

type AnalysisType

type AnalysisType [NumAvailableChs]ChannelType

AnalysisType stores the analysis type for all available channels.

type AnalyzedEEG

AnalyzedEEG is an array that stores the EEG analysis values for all available channels for 1 second.

func (*AnalyzedEEG) ToCSVHeader

func (a *AnalyzedEEG) ToCSVHeader(at AnalysisType) []string

func (*AnalyzedEEG) ToCSVRow

func (a *AnalyzedEEG) ToCSVRow() []string

type BandNum

type BandNum uint
const (
	Total BandNum = iota
	Delta
	Theta
	Alpha
	Beta
	Ratio
	NumBands = 6
)

type Calibration

type Calibration [NumAvailableChs]ChannelCal

Calibration stores the calibration values for all available channels.

type ChannelCal

type ChannelCal struct {
	BaseAD uint16
	CalAD  uint16
	EuHi   float64
	EuLo   float64
}

ChannelCal stores the calibration values for each channel.

type ChannelPower

type ChannelPower struct {
	// データが得られた時の測定経過時間
	Time uint
	// チャンネル番号
	ChNum uint
	// 帯域の番号
	BandNum BandNum
	// 直前5秒間に対する周波数解析の結果から算出された帯域のパワー
	Power float64
	// 直前の1秒間における生波形データの最大値
	MaxEEG float64
	// 直前の1秒間における生波形データの最小値
	MinEEG float64
}

ChannelPower is a struct for storing the data of the power of each channel.

type ChannelRange

type ChannelRange struct {
	Upper uint
	Lower uint
}

ChannelRange is a struct for storing the upper and lower limits of the trend graph display range for each channel.

type ChannelType

type ChannelType uint

ChannelType shows the analysis type for each channel.

const (
	NoAnalysis ChannelType = iota
	EMGCh
	EOGHCh
	EOGVCh
	EEGCh
	RRIntCh
	CICh
	RRCVCh
	HELFCh
	WAVECh
	ExtPlsCh
	RespCh
	Resp2Ch
)

func (*ChannelType) String

func (c *ChannelType) String() string

String returns the name of the analysis type. If the analysis type is not defined, it returns an empty string.

type Command

type Command struct {
	Name   string
	Params [NumSeparator + 1]string
}

func (*Command) NumValueParams

func (c *Command) NumValueParams() int

c.Paramsのうち空の文字列でない要素の数を返す

func (*Command) String

func (c *Command) String() string

type Setting

type Setting struct {
	TrendRange   TrendRange
	AnalysisType AnalysisType
	Calibration  Calibration
}

func NewSetting

func NewSetting() *Setting

func (*Setting) ToCSVHeader

func (s *Setting) ToCSVHeader() []string

func (*Setting) ToCSVRows

func (s *Setting) ToCSVRows() [][]string

type Signals

type Signals struct {
	Time     time.Time
	Channels [NumAvailableChs]channelSignal
}

送信バイナリーデータ1回分のAD値

func NewSignals

func NewSignals() *Signals

func (*Signals) SetMeasurements

func (s *Signals) SetMeasurements(cal Calibration, at AnalysisType) error

func (*Signals) ToRecords

func (s *Signals) ToRecords(offset int) [][]string

ToRecords makes records for csv from Signals. The first column of the records is the point number. The offset argument indicates how many times the signal has been received. So, the first offset should be 0.

type Status

type Status string
const (
	Acq         Status = "Acq"
	End         Status = "End"
	ReCalcEEG   Status = "ReCalcEEG"
	ReCalcHFLF  Status = "ReCalcHFLF"
	ReCalcEOG_V Status = "ReCalcEOG_V"
	ReCalcAll   Status = "ReCalcAll"
)

type TrendRange

type TrendRange [NumAvailableChs]ChannelRange

TrendRange is an array that stores the upper and lower limits of the trend graph display range for all available channels.

Jump to

Keyboard shortcuts

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