-
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
27 changed files
with
1,953 additions
and
97 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# This workflow will build a golang project | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | ||
|
||
name: Go | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.20' | ||
|
||
- name: Build | ||
run: go build -v ./... | ||
|
||
- name: Test | ||
run: go test -v ./... |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
##### Translate to: [简体中文](README_zh.md) | ||
## About go-comtrade | ||
|
||
> The go-comtrade is a lib used to parse COMTRADE file. | ||
## Getting Started | ||
|
||
```shell | ||
go get github.com/yonwoo9/go-comtrade | ||
``` | ||
|
||
## License | ||
|
||
The go-comtrade is open-sourced software licensed under the [MIT license](./LICENSE). | ||
|
||
## Acknowledgments | ||
|
||
The following project had particular influence on go-comtrade design. | ||
|
||
- [smslit/comtrade](https://github.com/smslit/comtrade). | ||
- [dparrini/python-comtrade](https://github.com/dparrini/python-comtrade). | ||
- [miguelmoreto/pycomtrade](https://github.com/miguelmoreto/pycomtrade). | ||
- [ValleyZw/comgo](https://github.com/ValleyZw/comgo). |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Translations: [English](README.md) | [简体中文](README_zh.md) | ||
|
||
## 关于 go-comtrade | ||
|
||
> go-comtrade是用一个库,用来解析COMTRADE录波文件. | ||
## 开始 | ||
|
||
```shell | ||
go get github.com/yonwoo9/go-comtrade | ||
``` | ||
|
||
## 开源协议 | ||
|
||
go-comtrade是基于[MIT license](./LICENSE)协议的开源软件. | ||
|
||
## 致谢 | ||
以下这些库对go-comtrade开发设计有较大影响. | ||
|
||
- [smslit/comtrade](https://github.com/smslit/comtrade). | ||
- [dparrini/python-comtrade](https://github.com/dparrini/python-comtrade). | ||
- [miguelmoreto/pycomtrade](https://github.com/miguelmoreto/pycomtrade). | ||
- [ValleyZw/comgo](https://github.com/ValleyZw/comgo). | ||
|
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,69 @@ | ||
package comtrade | ||
|
||
type ComtradeAnalog struct { | ||
An string //模拟通道索引号 an | ||
type ComtradeAnalogChan struct { | ||
An uint32 //模拟通道索引号 an | ||
ChId string //通道标识 ch_id | ||
Ph string //通道相别标识 ph | ||
Ccbm string //被监视的电路元件 ccbm | ||
Uu string //通道单位 uu | ||
A float64 //通道增益系数 a | ||
B float64 //通道偏移量 b | ||
Skew float64 //通道时滞 skew | ||
Min float64 //通道最小值 min | ||
Max float64 //通道最大值 max | ||
Primary float64 //一次系数 primary | ||
Secondary float64 //二次系数 secondary | ||
A float32 //通道增益系数 a | ||
B float32 //通道偏移量 b | ||
Skew float32 //通道时滞 skew | ||
Min float32 //通道最小值 min | ||
Max float32 //通道最大值 max | ||
Primary float32 //一次系数 primary | ||
Secondary float32 //二次系数 secondary | ||
PS string //一次二次标识 ps | ||
} | ||
|
||
func (c *ComtradeAnalog) GetAn() string { | ||
func (c ComtradeAnalogChan) GetAn() uint32 { | ||
return c.An | ||
} | ||
|
||
func (c *ComtradeAnalog) GetChId() string { | ||
func (c ComtradeAnalogChan) GetChId() string { | ||
return c.ChId | ||
} | ||
|
||
func (c *ComtradeAnalog) GetPh() string { | ||
func (c ComtradeAnalogChan) GetPh() string { | ||
return c.Ph | ||
} | ||
|
||
func (c *ComtradeAnalog) GetCcbm() string { | ||
func (c ComtradeAnalogChan) GetCcbm() string { | ||
return c.Ccbm | ||
} | ||
|
||
func (c *ComtradeAnalog) GetUu() string { | ||
func (c ComtradeAnalogChan) GetUu() string { | ||
return c.Uu | ||
} | ||
|
||
func (c *ComtradeAnalog) GetA() float64 { | ||
func (c ComtradeAnalogChan) GetA() float32 { | ||
return c.A | ||
} | ||
|
||
func (c *ComtradeAnalog) GetB() float64 { | ||
func (c ComtradeAnalogChan) GetB() float32 { | ||
return c.B | ||
} | ||
|
||
func (c *ComtradeAnalog) GetSkew() float64 { | ||
func (c ComtradeAnalogChan) GetSkew() float32 { | ||
return c.Skew | ||
} | ||
|
||
func (c *ComtradeAnalog) GetMin() float64 { | ||
func (c ComtradeAnalogChan) GetMin() float32 { | ||
return c.Min | ||
} | ||
|
||
func (c *ComtradeAnalog) GetMax() float64 { | ||
func (c ComtradeAnalogChan) GetMax() float32 { | ||
return c.Max | ||
} | ||
|
||
func (c *ComtradeAnalog) GetPrimary() float64 { | ||
func (c ComtradeAnalogChan) GetPrimary() float32 { | ||
return c.Primary | ||
} | ||
|
||
func (c *ComtradeAnalog) GetSecondary() float64 { | ||
func (c ComtradeAnalogChan) GetSecondary() float32 { | ||
return c.Secondary | ||
} | ||
|
||
func (c *ComtradeAnalog) GetPS() string { | ||
func (c ComtradeAnalogChan) GetPS() string { | ||
return c.PS | ||
} |
Oops, something went wrong.