datamodel

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProducingAtFullSpeedState means that the asset is producing at full speed
	ProducingAtFullSpeedState = 10000

	// ProducingAtLowerThanFullSpeedState means that the asset is producing lower than full speed
	ProducingAtLowerThanFullSpeedState = 20000

	// UnknownState means that the asset is in an unknown state
	UnknownState = 30000

	// UnspecifiedStopState means that the asset is in an unspecified stop
	UnspecifiedStopState = 40000

	// IdleState means that the asset is in an unspecified state, but theoretically ready to run
	IdleState = 40100

	// OperatorInteractionState means that the asset is in an unspecified state, because the operator has stopped the asset manually
	OperatorInteractionState = 40200

	// MicrostopState means that the asset is in an unspecified stop shorter than a certain amount of time
	// (typically between 2 to 10 minutes)
	MicrostopState = 50000

	// InletJamState means that the asset has a jam in the inlet
	InletJamState = 60000

	// OutletJamState means that the asset has a jam in the outlet
	OutletJamState = 70000

	// CongestionBypassState means that the asset has a congestion or deficiency in the bypass flow
	CongestionBypassState = 80000

	// MissingBottleCapsRinneState means that the asset has a congestion or deficiency in the bypass flow, specifically "Kronkorken Rinne"
	MissingBottleCapsRinneState = 80001

	// MissingBottleCapsUebergabeState means that the asset has a congestion or deficiency in the bypass flow, specifically "Kronkorken Uebergabe"
	MissingBottleCapsUebergabeState = 80002

	// MaterialIssueOtherState means that the asset has unknown or other material issue, which is not further specified
	MaterialIssueOtherState = 90000

	// ChangeoverState means that the asset is currently undergoing a changeover
	ChangeoverState = 100000

	// ChangeoverPreparationState means that the asset is currently undergoing a changeover in the preparation step
	// (time between order is started till the machine is first running)
	ChangeoverPreparationState = 100010

	// ChangeoverPostprocessingState means that the asset is currently undergoing a changeover in the postprocessing step
	// (time between machien was last running and the time when the order is ended )
	ChangeoverPostprocessingState = 100020

	// CleaningState means that the asset is currently undergoing a cleaning process
	CleaningState = 110000

	// EmptyingState means that the asset is currently undergoing a emptying process
	EmptyingState = 120000

	// SettingUpState means that the asset is currently setting up (e.g. warming up)
	SettingUpState = 130000

	// OperatorNotAtMachineState means that the asset is not running because there is no operator available
	OperatorNotAtMachineState = 140000

	// OperatorBreakState means that the asset is not running because the operators are in a break
	OperatorBreakState = 150000

	// NoShiftState means that there is no planned shift at the asset
	NoShiftState = 160000

	// NoOrderState means that there is no order at the asset
	NoOrderState = 170000

	// EquipmentFailureState means that there is an equipment failure (e.g. broken engine)
	EquipmentFailureState = 180000

	// EquipmentFailureState means that there is an equipment failure at the welder
	EquipmentFailureStateWelder = 180001

	// EquipmentFailureState means that there is an equipment failure at the welder
	EquipmentFailureStateExpender = 180002

	// EquipmentFailureState means that there is an equipment failure Palletizer
	EquipmentFailureStatePalletizer = 180003

	// EquipmentFailureState means that there is an equipment failure Underbody-machine
	EquipmentFailureStateUnderbody = 180004

	// EquipmentFailureState means that there is an equipment failure (e.g. broken engine)
	EquipmentFailureStateTopcover = 180005

	// ExternalFailureState means that there is an external failure (e.g. missing compressed air)
	ExternalFailureState = 190000

	// ExternalInterferenceState means that the asset is not running because of an external interference
	ExternalInterferenceState = 200000

	// CraneNotAvailableState means that the asset is not running because the crane is currently not available
	CraneNotAvailableState = 200010

	// PreventiveMaintenanceStop means that the asset is currently undergoing a preventive maintenance action
	PreventiveMaintenanceStop = 210000

	// TechnicalOtherStop means that the asset is currently having a not further specified technical issue
	TechnicalOtherStop = 220000

	// MaxState is the highest possible state
	MaxState = 230000
)

Variables

View Source
var ModelState = newModelStateRegistry()

Functions

func ConvertNewToOld

func ConvertNewToOld(NewState int) (OldState int)

ConvertNewToOld converts a state from the new data model to the old one (used to keep the old test files)

func ConvertOldToNew

func ConvertOldToNew(OldState int) (NewState int)

ConvertOldToNew converts a state from the old data model to the new one

func ConvertStateToString

func ConvertStateToString(state int, languageCode int) (stateString string)

ConvertStateToString converts a state in integer format to a human readable string

func GetStateFromString

func GetStateFromString(stateString string) uint64

GetStateFromString returns the state number from its string representation

func IsChangeover

func IsChangeover(state int) (returnValue bool)

IsChangeover checks whether

func IsCleaning

func IsCleaning(state int) (returnValue bool)

IsCleaning checks whether

func IsCongestionBypass

func IsCongestionBypass(state int) (returnValue bool)

IsCongestionBypass checks whether

func IsEmptying

func IsEmptying(state int) (returnValue bool)

IsEmptying checks whether

func IsEquipmentFailure

func IsEquipmentFailure(state int) (returnValue bool)

IsEquipmentFailure checks whether

func IsExternalFailure

func IsExternalFailure(state int) (returnValue bool)

IsExternalFailure checks whether

func IsExternalInterference

func IsExternalInterference(state int) (returnValue bool)

IsExternalInterference checks whether

func IsInletJam

func IsInletJam(state int) (returnValue bool)

IsInletJam checks whether

func IsMaterialIssueOther

func IsMaterialIssueOther(state int) (returnValue bool)

IsMaterialIssueOther checks whether

func IsMicrostop

func IsMicrostop(state int) (returnValue bool)

IsMicrostop checks whether the asset is in a microstop

func IsNoOrder

func IsNoOrder(state int) (returnValue bool)

IsNoOrder checks whether

func IsNoShift

func IsNoShift(state int) (returnValue bool)

IsNoShift checks whether the asset has no shift planned

func IsOperatorBreak

func IsOperatorBreak(state int) (returnValue bool)

IsOperatorBreak checks whether the asset is not running because the operators are in a break

func IsOperatorNotAtMachine

func IsOperatorNotAtMachine(state int) (returnValue bool)

IsOperatorNotAtMachine checks whether

func IsOutletJam

func IsOutletJam(state int) (returnValue bool)

IsOutletJam checks whether

func IsPreventiveMaintenance

func IsPreventiveMaintenance(state int) (returnValue bool)

IsPreventiveMaintenance checks whether

func IsProducing

func IsProducing(state int) (returnValue bool)

IsProducing checks whether the asset is producing

func IsProducingFullSpeed

func IsProducingFullSpeed(state int) (returnValue bool)

IsProducingFullSpeed checks whether the asset is producing on the full speed

func IsProducingLowerThanFullSpeed

func IsProducingLowerThanFullSpeed(state int) (returnValue bool)

IsProducingLowerThanFullSpeed checks whether the asset is producing lower than the full speed

func IsSettingUp

func IsSettingUp(state int) (returnValue bool)

IsSettingUp checks whether

func IsSpecifiedStop

func IsSpecifiedStop(state int) (returnValue bool)

IsSpecifiedStop checks whether the asset is in an specified stop (is not running, is not a microstop or unknown stop, and is defined)

func IsTechnicalOtherStop

func IsTechnicalOtherStop(state int) (returnValue bool)

IsTechnicalOtherStop checks whether

func IsUnknown

func IsUnknown(state int) (returnValue bool)

IsUnknown checks whether the asset is in an unknown state (e.g. data missing)

func IsUnspecifiedStop

func IsUnspecifiedStop(state int) (returnValue bool)

IsUnspecifiedStop checks whether the asset is in an unspecified stop

Types

type CountEntry

type CountEntry struct {
	Count     float64
	Scrap     float64
	Timestamp time.Time
}

CountEntry contains the count and its corresponding timestamp

type CustomerConfiguration

type CustomerConfiguration struct {
	MicrostopDurationInSeconds                   float64
	IgnoreMicrostopUnderThisDurationInSeconds    float64
	MinimumRunningTimeInSeconds                  float64
	ThresholdForNoShiftsConsideredBreakInSeconds float64
	AvailabilityLossStates                       []int32
	PerformanceLossStates                        []int32
	LowSpeedThresholdInPcsPerHour                float64
	AutomaticallyIdentifyChangeovers             bool
	LanguageCode                                 int
}

CustomerConfiguration contains all configurations for that specific customer (incl. machine specific configurations)

type DataResponseAny

type DataResponseAny struct {
	ColumnNames []string        `json:"columnNames"`
	Datapoints  [][]interface{} `json:"datapoints"`
}

DataResponseAny is the format of the returned JSON.

type OrderEntry

type OrderEntry struct {
	TimestampBegin time.Time
	TimestampEnd   time.Time
	OrderType      string
}

OrderEntry contains the begin and end time of a order

type OrdersRaw

type OrdersRaw struct {
	OrderName   string
	TargetUnits int

	BeginTimestamp time.Time
	EndTimestamp   time.Time

	ProductName          string
	TimePerUnitInSeconds float64
}

OrdersRaw contains information about orders including their products

type ParetoEntry

type ParetoEntry struct {
	State    int
	Duration float64
}

ParetoEntry contains the state and its corresponding total duration

type ShiftEntry

type ShiftEntry struct {
	TimestampBegin time.Time
	TimestampEnd   time.Time
	ShiftType      int //shiftType =0 is noShift
}

ShiftEntry contains the begin and end time of a shift

type StateEntry

type StateEntry struct {
	State     int
	Timestamp time.Time
}

StateEntry contains the state and its corresponding timestamp

type UpcomingTimeBasedMaintenanceActivities

type UpcomingTimeBasedMaintenanceActivities struct {
	ComponentName    string
	IntervallInHours int
	ActivityType     int

	LatestActivity pq.NullTime
	NextActivity   pq.NullTime
	DurationInDays sql.NullFloat64
}

UpcomingTimeBasedMaintenanceActivities contains information about upcoming time based maintenance activities

Jump to

Keyboard shortcuts

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