Documentation ¶
Overview ¶
Default generated models package docs (at least one file is necessary in a models package)
generated code - do not edit
generated code - do not edit
generated code - do not edit
generated code - do not edit
generated code - do not edit
generated code - do not edit
generated code - do not edit
generated code - do not edit
generated code - do not edit
generated code - do not edit
Index ¶
- Constants
- func AfterCreateFromFront[Type Gongstruct](stage *StageStruct, instance *Type)
- func AfterDeleteFromFront[Type Gongstruct](stage *StageStruct, staged, front *Type)
- func AfterReadFromFront[Type Gongstruct](stage *StageStruct, instance *Type)
- func AfterUpdateFromFront[Type Gongstruct](stage *StageStruct, old, new *Type)
- func CompareGongstructByName[T PointerToGongstruct](a, b T) int
- func CopyBranch[Type Gongstruct](from *Type) (to *Type)
- func EvictInOtherSlices[OwningType PointerToGongstruct, FieldType PointerToGongstruct](stage *StageStruct, owningInstance OwningType, sliceField []FieldType, ...)
- func GetAssociationName[Type Gongstruct]() *Type
- func GetFieldStringValue[Type Gongstruct](instance Type, fieldName string) (res string)
- func GetFieldStringValueFromPointer[Type PointerToGongstruct](instance Type, fieldName string) (res string)
- func GetFields[Type Gongstruct]() (res []string)
- func GetFieldsFromPointer[Type PointerToGongstruct]() (res []string)
- func GetGongstrucsSorted[T PointerToGongstruct](stage *StageStruct) (sortedSlice []T)
- func GetGongstructInstancesMap[Type Gongstruct](stage *StageStruct) *map[string]*Type
- func GetGongstructInstancesSet[Type Gongstruct](stage *StageStruct) *map[*Type]any
- func GetGongstructInstancesSetFromPointerType[Type PointerToGongstruct](stage *StageStruct) *map[Type]any
- func GetGongstructName[Type Gongstruct]() (res string)
- func GetPointerReverseMap[Start, End Gongstruct](fieldname string, stage *StageStruct) map[*End][]*Start
- func GetPointerToGongstructName[Type PointerToGongstruct]() (res string)
- func GetSliceOfPointersReverseMap[Start, End Gongstruct](fieldname string, stage *StageStruct) map[*End]*Start
- func GongGetMap[Type GongstructMapString](stage *StageStruct) *Type
- func GongGetSet[Type GongstructSet](stage *StageStruct) *Type
- func IntToLetters(number int32) (letters string)
- func IsStaged[Type Gongstruct](stage *StageStruct, instance *Type) (ok bool)
- func ParseAstFile(stage *StageStruct, pathToFile string) error
- func ParseAstFileFromAst(stage *StageStruct, inFile *ast.File, fset *token.FileSet) error
- func ReplaceOldDeclarationsInFile(pathToFile string) error
- func Serialize[Type Gongstruct](stage *StageStruct, tab Tabulator)
- func SerializeExcelize[Type Gongstruct](stage *StageStruct, f *excelize.File)
- func SerializeStage(stage *StageStruct, filename string)
- func SetCallbackAfterCreateFromFront[Type Gongstruct](stage *StageStruct, callback OnAfterCreateInterface[Type])
- func SetCallbackAfterDeleteFromFront[Type Gongstruct](stage *StageStruct, callback OnAfterDeleteInterface[Type])
- func SetCallbackAfterReadFromFront[Type Gongstruct](stage *StageStruct, callback OnAfterReadInterface[Type])
- func SetCallbackAfterUpdateFromFront[Type Gongstruct](stage *StageStruct, callback OnAfterUpdateInterface[Type])
- func SetOrchestratorOnAfterUpdate[Type Gongstruct](stage *StageStruct)
- func SortGongstructSetByName[T PointerToGongstruct](set map[T]any) (sortedSlice []T)
- func StageBranch[Type Gongstruct](stage *StageStruct, instance *Type)
- func UnmarshallGongstructStaging(stage *StageStruct, cmap *ast.CommentMap, assignStmt *ast.AssignStmt, ...) (instance any, identifier string, gongstructName string, fieldName string)
- func UnstageBranch[Type Gongstruct](stage *StageStruct, instance *Type)
- type AllModelsStructCreateInterface
- type AllModelsStructDeleteInterface
- type BackRepoInterface
- type CenterConcept
- type CivilianAirport
- func (civilianairport *CivilianAirport) Checkout(stage *StageStruct) *CivilianAirport
- func (civilianairport *CivilianAirport) Commit(stage *StageStruct) *CivilianAirport
- func (civilianairport *CivilianAirport) CommitVoid(stage *StageStruct)
- func (from *CivilianAirport) CopyBasicFields(to *CivilianAirport)
- func (civilianAirport *CivilianAirport) FireNextEvent()
- func (civilianAirport *CivilianAirport) GetLat() float64
- func (civilianAirport *CivilianAirport) GetLng() float64
- func (civilianairport *CivilianAirport) GetName() (res string)
- func (civilianAirport *CivilianAirport) Register(engine *gongsim_models.Engine) (res *CivilianAirport)
- func (civilianairport *CivilianAirport) Stage(stage *StageStruct) *CivilianAirport
- func (civilianairport *CivilianAirport) Unstage(stage *StageStruct) *CivilianAirport
- func (civilianairport *CivilianAirport) UnstageVoid(stage *StageStruct)
- type CivilianAirport_WOP
- type Concept
- type ConceptEnum
- func (conceptenum ConceptEnum) CodeValues() (res []string)
- func (conceptenum ConceptEnum) Codes() (res []string)
- func (conceptenum *ConceptEnum) FromCodeString(input string) (err error)
- func (conceptenum *ConceptEnum) FromString(input string) (err error)
- func (conceptenum *ConceptEnum) ToCodeString() (res string)
- func (conceptenum ConceptEnum) ToString() (res string)
- type ConceptInterface
- type ExcelizeTabulator
- type GONG__ExpressionType
- type GONG__Identifier
- type GongStructInterface
- type Gongstruct
- type GongstructEnumIntField
- type GongstructEnumStringField
- type GongstructMapString
- type GongstructSet
- type GongtructBasicField
- type LatLngAgentInterface
- type Liner
- func (liner *Liner) Checkout(stage *StageStruct) *Liner
- func (liner *Liner) Commit(stage *StageStruct) *Liner
- func (liner *Liner) CommitVoid(stage *StageStruct)
- func (from *Liner) CopyBasicFields(to *Liner)
- func (liner *Liner) FireNextEvent()
- func (liner *Liner) GetDisplay() bool
- func (liner *Liner) GetHeading() float64
- func (liner *Liner) GetLat() float64
- func (liner *Liner) GetLatPositions() []float64
- func (*Liner) GetLayerGroupName() (name string)
- func (liner *Liner) GetLevel() float64
- func (liner *Liner) GetLng() float64
- func (liner *Liner) GetLngPositions() []float64
- func (liner *Liner) GetName() (res string)
- func (liner *Liner) GetSpeed() float64
- func (liner *Liner) GetVerticalSpeed() float64
- func (Liner *Liner) Register(engine *gongsim_models.Engine) (res *Liner)
- func (liner *Liner) Stage(stage *StageStruct) *Liner
- func (liner *Liner) Unstage(stage *StageStruct) *Liner
- func (liner *Liner) UnstageVoid(stage *StageStruct)
- type LinerStateEnum
- func (linerstateenum LinerStateEnum) CodeValues() (res []string)
- func (linerstateenum LinerStateEnum) Codes() (res []string)
- func (linerstateenum *LinerStateEnum) FromCodeString(input string) (err error)
- func (linerstateenum *LinerStateEnum) FromString(input string) (err error)
- func (linerstateenum *LinerStateEnum) ToCodeString() (res string)
- func (linerstateenum LinerStateEnum) ToString() (res string)
- type Liner_WOP
- type Message
- func (message *Message) Checkout(stage *StageStruct) *Message
- func (message *Message) Commit(stage *StageStruct) *Message
- func (message *Message) CommitVoid(stage *StageStruct)
- func (from *Message) CopyBasicFields(to *Message)
- func (message *Message) FireNextEvent()
- func (message *Message) GetDisplay() bool
- func (message *Message) GetHeading() float64
- func (message *Message) GetLat() float64
- func (*Message) GetLayerGroupName() (name string)
- func (message *Message) GetLevel() float64
- func (message *Message) GetLng() float64
- func (message *Message) GetName() (res string)
- func (message *Message) GetSpeed() float64
- func (message *Message) GetVerticalSpeed() float64
- func (message *Message) GetVisualLayerName() string
- func (Message *Message) Register(engine *gongsim_models.Engine) (res *Message)
- func (message *Message) Stage(stage *StageStruct) *Message
- func (message *Message) Unstage(stage *StageStruct) *Message
- func (message *Message) UnstageVoid(stage *StageStruct)
- type MessageStateEnum
- func (messagestateenum MessageStateEnum) CodeValues() (res []string)
- func (messagestateenum MessageStateEnum) Codes() (res []string)
- func (messagestateenum *MessageStateEnum) FromCodeString(input string) (err error)
- func (messagestateenum *MessageStateEnum) FromString(input string) (err error)
- func (messagestateenum *MessageStateEnum) ToCodeString() (res string)
- func (messagestateenum MessageStateEnum) ToString() (res string)
- type Message_WOP
- type MovingObject
- type MovingObjectInterface
- type Network
- func (network *Network) GetConcept() ConceptEnum
- func (network *Network) GetIsTransmitting() bool
- func (network *Network) GetIsTransmittingBackward() bool
- func (network *Network) GetLayerGroupName() (name string)
- func (network *Network) GetMessage() (name string)
- func (network *Network) GetMessageBackward() (name string)
- type NetworkCallbackInterface
- type OnAfterCreateInterface
- type OnAfterDeleteInterface
- type OnAfterReadInterface
- type OnAfterUpdateInterface
- type OnInitCommitInterface
- type OperationalLineStateEnum
- func (operationallinestateenum OperationalLineStateEnum) CodeValues() (res []string)
- func (operationallinestateenum OperationalLineStateEnum) Codes() (res []string)
- func (operationallinestateenum *OperationalLineStateEnum) FromCodeString(input string) (err error)
- func (operationallinestateenum *OperationalLineStateEnum) FromString(input string) (err error)
- func (operationallinestateenum *OperationalLineStateEnum) ToCodeString() (res string)
- func (operationallinestateenum OperationalLineStateEnum) ToString() (res string)
- type OpsLine
- func (opsline *OpsLine) Checkout(stage *StageStruct) *OpsLine
- func (opsline *OpsLine) Commit(stage *StageStruct) *OpsLine
- func (opsline *OpsLine) CommitVoid(stage *StageStruct)
- func (from *OpsLine) CopyBasicFields(to *OpsLine)
- func (opsLine *OpsLine) FireNextEvent()
- func (link *OpsLine) GetEndLat() float64
- func (link *OpsLine) GetEndLng() float64
- func (link *OpsLine) GetIsTransmittingBackwardOverride() bool
- func (link *OpsLine) GetIsTransmittingOverride() bool
- func (link *OpsLine) GetMessageBackwardOverride() string
- func (link *OpsLine) GetMessageOverride() string
- func (opsline *OpsLine) GetName() (res string)
- func (link *OpsLine) GetStartLat() float64
- func (link *OpsLine) GetStartLng() float64
- func (OpsLine *OpsLine) Register(engine *gongsim_models.Engine) (res *OpsLine)
- func (opsline *OpsLine) Stage(stage *StageStruct) *OpsLine
- func (opsline *OpsLine) Unstage(stage *StageStruct) *OpsLine
- func (opsline *OpsLine) UnstageVoid(stage *StageStruct)
- type OpsLine_WOP
- type Order
- type OrderEnum
- func (orderenum OrderEnum) CodeValues() (res []string)
- func (orderenum OrderEnum) Codes() (res []string)
- func (orderenum *OrderEnum) FromCodeString(input string) (err error)
- func (orderenum *OrderEnum) FromString(input string) (err error)
- func (orderenum *OrderEnum) ToCodeString() (res string)
- func (orderenum OrderEnum) ToString() (res string)
- type PointerToGongstruct
- type PointerToGongstructEnumIntField
- type PointerToGongstructEnumStringField
- type Radar
- func (radar *Radar) Checkout(stage *StageStruct) *Radar
- func (radar *Radar) Commit(stage *StageStruct) *Radar
- func (radar *Radar) CommitVoid(stage *StageStruct)
- func (from *Radar) CopyBasicFields(to *Radar)
- func (radar *Radar) FireNextEvent()
- func (radar *Radar) GetLat() float64
- func (radar *Radar) GetLng() float64
- func (radar *Radar) GetName() (res string)
- func (radar *Radar) GetRadius() float64
- func (Radar *Radar) Register(engine *gongsim_models.Engine) (res *Radar)
- func (radar *Radar) Stage(stage *StageStruct) *Radar
- func (radar *Radar) Unstage(stage *StageStruct) *Radar
- func (radar *Radar) UnstageVoid(stage *StageStruct)
- type RadarStateEnum
- func (radarstateenum RadarStateEnum) CodeValues() (res []string)
- func (radarstateenum RadarStateEnum) Codes() (res []string)
- func (radarstateenum *RadarStateEnum) FromCodeString(input string) (err error)
- func (radarstateenum *RadarStateEnum) FromString(input string) (err error)
- func (radarstateenum *RadarStateEnum) ToCodeString() (res string)
- func (radarstateenum RadarStateEnum) ToString() (res string)
- type Radar_WOP
- type Report
- type ReportEnum
- func (reportenum ReportEnum) CodeValues() (res []string)
- func (reportenum ReportEnum) Codes() (res []string)
- func (reportenum *ReportEnum) FromCodeString(input string) (err error)
- func (reportenum *ReportEnum) FromString(input string) (err error)
- func (reportenum *ReportEnum) ToCodeString() (res string)
- func (reportenum ReportEnum) ToString() (res string)
- type ReverseField
- type Satellite
- func (satellite *Satellite) Checkout(stage *StageStruct) *Satellite
- func (satellite *Satellite) Commit(stage *StageStruct) *Satellite
- func (satellite *Satellite) CommitVoid(stage *StageStruct)
- func (from *Satellite) CopyBasicFields(to *Satellite)
- func (satellite *Satellite) FireNextEvent()
- func (satellite *Satellite) GetDisplay() bool
- func (satellite *Satellite) GetHeading() float64
- func (satellite *Satellite) GetLat() float64
- func (*Satellite) GetLayerGroupName() (name string)
- func (satellite *Satellite) GetLevel() float64
- func (satellite *Satellite) GetLng() float64
- func (satellite *Satellite) GetName() (res string)
- func (satellite *Satellite) GetSpeed() float64
- func (satellite *Satellite) GetVerticalSpeed() float64
- func (satellite *Satellite) InitFromTLE() (res *Satellite)
- func (satellite *Satellite) Register(engine *gongsim_models.Engine) (res *Satellite)
- func (satellite *Satellite) Stage(stage *StageStruct) *Satellite
- func (satellite *Satellite) Unstage(stage *StageStruct) *Satellite
- func (satellite *Satellite) UnstageVoid(stage *StageStruct)
- type Satellite_WOP
- type Scenario
- func (scenario *Scenario) Checkout(stage *StageStruct) *Scenario
- func (scenario *Scenario) Commit(stage *StageStruct) *Scenario
- func (scenario *Scenario) CommitVoid(stage *StageStruct)
- func (from *Scenario) CopyBasicFields(to *Scenario)
- func (scenario *Scenario) GetEnd() time.Time
- func (scenario *Scenario) GetLat() float64
- func (scenario *Scenario) GetLng() float64
- func (scenario *Scenario) GetName() (res string)
- func (scenario *Scenario) GetStart() time.Time
- func (scenario *Scenario) GetZoomLevel() float64
- func (scenario *Scenario) SetEnd(time time.Time)
- func (scenario *Scenario) SetStart(time time.Time)
- func (scenario *Scenario) Stage(stage *StageStruct) *Scenario
- func (scenario *Scenario) Unstage(stage *StageStruct) *Scenario
- func (scenario *Scenario) UnstageVoid(stage *StageStruct)
- type Scenario_WOP
- type StacksNames
- func (stacksnames StacksNames) CodeValues() (res []string)
- func (stacksnames StacksNames) Codes() (res []string)
- func (stacksnames *StacksNames) FromCodeString(input string) (err error)
- func (stacksnames *StacksNames) FromString(input string) (err error)
- func (stacksnames *StacksNames) ToCodeString() (res string)
- func (stacksnames StacksNames) ToString() (res string)
- type StageStruct
- func (stage *StageStruct) Backup(dirPath string)
- func (stage *StageStruct) BackupXL(dirPath string)
- func (stage *StageStruct) Checkout()
- func (stage *StageStruct) Commit()
- func (stage *StageStruct) CommitWithSuspendedCallbacks()
- func (stage *StageStruct) ComputeReverseMaps()
- func (stage *StageStruct) GetPath() string
- func (stage *StageStruct) GetType() string
- func (stage *StageStruct) IsStagedCivilianAirport(civilianairport *CivilianAirport) (ok bool)
- func (stage *StageStruct) IsStagedLiner(liner *Liner) (ok bool)
- func (stage *StageStruct) IsStagedMessage(message *Message) (ok bool)
- func (stage *StageStruct) IsStagedOpsLine(opsline *OpsLine) (ok bool)
- func (stage *StageStruct) IsStagedRadar(radar *Radar) (ok bool)
- func (stage *StageStruct) IsStagedSatellite(satellite *Satellite) (ok bool)
- func (stage *StageStruct) IsStagedScenario(scenario *Scenario) (ok bool)
- func (stage *StageStruct) Marshall(file *os.File, modelsPackageName, packageName string)
- func (stage *StageStruct) Nil()
- func (stage *StageStruct) Reset()
- func (stage *StageStruct) Restore(dirPath string)
- func (stage *StageStruct) RestoreXL(dirPath string)
- func (stage *StageStruct) StageBranchCivilianAirport(civilianairport *CivilianAirport)
- func (stage *StageStruct) StageBranchLiner(liner *Liner)
- func (stage *StageStruct) StageBranchMessage(message *Message)
- func (stage *StageStruct) StageBranchOpsLine(opsline *OpsLine)
- func (stage *StageStruct) StageBranchRadar(radar *Radar)
- func (stage *StageStruct) StageBranchSatellite(satellite *Satellite)
- func (stage *StageStruct) StageBranchScenario(scenario *Scenario)
- func (stage *StageStruct) Unstage()
- func (stage *StageStruct) UnstageBranchCivilianAirport(civilianairport *CivilianAirport)
- func (stage *StageStruct) UnstageBranchLiner(liner *Liner)
- func (stage *StageStruct) UnstageBranchMessage(message *Message)
- func (stage *StageStruct) UnstageBranchOpsLine(opsline *OpsLine)
- func (stage *StageStruct) UnstageBranchRadar(radar *Radar)
- func (stage *StageStruct) UnstageBranchSatellite(satellite *Satellite)
- func (stage *StageStruct) UnstageBranchScenario(scenario *Scenario)
- type System
- type Tabulator
Constants ¶
const IdentifiersDecls = `
{{Identifier}} := (&models.{{GeneratedStructName}}{}).Stage(stage)`
const MessageSpeed = 1000.0 // in km/h
const NumberInitStatement = `
{{Identifier}}.{{GeneratedFieldName}} = {{GeneratedFieldNameValue}}`
const PointerFieldInitStatement = `
{{Identifier}}.{{GeneratedFieldName}} = {{GeneratedFieldNameValue}}`
const SliceOfPointersFieldInitStatement = `
{{Identifier}}.{{GeneratedFieldName}} = append({{Identifier}}.{{GeneratedFieldName}}, {{GeneratedFieldNameValue}})`
const StringEnumInitStatement = `
{{Identifier}}.{{GeneratedFieldName}} = {{GeneratedFieldNameValue}}`
const StringInitStatement = `
{{Identifier}}.{{GeneratedFieldName}} = ` + "`" + `{{GeneratedFieldNameValue}}` + "`"
const TimeInitStatement = `` /* 129-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func AfterCreateFromFront ¶
func AfterCreateFromFront[Type Gongstruct](stage *StageStruct, instance *Type)
AfterCreateFromFront is called after a create from front
func AfterDeleteFromFront ¶
func AfterDeleteFromFront[Type Gongstruct](stage *StageStruct, staged, front *Type)
AfterDeleteFromFront is called after a delete from front
func AfterReadFromFront ¶
func AfterReadFromFront[Type Gongstruct](stage *StageStruct, instance *Type)
AfterReadFromFront is called after a Read from front
func AfterUpdateFromFront ¶
func AfterUpdateFromFront[Type Gongstruct](stage *StageStruct, old, new *Type)
AfterUpdateFromFront is called after a update from front
func CompareGongstructByName ¶
func CompareGongstructByName[T PointerToGongstruct](a, b T) int
func CopyBranch ¶
func CopyBranch[Type Gongstruct](from *Type) (to *Type)
CopyBranch stages instance and apply CopyBranch on all gongstruct instances that are referenced by pointers or slices of pointers of the instance
the algorithm stops along the course of graph if a vertex is already staged
func EvictInOtherSlices ¶
func EvictInOtherSlices[OwningType PointerToGongstruct, FieldType PointerToGongstruct]( stage *StageStruct, owningInstance OwningType, sliceField []FieldType, fieldName string)
EvictInOtherSlices allows for adherance between the gong association model and go.
Says you have a Astruct struct with a slice field "anarrayofb []*Bstruct"
go allows many Astruct instance to have the anarrayofb field that have the same pointers. go slices are MANY-MANY association.
With gong it is only ZERO-ONE-MANY associations, a Bstruct can be pointed only once by an Astruct instance through a given field. This follows the requirement that gong is suited for full stack programming and therefore the association is encoded as a reverse pointer (not as a joint table). In gong, a named struct is translated in a table and each table is a named struct.
EvictInOtherSlices removes the fields instances from other fields of other instance
Note : algo is in O(N)log(N) of nb of Astruct and Bstruct instances
func GetAssociationName ¶
func GetAssociationName[Type Gongstruct]() *Type
GetAssociationName is a generic function that returns an instance of Type where each association is filled with an instance whose name is the name of the association
This function can be handy for generating navigation function that are refactorable
func GetFieldStringValue ¶
func GetFieldStringValue[Type Gongstruct](instance Type, fieldName string) (res string)
func GetFieldStringValueFromPointer ¶
func GetFieldStringValueFromPointer[Type PointerToGongstruct](instance Type, fieldName string) (res string)
func GetFields ¶
func GetFields[Type Gongstruct]() (res []string)
GetFields return the array of the fields
func GetFieldsFromPointer ¶
func GetFieldsFromPointer[Type PointerToGongstruct]() (res []string)
GetFieldsFromPointer return the array of the fields
func GetGongstrucsSorted ¶
func GetGongstrucsSorted[T PointerToGongstruct](stage *StageStruct) (sortedSlice []T)
func GetGongstructInstancesMap ¶
func GetGongstructInstancesMap[Type Gongstruct](stage *StageStruct) *map[string]*Type
GetGongstructInstancesMap returns the map of staged GongstructType instances it is usefull because it allows refactoring of gong struct identifier
func GetGongstructInstancesSet ¶
func GetGongstructInstancesSet[Type Gongstruct](stage *StageStruct) *map[*Type]any
GetGongstructInstancesSet returns the set staged GongstructType instances it is usefull because it allows refactoring of gongstruct identifier
func GetGongstructInstancesSetFromPointerType ¶
func GetGongstructInstancesSetFromPointerType[Type PointerToGongstruct](stage *StageStruct) *map[Type]any
GetGongstructInstancesSetFromPointerType returns the set staged GongstructType instances it is usefull because it allows refactoring of gongstruct identifier
func GetGongstructName ¶
func GetGongstructName[Type Gongstruct]() (res string)
GetGongstructName returns the name of the Gongstruct this can be usefull if one want program robust to refactoring
func GetPointerReverseMap ¶
func GetPointerReverseMap[Start, End Gongstruct](fieldname string, stage *StageStruct) map[*End][]*Start
GetPointerReverseMap allows backtrack navigation of any Start.Fieldname associations (0..1) that is a pointer from one staged Gongstruct (type Start) instances to another (type End)
The function provides a map with keys as instances of End and values to arrays of *Start the map is construed by iterating over all Start instances and populationg keys with End instances and values with slice of Start instances
func GetPointerToGongstructName ¶
func GetPointerToGongstructName[Type PointerToGongstruct]() (res string)
GetPointerToGongstructName returns the name of the Gongstruct this can be usefull if one want program robust to refactoring
func GetSliceOfPointersReverseMap ¶
func GetSliceOfPointersReverseMap[Start, End Gongstruct](fieldname string, stage *StageStruct) map[*End]*Start
GetSliceOfPointersReverseMap allows backtrack navigation of any Start.Fieldname associations (0..N) between one staged Gongstruct instances and many others
The function provides a map with keys as instances of End and values to *Start instances the map is construed by iterating over all Start instances and populating keys with End instances and values with the Start instances
func GongGetMap ¶
func GongGetMap[Type GongstructMapString](stage *StageStruct) *Type
GongGetMap returns the map of staged GongstructType instances it is usefull because it allows refactoring of gong struct identifier
func GongGetSet ¶
func GongGetSet[Type GongstructSet](stage *StageStruct) *Type
GongGetSet returns the set staged GongstructType instances it is usefull because it allows refactoring of gong struct identifier
func IntToLetters ¶
func IsStaged ¶
func IsStaged[Type Gongstruct](stage *StageStruct, instance *Type) (ok bool)
func ParseAstFile ¶
func ParseAstFile(stage *StageStruct, pathToFile string) error
ParseAstFile Parse pathToFile and stages all instances declared in the file
func ParseAstFileFromAst ¶
ParseAstFile Parse pathToFile and stages all instances declared in the file
func ReplaceOldDeclarationsInFile ¶
ReplaceOldDeclarationsInFile replaces specific text in a file at the given path.
func Serialize ¶
func Serialize[Type Gongstruct](stage *StageStruct, tab Tabulator)
func SerializeExcelize ¶
func SerializeExcelize[Type Gongstruct](stage *StageStruct, f *excelize.File)
func SerializeStage ¶
func SerializeStage(stage *StageStruct, filename string)
func SetCallbackAfterCreateFromFront ¶
func SetCallbackAfterCreateFromFront[Type Gongstruct](stage *StageStruct, callback OnAfterCreateInterface[Type])
func SetCallbackAfterDeleteFromFront ¶
func SetCallbackAfterDeleteFromFront[Type Gongstruct](stage *StageStruct, callback OnAfterDeleteInterface[Type])
func SetCallbackAfterReadFromFront ¶
func SetCallbackAfterReadFromFront[Type Gongstruct](stage *StageStruct, callback OnAfterReadInterface[Type])
func SetCallbackAfterUpdateFromFront ¶
func SetCallbackAfterUpdateFromFront[Type Gongstruct](stage *StageStruct, callback OnAfterUpdateInterface[Type])
SetCallbackAfterUpdateFromFront is a function to set up callback that is robust to refactoring
func SetOrchestratorOnAfterUpdate ¶
func SetOrchestratorOnAfterUpdate[Type Gongstruct](stage *StageStruct)
func SortGongstructSetByName ¶
func SortGongstructSetByName[T PointerToGongstruct](set map[T]any) (sortedSlice []T)
func StageBranch ¶
func StageBranch[Type Gongstruct](stage *StageStruct, instance *Type)
StageBranch stages instance and apply StageBranch on all gongstruct instances that are referenced by pointers or slices of pointers of the instance
the algorithm stops along the course of graph if a vertex is already staged
func UnmarshallGongstructStaging ¶
func UnmarshallGongstructStaging(stage *StageStruct, cmap *ast.CommentMap, assignStmt *ast.AssignStmt, astCoordinate_ string) ( instance any, identifier string, gongstructName string, fieldName string)
UnmarshallGoStaging unmarshall a go assign statement
func UnstageBranch ¶
func UnstageBranch[Type Gongstruct](stage *StageStruct, instance *Type)
UnstageBranch stages instance and apply UnstageBranch on all gongstruct instances that are referenced by pointers or slices of pointers of the insance
the algorithm stops along the course of graph if a vertex is already staged
Types ¶
type AllModelsStructCreateInterface ¶
type AllModelsStructCreateInterface interface { CreateORMCivilianAirport(CivilianAirport *CivilianAirport) CreateORMLiner(Liner *Liner) CreateORMMessage(Message *Message) CreateORMOpsLine(OpsLine *OpsLine) CreateORMRadar(Radar *Radar) CreateORMSatellite(Satellite *Satellite) CreateORMScenario(Scenario *Scenario) }
swagger:ignore
type AllModelsStructDeleteInterface ¶
type AllModelsStructDeleteInterface interface { DeleteORMCivilianAirport(CivilianAirport *CivilianAirport) DeleteORMLiner(Liner *Liner) DeleteORMMessage(Message *Message) DeleteORMOpsLine(OpsLine *OpsLine) DeleteORMRadar(Radar *Radar) DeleteORMSatellite(Satellite *Satellite) DeleteORMScenario(Scenario *Scenario) }
type BackRepoInterface ¶
type BackRepoInterface interface { Commit(stage *StageStruct) Checkout(stage *StageStruct) Backup(stage *StageStruct, dirPath string) Restore(stage *StageStruct, dirPath string) BackupXL(stage *StageStruct, dirPath string) RestoreXL(stage *StageStruct, dirPath string) // insertion point for Commit and Checkout signatures CommitCivilianAirport(civilianairport *CivilianAirport) CheckoutCivilianAirport(civilianairport *CivilianAirport) CommitLiner(liner *Liner) CheckoutLiner(liner *Liner) CommitMessage(message *Message) CheckoutMessage(message *Message) CommitOpsLine(opsline *OpsLine) CheckoutOpsLine(opsline *OpsLine) CommitRadar(radar *Radar) CheckoutRadar(radar *Radar) CommitSatellite(satellite *Satellite) CheckoutSatellite(satellite *Satellite) CommitScenario(scenario *Scenario) CheckoutScenario(scenario *Scenario) GetLastCommitFromBackNb() uint GetLastPushFromFrontNb() uint }
type CenterConcept ¶
func (*CenterConcept) GetConcept ¶
func (center *CenterConcept) GetConcept() ConceptEnum
func (*CenterConcept) GetLayerGroupName ¶
func (center *CenterConcept) GetLayerGroupName() (name string)
type CivilianAirport ¶
type CivilianAirport struct { CenterConcept // allow for selecting visual objects // Agent // swagger:ignore gongsim_models.Agent Name string }
CivilianAirport
func CopyBranchCivilianAirport ¶
func CopyBranchCivilianAirport(mapOrigCopy map[any]any, civilianairportFrom *CivilianAirport) (civilianairportTo *CivilianAirport)
insertion point for stage branch per struct
func (*CivilianAirport) Checkout ¶
func (civilianairport *CivilianAirport) Checkout(stage *StageStruct) *CivilianAirport
Checkout civilianairport to the back repo (if it is already staged)
func (*CivilianAirport) Commit ¶
func (civilianairport *CivilianAirport) Commit(stage *StageStruct) *CivilianAirport
commit civilianairport to the back repo (if it is already staged)
func (*CivilianAirport) CommitVoid ¶
func (civilianairport *CivilianAirport) CommitVoid(stage *StageStruct)
func (*CivilianAirport) CopyBasicFields ¶
func (from *CivilianAirport) CopyBasicFields(to *CivilianAirport)
func (*CivilianAirport) FireNextEvent ¶
func (civilianAirport *CivilianAirport) FireNextEvent()
FireNextEvent fire next Event basicaly, it does nothing (yet to be implemented)
func (*CivilianAirport) GetLat ¶
func (civilianAirport *CivilianAirport) GetLat() float64
functions to satisty the visual interface for center
func (*CivilianAirport) GetLng ¶
func (civilianAirport *CivilianAirport) GetLng() float64
func (*CivilianAirport) GetName ¶
func (civilianairport *CivilianAirport) GetName() (res string)
for satisfaction of GongStruct interface
func (*CivilianAirport) Register ¶
func (civilianAirport *CivilianAirport) Register(engine *gongsim_models.Engine) (res *CivilianAirport)
func (*CivilianAirport) Stage ¶
func (civilianairport *CivilianAirport) Stage(stage *StageStruct) *CivilianAirport
insertion point for cumulative sub template with model space calls Stage puts civilianairport to the model stage
func (*CivilianAirport) Unstage ¶
func (civilianairport *CivilianAirport) Unstage(stage *StageStruct) *CivilianAirport
Unstage removes civilianairport off the model stage
func (*CivilianAirport) UnstageVoid ¶
func (civilianairport *CivilianAirport) UnstageVoid(stage *StageStruct)
UnstageVoid removes civilianairport off the model stage
type CivilianAirport_WOP ¶
insertion point
type ConceptEnum ¶
type ConceptEnum string
ConceptEnum .. swagger:enum ConceptEnum
const ( Aircraft_ ConceptEnum = "Aircrafts" Satellite_ ConceptEnum = "Satellites" Network_ ConceptEnum = "Networks" Center_ ConceptEnum = "Centers" System_ ConceptEnum = "Systems" )
available concepts that enable visual filters
func (ConceptEnum) CodeValues ¶
func (conceptenum ConceptEnum) CodeValues() (res []string)
func (ConceptEnum) Codes ¶
func (conceptenum ConceptEnum) Codes() (res []string)
func (*ConceptEnum) FromCodeString ¶
func (conceptenum *ConceptEnum) FromCodeString(input string) (err error)
func (*ConceptEnum) FromString ¶
func (conceptenum *ConceptEnum) FromString(input string) (err error)
func (*ConceptEnum) ToCodeString ¶
func (conceptenum *ConceptEnum) ToCodeString() (res string)
func (ConceptEnum) ToString ¶
func (conceptenum ConceptEnum) ToString() (res string)
insertion point of enum utility functions Utility function for ConceptEnum if enum values are string, it is stored with the value if enum values are int, they are stored with the code of the value
type ConceptInterface ¶
type ConceptInterface interface {
GetConcept() ConceptEnum
}
type ExcelizeTabulator ¶
type ExcelizeTabulator struct {
// contains filtered or unexported fields
}
func (*ExcelizeTabulator) AddCell ¶
func (tab *ExcelizeTabulator) AddCell(sheetName string, rowId, columnIndex int, value string)
func (*ExcelizeTabulator) AddRow ¶
func (tab *ExcelizeTabulator) AddRow(sheetName string) (rowId int)
func (*ExcelizeTabulator) AddSheet ¶
func (tab *ExcelizeTabulator) AddSheet(sheetName string)
func (*ExcelizeTabulator) SetExcelizeFile ¶
func (tab *ExcelizeTabulator) SetExcelizeFile(f *excelize.File)
type GONG__ExpressionType ¶
type GONG__ExpressionType string
swagger:ignore
const ( GONG__STRUCT_INSTANCE GONG__ExpressionType = "STRUCT_INSTANCE" GONG__FIELD_OR_CONST_VALUE GONG__ExpressionType = "FIELD_OR_CONST_VALUE" GONG__FIELD_VALUE GONG__ExpressionType = "FIELD_VALUE" GONG__ENUM_CAST_INT GONG__ExpressionType = "ENUM_CAST_INT" GONG__ENUM_CAST_STRING GONG__ExpressionType = "ENUM_CAST_STRING" GONG__IDENTIFIER_CONST GONG__ExpressionType = "IDENTIFIER_CONST" )
type GONG__Identifier ¶
type GONG__Identifier struct { Ident string Type GONG__ExpressionType }
type GongStructInterface ¶
type GongStructInterface interface {
GetName() (res string)
}
GongStructInterface is the interface met by GongStructs It allows runtime reflexion of instances (without the hassle of the "reflect" package)
type Gongstruct ¶
type Gongstruct interface { }
Gongstruct is the type parameter for generated generic function that allows - access to staged instances - navigation between staged instances by going backward association links between gongstruct - full refactoring of Gongstruct identifiers / fields
type GongstructEnumIntField ¶
type GongstructMapString ¶
type GongstructSet ¶
type GongtructBasicField ¶
type LatLngAgentInterface ¶
type LatLngAgentInterface interface { GetName() string GetLat() float64 GetLng() float64 QueueEvent(gongsim_models.EventInterface) TransfertAndQueueEvent(gongsim_models.EventInterface) }
LatLngAgentInterface is an interface to another agent that have a name, a position and who can queue/fire events usefull for handling message from one agent to another
type Liner ¶
type Liner struct { Name string MovingObject // concept // Agent // swagger:ignore gongsim_models.Agent State LinerStateEnum // Control of the aircraft TargetHeading float64 TargetLocationLat float64 TargetLocationLng float64 DistanceToTarget float64 // Max rotational speed, in degrees/seconds MaxRotationalSpeed float64 // Vertical Speed VerticalSpeed float64 Timestampstring string ReporingLine *OpsLine // contains filtered or unexported fields }
Liner is a moving object swagger:model liner
func CopyBranchLiner ¶
func (*Liner) Checkout ¶
func (liner *Liner) Checkout(stage *StageStruct) *Liner
Checkout liner to the back repo (if it is already staged)
func (*Liner) Commit ¶
func (liner *Liner) Commit(stage *StageStruct) *Liner
commit liner to the back repo (if it is already staged)
func (*Liner) CommitVoid ¶
func (liner *Liner) CommitVoid(stage *StageStruct)
func (*Liner) CopyBasicFields ¶
func (*Liner) GetDisplay ¶
func (*Liner) GetHeading ¶
func (*Liner) GetLatPositions ¶
func (*Liner) GetLayerGroupName ¶
func (*Liner) GetLngPositions ¶
func (*Liner) GetVerticalSpeed ¶
func (*Liner) Stage ¶
func (liner *Liner) Stage(stage *StageStruct) *Liner
Stage puts liner to the model stage
func (*Liner) Unstage ¶
func (liner *Liner) Unstage(stage *StageStruct) *Liner
Unstage removes liner off the model stage
func (*Liner) UnstageVoid ¶
func (liner *Liner) UnstageVoid(stage *StageStruct)
UnstageVoid removes liner off the model stage
type LinerStateEnum ¶
type LinerStateEnum string
LinerStateEnum .. swagger:enum LinerStateEnum
const ( EN_ROUTE_NOMINAL LinerStateEnum = "EN_ROUTE_NOMINAL" LANDED LinerStateEnum = "LANDED" )
state
func (LinerStateEnum) CodeValues ¶
func (linerstateenum LinerStateEnum) CodeValues() (res []string)
func (LinerStateEnum) Codes ¶
func (linerstateenum LinerStateEnum) Codes() (res []string)
func (*LinerStateEnum) FromCodeString ¶
func (linerstateenum *LinerStateEnum) FromCodeString(input string) (err error)
func (*LinerStateEnum) FromString ¶
func (linerstateenum *LinerStateEnum) FromString(input string) (err error)
func (*LinerStateEnum) ToCodeString ¶
func (linerstateenum *LinerStateEnum) ToCodeString() (res string)
func (LinerStateEnum) ToString ¶
func (linerstateenum LinerStateEnum) ToString() (res string)
Utility function for LinerStateEnum if enum values are string, it is stored with the value if enum values are int, they are stored with the code of the value
type Liner_WOP ¶
type Liner_WOP struct { // insertion point Name string Lat float64 Lng float64 Heading float64 Level float64 Speed float64 State LinerStateEnum TargetHeading float64 TargetLocationLat float64 TargetLocationLng float64 DistanceToTarget float64 MaxRotationalSpeed float64 VerticalSpeed float64 Timestampstring string }
type Message ¶
type Message struct { MovingObject // concept // Agent // swagger:ignore gongsim_models.Agent State MessageStateEnum Name string // Control of the aircraft TargetLocationLat float64 TargetLocationLng float64 DistanceToTarget float64 Timestampstring string DurationSinceSimulationStart time.Duration Timestampstartstring string From LatLngAgentInterface `gorm:"-"` Source string // string version of from To LatLngAgentInterface `gorm:"-"` Destination string // string version of to Content string About_string string Display bool // contains filtered or unexported fields }
Message swagger:model message
func CopyBranchMessage ¶
func (*Message) Checkout ¶
func (message *Message) Checkout(stage *StageStruct) *Message
Checkout message to the back repo (if it is already staged)
func (*Message) Commit ¶
func (message *Message) Commit(stage *StageStruct) *Message
commit message to the back repo (if it is already staged)
func (*Message) CommitVoid ¶
func (message *Message) CommitVoid(stage *StageStruct)
func (*Message) CopyBasicFields ¶
func (*Message) FireNextEvent ¶
func (message *Message) FireNextEvent()
FireNextEvent fire next Event
func (*Message) GetDisplay ¶
func (*Message) GetHeading ¶
func (*Message) GetLayerGroupName ¶
func (*Message) GetVerticalSpeed ¶
func (*Message) GetVisualLayerName ¶
func (*Message) Register ¶
func (Message *Message) Register(engine *gongsim_models.Engine) (res *Message)
func (*Message) Stage ¶
func (message *Message) Stage(stage *StageStruct) *Message
Stage puts message to the model stage
func (*Message) Unstage ¶
func (message *Message) Unstage(stage *StageStruct) *Message
Unstage removes message off the model stage
func (*Message) UnstageVoid ¶
func (message *Message) UnstageVoid(stage *StageStruct)
UnstageVoid removes message off the model stage
type MessageStateEnum ¶
type MessageStateEnum string
MessageStateEnum .. swagger:enum MessageStateEnum
const ( MESSAGE_EN_ROUTE MessageStateEnum = "MESSAGE_EN_ROUTE" MESSAGE_ARRIVED MessageStateEnum = "MESSAGE_ARRIVED" )
state
func (MessageStateEnum) CodeValues ¶
func (messagestateenum MessageStateEnum) CodeValues() (res []string)
func (MessageStateEnum) Codes ¶
func (messagestateenum MessageStateEnum) Codes() (res []string)
func (*MessageStateEnum) FromCodeString ¶
func (messagestateenum *MessageStateEnum) FromCodeString(input string) (err error)
func (*MessageStateEnum) FromString ¶
func (messagestateenum *MessageStateEnum) FromString(input string) (err error)
func (*MessageStateEnum) ToCodeString ¶
func (messagestateenum *MessageStateEnum) ToCodeString() (res string)
func (MessageStateEnum) ToString ¶
func (messagestateenum MessageStateEnum) ToString() (res string)
Utility function for MessageStateEnum if enum values are string, it is stored with the value if enum values are int, they are stored with the code of the value
type Message_WOP ¶
type Message_WOP struct { // insertion point Lat float64 Lng float64 Heading float64 Level float64 Speed float64 State MessageStateEnum Name string TargetLocationLat float64 TargetLocationLng float64 DistanceToTarget float64 Timestampstring string DurationSinceSimulationStart time.Duration Timestampstartstring string Source string Destination string Content string About_string string Display bool }
type MovingObject ¶
type MovingObject struct { // current position Lat float64 Lng float64 // heading in degrees Heading float64 // level // for instance 210 means 21 000 feets Level float64 // Horizonatl Speed, in km/h Speed float64 }
swagger:model MovingObject
func (*MovingObject) GetConcept ¶
func (*MovingObject) GetConcept() ConceptEnum
type MovingObjectInterface ¶
type MovingObjectInterface interface { GetName() string GetLat() float64 GetLng() float64 QueueEvent(gongsim_models.EventInterface) TransfertAndQueueEvent(gongsim_models.EventInterface) }
type Network ¶
type Network struct { IsTransmitting bool // true if it has to display the message TransmissionMessage string // message to display IsTransmittingBackward bool // true if it has to display the message TransmissionMessageBackward string // message to display // this interface can be set to override the default behavior of the network // which is doing nothing NetworkCallbackInterface NetworkCallbackInterface `gorm:"-"` }
Network is a two-ways message transmitter
func (*Network) GetConcept ¶
func (network *Network) GetConcept() ConceptEnum
func (*Network) GetIsTransmitting ¶
func (*Network) GetIsTransmittingBackward ¶
func (*Network) GetLayerGroupName ¶
func (*Network) GetMessage ¶
func (*Network) GetMessageBackward ¶
type OnAfterCreateInterface ¶
type OnAfterCreateInterface[Type Gongstruct] interface { OnAfterCreate(stage *StageStruct, instance *Type) }
OnAfterCreateInterface callback when an instance is updated from the front
type OnAfterDeleteInterface ¶
type OnAfterDeleteInterface[Type Gongstruct] interface { OnAfterDelete(stage *StageStruct, staged, front *Type) }
OnAfterDeleteInterface callback when an instance is updated from the front
type OnAfterReadInterface ¶
type OnAfterReadInterface[Type Gongstruct] interface { OnAfterRead(stage *StageStruct, instance *Type) }
OnAfterReadInterface callback when an instance is updated from the front
type OnAfterUpdateInterface ¶
type OnAfterUpdateInterface[Type Gongstruct] interface { OnAfterUpdate(stage *StageStruct, old, new *Type) }
OnAfterUpdateInterface callback when an instance is updated from the front
type OnInitCommitInterface ¶
type OnInitCommitInterface interface {
BeforeCommit(stage *StageStruct)
}
type OperationalLineStateEnum ¶
type OperationalLineStateEnum string
OperationalLineStateEnum .. swagger:enum OperationalLineStateEnum
const ( OPS_COM_LINK_OPERATIONAL_LINE_WORKING OperationalLineStateEnum = "OPS_COM_LINK_OPERATIONAL_LINE_WORKING" OPS_COM_LINK_OPERATIONAL_LINE_NOT_WORKING OperationalLineStateEnum = "OPS_COM_LINK_OPERATIONAL_LINE_NOT_WORKING" )
state
func (OperationalLineStateEnum) CodeValues ¶
func (operationallinestateenum OperationalLineStateEnum) CodeValues() (res []string)
func (OperationalLineStateEnum) Codes ¶
func (operationallinestateenum OperationalLineStateEnum) Codes() (res []string)
func (*OperationalLineStateEnum) FromCodeString ¶
func (operationallinestateenum *OperationalLineStateEnum) FromCodeString(input string) (err error)
func (*OperationalLineStateEnum) FromString ¶
func (operationallinestateenum *OperationalLineStateEnum) FromString(input string) (err error)
func (*OperationalLineStateEnum) ToCodeString ¶
func (operationallinestateenum *OperationalLineStateEnum) ToCodeString() (res string)
func (OperationalLineStateEnum) ToString ¶
func (operationallinestateenum OperationalLineStateEnum) ToString() (res string)
Utility function for OperationalLineStateEnum if enum values are string, it is stored with the value if enum values are int, they are stored with the code of the value
type OpsLine ¶
type OpsLine struct { Network // for filtering sake and for handling messages // Agent // swagger:ignore gongsim_models.Agent Scenario *Scenario State OperationalLineStateEnum Name string // Authority Authority LatLngAgentInterface `gorm:"-"` // Subordonate Subordonate LatLngAgentInterface `gorm:"-"` }
OpsLine
An OpsLine is an agent simulating a operational communication between a Aircraft and a Center
swagger:model OpsLine
func CopyBranchOpsLine ¶
func (*OpsLine) Checkout ¶
func (opsline *OpsLine) Checkout(stage *StageStruct) *OpsLine
Checkout opsline to the back repo (if it is already staged)
func (*OpsLine) Commit ¶
func (opsline *OpsLine) Commit(stage *StageStruct) *OpsLine
commit opsline to the back repo (if it is already staged)
func (*OpsLine) CommitVoid ¶
func (opsline *OpsLine) CommitVoid(stage *StageStruct)
func (*OpsLine) CopyBasicFields ¶
func (*OpsLine) FireNextEvent ¶
func (opsLine *OpsLine) FireNextEvent()
FireNextEvent fire next Event
func (*OpsLine) GetIsTransmittingBackwardOverride ¶
func (*OpsLine) GetIsTransmittingOverride ¶
func (*OpsLine) GetMessageBackwardOverride ¶
func (*OpsLine) GetMessageOverride ¶
func (*OpsLine) GetStartLat ¶
functions to satisty the visual interface for center
func (*OpsLine) GetStartLng ¶
func (*OpsLine) Register ¶
func (OpsLine *OpsLine) Register(engine *gongsim_models.Engine) (res *OpsLine)
func (*OpsLine) Stage ¶
func (opsline *OpsLine) Stage(stage *StageStruct) *OpsLine
Stage puts opsline to the model stage
func (*OpsLine) Unstage ¶
func (opsline *OpsLine) Unstage(stage *StageStruct) *OpsLine
Unstage removes opsline off the model stage
func (*OpsLine) UnstageVoid ¶
func (opsline *OpsLine) UnstageVoid(stage *StageStruct)
UnstageVoid removes opsline off the model stage
type OpsLine_WOP ¶
type Order ¶
type Order struct { gongsim_models.Event OrderMessage string Number int Type OrderEnum Target *Liner // the liner the order is about TargetLat float64 TargetLng float64 }
A Order is the event that will change the operational communication is a non working mode swagger:model Order
type OrderEnum ¶
type OrderEnum string
OrderEnum .. swagger:enum OrderEnum
const (
TAKE_OFF OrderEnum = "TAKE_OFF"
)
state
func (OrderEnum) CodeValues ¶
func (*OrderEnum) FromCodeString ¶
func (*OrderEnum) FromString ¶
func (*OrderEnum) ToCodeString ¶
type PointerToGongstruct ¶
type PointerToGongstruct interface { GetName() string CommitVoid(*StageStruct) UnstageVoid(stage *StageStruct) comparable }
Gongstruct is the type parameter for generated generic function that allows - access to staged instances - navigation between staged instances by going backward association links between gongstruct - full refactoring of Gongstruct identifiers / fields
type Radar ¶
type Radar struct { System // concept // Agent // swagger:ignore gongsim_models.Agent State RadarStateEnum Name string // current position Lat float64 Lng float64 // range in km Range float64 }
Radar swagger:model radar
func CopyBranchRadar ¶
func (*Radar) Checkout ¶
func (radar *Radar) Checkout(stage *StageStruct) *Radar
Checkout radar to the back repo (if it is already staged)
func (*Radar) Commit ¶
func (radar *Radar) Commit(stage *StageStruct) *Radar
commit radar to the back repo (if it is already staged)
func (*Radar) CommitVoid ¶
func (radar *Radar) CommitVoid(stage *StageStruct)
func (*Radar) CopyBasicFields ¶
func (*Radar) Stage ¶
func (radar *Radar) Stage(stage *StageStruct) *Radar
Stage puts radar to the model stage
func (*Radar) Unstage ¶
func (radar *Radar) Unstage(stage *StageStruct) *Radar
Unstage removes radar off the model stage
func (*Radar) UnstageVoid ¶
func (radar *Radar) UnstageVoid(stage *StageStruct)
UnstageVoid removes radar off the model stage
type RadarStateEnum ¶
type RadarStateEnum string
RadarStateEnum .. swagger:enum RadarStateEnum
const (
WORKING RadarStateEnum = "WORKING"
)
state
func (RadarStateEnum) CodeValues ¶
func (radarstateenum RadarStateEnum) CodeValues() (res []string)
func (RadarStateEnum) Codes ¶
func (radarstateenum RadarStateEnum) Codes() (res []string)
func (*RadarStateEnum) FromCodeString ¶
func (radarstateenum *RadarStateEnum) FromCodeString(input string) (err error)
func (*RadarStateEnum) FromString ¶
func (radarstateenum *RadarStateEnum) FromString(input string) (err error)
func (*RadarStateEnum) ToCodeString ¶
func (radarstateenum *RadarStateEnum) ToCodeString() (res string)
func (RadarStateEnum) ToString ¶
func (radarstateenum RadarStateEnum) ToString() (res string)
Utility function for RadarStateEnum if enum values are string, it is stored with the value if enum values are int, they are stored with the code of the value
type Radar_WOP ¶
type Radar_WOP struct { // insertion point State RadarStateEnum Name string Lat float64 Lng float64 Range float64 }
type Report ¶
type Report struct { gongsim_models.Event ReportMessage string Number int Type ReportEnum About *Liner // the liner the report is about OpsLine *OpsLine // the reporting line }
A Report is the event that will change the operational communication is a non working mode swagger:model Report
type ReportEnum ¶
type ReportEnum string
ReportEnum .. swagger:enum ReportEnum
const (
TAKE_OFF_COMPLETED ReportEnum = "TAKE_OFF_COMPLETED"
)
state
func (ReportEnum) CodeValues ¶
func (reportenum ReportEnum) CodeValues() (res []string)
func (ReportEnum) Codes ¶
func (reportenum ReportEnum) Codes() (res []string)
func (*ReportEnum) FromCodeString ¶
func (reportenum *ReportEnum) FromCodeString(input string) (err error)
func (*ReportEnum) FromString ¶
func (reportenum *ReportEnum) FromString(input string) (err error)
func (*ReportEnum) ToCodeString ¶
func (reportenum *ReportEnum) ToCodeString() (res string)
func (ReportEnum) ToString ¶
func (reportenum ReportEnum) ToString() (res string)
Utility function for ReportEnum if enum values are string, it is stored with the value if enum values are int, they are stored with the code of the value
type ReverseField ¶
func GetReverseFields ¶
func GetReverseFields[Type Gongstruct]() (res []ReverseField)
type Satellite ¶
type Satellite struct { Name string Line1 string Line2 string MovingObject // concept // Agent // swagger:ignore gongsim_models.Agent VerticalSpeed float64 Timestampstring string // contains filtered or unexported fields }
Satellite is a moving object swagger:model satellite
func CopyBranchSatellite ¶
func (*Satellite) Checkout ¶
func (satellite *Satellite) Checkout(stage *StageStruct) *Satellite
Checkout satellite to the back repo (if it is already staged)
func (*Satellite) Commit ¶
func (satellite *Satellite) Commit(stage *StageStruct) *Satellite
commit satellite to the back repo (if it is already staged)
func (*Satellite) CommitVoid ¶
func (satellite *Satellite) CommitVoid(stage *StageStruct)
func (*Satellite) CopyBasicFields ¶
func (*Satellite) FireNextEvent ¶
func (satellite *Satellite) FireNextEvent()
FireNextEvent fire next Event
func (*Satellite) GetDisplay ¶
func (*Satellite) GetHeading ¶
func (*Satellite) GetLayerGroupName ¶
func (*Satellite) GetVerticalSpeed ¶
func (*Satellite) InitFromTLE ¶
func (*Satellite) Register ¶
func (satellite *Satellite) Register(engine *gongsim_models.Engine) (res *Satellite)
func (*Satellite) Stage ¶
func (satellite *Satellite) Stage(stage *StageStruct) *Satellite
Stage puts satellite to the model stage
func (*Satellite) Unstage ¶
func (satellite *Satellite) Unstage(stage *StageStruct) *Satellite
Unstage removes satellite off the model stage
func (*Satellite) UnstageVoid ¶
func (satellite *Satellite) UnstageVoid(stage *StageStruct)
UnstageVoid removes satellite off the model stage
type Satellite_WOP ¶
type Scenario ¶
type Scenario struct { Name string // mandatory Lat, Lng float64 // map center ZoomLevel float64 // zoom level at the initialisation // Message Visual Speed, in km/h // this field can be tweaked by the end user MessageVisualSpeed float64 // contains filtered or unexported fields }
Scenario holds all infos about a scenario swagger:model Scenario
func CopyBranchScenario ¶
func (*Scenario) Checkout ¶
func (scenario *Scenario) Checkout(stage *StageStruct) *Scenario
Checkout scenario to the back repo (if it is already staged)
func (*Scenario) Commit ¶
func (scenario *Scenario) Commit(stage *StageStruct) *Scenario
commit scenario to the back repo (if it is already staged)
func (*Scenario) CommitVoid ¶
func (scenario *Scenario) CommitVoid(stage *StageStruct)
func (*Scenario) CopyBasicFields ¶
func (*Scenario) GetZoomLevel ¶
func (*Scenario) Stage ¶
func (scenario *Scenario) Stage(stage *StageStruct) *Scenario
Stage puts scenario to the model stage
func (*Scenario) Unstage ¶
func (scenario *Scenario) Unstage(stage *StageStruct) *Scenario
Unstage removes scenario off the model stage
func (*Scenario) UnstageVoid ¶
func (scenario *Scenario) UnstageVoid(stage *StageStruct)
UnstageVoid removes scenario off the model stage
type Scenario_WOP ¶
type StacksNames ¶
type StacksNames string
StacksNames - enumeration of possible 'type' values for an HTML <input> element swagger:enum StacksNames
const ( // we have three application stacks. All have the same name GongflyStackName StacksNames = "gongfly" GongLeafleatStackName StacksNames = "gongleaflet" GongsimStackName StacksNames = "gongsim" )
values for TableExtraNameEnum
func (StacksNames) CodeValues ¶
func (stacksnames StacksNames) CodeValues() (res []string)
func (StacksNames) Codes ¶
func (stacksnames StacksNames) Codes() (res []string)
func (*StacksNames) FromCodeString ¶
func (stacksnames *StacksNames) FromCodeString(input string) (err error)
func (*StacksNames) FromString ¶
func (stacksnames *StacksNames) FromString(input string) (err error)
func (*StacksNames) ToCodeString ¶
func (stacksnames *StacksNames) ToCodeString() (res string)
func (StacksNames) ToString ¶
func (stacksnames StacksNames) ToString() (res string)
Utility function for StacksNames if enum values are string, it is stored with the value if enum values are int, they are stored with the code of the value
type StageStruct ¶
type StageStruct struct { // insertion point for definition of arrays registering instances CivilianAirports map[*CivilianAirport]any CivilianAirports_mapString map[string]*CivilianAirport // insertion point for slice of pointers maps OnAfterCivilianAirportCreateCallback OnAfterCreateInterface[CivilianAirport] OnAfterCivilianAirportUpdateCallback OnAfterUpdateInterface[CivilianAirport] OnAfterCivilianAirportDeleteCallback OnAfterDeleteInterface[CivilianAirport] OnAfterCivilianAirportReadCallback OnAfterReadInterface[CivilianAirport] Liners map[*Liner]any Liners_mapString map[string]*Liner // insertion point for slice of pointers maps OnAfterLinerCreateCallback OnAfterCreateInterface[Liner] OnAfterLinerUpdateCallback OnAfterUpdateInterface[Liner] OnAfterLinerDeleteCallback OnAfterDeleteInterface[Liner] OnAfterLinerReadCallback OnAfterReadInterface[Liner] Messages map[*Message]any Messages_mapString map[string]*Message // insertion point for slice of pointers maps OnAfterMessageCreateCallback OnAfterCreateInterface[Message] OnAfterMessageUpdateCallback OnAfterUpdateInterface[Message] OnAfterMessageDeleteCallback OnAfterDeleteInterface[Message] OnAfterMessageReadCallback OnAfterReadInterface[Message] OpsLines map[*OpsLine]any OpsLines_mapString map[string]*OpsLine // insertion point for slice of pointers maps OnAfterOpsLineCreateCallback OnAfterCreateInterface[OpsLine] OnAfterOpsLineUpdateCallback OnAfterUpdateInterface[OpsLine] OnAfterOpsLineDeleteCallback OnAfterDeleteInterface[OpsLine] OnAfterOpsLineReadCallback OnAfterReadInterface[OpsLine] Radars map[*Radar]any Radars_mapString map[string]*Radar // insertion point for slice of pointers maps OnAfterRadarCreateCallback OnAfterCreateInterface[Radar] OnAfterRadarUpdateCallback OnAfterUpdateInterface[Radar] OnAfterRadarDeleteCallback OnAfterDeleteInterface[Radar] OnAfterRadarReadCallback OnAfterReadInterface[Radar] Satellites map[*Satellite]any Satellites_mapString map[string]*Satellite // insertion point for slice of pointers maps OnAfterSatelliteCreateCallback OnAfterCreateInterface[Satellite] OnAfterSatelliteUpdateCallback OnAfterUpdateInterface[Satellite] OnAfterSatelliteDeleteCallback OnAfterDeleteInterface[Satellite] OnAfterSatelliteReadCallback OnAfterReadInterface[Satellite] Scenarios map[*Scenario]any Scenarios_mapString map[string]*Scenario // insertion point for slice of pointers maps OnAfterScenarioCreateCallback OnAfterCreateInterface[Scenario] OnAfterScenarioUpdateCallback OnAfterUpdateInterface[Scenario] OnAfterScenarioDeleteCallback OnAfterDeleteInterface[Scenario] OnAfterScenarioReadCallback OnAfterReadInterface[Scenario] AllModelsStructCreateCallback AllModelsStructCreateInterface AllModelsStructDeleteCallback AllModelsStructDeleteInterface BackRepo BackRepoInterface // if set will be called before each commit to the back repo OnInitCommitCallback OnInitCommitInterface OnInitCommitFromFrontCallback OnInitCommitInterface OnInitCommitFromBackCallback OnInitCommitInterface // store the number of instance per gongstruct Map_GongStructName_InstancesNb map[string]int // store meta package import MetaPackageImportPath string MetaPackageImportAlias string // to be removed after fix of [issue](https://github.com/golang/go/issues/57559) // map to enable docLink renaming when an identifier is renamed Map_DocLink_Renaming map[string]GONG__Identifier // contains filtered or unexported fields }
StageStruct enables storage of staged instances swagger:ignore
func NewStage ¶
func NewStage(path string) (stage *StageStruct)
func (*StageStruct) Backup ¶
func (stage *StageStruct) Backup(dirPath string)
backup generates backup files in the dirPath
func (*StageStruct) BackupXL ¶
func (stage *StageStruct) BackupXL(dirPath string)
backup generates backup files in the dirPath
func (*StageStruct) Checkout ¶
func (stage *StageStruct) Checkout()
func (*StageStruct) Commit ¶
func (stage *StageStruct) Commit()
func (*StageStruct) CommitWithSuspendedCallbacks ¶
func (stage *StageStruct) CommitWithSuspendedCallbacks()
func (*StageStruct) ComputeReverseMaps ¶
func (stage *StageStruct) ComputeReverseMaps()
ComputeReverseMaps computes the reverse map, for all intances, for all slice to pointers field Its complexity is in O(n)O(p) where p is the number of pointers
func (*StageStruct) GetPath ¶
func (stage *StageStruct) GetPath() string
func (*StageStruct) GetType ¶
func (stage *StageStruct) GetType() string
func (*StageStruct) IsStagedCivilianAirport ¶
func (stage *StageStruct) IsStagedCivilianAirport(civilianairport *CivilianAirport) (ok bool)
insertion point for stage per struct
func (*StageStruct) IsStagedLiner ¶
func (stage *StageStruct) IsStagedLiner(liner *Liner) (ok bool)
func (*StageStruct) IsStagedMessage ¶
func (stage *StageStruct) IsStagedMessage(message *Message) (ok bool)
func (*StageStruct) IsStagedOpsLine ¶
func (stage *StageStruct) IsStagedOpsLine(opsline *OpsLine) (ok bool)
func (*StageStruct) IsStagedRadar ¶
func (stage *StageStruct) IsStagedRadar(radar *Radar) (ok bool)
func (*StageStruct) IsStagedSatellite ¶
func (stage *StageStruct) IsStagedSatellite(satellite *Satellite) (ok bool)
func (*StageStruct) IsStagedScenario ¶
func (stage *StageStruct) IsStagedScenario(scenario *Scenario) (ok bool)
func (*StageStruct) Marshall ¶
func (stage *StageStruct) Marshall(file *os.File, modelsPackageName, packageName string)
Marshall marshall the stage content into the file as an instanciation into a stage
func (*StageStruct) Nil ¶
func (stage *StageStruct) Nil()
func (*StageStruct) Reset ¶
func (stage *StageStruct) Reset()
func (*StageStruct) Restore ¶
func (stage *StageStruct) Restore(dirPath string)
Restore resets Stage & BackRepo and restores their content from the restore files in dirPath
func (*StageStruct) RestoreXL ¶
func (stage *StageStruct) RestoreXL(dirPath string)
Restore resets Stage & BackRepo and restores their content from the restore files in dirPath
func (*StageStruct) StageBranchCivilianAirport ¶
func (stage *StageStruct) StageBranchCivilianAirport(civilianairport *CivilianAirport)
insertion point for stage branch per struct
func (*StageStruct) StageBranchLiner ¶
func (stage *StageStruct) StageBranchLiner(liner *Liner)
func (*StageStruct) StageBranchMessage ¶
func (stage *StageStruct) StageBranchMessage(message *Message)
func (*StageStruct) StageBranchOpsLine ¶
func (stage *StageStruct) StageBranchOpsLine(opsline *OpsLine)
func (*StageStruct) StageBranchRadar ¶
func (stage *StageStruct) StageBranchRadar(radar *Radar)
func (*StageStruct) StageBranchSatellite ¶
func (stage *StageStruct) StageBranchSatellite(satellite *Satellite)
func (*StageStruct) StageBranchScenario ¶
func (stage *StageStruct) StageBranchScenario(scenario *Scenario)
func (*StageStruct) Unstage ¶
func (stage *StageStruct) Unstage()
func (*StageStruct) UnstageBranchCivilianAirport ¶
func (stage *StageStruct) UnstageBranchCivilianAirport(civilianairport *CivilianAirport)
insertion point for unstage branch per struct
func (*StageStruct) UnstageBranchLiner ¶
func (stage *StageStruct) UnstageBranchLiner(liner *Liner)
func (*StageStruct) UnstageBranchMessage ¶
func (stage *StageStruct) UnstageBranchMessage(message *Message)
func (*StageStruct) UnstageBranchOpsLine ¶
func (stage *StageStruct) UnstageBranchOpsLine(opsline *OpsLine)
func (*StageStruct) UnstageBranchRadar ¶
func (stage *StageStruct) UnstageBranchRadar(radar *Radar)
func (*StageStruct) UnstageBranchSatellite ¶
func (stage *StageStruct) UnstageBranchSatellite(satellite *Satellite)
func (*StageStruct) UnstageBranchScenario ¶
func (stage *StageStruct) UnstageBranchScenario(scenario *Scenario)
type System ¶
type System struct{}
func (*System) GetConcept ¶
func (system *System) GetConcept() ConceptEnum
func (*System) GetLayerGroupName ¶
Source Files ¶
- center_concept.go
- civil_airport.go
- concept.go
- docs.go
- gong.go
- gong_ast.go
- gong_callbacks.go
- gong_enum.go
- gong_graph.go
- gong_marshall.go
- gong_orchestrator.go
- gong_serialize.go
- gong_slices.go
- gong_wop.go
- lat_lng_agent_inteface.go
- liner.go
- message.go
- moving_object.go
- network.go
- ops_line.go
- order.go
- radar.go
- report.go
- satellite.go
- scenario.go
- stack_names_enum.go
- system.go