models

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventAttributeEventType = "SKF.Hierarchy.EventType"
	EventAttributeAggregate = "SKF.Hierarchy.Aggregate"
)
View Source
const (
	EventTypeThreshold   = "SetPointAlarmThresholdEvent"
	EventTypeAlarmStatus = "PointAlarmStatusEvent"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AlarmStatus

type AlarmStatus struct {
	Status       AlarmStatusType
	UpdatedAt    time.Time
	Overall      *GenericAlarmStatus
	RateOfChange *GenericAlarmStatus
	Inspection   *GenericAlarmStatus
	Band         []BandAlarmStatus
	HAL          []HALAlarmStatus
	External     *ExternalAlarmStatus
}

func (*AlarmStatus) FromInternal

func (a *AlarmStatus) FromInternal(internal models.ModelsGetAlarmStatusResponse)

type AlarmStatusEvent

type AlarmStatusEvent struct {
	AggregateID uuid.UUID
	UserID      uuid.UUID
	Changed     bool
	AlarmStatus AlarmStatus
}

func (*AlarmStatusEvent) FromInternal

func (a *AlarmStatusEvent) FromInternal(buf []byte) error

type AlarmStatusType

type AlarmStatusType int32
const (
	AlarmStatusNotConfigured AlarmStatusType = iota
	AlarmStatusNoData
	AlarmStatusGood
	AlarmStatusAlert
	AlarmStatusDanger
)

type BandAlarm

type BandAlarm struct {
	Label            string
	MinFrequency     BandAlarmFrequency
	MaxFrequency     BandAlarmFrequency
	OverallThreshold *BandAlarmOverallThreshold
}

func (*BandAlarm) FromInternal

func (b *BandAlarm) FromInternal(internal *models.ModelsBandAlarm)

func (*BandAlarm) FromProto

func (b *BandAlarm) FromProto(buf []byte) error

func (BandAlarm) ToInternal

func (b BandAlarm) ToInternal() *models.ModelsBandAlarm

type BandAlarmFrequency

type BandAlarmFrequency struct {
	ValueType BandAlarmFrequencyValueType
	Value     float64
}

func (*BandAlarmFrequency) FromInternalAlarmStatus

func (f *BandAlarmFrequency) FromInternalAlarmStatus(internal *models.ModelsGetAlarmStatusResponseFrequency)

func (*BandAlarmFrequency) FromInternalThreshold

func (f *BandAlarmFrequency) FromInternalThreshold(internal *models.ModelsBandAlarmFrequency)

func (*BandAlarmFrequency) FromProto

func (f *BandAlarmFrequency) FromProto(internal *pas.Frequency)

func (BandAlarmFrequency) ToInternal

type BandAlarmFrequencyValueType

type BandAlarmFrequencyValueType int32
const (
	BandAlarmFrequencyUnknown BandAlarmFrequencyValueType = iota
	BandAlarmFrequencyFixed
	BandAlarmFrequencySpeedMultiple
)

type BandAlarmOverallThreshold

type BandAlarmOverallThreshold struct {
	Unit        string
	UpperAlert  *BandAlarmThreshold
	UpperDanger *BandAlarmThreshold
}

func (*BandAlarmOverallThreshold) FromInternal

func (*BandAlarmOverallThreshold) FromProto

func (BandAlarmOverallThreshold) ToInternal

type BandAlarmStatus

type BandAlarmStatus struct {
	GenericAlarmStatus
	Label             string
	MinFrequency      BandAlarmFrequency
	MaxFrequency      BandAlarmFrequency
	CalculatedOverall *BandAlarmStatusCalculatedOverall
}

func (*BandAlarmStatus) FromEvent

func (b *BandAlarmStatus) FromEvent(internal events.BandAlarmStatus)

func (*BandAlarmStatus) FromInternal

type BandAlarmStatusCalculatedOverall

type BandAlarmStatusCalculatedOverall struct {
	Unit  string
	Value float64
}

type BandAlarmThreshold

type BandAlarmThreshold struct {
	ValueType BandAlarmThresholdType
	Value     float64
}

func (*BandAlarmThreshold) FromInternal

func (t *BandAlarmThreshold) FromInternal(internal *models.ModelsBandAlarmThreshold)

func (*BandAlarmThreshold) FromProto

func (t *BandAlarmThreshold) FromProto(internal *pas.ThresholdValue)

func (BandAlarmThreshold) ToInternal

type BandAlarmThresholdType

type BandAlarmThresholdType int32
const (
	BandAlarmThresholdTypeUnknown BandAlarmThresholdType = iota
	BandAlarmThresholdTypeAbsolute
	BandAlarmThresholdTypeRelativeFullscale
)

type Bearing

type Bearing struct {
	Manufacturer string
	ModelNumber  string
}

func (Bearing) ToInternal added in v0.1.1

func (b Bearing) ToInternal() *models.ModelsBearing

type ContentType

type ContentType string
const (
	ContentTypeDataPoint       ContentType = "DATA_POINT"
	ContentTypeSpectrum        ContentType = "SPECTRUM"
	ContentTypeQuestionAnswers ContentType = "QUESTION_ANSWERS"
)

type Coordinate

type Coordinate struct {
	X float64
	Y float64
}

type DataPoint

type DataPoint struct {
	Coordinate Coordinate
	XUnit      string
	YUnit      string
}

type ExternalAlarmStatus

type ExternalAlarmStatus struct {
	Status AlarmStatusType
	SetBy  *uuid.UUID
}

func (*ExternalAlarmStatus) FromEvent

func (e *ExternalAlarmStatus) FromEvent(internal *events.ExternalAlarm)

func (*ExternalAlarmStatus) FromInternal

func (*ExternalAlarmStatus) ToSetRequest

type GenericAlarmStatus

type GenericAlarmStatus struct {
	TriggeringMeasurement uuid.UUID
	Status                AlarmStatusType
}

func (*GenericAlarmStatus) FromEvent

func (g *GenericAlarmStatus) FromEvent(internal *events.GenericAlarm)

func (*GenericAlarmStatus) FromInternal

type HALAlarm

type HALAlarm struct {
	Label        string
	Bearing      *Bearing
	HALAlarmType HALAlarmType
	UpperDanger  *float64
	UpperAlert   *float64
}

func (*HALAlarm) FromInternal

func (h *HALAlarm) FromInternal(internal *models.ModelsHALAlarm)

func (*HALAlarm) FromProto

func (h *HALAlarm) FromProto(buf []byte) error

func (HALAlarm) ToInternal

func (h HALAlarm) ToInternal() *models.ModelsHALAlarm

type HALAlarmStatus

type HALAlarmStatus struct {
	GenericAlarmStatus
	Label                 string
	Bearing               *Bearing
	HALIndex              *float64
	FaultFrequency        *float64
	RPMFactor             *float64
	NumberOfHarmonicsUsed *int64
	ErrorDescription      *string
}

func (*HALAlarmStatus) FromEvent

func (h *HALAlarmStatus) FromEvent(internal events.HalAlarmStatus)

func (*HALAlarmStatus) FromInternal

func (h *HALAlarmStatus) FromInternal(internal *models.ModelsGetAlarmStatusResponseHALAlarm)

type HALAlarmType

type HALAlarmType string
const (
	HALAlarmTypeGlobal         HALAlarmType = "GLOBAL"
	HALAlarmTypeFaultFrequency HALAlarmType = "FREQUENCY"
)

type Inspection

type Inspection struct {
	Choices []InspectionChoice
}

func (*Inspection) FromInternal

func (i *Inspection) FromInternal(internal *models.ModelsInspection)

func (*Inspection) FromProto

func (i *Inspection) FromProto(buf []byte) error

func (Inspection) ToInternal

func (i Inspection) ToInternal() *models.ModelsInspection

type InspectionChoice

type InspectionChoice struct {
	Answer      string
	Instruction string
	Status      AlarmStatusType
}

func (*InspectionChoice) FromInternal

func (i *InspectionChoice) FromInternal(internal *models.ModelsInspectionChoice)

func (*InspectionChoice) FromProto

func (i *InspectionChoice) FromProto(internal *pas.InspectionChoice)

func (InspectionChoice) ToInternal

type Measurement

type Measurement struct {
	MeasurementID   uuid.UUID
	CreatedAt       time.Time
	ContentType     ContentType
	DataPoint       *DataPoint
	Spectrum        *Spectrum
	QuestionAnswers []string
	RateOfChange    *float64
	Tags            map[string]interface{}
}

func (*Measurement) ToInternal

type Overall

type Overall struct {
	OuterHigh *float64
	InnerHigh *float64
	InnerLow  *float64
	OuterLow  *float64
	Unit      string
}

func (*Overall) FromInternal

func (o *Overall) FromInternal(internal *models.ModelsOverall)

func (*Overall) FromProto

func (o *Overall) FromProto(buf []byte) error

func (Overall) ToInternal

func (o Overall) ToInternal() *models.ModelsOverall

type Patch

type Patch = []jsondiff.Operation

type RateOfChange

type RateOfChange struct {
	OuterHigh *float64
	InnerHigh *float64
	InnerLow  *float64
	OuterLow  *float64
	Unit      string
}

func (*RateOfChange) FromInternal

func (r *RateOfChange) FromInternal(internal *models.ModelsRateOfChange)

func (*RateOfChange) FromProto

func (r *RateOfChange) FromProto(buf []byte) error

func (RateOfChange) ToInternal

func (r RateOfChange) ToInternal() *models.ModelsRateOfChange

type Spectrum

type Spectrum struct {
	XUnit string
	YUnit string
	Speed float64
}

type Threshold

type Threshold struct {
	NodeID        uuid.UUID
	ThresholdType ThresholdType
	Overall       *Overall
	RateOfChange  *RateOfChange
	Inspection    *Inspection
	FullScale     *float64
	BandAlarms    []BandAlarm
	HALAlarms     []HALAlarm
}

func (*Threshold) FromInternal

func (t *Threshold) FromInternal(internal models.ModelsGetPointAlarmThresholdResponse) (err error)

func (Threshold) ToInternal

type ThresholdEvent

type ThresholdEvent struct {
	AggregateID uuid.UUID
	UserID      uuid.UUID
	Threshold   Threshold
}

func (*ThresholdEvent) FromInternal

func (t *ThresholdEvent) FromInternal(buf []byte) error

type ThresholdType

type ThresholdType int32
const (
	ThresholdTypeNone ThresholdType = iota
	ThresholdTypeOverallInWindow
	ThresholdTypeOverallOutOfWindow
	ThresholdTypeInspection
)

Jump to

Keyboard shortcuts

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