icd

package
v0.0.0-...-91c7ab2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertLdModelToString

func ConvertLdModelToString(ldModel LdModel) (string, error)

func ConvertSensorTemplateModelsToString

func ConvertSensorTemplateModelsToString(sensorTemplateModels []SensorTemplateModel) (string, error)

func GenerateIcdFile

func GenerateIcdFile(filename, iedDesc, iedName, iedType, ip, manufacturer, ldModelInst, sensorTemplates string)

func GenerateLdModel

func GenerateLdModel(ldInfo LdInfo) (LdModel, []SensorTemplateModel)

Types

type DAI

type DAI struct {
	XMLName xml.Name `xml:"DAI"`
	Name    string   `xml:"name,attr"`
	Val     string   `xml:"Val"`
}

type DOI

type DOI struct {
	XMLName xml.Name `xml:"DOI"`
	Desc    string   `xml:"desc,attr"`
	Name    string   `xml:"name,attr"`
	Sdis    []SDI
	Dais    []DAI
}

func GenerateDOForMeasure

func GenerateDOForMeasure(isInt bool, desc, name, value, SIUnit, multiplier, dU string, rangeC RangeC) DOI

func GenerateDOForSettingGroup

func GenerateDOForSettingGroup(desc, name, dU string) DOI

func GenerateDOForStatus

func GenerateDOForStatus(desc, name, dU string) DOI

type DataSetModel

type DataSetModel struct {
	XMLName xml.Name `xml:"DataSet"`
	Desc    string   `xml:"desc,attr"`
	Name    string   `xml:"name,attr"`

	FCDAs []FCDAModel
}

type FCDAModel

type FCDAModel struct {
	XMLName xml.Name `xml:"FCDA"`
	Prefix  string   `xml:"prefix,attr,omitempty"`
	DoName  string   `xml:"doName,attr"`
	LnInst  string   `xml:"lnInst,attr"`
	LnClass string   `xml:"lnClass,attr"`
	LdInst  string   `xml:"ldInst,attr"`
	FC      string   `xml:"fc,attr"`
}

type IEDInfo

type IEDInfo struct {
	Desc         string
	IEDName      string
	IEDType      string
	IP           string
	Manufacturer string

	LdModelInst      string
	LnSensorTemplate string
}

type LLN0Info

type LLN0Info struct {
	Desc   string
	Prefix string

	NamPlt
}

type LLN0LnModel

type LLN0LnModel struct {
	XMLName xml.Name `xml:"LN0"`

	Desc    string `xml:"desc,attr"`
	Prefix  string `xml:"prefix,attr,omitempty"`
	Inst    string `xml:"inst,attr"`
	LnClass string `xml:"lnClass,attr"`
	LnType  string `xml:"lnType,attr"`

	MeasureDataSets      []*DataSetModel
	StatusDataSets       []*DataSetModel
	SettingGroupDataSets []*DataSetModel

	ReportCtrls  []ReportCtrlModel
	LogCtrls     []LogControlModel
	SettingGroup SettingGroupModel

	MandatoryDOIs []DOI
}

func (*LLN0LnModel) SetLLN0LnModelMandatoryDo

func (m *LLN0LnModel) SetLLN0LnModelMandatoryDo(lln0Info LLN0Info)

func (*LLN0LnModel) SetLLN0LnModelMeasureDataSet

func (m *LLN0LnModel) SetLLN0LnModelMeasureDataSet(ldInst, prefix, sensorClass string, sensorInst int, mvDos []DOI)

func (*LLN0LnModel) SetLLN0LnModelReportAndLog

func (m *LLN0LnModel) SetLLN0LnModelReportAndLog(ldInst string, isSCD bool)

func (*LLN0LnModel) SetLLN0LnModelSettingGroupDataSet

func (m *LLN0LnModel) SetLLN0LnModelSettingGroupDataSet(ldInst, prefix, sensorClass string, sensorInst int, sgDos []DOI)

func (*LLN0LnModel) SetLLN0LnModelStatusDataSet

func (m *LLN0LnModel) SetLLN0LnModelStatusDataSet(ldInst, prefix, sensorClass string, sensorInst int, stDos []DOI)

type LPHDInfo

type LPHDInfo struct {
	Desc   string
	Prefix string
	Inst   int

	NamPlt
}

type LPHDLnModel

type LPHDLnModel struct {
	XMLName xml.Name `xml:"LN"`
	Desc    string   `xml:"desc,attr"`
	Prefix  string   `xml:"prefix,attr,omitempty"`
	Inst    string   `xml:"inst,attr"`
	LnClass string   `xml:"lnClass,attr"`
	LnType  string   `xml:"lnType,attr"`

	MandatoryDOIs []DOI
}

func (*LPHDLnModel) SetLPHDLnModel

func (m *LPHDLnModel) SetLPHDLnModel(lphdInfo LPHDInfo, phyHealthVal, phyHealthQuality string)

type LdInfo

type LdInfo struct {
	Desc  string
	Inst  string
	IsSCD bool

	LLN0NamPlt   NamPlt
	LPHDNamPlt   NamPlt
	SensorNamPlt NamPlt

	SensorInfo []SensorLnInfo //include all sensor instance info

	HealthVal     string
	HealthQuality string
}

type LdModel

type LdModel struct {
	XMLName xml.Name `xml:"LDevice"`
	Desc    string   `xml:"desc,attr"`
	Inst    string   `xml:"inst,attr"`
	LLN0    LLN0LnModel
	LPHD    LPHDLnModel
	Sensors []SensorLnModel
}

type LogControlModel

type LogControlModel struct {
	XMLName xml.Name `xml:"LogControl"`
	Desc    string   `xml:"desc,attr"`
	Name    string   `xml:"name,attr"`
	DataSet string   `xml:"datSet,attr"`
	LogName string   `xml:"logName,attr"`
	LogEna  string   `xml:"logEna,attr"`
	IntgPd  string   `xml:"intgPd,attr"`

	TrgOps TrgOpsModel
}

type MeasureDoInfo

type MeasureDoInfo struct {
	IsInt      bool
	Desc       string
	Name       string
	SIUnit     string
	Multiplier string
	DU         string
	Range      RangeC
}

type NamPlt

type NamPlt struct {
	Vendor    string //生产厂家
	SwRev     string //软件版本
	ConfigRev string //only for LLN0 LPHDLnModel, sensor LN should ignore this
	Model     string //only for LPHDLnModel
	DU        string
}

func GenerateLLN0NamPlt

func GenerateLLN0NamPlt(vendor, swRev, configRev, du string) NamPlt

func GenerateLPHDNamPlt

func GenerateLPHDNamPlt(vendor, swRev, model, du string) NamPlt

func GenerateSensorNamPlt

func GenerateSensorNamPlt(vendor, swRev, du string) NamPlt

type OptFieldsModel

type OptFieldsModel struct {
	XMLName    xml.Name `xml:"OptFields"`
	DataRef    string   `xml:"dataRef,attr"`
	ReasonCode string   `xml:"reasonCode,attr"`
	DataSet    string   `xml:"dataSet,attr"`
	TimeStamp  string   `xml:"timeStamp,attr"`
	EntryID    string   `xml:"entryID,attr,omitempty"`
}

type Property

type Property struct {
	Desc       string
	Name       string
	FC         string
	DataType   string
	SIUnit     string
	Multiplier string
	DU         string
	Range      RangeC
}

type RangeC

type RangeC struct {
	HHLim int
	HLim  int
	LLim  int
	LLLim int
	Min   int
	Max   int
}

type ReportCtrlModel

type ReportCtrlModel struct {
	XMLName  xml.Name `xml:"ReportControl"`
	Desc     string   `xml:"desc,attr"`
	ConfRev  string   `xml:"confRev,attr"`
	RptID    string   `xml:"rptID,attr"`
	RptName  string   `xml:"name,attr"`
	DataSet  string   `xml:"datSet,attr"`
	IntgPd   string   `xml:"intgPd,attr"` //周期
	BufTime  string   `xml:"bufTime,attr"`
	Buffered string   `xml:"buffered,attr"` //是否缓冲报告块

	TrgOps     TrgOpsModel
	OptFields  OptFieldsModel
	RptEnabled RptEnabledModel
}

type RptEnabledModel

type RptEnabledModel struct {
	XMLName xml.Name `xml:"RptEnabled"`
	Max     string   `xml:"max,attr"`
}

type SDI

type SDI struct {
	XMLName xml.Name `xml:"SDI"`
	Name    string   `xml:"name,attr"`
	Sdi     []SDI
	Dais    []DAI
}

type SensorDoModel

type SensorDoModel struct {
	XMLName xml.Name `xml:"DO"`
	Desc    string   `xml:"desc,attr"`
	Type    string   `xml:"type,attr"`
	Name    string   `xml:"name,attr"`
}

type SensorLnInfo

type SensorLnInfo struct {
	Desc    string //ln instance description
	Prefix  string
	Inst    int
	LnClass string
	LnType  string
	LnDesc  string //ln template description

	Properties []Property
}

type SensorLnMandatoryInfo

type SensorLnMandatoryInfo struct {
	HealthVal     string
	HealthQuality string

	NamPlt
}

type SensorLnModel

type SensorLnModel struct {
	XMLName xml.Name `xml:"LN"`
	Desc    string   `xml:"desc,attr"`
	Prefix  string   `xml:"prefix,attr,omitempty"`
	Inst    string   `xml:"inst,attr"`
	LnClass string   `xml:"lnClass,attr"`
	LnType  string   `xml:"lnType,attr"`

	MandatoryDOIs []DOI
	SensorDOIs    []DOI
}

func (*SensorLnModel) SetSensorLnModelMandatoryDo

func (m *SensorLnModel) SetSensorLnModelMandatoryDo(lnInfo SensorLnInfo, mandatoryInfo SensorLnMandatoryInfo)

func (*SensorLnModel) SetSensorLnModelSensorDo

func (m *SensorLnModel) SetSensorLnModelSensorDo(dois []DOI)

type SensorTemplateModel

type SensorTemplateModel struct {
	XMLName xml.Name `xml:"LNodeType"`
	Desc    string   `xml:"desc,attr,omitempty"`
	LnClass string   `xml:"lnClass,attr"`
	ID      string   `xml:"id,attr"`

	Dos []*SensorDoModel
}

func (*SensorTemplateModel) SetLnTemplate

func (m *SensorTemplateModel) SetLnTemplate(lnDesc, lnClass, lnType string, properties []Property)

type SettingGroupDOInfo

type SettingGroupDOInfo struct {
	Desc string
	Name string
	DU   string
}

type SettingGroupModel

type SettingGroupModel struct {
	XMLName xml.Name `xml:"SettingControl"`
	NumOfSG string   `xml:"numOfSGs,attr"`
	ActSG   string   `xml:"actSG,attr"`
}

type StatusDoInfo

type StatusDoInfo struct {
	Desc string
	Name string
	DU   string
}

type TrgOpsModel

type TrgOpsModel struct {
	XMLName xml.Name `xml:"TrgOps"`
	Period  string   `xml:"period,attr,omitempty"`
	Dchg    string   `xml:"dchg,attr,omitempty"`
	Dupd    string   `xml:"dupd,attr,omitempty"`
	Qchg    string   `xml:"qchg,attr,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL