Version: v0.0.0-...-985a1f7 Latest Latest

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

Go to latest
Published: Aug 16, 2019 License: MIT Imports: 7 Imported by: 0




This section is empty.


This section is empty.


func DatePack

func DatePack(Date *Date, verbose bool) int32

DatePack Packs date into int32

func SPCPack

func SPCPack(head *Header, sHead *SubHeader, lHead *LogHeader, data *Data, verbose bool) *bytes.Buffer

SPCPack packs an SPC object into a binary File struct

func SaveCSV

func SaveCSV(SPC SPCfile, filename string)

SaveCSV saves a CSV file

func SaveSPC

func SaveSPC(SPC SPCfile, filename string, verbose bool)

SaveSPC saves the SPC file


type Data

type Data struct {
	X, Y *[]float32

Data stores data for SPC file

type Date

type Date struct {
	Year, Month, Day, Hour, Minute int32

Date is a more usable date format for SPC file

func DateUnpack

func DateUnpack(Fdate int32, verbose bool) *Date

DateUnpack Unpacks date from int32

type Flags

type Flags struct {
	Tsprec, Tcgram, Tmulti, Trandm, Tordrd, Talabs, Txyxys, Txvals bool

Flags store flags for SPC file

func FlagsUnpack

func FlagsUnpack(Ftflg uint8, verbose bool) *Flags

FlagsUnpack unpacks flags from flag variable

type Header struct {
	Ftflg, Fversn, Fexper, Fexp   uint8
	Fnpts                         int32
	Ffirst, Flast                 float64
	Fnsub                         int32
	Fxtype, Fytype, Fztype, Fpost uint8
	Fdate                         int32
	Fres, Fsource                 [9]byte
	Fpeakpt                       int16
	Fspare                        [32]uint8
	Fcmnt                         [130]uint8
	Fcatxt                        [30]uint8
	Flogoff                       int32
	Fmods                         int32
	Fprocs, Flevel                uint8
	Fsampin                       int16
	Ffactor                       float32
	Fmethod                       [48]uint8
	Fzinc                         float32
	Fwplanes                      int32
	Fwinc                         float32
	Fwtype                        uint8
	Freserv                       [187]uint8

Header stores header info for SPC file

func HeaderReader

func HeaderReader(content []byte) *Header

HeaderReader read header out of spc file

type LogHeader

type LogHeader struct {
	Lsize, Lspace, Loff, Lbnsz, Lbnspc uint32
	Lreserv                            [44]byte

LogHeader stores the log header for SPC file

func LogHeaderReader

func LogHeaderReader(content []byte, start *int32) *LogHeader

LogHeaderReader reads the log header out of spc file

type SPCfile

type SPCfile struct {
	Head  *Header
	SHead *SubHeader
	LHead *LogHeader
	Data  *Data

SPCfile stores required parts for SPC file

func ReadSPC

func ReadSPC(filename string, verbose bool) SPCfile

ReadSPC takes in a filename and verbose boolean and returns an SPCfile struct

type SubFlags

type SubFlags struct {
	Tchng, Tdnupk, Tmodar bool

SubFlags stores sub flags for SPC file

func SubFlagsUnpack

func SubFlagsUnpack(Ftflg uint8, verbose bool) *SubFlags

SubFlagsUnpack Unpacks sub flags from sub flag variable

type SubHeader

type SubHeader struct {
	Sflags, Sexp           uint8
	Sindex                 uint16
	Sstartz, Sendz, Snoise float32
	Snpts, Snscans         int32
	Swaxis                 float32
	Sreserv                [4]uint8

SubHeader stores sub header for SPC file

func SubHeaderReader

func SubHeaderReader(content []byte, start *int32) *SubHeader

SubHeaderReader reads sub header out of spc file

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL