Documentation
¶
Index ¶
- Constants
- func CalcPrimaryBySecondary(PrimaryFactor, SecondaryFactor, Secondary float32) float32
- func CalcSecondaryByPrimary(PrimaryFactor, SecondaryFactor, Primary float32) float32
- func CalcValue(multiplier, offset, x float32) float32
- type AnalogChannelInfo
- type AnalogsPoints
- type CfgFileInfo
- func (c *CfgFileInfo) GenerateAsciiFile(filename string) error
- func (c *CfgFileInfo) InitAnalogChannelInfo(channelIndex uint32, channelID, phaseID, monitoredDevice, unit string, ...)
- func (c *CfgFileInfo) InitChannelCountInfo(analogChannelCount, statusChannelCount uint32)
- func (c *CfgFileInfo) InitFileTypeInfo(fileType string)
- func (c *CfgFileInfo) InitSampleInfo(channelFrequency float32, sampleCount uint32, sampleDetails []SampleDetail)
- func (c *CfgFileInfo) InitStatusChannelInfo(channelIndex uint32, channelID, phaseID, monitoredDevice string, state byte)
- func (c *CfgFileInfo) InitSubstationInfo(substation, deviceID string)
- func (c *CfgFileInfo) InitTimeMultiInfo(timeMulti float32)
- func (c *CfgFileInfo) InitTimestampInfo(startTimestamp, triggerTimestamp time.Time)
- type ChannelCountInfo
- type Comtrader
- type DatFileInfo
- type SampleDetail
- type SampleInfo
- type StatusChannelInfo
- type StatusPoints
- type SubstationInfo
- type TimestampInfo
Constants ¶
View Source
const ( ComtradeTimestampLayout = "02/01/2006,15:04:05.000000" ErrStringLength = "Comtrade attribution length range err" ErrRangeValue = "Comtrade attribution value range err" ErrConstraintValue = "Comtrade attribution value constraint err" )
Variables ¶
This section is empty.
Functions ¶
func CalcPrimaryBySecondary ¶
func CalcSecondaryByPrimary ¶
Types ¶
type AnalogChannelInfo ¶
type AnalogChannelInfo struct { ChannelIndex uint32 //M ChannelID string //O 0-64characters PhaseID string //O 0-2characters MonitoredDevice string //O ccbm 0-64characters Unit string //M 1-32characters Multiplier float32 //M value = x*Multiplier + Offset Offset float32 //M Skew float32 //O us channel timestamp offset MinRange int32 //M MaxRange int32 //M PrimaryFactor float32 //M SecondaryFactor float32 //M PS byte //M ax+b represent P or S }
AnalogChannelInfo An,ch_id,ph,ccbm,uu,a,b,skew,min,max,primary,secondary,PS <CR/LF>
func (AnalogChannelInfo) Convertor ¶
func (a AnalogChannelInfo) Convertor() string
func (AnalogChannelInfo) Parser ¶
func (a AnalogChannelInfo) Parser(line string) error
func (AnalogChannelInfo) Validator ¶
func (a AnalogChannelInfo) Validator() error
type AnalogsPoints ¶
type AnalogsPoints []int16
func MockAnalogsPoints ¶
func MockAnalogsPoints(pointCount uint32) AnalogsPoints
type CfgFileInfo ¶
type CfgFileInfo struct { SubstationInfo ChannelCountInfo AnalogChannels []AnalogChannelInfo StatusChannels []StatusChannelInfo SampleInfo TimestampInfo FileTypeInfo string TimeMultiInfo float32 }
func NewComtradeCfgInfo ¶
func NewComtradeCfgInfo() *CfgFileInfo
func (*CfgFileInfo) GenerateAsciiFile ¶
func (c *CfgFileInfo) GenerateAsciiFile(filename string) error
func (*CfgFileInfo) InitAnalogChannelInfo ¶
func (*CfgFileInfo) InitChannelCountInfo ¶
func (c *CfgFileInfo) InitChannelCountInfo(analogChannelCount, statusChannelCount uint32)
func (*CfgFileInfo) InitFileTypeInfo ¶
func (c *CfgFileInfo) InitFileTypeInfo(fileType string)
func (*CfgFileInfo) InitSampleInfo ¶
func (c *CfgFileInfo) InitSampleInfo(channelFrequency float32, sampleCount uint32, sampleDetails []SampleDetail)
func (*CfgFileInfo) InitStatusChannelInfo ¶
func (c *CfgFileInfo) InitStatusChannelInfo(channelIndex uint32, channelID, phaseID, monitoredDevice string, state byte)
func (*CfgFileInfo) InitSubstationInfo ¶
func (c *CfgFileInfo) InitSubstationInfo(substation, deviceID string)
func (*CfgFileInfo) InitTimeMultiInfo ¶
func (c *CfgFileInfo) InitTimeMultiInfo(timeMulti float32)
func (*CfgFileInfo) InitTimestampInfo ¶
func (c *CfgFileInfo) InitTimestampInfo(startTimestamp, triggerTimestamp time.Time)
type ChannelCountInfo ¶
type ChannelCountInfo struct { TotalChannelCount uint32 //M 1-999999 TotalChannelCount = AnalogChannelCount + StatusChannelCount AnalogChannelCount uint32 //M StatusChannelCount uint32 //M }
ChannelCountInfo channel means DO TT,##A,##D <CR/LF>
func (ChannelCountInfo) Convertor ¶
func (c ChannelCountInfo) Convertor() string
func (ChannelCountInfo) Parser ¶
func (c ChannelCountInfo) Parser(line string) error
func (ChannelCountInfo) Validator ¶
func (c ChannelCountInfo) Validator() error
type DatFileInfo ¶
type DatFileInfo struct { SampleIndex uint32 //M Timestamp time.Time //O, depends on SampleCount\SampleDetail Analogs []AnalogsPoints //O States []StatusPoints //O // contains filtered or unexported fields }
func NewDatFileInfo ¶
func NewDatFileInfo(cfgInfo *CfgFileInfo) *DatFileInfo
func (*DatFileInfo) GenerateBinaryFile ¶
func (d *DatFileInfo) GenerateBinaryFile(filename string) error
type SampleDetail ¶
type SampleInfo ¶
type SampleInfo struct { ChannelFrequency float32 //O Hz SampleCount uint32 //M 0-999, sample count with N frequency SampleDetails []SampleDetail //M }
SampleInfo lf <CR/LF> nrates <CR/LF> samp,endsamp <CR/LF> samp,endsamp <CR/LF>
func (SampleInfo) Convertor ¶
func (s SampleInfo) Convertor() string
func (SampleInfo) Parser ¶
func (s SampleInfo) Parser(line string) error
func (SampleInfo) Validator ¶
func (s SampleInfo) Validator() error
type StatusChannelInfo ¶
type StatusChannelInfo struct { ChannelIndex uint32 //M ChannelID string //O 0-64characters PhaseID string //O 0-2characters MonitoredDevice string //O ccbm 0-64characters State byte //M 0 or 1 }
StatusChannelInfo Dn,ch_id,ph,ccbm,y <CR/LF>
func (StatusChannelInfo) Convertor ¶
func (s StatusChannelInfo) Convertor() string
func (StatusChannelInfo) Parser ¶
func (s StatusChannelInfo) Parser(line string) error
func (StatusChannelInfo) Validator ¶
func (s StatusChannelInfo) Validator() error
type StatusPoints ¶
type StatusPoints []byte
func MockStatusPoints ¶
func MockStatusPoints(pointCount uint32) StatusPoints
type SubstationInfo ¶
type SubstationInfo struct { Substation string //O 0-64characters DeviceID string //O 0-64characters RevisionYear string //M 1999 }
SubstationInfo station_name,rec_dev_id,rev_year <CR/LF>
func (SubstationInfo) Convertor ¶
func (s SubstationInfo) Convertor() string
func (SubstationInfo) Parser ¶
func (s SubstationInfo) Parser(line string) error
func (SubstationInfo) Validator ¶
func (s SubstationInfo) Validator() error
type TimestampInfo ¶
TimestampInfo dd/mm/yyyy,hh:mm:ss.ssssss <CR/LF> dd/mm/yyyy,hh:mm:ss.ssssss <CR/LF>
func (TimestampInfo) Convertor ¶
func (t TimestampInfo) Convertor() string
func (TimestampInfo) Parser ¶
func (t TimestampInfo) Parser(line string) error
func (TimestampInfo) Validator ¶
func (t TimestampInfo) Validator() error
Click to show internal directories.
Click to hide internal directories.