-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
103 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,70 @@ | ||
package comtrade | ||
|
||
type ComtradeAnalogChan struct { | ||
An uint32 //模拟通道索引号 an | ||
ChId string //通道标识 ch_id | ||
Ph string //通道相别标识 ph | ||
Ccbm string //被监视的电路元件 ccbm | ||
Uu string //通道单位 uu | ||
A float32 //通道增益系数 a | ||
B float32 //通道偏移量 b | ||
Skew float32 //通道时滞 skew | ||
Min float32 //通道最小值 min | ||
Max float32 //通道最大值 max | ||
Primary float32 //一次系数 primary | ||
Secondary float32 //二次系数 secondary | ||
PS string //一次二次标识 ps | ||
// AnalogChan 模拟通道 | ||
type AnalogChan struct { | ||
An uint32 `json:"an"` //模拟通道索引号 | ||
ChId string `json:"ch_id"` //通道标识 | ||
Ph string `json:"ph"` //通道相别标识 | ||
Ccbm string `json:"ccbm"` //被监视的电路元件 | ||
Uu string `json:"uu"` //通道单位 | ||
A float32 `json:"a"` //通道增益系数 | ||
B float32 `json:"b"` //通道偏移量 | ||
Skew float32 `json:"skew"` //通道时滞 | ||
Min float32 `json:"min"` //通道最小值 | ||
Max float32 `json:"max"` //通道最大值 | ||
Primary float32 `json:"primary"` //一次系数 | ||
Secondary float32 `json:"secondary"` //二次系数 | ||
PS string `json:"ps"` //一次二次标识 | ||
} | ||
|
||
func (c *ComtradeAnalogChan) GetAn() uint32 { | ||
func (c *AnalogChan) GetAn() uint32 { | ||
return c.An | ||
} | ||
|
||
func (c *ComtradeAnalogChan) GetChId() string { | ||
func (c *AnalogChan) GetChId() string { | ||
return c.ChId | ||
} | ||
|
||
func (c *ComtradeAnalogChan) GetPh() string { | ||
func (c *AnalogChan) GetPh() string { | ||
return c.Ph | ||
} | ||
|
||
func (c *ComtradeAnalogChan) GetCcbm() string { | ||
func (c *AnalogChan) GetCcbm() string { | ||
return c.Ccbm | ||
} | ||
|
||
func (c *ComtradeAnalogChan) GetUu() string { | ||
func (c *AnalogChan) GetUu() string { | ||
return c.Uu | ||
} | ||
|
||
func (c *ComtradeAnalogChan) GetA() float32 { | ||
func (c *AnalogChan) GetA() float32 { | ||
return c.A | ||
} | ||
|
||
func (c *ComtradeAnalogChan) GetB() float32 { | ||
func (c *AnalogChan) GetB() float32 { | ||
return c.B | ||
} | ||
|
||
func (c *ComtradeAnalogChan) GetSkew() float32 { | ||
func (c *AnalogChan) GetSkew() float32 { | ||
return c.Skew | ||
} | ||
|
||
func (c *ComtradeAnalogChan) GetMin() float32 { | ||
func (c *AnalogChan) GetMin() float32 { | ||
return c.Min | ||
} | ||
|
||
func (c *ComtradeAnalogChan) GetMax() float32 { | ||
func (c *AnalogChan) GetMax() float32 { | ||
return c.Max | ||
} | ||
|
||
func (c *ComtradeAnalogChan) GetPrimary() float32 { | ||
func (c *AnalogChan) GetPrimary() float32 { | ||
return c.Primary | ||
} | ||
|
||
func (c *ComtradeAnalogChan) GetSecondary() float32 { | ||
func (c *AnalogChan) GetSecondary() float32 { | ||
return c.Secondary | ||
} | ||
|
||
func (c *ComtradeAnalogChan) GetPS() string { | ||
func (c *AnalogChan) GetPS() string { | ||
return c.PS | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
package comtrade | ||
|
||
// ComtradeData is the data of a comtrade file. | ||
type ComtradeData struct { | ||
AnalogData []ComtradeAnalogData | ||
DigitalData []ComtradeDigitalData | ||
// Data is the data of a comtrade file. | ||
type Data struct { | ||
AnalogData []AnalogData | ||
DigitalData []DigitalData | ||
} | ||
|
||
// ComtradeAnalogData is the analog data of a comtrade file. | ||
type ComtradeAnalogData struct { | ||
N uint32 //模拟通道序号 n | ||
Timestamp uint32 //模拟通道时标 timestamp | ||
Data []int32 //模拟通道数据 data | ||
// AnalogData is the analog data of a comtrade file. | ||
type AnalogData struct { | ||
N uint32 `json:"n"` //模拟通道序号 | ||
Timestamp uint32 `json:"timestamp"` //模拟通道时标 | ||
Data []int32 `json:"data"` //模拟通道数据 | ||
} | ||
|
||
// ComtradeDigitalData is the digital data of a comtrade file. | ||
type ComtradeDigitalData struct { | ||
N uint32 //数字通道序号 n | ||
Timestamp uint32 //数字通道时标 timestamp | ||
Data []uint8 //数字通道数据 data | ||
// DigitalData is the digital data of a comtrade file. | ||
type DigitalData struct { | ||
N uint32 `json:"n"` //数字通道序号 | ||
Timestamp uint32 `json:"timestamp"` //数字通道时标 | ||
Data []uint8 `json:"data"` //数字通道数据 | ||
} | ||
|
||
func (cd *ComtradeData) GetAnalogData() []ComtradeAnalogData { | ||
func (cd *Data) GetAnalogData() []AnalogData { | ||
return cd.AnalogData | ||
} | ||
|
||
func (cd *ComtradeData) GetDigitalData() []ComtradeDigitalData { | ||
func (cd *Data) GetDigitalData() []DigitalData { | ||
return cd.DigitalData | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,30 @@ | ||
package comtrade | ||
|
||
type ComtradeDigitalChan struct { | ||
Dn uint32 //数字/状态通道索引号 dn | ||
ChId string //通道标识 ch_id | ||
Ph string //通道相别标识 ph | ||
Ccbm string //被监视的电路元件 ccbm | ||
Y uint8 //通道状态 y | ||
// DigitalChan 数字通道 | ||
type DigitalChan struct { | ||
Dn uint32 `json:"dn"` //数字/状态通道索引号 | ||
ChId string `json:"ch_id"` //通道标识 | ||
Ph string `json:"ph"` //通道相别标识 | ||
Ccbm string `json:"ccbm"` //被监视的电路元件 | ||
Y uint8 `json:"y"` //通道状态 | ||
} | ||
|
||
func (c *ComtradeDigitalChan) GetDn() uint32 { | ||
func (c *DigitalChan) GetDn() uint32 { | ||
return c.Dn | ||
} | ||
|
||
func (c *ComtradeDigitalChan) GetChId() string { | ||
func (c *DigitalChan) GetChId() string { | ||
return c.ChId | ||
} | ||
|
||
func (c *ComtradeDigitalChan) GetPh() string { | ||
func (c *DigitalChan) GetPh() string { | ||
return c.Ph | ||
} | ||
|
||
func (c *ComtradeDigitalChan) GetCcbm() string { | ||
func (c *DigitalChan) GetCcbm() string { | ||
return c.Ccbm | ||
} | ||
|
||
func (c *ComtradeDigitalChan) GetY() uint8 { | ||
func (c *DigitalChan) GetY() uint8 { | ||
return c.Y | ||
} |
Oops, something went wrong.