Documentation ¶
Index ¶
- Constants
- func ByteToString(b []byte) string
- type BinData
- type CFG
- func (cfg *CFG) GetAnalogChannelData(num uint16) (result []float64, err error)
- func (cfg *CFG) GetAnalogChannelNames() []string
- func (cfg *CFG) GetAnalogDetail() *ChannelA
- func (cfg *CFG) GetChannelNumber() uint16
- func (cfg *CFG) GetDataFileContent() []byte
- func (cfg *CFG) GetDataFileType() string
- func (cfg *CFG) GetDigitDetail() *ChannelD
- func (cfg *CFG) GetLineFrequency() uint16
- func (cfg *CFG) GetLocalCode() string
- func (cfg *CFG) GetRecordDeviceId() string
- func (cfg *CFG) GetRevisionYear() uint16
- func (cfg *CFG) GetSampleDetail() []SampleRate
- func (cfg *CFG) GetSampleRateNum() uint16
- func (cfg *CFG) GetSamplingNumber() int
- func (cfg *CFG) GetSamplingRate() float64
- func (cfg *CFG) GetStartTime() time.Time
- func (cfg *CFG) GetStationName() string
- func (cfg *CFG) GetTimeCode() string
- func (cfg *CFG) GetTimeCodeOffset() int64
- func (cfg *CFG) GetTimeFactor() float64
- func (cfg *CFG) GetTriggerTime() time.Time
- func (cfg *CFG) ReadCFG(rd io.Reader) (err error)
- func (cfg *CFG) ReadDAT(rd io.Reader) (err error)
- type ChannelA
- func (m *ChannelA) GetChannelElements() []string
- func (m *ChannelA) GetChannelNames() []string
- func (m *ChannelA) GetChannelNumber() []uint16
- func (m *ChannelA) GetChannelPhases() []string
- func (m *ChannelA) GetChannelTotal() uint16
- func (m *ChannelA) GetChannelUnits() []string
- func (m *ChannelA) GetConversionFactors() map[string][]float64
- func (m *ChannelA) GetPrimary() []float64
- func (m *ChannelA) GetSecondary() []float64
- func (m *ChannelA) GetTimeFactors() []float64
- func (m *ChannelA) GetValueMax() []int
- func (m *ChannelA) GetValueMin() []int
- type ChannelD
- type SampleRate
Constants ¶
const TimeFormat = "02/01/2006T15:04:05.000000"
Variables ¶
This section is empty.
Functions ¶
func ByteToString ¶
Convert []byte type file content to string Delete extra space
Types ¶
type BinData ¶
* BinData - Dat date structure * @Sample: Sample series * @Stamp: Time Stamp * @Value: Analog values: y = factorA * x + factorB
type CFG ¶
type CFG struct { StationName string RecordDeviceId string RevisionYear uint16 ChannelNumber uint16 AnalogDetail *ChannelA DigitDetail *ChannelD LineFrequency uint16 SampleRateNum uint16 SampleDetail []SampleRate StartTime time.Time TriggerTime time.Time DataFileType string TimeFactor float64 TimeCode string LocalCode string DataFileContent []byte }
* CFG - Configuration parameters * @StationName: Name of the station * @RecordDeviceId: Identification of the recording device * @RevisionYear: COMTRADE standard revision year * @ChannelNumber: Number of channels * @ChannelType: Type of channels * @AnalogDetail: Analog channel details * @DigitDetail: Digit channel details * @LineFrequency: line frequency * @SampleRateNum: Sampling rate(s) * @SampleDetail: Number of samples at each rate * @StartTime: Date and time of first data point * @TriggerTime: Date and time of trigger point * @DataFileType: Data file type * @TimeFactor: Time Stamp multiplication factor * @DataFileContent: Store data file content
func (*CFG) GetAnalogChannelData ¶
Returns an array of numbers containing the data values of the channel number num is the number of the channel as in .cfg file
func (*CFG) GetAnalogChannelNames ¶
Return the names of all analog channel
func (*CFG) GetAnalogDetail ¶
func (*CFG) GetChannelNumber ¶
func (*CFG) GetDataFileContent ¶
func (*CFG) GetDataFileType ¶
func (*CFG) GetDigitDetail ¶
func (*CFG) GetLineFrequency ¶
func (*CFG) GetLocalCode ¶
func (*CFG) GetRecordDeviceId ¶
func (*CFG) GetRevisionYear ¶
func (*CFG) GetSampleDetail ¶
func (cfg *CFG) GetSampleDetail() []SampleRate
func (*CFG) GetSampleRateNum ¶
func (*CFG) GetSamplingNumber ¶
Return the number of samples only one sampling rate is taking into account
func (*CFG) GetSamplingRate ¶
Return the sampling rate only one sampling rate is taking into account
func (*CFG) GetStartTime ¶
func (*CFG) GetStationName ¶
func (*CFG) GetTimeCode ¶
func (*CFG) GetTimeCodeOffset ¶
GetTimeCodeOffset returns the time difference between local time and UTC in nanoseconds sample formats: “+10h30”, "-4t", “-7h15”, "0"
func (*CFG) GetTimeFactor ¶
func (*CFG) GetTriggerTime ¶
type ChannelA ¶
type ChannelA struct { ChannelTotal uint16 ChannelNumber []uint16 ChannelNames []string ChannelPhases []string ChannelElements []string ChannelUnits []string ConversionFactors map[string][]float64 TimeFactors []float64 ValueMin []int ValueMax []int Primary []float64 Secondary []float64 IsSecondaryMeasurement []bool }
* ChannelA - Analog channel parameters * @ChannelTotal: Total number of channels * @ChannelNumber: Channel number series * @ChannelNames: Names of each channel * @ChannelPhases: Phases of each channel * @ChannelElements: Channel element (usually null) * @ChannelUnits: Units of each channel * @ConversionFactors: Conversion factor A and B * @TimeFactors: Time factors of each channels * @ValueMin: Min Value of each channels * @ValueMax: Max Value of each channels * @Primary: Primary ratios * @Secondary: Secondary ratios
func (*ChannelA) GetChannelElements ¶
func (*ChannelA) GetChannelNames ¶
func (*ChannelA) GetChannelNumber ¶
func (*ChannelA) GetChannelPhases ¶
func (*ChannelA) GetChannelTotal ¶
func (*ChannelA) GetChannelUnits ¶
func (*ChannelA) GetConversionFactors ¶
func (*ChannelA) GetPrimary ¶
func (*ChannelA) GetSecondary ¶
func (*ChannelA) GetTimeFactors ¶
func (*ChannelA) GetValueMax ¶
func (*ChannelA) GetValueMin ¶
type ChannelD ¶
type ChannelD struct { ChannelTotal uint16 ChannelNumber []uint16 ChannelNames []string ChannelPhases []string ChannelElements []string InitialState []uint8 }
* ChannelD - Digit channel parameters * @ChannelTotal: Total number of channels * @ChannelNumber: Channel number series * @ChannelNames: Names of each channel * @ChannelPhases: Phases of each channel * @ChannelElements: Channel element (usually null)
func (*ChannelD) GetChannelElements ¶
func (*ChannelD) GetChannelNames ¶
func (*ChannelD) GetChannelNumber ¶
func (*ChannelD) GetChannelPhases ¶
func (*ChannelD) GetChannelTotal ¶
func (*ChannelD) GetInitialState ¶
type SampleRate ¶
* SampleRate - Sampling rate and sampling number * @Rate: Sampling rate * @Number: Total number under current sampling rate
func (*SampleRate) GetNumber ¶
func (m *SampleRate) GetNumber() int
func (*SampleRate) GetRate ¶
func (m *SampleRate) GetRate() float64