From 04f9d35f08f56c07ad6acd504a36c894cb332ecc Mon Sep 17 00:00:00 2001 From: guidfort Date: Fri, 11 Aug 2023 04:51:49 +0000 Subject: [PATCH 1/8] update fbs files --- .../comm/axisprofile/fbtypes/APRBootState.go | 11 +- pkg/fbs/comm/axisprofile/fbtypes/dummyFbs.go | 15 +- .../comm/axisprofile/fbtypes/mappingEntry.go | 69 +++- pkg/fbs/comm/axisprofile/fbtypes/profile.go | 9 +- .../comm/axisprofile/fbtypes/profileConfig.go | 31 +- .../axisprofile/fbtypes/profileConfigInfo.go | 38 +- .../fbtypes/profileDeviceScalingType.go | 2 +- .../axisprofile/fbtypes/profileScalingCfg.go | 10 +- .../fbtypes/profileScalingStrategy.go | 2 +- .../axisprofile/fbtypes/profileTypeData.go | 2 +- .../comm/axisprofile/fbtypes/valueMapping.go | 11 +- .../comm/axisprofile/fbtypes/variableType.go | 30 +- pkg/fbs/comm/datalayer/AllowedOperations.go | 10 +- pkg/fbs/comm/datalayer/ArrayOfBool8.go | 2 +- pkg/fbs/comm/datalayer/ArrayOfDouble.go | 2 +- pkg/fbs/comm/datalayer/ArrayOfFloat32.go | 2 +- pkg/fbs/comm/datalayer/ArrayOfFloat64.go | 2 +- pkg/fbs/comm/datalayer/ArrayOfInt16.go | 2 +- pkg/fbs/comm/datalayer/ArrayOfInt32.go | 2 +- pkg/fbs/comm/datalayer/ArrayOfInt64.go | 2 +- pkg/fbs/comm/datalayer/ArrayOfInt8.go | 2 +- pkg/fbs/comm/datalayer/ArrayOfString.go | 2 +- pkg/fbs/comm/datalayer/ArrayOfTimestamp.go | 2 +- pkg/fbs/comm/datalayer/ArrayOfUInt16.go | 2 +- pkg/fbs/comm/datalayer/ArrayOfUInt32.go | 2 +- pkg/fbs/comm/datalayer/ArrayOfUInt64.go | 2 +- pkg/fbs/comm/datalayer/ArrayOfUInt8.go | 2 +- pkg/fbs/comm/datalayer/Bool8.go | 2 +- pkg/fbs/comm/datalayer/ChangeEvents.go | 6 +- pkg/fbs/comm/datalayer/CheckOperations.go | 14 +- pkg/fbs/comm/datalayer/Claim.go | 47 ++- pkg/fbs/comm/datalayer/Counting.go | 2 +- pkg/fbs/comm/datalayer/DataChangeFilter.go | 2 +- pkg/fbs/comm/datalayer/DebugChannel.go | 16 +- pkg/fbs/comm/datalayer/DiagMoreInfo.go | 47 ++- pkg/fbs/comm/datalayer/Diagnosis.go | 31 +- pkg/fbs/comm/datalayer/Double.go | 2 +- pkg/fbs/comm/datalayer/Extension.go | 47 ++- pkg/fbs/comm/datalayer/FactoryStats.go | 8 +- pkg/fbs/comm/datalayer/Float32.go | 2 +- pkg/fbs/comm/datalayer/Float64.go | 2 +- pkg/fbs/comm/datalayer/Int16.go | 2 +- pkg/fbs/comm/datalayer/Int32.go | 2 +- pkg/fbs/comm/datalayer/Int64.go | 2 +- pkg/fbs/comm/datalayer/Int8.go | 2 +- pkg/fbs/comm/datalayer/LocaleText.go | 47 ++- pkg/fbs/comm/datalayer/Memory.go | 13 +- pkg/fbs/comm/datalayer/MemoryMap.go | 15 +- pkg/fbs/comm/datalayer/MemoryType.go | 38 +- pkg/fbs/comm/datalayer/MessageDetail.go | 2 +- pkg/fbs/comm/datalayer/Metadata.go | 78 +++- pkg/fbs/comm/datalayer/MetadataDB.go | 55 ++- pkg/fbs/comm/datalayer/NTelBufferConfig.go | 2 +- pkg/fbs/comm/datalayer/NotifyInfo.go | 11 +- pkg/fbs/comm/datalayer/NotifyType.go | 3 + pkg/fbs/comm/datalayer/PersistenceParam.go | 21 +- pkg/fbs/comm/datalayer/Problem.go | 68 +++- pkg/fbs/comm/datalayer/ProgramTask.go | 114 +++++- pkg/fbs/comm/datalayer/ProgramTaskAll.go | 41 +- pkg/fbs/comm/datalayer/Queueing.go | 4 +- pkg/fbs/comm/datalayer/Raw.go | 2 +- pkg/fbs/comm/datalayer/RealtimeConfig.go | 4 +- pkg/fbs/comm/datalayer/Reference.go | 49 ++- pkg/fbs/comm/datalayer/RetainStats.go | 43 +- pkg/fbs/comm/datalayer/Sampling.go | 2 +- pkg/fbs/comm/datalayer/Scope.go | 142 ++++--- pkg/fbs/comm/datalayer/Scopes.go | 11 +- pkg/fbs/comm/datalayer/ServerSettings.go | 64 ++- pkg/fbs/comm/datalayer/String.go | 7 +- pkg/fbs/comm/datalayer/SubscriptionData.go | 4 +- .../comm/datalayer/SubscriptionProperties.go | 15 +- .../comm/datalayer/SubscriptionSettings.go | 22 +- .../comm/datalayer/SubscriptionStatistics.go | 20 +- pkg/fbs/comm/datalayer/Timestamp.go | 2 +- pkg/fbs/comm/datalayer/Token.go | 33 +- pkg/fbs/comm/datalayer/UInt16.go | 2 +- pkg/fbs/comm/datalayer/UInt32.go | 2 +- pkg/fbs/comm/datalayer/UInt64.go | 2 +- pkg/fbs/comm/datalayer/UInt8.go | 2 +- pkg/fbs/comm/datalayer/Variable.go | 55 ++- pkg/fbs/comm/datalayer/Watchlist.go | 9 +- pkg/fbs/comm/datalayer/Watchlists.go | 2 +- pkg/fbs/comm/datalayer/framework/Bundle.go | 45 +- .../comm/datalayer/framework/BundleList.go | 2 +- pkg/fbs/comm/datalayer/framework/Component.go | 78 +++- .../comm/datalayer/framework/ComponentList.go | 11 +- .../comm/datalayer/framework/Dependency.go | 51 ++- .../datalayer/framework/DependencyList.go | 11 +- pkg/fbs/comm/datalayer/framework/Exception.go | 41 +- .../comm/datalayer/framework/Exceptions.go | 2 +- .../datalayer/framework/InterfaceList_.go | 11 +- .../comm/datalayer/framework/Interface_.go | 65 ++- pkg/fbs/comm/datalayer/framework/Property.go | 47 ++- .../comm/datalayer/framework/PropertyList.go | 11 +- pkg/fbs/comm/datalayer/framework/Register.go | 51 ++- .../comm/datalayer/framework/Stackentry.go | 46 ++- pkg/fbs/comm/datalayer/remote/ConfigItem.go | 47 ++- pkg/fbs/comm/datalayer/remote/RemoteConfig.go | 11 +- .../master/fbs/AddressMappingEntry.go | 9 +- .../ethercat/master/fbs/AddressedRequest.go | 4 +- .../comm/ethercat/master/fbs/AoeConfigInfo.go | 4 +- .../master/fbs/AoeConfigInfoResponse.go | 2 +- .../comm/ethercat/master/fbs/AoeControl.go | 4 +- .../ethercat/master/fbs/AoeControlRequest.go | 14 +- .../ethercat/master/fbs/AoeControlResponse.go | 4 +- pkg/fbs/comm/ethercat/master/fbs/AoeData.go | 4 +- .../ethercat/master/fbs/AoeDataRequest.go | 16 +- .../ethercat/master/fbs/AoeDataResponse.go | 6 +- .../master/fbs/BusLoadStatisticCounters.go | 2 +- .../fbs/BusLoadStatisticCountersResponse.go | 4 +- .../comm/ethercat/master/fbs/Capability.go | 14 +- .../ethercat/master/fbs/CapableInterfaces.go | 2 +- pkg/fbs/comm/ethercat/master/fbs/Checksum.go | 2 +- .../ethercat/master/fbs/ChecksumElement.go | 42 +- .../ethercat/master/fbs/ChecksumResponse.go | 11 +- .../ethercat/master/fbs/CoeVariableInfo.go | 6 +- .../comm/ethercat/master/fbs/DcConfigInfo.go | 2 +- .../master/fbs/DcConfigInfoResponse.go | 12 +- .../comm/ethercat/master/fbs/DcOnlineInfo.go | 2 +- .../master/fbs/DcOnlineInfoResponse.go | 14 +- .../ethercat/master/fbs/EntryDescription.go | 4 +- .../master/fbs/EntryDescriptionRequest.go | 12 +- .../master/fbs/EntryDescriptionResponse.go | 2 +- .../comm/ethercat/master/fbs/EoeConfigInfo.go | 4 +- .../master/fbs/EoeConfigInfoResponse.go | 17 +- .../master/fbs/EthercatIdentityInfo.go | 8 +- .../master/fbs/EthercatMailboxInfo.go | 4 +- .../ethercat/master/fbs/EthercatMemoryInfo.go | 4 +- .../ethercat/master/fbs/FieldbusConfig.go | 4 +- .../master/fbs/FieldbusConfigRequest.go | 4 +- .../master/fbs/FieldbusConfigResponse.go | 4 +- pkg/fbs/comm/ethercat/master/fbs/Foe.go | 4 +- .../comm/ethercat/master/fbs/FoeRequest.go | 19 +- .../comm/ethercat/master/fbs/FoeResponse.go | 2 +- .../master/fbs/FrameStatisticCounters.go | 2 +- .../fbs/FrameStatisticCountersResponse.go | 18 +- .../master/fbs/FrameStatisticReset.go | 2 +- .../master/fbs/FrameStatisticResetRequest.go | 18 +- .../comm/ethercat/master/fbs/InhibitTime.go | 2 +- .../master/fbs/InhibitTimeResponse.go | 2 +- .../ethercat/master/fbs/InstancesCreate.go | 2 +- .../master/fbs/InstancesCreateRequest.go | 28 +- pkg/fbs/comm/ethercat/master/fbs/Interface.go | 23 +- .../master/fbs/LinkLayerConfigInfo.go | 2 +- .../master/fbs/LinkLayerConfigInfoResponse.go | 21 +- .../master/fbs/LinkLayerOnlineInfo.go | 2 +- .../master/fbs/LinkLayerOnlineInfoResponse.go | 46 ++- .../master/fbs/MailboxStatisticCounters.go | 2 +- .../fbs/MailboxStatisticCountersResponse.go | 14 +- .../master/fbs/MailboxStatisticReset.go | 4 +- .../fbs/MailboxStatisticResetRequest.go | 14 +- .../comm/ethercat/master/fbs/MasterInfo.go | 2 +- .../ethercat/master/fbs/MasterInfoResponse.go | 23 +- .../comm/ethercat/master/fbs/MasterState.go | 4 +- .../ethercat/master/fbs/MasterStateRequest.go | 2 +- .../master/fbs/MasterStateResponse.go | 4 +- .../comm/ethercat/master/fbs/MasterStatus.go | 2 +- .../master/fbs/MasterStatusResponse.go | 2 +- .../ethercat/master/fbs/MinActMaxValues.go | 6 +- .../master/fbs/NumConfiguredMailboxSlaves.go | 2 +- .../fbs/NumConfiguredMailboxSlavesResponse.go | 2 +- .../master/fbs/NumConfiguredSlaves.go | 2 +- .../master/fbs/NumConfiguredSlavesResponse.go | 2 +- .../master/fbs/NumConnectedDcSlaves.go | 2 +- .../fbs/NumConnectedDcSlavesResponse.go | 2 +- .../ethercat/master/fbs/NumConnectedSlaves.go | 2 +- .../master/fbs/NumConnectedSlavesResponse.go | 2 +- .../ethercat/master/fbs/ObjectDescription.go | 4 +- .../master/fbs/ObjectDescriptionRequest.go | 8 +- .../master/fbs/ObjectDescriptionResponse.go | 2 +- .../master/fbs/ObjectDictionaryList.go | 4 +- .../master/fbs/ObjectDictionaryListRequest.go | 8 +- .../fbs/ObjectDictionaryListResponse.go | 2 +- pkg/fbs/comm/ethercat/master/fbs/Parameter.go | 4 +- .../ethercat/master/fbs/ParameterRequest.go | 14 +- .../ethercat/master/fbs/ParameterResponse.go | 4 +- .../ethercat/master/fbs/PortErrorCounters.go | 8 +- .../ethercat/master/fbs/ProfileChannelInfo.go | 4 +- .../master/fbs/ProfileChannelInfoRequest.go | 6 +- .../master/fbs/ProfileChannelInfoResponse.go | 25 +- .../ethercat/master/fbs/ProtocolStatistic.go | 4 +- .../master/fbs/ProtocolStatisticCounters.go | 4 +- .../fbs/ProtocolStatisticPeriodCounters.go | 4 +- .../fbs/ProtocolStatisticPeriodReset.go | 4 +- .../master/fbs/ProtocolStatisticReset.go | 4 +- .../master/fbs/ProtocolStatisticResetFlags.go | 4 +- pkg/fbs/comm/ethercat/master/fbs/SDO.go | 4 +- .../comm/ethercat/master/fbs/SDORequest.go | 14 +- .../comm/ethercat/master/fbs/SDOResponse.go | 2 +- .../master/fbs/SlaveAddressMapping.go | 4 +- .../master/fbs/SlaveAddressMappingRequest.go | 9 +- .../master/fbs/SlaveAddressMappingResponse.go | 32 +- .../ethercat/master/fbs/SlaveConfigInfo.go | 4 +- .../master/fbs/SlaveConfigInfoResponse.go | 55 +-- .../comm/ethercat/master/fbs/SlaveEeprom.go | 4 +- .../ethercat/master/fbs/SlaveEepromRequest.go | 10 +- .../master/fbs/SlaveEepromResponse.go | 2 +- .../ethercat/master/fbs/SlaveOnlineInfo.go | 4 +- .../master/fbs/SlaveOnlineInfoResponse.go | 54 +-- .../comm/ethercat/master/fbs/SlaveRegister.go | 4 +- .../master/fbs/SlaveRegisterRequest.go | 10 +- .../master/fbs/SlaveRegisterResponse.go | 2 +- .../comm/ethercat/master/fbs/SlaveState.go | 4 +- .../ethercat/master/fbs/SlaveStateRequest.go | 6 +- .../ethercat/master/fbs/SlaveStateResponse.go | 4 +- .../master/fbs/SlaveStatisticCounters.go | 4 +- .../fbs/SlaveStatisticCountersResponse.go | 8 +- .../master/fbs/SlaveStatisticModeAuto.go | 4 +- .../fbs/SlaveStatisticModeAutoRequest.go | 4 +- .../fbs/SlaveStatisticModeAutoResponse.go | 4 +- .../SlaveStatisticModeSingleShotTrigger.go | 4 +- ...veStatisticModeSingleShotTriggerRequest.go | 2 +- ...eStatisticModeSingleShotTriggerResponse.go | 4 +- .../comm/ethercat/master/fbs/SlaveStatus.go | 4 +- .../master/fbs/SlaveStatusResponse.go | 2 +- .../master/fbs/SlaveVariablesConfigInfo.go | 4 +- .../fbs/SlaveVariablesConfigInfoEntry.go | 6 +- .../fbs/SlaveVariablesConfigInfoRequest.go | 9 +- .../SlaveVariablesConfigInfoResponseList.go | 2 +- .../ethercat/master/fbs/SoeVariableInfo.go | 4 +- .../ethercat/master/fbs/TopologyStatus.go | 2 +- .../master/fbs/TopologyStatusResponse.go | 4 +- .../master/fbs/VariableProtocolInfo.go | 4 +- pkg/fbs/comm/ethercat/master/fbs/taskInfo.go | 4 +- .../comm/opcua/client/ClientConfiguration.go | 20 +- .../opcua/client/DlResultToUaStatusCode.go | 18 +- pkg/fbs/comm/opcua/client/ErrorCodeMapping.go | 2 +- .../comm/opcua/client/MessageSecurityMode.go | 2 +- pkg/fbs/comm/opcua/client/SecurityPolicy.go | 2 +- .../comm/opcua/client/SessionConfiguration.go | 8 +- pkg/fbs/comm/opcua/client/State.go | 2 +- .../comm/opcua/client/TimeoutConfiguration.go | 16 +- pkg/fbs/comm/opcua/client/TokenCert.go | 14 +- .../comm/opcua/client/TokenUserPassword.go | 14 +- .../comm/opcua/client/UserIdentityToken.go | 2 +- .../opcua/client/UserIdentityTokenUnion.go | 10 +- .../comm/opcua/server/ArrayOfSecConfigType.go | 2 +- .../comm/opcua/server/ArrayOfUserTokenType.go | 2 +- pkg/fbs/comm/opcua/server/BuildInfoType.go | 37 +- pkg/fbs/comm/opcua/server/SecConfigType.go | 8 +- .../server/ServerDiagnosticsSummaryType.go | 24 +- pkg/fbs/comm/opcua/server/ServerStateType.go | 2 +- pkg/fbs/comm/opcua/server/ServerStatusType.go | 17 +- pkg/fbs/comm/opcua/server/UserTokenType.go | 4 +- pkg/fbs/comm/osci/fbtypes/BufferCfg.go | 6 +- pkg/fbs/comm/osci/fbtypes/ChannelCfg.go | 75 +++- pkg/fbs/comm/osci/fbtypes/DiagramCfg.go | 9 +- pkg/fbs/comm/osci/fbtypes/Oscilloscope.go | 4 +- pkg/fbs/comm/osci/fbtypes/OscilloscopeCfg.go | 15 +- .../osci/fbtypes/OscilloscopeDiagnosis.go | 11 +- pkg/fbs/comm/osci/fbtypes/OscilloscopeRec.go | 4 +- .../comm/osci/fbtypes/OscilloscopeState.go | 6 +- pkg/fbs/comm/osci/fbtypes/RecAllSignals.go | 2 +- pkg/fbs/comm/osci/fbtypes/RecChannel.go | 9 +- pkg/fbs/comm/osci/fbtypes/RecSlice.go | 2 +- pkg/fbs/comm/osci/fbtypes/RecValue.go | 31 +- pkg/fbs/comm/osci/fbtypes/Time.go | 2 +- pkg/fbs/comm/osci/fbtypes/TriggerCfg.go | 13 +- pkg/fbs/comm/osci/fbtypes/ViewChannel.go | 18 +- pkg/fbs/comm/osci/fbtypes/type_bool.go | 2 +- pkg/fbs/comm/osci/fbtypes/type_byte.go | 2 +- pkg/fbs/comm/osci/fbtypes/type_double.go | 2 +- pkg/fbs/comm/osci/fbtypes/type_float.go | 2 +- pkg/fbs/comm/osci/fbtypes/type_int.go | 2 +- pkg/fbs/comm/osci/fbtypes/type_long.go | 2 +- pkg/fbs/comm/osci/fbtypes/type_short.go | 2 +- pkg/fbs/comm/osci/fbtypes/type_string.go | 7 +- pkg/fbs/comm/osci/fbtypes/type_ubyte.go | 2 +- pkg/fbs/comm/osci/fbtypes/type_uint.go | 2 +- pkg/fbs/comm/osci/fbtypes/type_ulong.go | 2 +- pkg/fbs/comm/osci/fbtypes/type_ushort.go | 2 +- .../comm/profinet/device/fbs/Capability.go | 14 +- .../profinet/device/fbs/CapableInterfaces.go | 2 +- .../comm/profinet/device/fbs/ConfigData.go | 16 +- .../comm/profinet/device/fbs/DeviceConfig.go | 14 +- .../device/fbs/DeviceConfigRequest.go | 9 +- .../device/fbs/DeviceConfigResponse.go | 14 +- .../comm/profinet/device/fbs/DeviceState.go | 4 +- .../profinet/device/fbs/DeviceStateRequest.go | 2 +- .../device/fbs/DeviceStateResponse.go | 4 +- .../comm/profinet/device/fbs/DeviceStatus.go | 2 +- .../device/fbs/DeviceStatusResponse.go | 2 +- .../profinet/device/fbs/InstancesCreate.go | 2 +- .../device/fbs/InstancesCreateRequest.go | 28 +- pkg/fbs/comm/profinet/device/fbs/Interface.go | 23 +- .../comm/profinet/device/fbs/ModuleData.go | 8 +- pkg/fbs/comm/profinet/device/fbs/Parameter.go | 4 +- .../profinet/device/fbs/ParameterRequest.go | 4 +- .../profinet/device/fbs/ParameterResponse.go | 2 +- .../device/fbs/SelectableDeviceConfigs.go | 2 +- .../common/log/diagnosis/fbs/ClassConfig.go | 2 +- .../log/diagnosis/fbs/DetailedDiagnostic.go | 16 +- .../log/diagnosis/fbs/DiagnosisElement.go | 11 +- .../log/diagnosis/fbs/DiagnosisElements.go | 2 +- .../diagnosis/fbs/DiagnosisIdentification.go | 21 +- .../DiagnosisIdentificationWithTimestamp.go | 9 +- .../common/log/diagnosis/fbs/EventType1.go | 2 +- .../common/log/diagnosis/fbs/EventType2.go | 2 +- .../diagnosis/fbs/GetDetailedDiagnosisText.go | 14 +- .../log/diagnosis/fbs/GetMainDiagnosisText.go | 7 +- ...istDiagnosisIdentificationWithTimestamp.go | 2 +- .../common/log/diagnosis/fbs/LogParameters.go | 65 ++- .../log/diagnosis/fbs/MainDiagnostic.go | 18 +- .../diagnosis/fbs/PendingDiagnosticState.go | 2 +- .../log/diagnosis/fbs/RegistrationFile.go | 23 +- pkg/fbs/common/log/trace/fbs/EnablingState.go | 13 +- .../common/log/trace/fbs/EnablingStates.go | 9 +- pkg/fbs/common/oblivion/OblivionCurrent.go | 6 +- pkg/fbs/common/oblivion/OblivionOverview.go | 6 +- pkg/fbs/common/oblivion/OblivionResult.go | 4 +- pkg/fbs/common/oblivion/OblivionResultItem.go | 79 +++- pkg/fbs/common/oblivion/OblivionSettings.go | 12 +- pkg/fbs/common/oblivion/OblivionTotal.go | 4 +- pkg/fbs/common/oblivion/RecordType.go | 15 +- pkg/fbs/common/oblivion/StackInfo.go | 17 +- pkg/fbs/common/oblivion/StackUsage.go | 2 +- .../scheduler/controls/fbs/AdminControls.go | 2 +- .../common/scheduler/controls/fbs/Controls.go | 4 +- .../common/scheduler/controls/fbs/Debug.go | 7 +- pkg/fbs/common/scheduler/fbs/Admin.go | 12 +- pkg/fbs/common/scheduler/fbs/Callable.go | 29 +- .../scheduler/fbs/CallableConfiguration.go | 15 +- .../scheduler/fbs/CallableConfigurations.go | 2 +- pkg/fbs/common/scheduler/fbs/CpuInfo.go | 35 +- pkg/fbs/common/scheduler/fbs/DataRt.go | 4 +- pkg/fbs/common/scheduler/fbs/Duration.go | 8 +- pkg/fbs/common/scheduler/fbs/DurationRt.go | 16 +- pkg/fbs/common/scheduler/fbs/DurationTimer.go | 2 +- pkg/fbs/common/scheduler/fbs/Histogram.go | 4 +- pkg/fbs/common/scheduler/fbs/Program.go | 6 +- pkg/fbs/common/scheduler/fbs/Programs.go | 2 +- .../scheduler/fbs/StartupErrorReaction.go | 2 +- pkg/fbs/common/scheduler/fbs/State.go | 2 +- pkg/fbs/common/scheduler/fbs/SyncPoints.go | 4 +- pkg/fbs/common/scheduler/fbs/Task.go | 22 +- pkg/fbs/common/scheduler/fbs/TaskSpecs.go | 23 +- pkg/fbs/common/scheduler/fbs/Trigger.go | 2 +- pkg/fbs/common/scheduler/fbs2/Admin.go | 20 +- .../common/scheduler/fbs2/CallableTimeouts.go | 6 +- pkg/fbs/common/scheduler/fbs2/CpuInfo.go | 35 +- pkg/fbs/common/scheduler/fbs2/Program.go | 8 +- pkg/fbs/common/scheduler/fbs2/Programs.go | 4 +- pkg/fbs/common/scheduler/fbs2/State.go | 2 +- .../scheduler/fbs2/StateSwitchingInfo.go | 6 +- .../scheduler/fbs2/UtilizationThreshold.go | 4 +- .../watchdog/errorreaction/fbs/Class.go | 2 +- .../errorreaction/fbs/Configuration.go | 2 +- .../common/scheduler/watchdog/fbs/Cyclic.go | 6 +- .../scheduler/watchdog/fbs/ErrorReaction.go | 6 +- pkg/fbs/common/scheduler/watchdog/fbs/Type.go | 2 +- .../common/scheduler/watchdog/fbs/Watchdog.go | 15 +- .../scheduler/watchdog/fbs/WatchdogVariant.go | 4 +- .../licenseproxy/LicenseCapabilities.go | 2 +- .../licenseproxy/LicenseCapability.go | 32 +- .../systemcore/licenseproxy/LicenseRequest.go | 14 +- .../licenseproxy/LicenseResponse.go | 39 +- .../common/systemhandler/fbs/CurrentState.go | 12 + pkg/fbs/common/systemhandler/fbs/State.go | 5 +- .../fbtypes/CollisionAvoidance.go | 11 +- .../fbtypes/GetCollisionGuardStateParams.go | 24 +- .../motion/core/fbtypes/AcquiredLicenses.go | 2 +- .../motion/core/fbtypes/AxsActualValues.go | 45 +- .../core/fbtypes/AxsBrakingDistanceEx.go | 13 +- pkg/fbs/motion/core/fbtypes/AxsCfg.go | 28 +- pkg/fbs/motion/core/fbtypes/AxsCfgCoupling.go | 4 +- .../core/fbtypes/AxsCfgDeviceErrorReaction.go | 4 +- .../core/fbtypes/AxsCfgEstopDynamicLimits.go | 18 +- .../core/fbtypes/AxsCfgEstopSettings.go | 12 +- .../motion/core/fbtypes/AxsCfgFunctions.go | 28 +- pkg/fbs/motion/core/fbtypes/AxsCfgGantry.go | 6 +- .../core/fbtypes/AxsCfgKinProperties.go | 4 +- pkg/fbs/motion/core/fbtypes/AxsCfgLimits.go | 72 ++-- .../motion/core/fbtypes/AxsCfgProperties.go | 18 +- .../motion/core/fbtypes/AxsCmdAbortData.go | 8 +- .../core/fbtypes/AxsCmdAddToGantryData.go | 9 +- .../motion/core/fbtypes/AxsCmdAddToKinData.go | 9 +- pkg/fbs/motion/core/fbtypes/AxsCmdJogData.go | 11 +- pkg/fbs/motion/core/fbtypes/AxsCmdPosData.go | 32 +- .../core/fbtypes/AxsCmdProbeBaseData.go | 14 +- .../motion/core/fbtypes/AxsCmdProbeData.go | 4 +- pkg/fbs/motion/core/fbtypes/AxsCmdValues.go | 33 +- pkg/fbs/motion/core/fbtypes/AxsCmdVelData.go | 16 +- pkg/fbs/motion/core/fbtypes/AxsIpoValues.go | 36 +- pkg/fbs/motion/core/fbtypes/BootState.go | 11 +- pkg/fbs/motion/core/fbtypes/BootTimes.go | 18 +- pkg/fbs/motion/core/fbtypes/Capability.go | 13 +- pkg/fbs/motion/core/fbtypes/CmdOptNoParam.go | 7 +- pkg/fbs/motion/core/fbtypes/CmdSource.go | 18 +- pkg/fbs/motion/core/fbtypes/DiagInfo.go | 60 ++- pkg/fbs/motion/core/fbtypes/DynamicLimits.go | 22 +- .../motion/core/fbtypes/DynamicLimitsState.go | 45 +- .../motion/core/fbtypes/FeedGroupSettings.go | 2 +- pkg/fbs/motion/core/fbtypes/IpoAddData.go | 36 +- .../motion/core/fbtypes/KinActualValues.go | 31 +- pkg/fbs/motion/core/fbtypes/KinAxsAll.go | 11 +- pkg/fbs/motion/core/fbtypes/KinAxsSingle.go | 56 ++- pkg/fbs/motion/core/fbtypes/KinCfg.go | 23 +- pkg/fbs/motion/core/fbtypes/KinCfgAxs.go | 23 +- pkg/fbs/motion/core/fbtypes/KinCfgDynamics.go | 2 +- .../core/fbtypes/KinCfgJntTrafoAllParam.go | 6 +- .../fbtypes/KinCfgJntTrafoAllParamGrps.go | 2 +- .../core/fbtypes/KinCfgJntTrafoAllSets.go | 2 +- .../fbtypes/KinCfgJntTrafoAxisAssignment.go | 2 +- .../core/fbtypes/KinCfgJntTrafoAxisOffsets.go | 2 +- .../core/fbtypes/KinCfgJntTrafoParamGroup.go | 9 +- .../motion/core/fbtypes/KinCfgJntTrafoSet.go | 16 +- .../KinCfgJntTrafoSingleAxisAssignment.go | 21 +- .../fbtypes/KinCfgJntTrafoSingleAxisOffset.go | 40 +- .../core/fbtypes/KinCfgJntTrafoSingleParam.go | 25 +- pkg/fbs/motion/core/fbtypes/KinCfgLimits.go | 45 +- .../motion/core/fbtypes/KinCfgPrepLimits.go | 2 +- .../core/fbtypes/KinCfgRotToLinConversion.go | 16 +- .../motion/core/fbtypes/KinCmdAbortData.go | 2 +- .../motion/core/fbtypes/KinCmdContourData.go | 4 +- pkg/fbs/motion/core/fbtypes/KinCmdJogData.go | 13 +- pkg/fbs/motion/core/fbtypes/KinCmdMoveData.go | 13 +- .../core/fbtypes/KinCmdMoveDirectAsyncData.go | 13 +- .../core/fbtypes/KinCmdMoveDirectData.go | 11 +- .../core/fbtypes/KinCmdOptAxsDynLimData.go | 9 +- .../motion/core/fbtypes/KinCmdOptBlendData.go | 19 +- .../core/fbtypes/KinCmdOptFeedGroupData.go | 9 +- .../motion/core/fbtypes/KinCmdOptMCSData.go | 14 +- .../motion/core/fbtypes/KinCmdOptPCSData.go | 14 +- .../core/fbtypes/KinCmdOptPolyTransData.go | 21 +- .../core/fbtypes/KinCmdOptSafeAreaData.go | 14 +- pkg/fbs/motion/core/fbtypes/KinCmdValues.go | 15 +- .../motion/core/fbtypes/KinCoordTransform.go | 18 +- pkg/fbs/motion/core/fbtypes/KinGeoCfg.go | 26 +- pkg/fbs/motion/core/fbtypes/KinIpoValues.go | 31 +- pkg/fbs/motion/core/fbtypes/KinOriCfg.go | 8 +- pkg/fbs/motion/core/fbtypes/KinOriRadius.go | 16 +- pkg/fbs/motion/core/fbtypes/KinPosValues.go | 4 +- .../core/fbtypes/KinStateJntTrafoData.go | 2 +- .../fbtypes/KinStateJntTrafoDataAllParam.go | 4 +- .../core/fbtypes/KinStateJntTrafoDataParam.go | 95 ++++- .../fbtypes/KinStateJntTrafoDataReqAxis.go | 32 +- .../fbtypes/KinStateJntTrafoDataSingle.go | 148 ++++++- .../motion/core/fbtypes/ProbeActualValues.go | 44 +- pkg/fbs/motion/core/fbtypes/ProbeCfgData.go | 48 ++- pkg/fbs/motion/core/fbtypes/RTInputsCfg.go | 4 +- pkg/fbs/motion/core/fbtypes/SingleLicense.go | 14 +- pkg/fbs/motion/core/fbtypes/SysCfg.go | 10 +- pkg/fbs/motion/core/fbtypes/SysCfgFunction.go | 2 +- pkg/fbs/motion/core/fbtypes/SysCfgInternal.go | 20 +- pkg/fbs/motion/core/fbtypes/SysCfgPcsAll.go | 22 +- pkg/fbs/motion/core/fbtypes/SysCfgPcsGroup.go | 42 +- pkg/fbs/motion/core/fbtypes/SysCfgPcsSet.go | 142 ++++--- pkg/fbs/motion/core/fbtypes/SysCfgSafeArea.go | 18 +- .../motion/core/fbtypes/SysCfgSafeAreaAll.go | 2 +- .../motion/core/fbtypes/SysCfgSafeAreaBox.go | 13 +- pkg/fbs/motion/core/fbtypes/SysCmdReset.go | 2 +- pkg/fbs/motion/core/fbtypes/UnitCfgKin.go | 39 +- pkg/fbs/motion/core/fbtypes/UnitCfgObj.go | 37 +- .../motion/core/fbtypes/UnitCfgObjSingle.go | 47 ++- pkg/fbs/motion/core/fbtypes/UnitDataAll.go | 2 +- pkg/fbs/motion/core/fbtypes/UnitDataSingle.go | 47 ++- .../motion/core/fbtypes/actCmdJobObjects.go | 9 +- .../core/fbtypes/allActCmdJobObjects.go | 2 +- .../motion/core/fbtypes/allDebugCmdInfo.go | 4 +- pkg/fbs/motion/core/fbtypes/debugCmdInfo.go | 37 +- pkg/fbs/motion/core/fbtypes/dummyFbs.go | 15 +- pkg/fbs/motion/somo/fbtypes/CmdJoin.go | 4 +- .../motion/somo/fbtypes/CmdOptionSetSignal.go | 9 +- pkg/fbs/motion/somo/fbtypes/CmdResetSignal.go | 2 +- pkg/fbs/motion/somo/fbtypes/CmdSetSignal.go | 2 +- .../motion/somo/fbtypes/CmdWaitForSignal.go | 4 +- .../motion/sync/fbtypes/AxsCfgCalcPipeline.go | 9 +- .../sync/fbtypes/AxsCfgCalcPipelineAll.go | 222 +++++----- pkg/fbs/motion/sync/fbtypes/AxsCfgCalcStep.go | 27 +- .../motion/sync/fbtypes/AxsCfgCalcStepAll.go | 2 +- .../sync/fbtypes/AxsCfgCalcStepParam.go | 92 +---- .../sync/fbtypes/AxsCfgCalcStepParamAll.go | 2 +- .../sync/fbtypes/AxsCfgDynSynchronisation.go | 2 +- .../fbtypes/AxsCfgDynSynchronisationLim.go | 12 +- .../motion/sync/fbtypes/AxsCfgErrReaction.go | 2 +- .../AxsCfgErrReactionSlaveLimExceeded.go | 4 +- .../motion/sync/fbtypes/AxsCfgSyncMotion.go | 6 +- .../sync/fbtypes/AxsCmdGearInPosData.go | 17 +- .../sync/fbtypes/AxsCmdGearInPosDlParams.go | 22 +- .../sync/fbtypes/AxsCmdGearInPosExData.go | 19 +- .../sync/fbtypes/AxsCmdGearInPosParams.go | 10 +- .../sync/fbtypes/AxsCmdGearInVelData.go | 13 +- .../sync/fbtypes/AxsCmdGearInVelDlParams.go | 18 +- .../sync/fbtypes/AxsCmdGearInVelExData.go | 15 +- .../sync/fbtypes/AxsCmdGearInVelParams.go | 8 +- .../sync/fbtypes/AxsCmdSyncGenericData.go | 16 +- .../fbtypes/AxsCmdSyncGenericGearInData.go | 18 +- .../fbtypes/AxsCmdSyncGenericGearInPosData.go | 22 +- .../fbtypes/AxsCmdSyncGenericGearInVelData.go | 18 +- .../fbtypes/AxsStateCalcPipelineInputs.go | 40 +- .../sync/fbtypes/AxsStateCalcPipelines.go | 2 +- .../fbtypes/AxsStateCalcSinglePipeline.go | 58 +-- .../motion/sync/fbtypes/CalcPipelineCfg.go | 11 +- pkg/fbs/motion/sync/fbtypes/CalcStepCfg.go | 27 +- .../sync/fbtypes/CalcStepCfgSingleParam.go | 18 +- .../motion/sync/fbtypes/MutexGroupPart1.go | 2 +- .../motion/sync/fbtypes/MutexGroupPart2.go | 2 +- .../motion/sync/fbtypes/PipelineValidation.go | 2 +- pkg/fbs/motion/sync/fbtypes/SegmentLawType.go | 385 ++++++++---------- .../sync/fbtypes/SinglePipelineValidation.go | 18 +- .../sync/fbtypes/StateCalcSingleStep.go | 29 +- .../sync/fbtypes/StateCalcStepMutexParam.go | 2 +- .../sync/fbtypes/StateCalcStepParams.go | 2 +- .../sync/fbtypes/StateCalcStepSingleParam.go | 20 +- pkg/fbs/motion/sync/fbtypes/StateCalcSteps.go | 2 +- .../addbundle/fbtypes/KinCmdCircularData.go | 8 +- .../plc/cmp/datalayer/fbs/AppDateAndTime.go | 40 +- .../plc/cmp/datalayer/fbs/AppIdmUserInfo.go | 9 +- .../plc/cmp/datalayer/fbs/AppIdmUserInfos.go | 2 +- .../plc/cmp/datalayer/fbs/AppIdmUserLogin.go | 14 +- pkg/fbs/plc/cmp/datalayer/fbs/AppInfo.go | 77 +++- .../cmp/datalayer/fbs/AppLoadApplications.go | 9 +- .../plc/cmp/datalayer/fbs/AppMemoryArea.go | 2 +- .../cmp/datalayer/fbs/AppMemoryAreaAccess.go | 8 +- .../cmp/datalayer/fbs/AppOperationState.go | 44 +- .../plc/cmp/datalayer/fbs/AppProjectInfo.go | 68 +++- pkg/fbs/plc/cmp/datalayer/fbs/AppReset.go | 2 +- pkg/fbs/plc/cmp/datalayer/fbs/AppState.go | 2 +- pkg/fbs/plc/cmp/datalayer/fbs/AppTaskInfo.go | 64 ++- pkg/fbs/plc/cmp/datalayer/fbs/AppTasksInfo.go | 11 +- pkg/fbs/plc/cmp/datalayer/fbs/ArrayBool_t.go | 2 +- .../plc/cmp/datalayer/fbs/ArrayFloat32_t.go | 2 +- .../plc/cmp/datalayer/fbs/ArrayFloat64_t.go | 2 +- pkg/fbs/plc/cmp/datalayer/fbs/ArrayInt16_t.go | 2 +- pkg/fbs/plc/cmp/datalayer/fbs/ArrayInt32_t.go | 2 +- pkg/fbs/plc/cmp/datalayer/fbs/ArrayInt64_t.go | 2 +- pkg/fbs/plc/cmp/datalayer/fbs/ArrayInt8_t.go | 2 +- .../plc/cmp/datalayer/fbs/ArrayUint16_t.go | 2 +- .../plc/cmp/datalayer/fbs/ArrayUint32_t.go | 2 +- .../plc/cmp/datalayer/fbs/ArrayUint64_t.go | 2 +- pkg/fbs/plc/cmp/datalayer/fbs/ArrayUint8_t.go | 2 +- pkg/fbs/plc/cmp/datalayer/fbs/Bool_t.go | 2 +- pkg/fbs/plc/cmp/datalayer/fbs/Float32_t.go | 2 +- pkg/fbs/plc/cmp/datalayer/fbs/Float64_t.go | 2 +- pkg/fbs/plc/cmp/datalayer/fbs/Int16_t.go | 2 +- pkg/fbs/plc/cmp/datalayer/fbs/Int32_t.go | 2 +- pkg/fbs/plc/cmp/datalayer/fbs/Int64_t.go | 2 +- pkg/fbs/plc/cmp/datalayer/fbs/Int8_t.go | 2 +- pkg/fbs/plc/cmp/datalayer/fbs/Uint16_t.go | 2 +- pkg/fbs/plc/cmp/datalayer/fbs/Uint32_t.go | 2 +- pkg/fbs/plc/cmp/datalayer/fbs/Uint64_t.go | 2 +- pkg/fbs/plc/cmp/datalayer/fbs/Uint8_t.go | 2 +- pkg/fbs/plc/cmp/datalayer/fbs/Value.go | 67 +-- pkg/fbs/script/manager/fbtypes/CfgGlobal.go | 2 +- .../script/manager/fbtypes/CfgInitScript.go | 16 +- .../script/manager/fbtypes/CfgProbeData.go | 48 ++- pkg/fbs/script/manager/fbtypes/CmdOpt_Base.go | 9 +- .../manager/fbtypes/CmdOpt_KinAxsDynLim.go | 11 +- .../script/manager/fbtypes/CmdOpt_KinBlend.go | 6 +- .../manager/fbtypes/CmdOpt_KinFeedGroup.go | 4 +- .../manager/fbtypes/CmdOpt_KinPolyTrans.go | 8 +- .../manager/fbtypes/CmdOpt_KinSetMCS.go | 9 +- .../manager/fbtypes/CmdOpt_KinSetPCS.go | 9 +- .../manager/fbtypes/CmdOpt_KinSetSafeArea.go | 9 +- .../fbtypes/CmdType_CmdOptionInfoReq.go | 14 +- .../CmdType_ListRegisteredCmdsOptions.go | 14 +- .../script/manager/fbtypes/Cmd_AxsAbort.go | 6 +- .../manager/fbtypes/Cmd_AxsAddToGantry.go | 11 +- .../script/manager/fbtypes/Cmd_AxsAddToKin.go | 11 +- pkg/fbs/script/manager/fbtypes/Cmd_AxsJog.go | 13 +- pkg/fbs/script/manager/fbtypes/Cmd_AxsPos.go | 8 +- .../script/manager/fbtypes/Cmd_AxsPower.go | 4 +- .../script/manager/fbtypes/Cmd_AxsVelocity.go | 10 +- pkg/fbs/script/manager/fbtypes/Cmd_Base.go | 16 +- .../script/manager/fbtypes/Cmd_DynLimits.go | 10 +- .../manager/fbtypes/Cmd_GenCmdOption.go | 21 +- .../script/manager/fbtypes/Cmd_KinAbort.go | 11 +- .../script/manager/fbtypes/Cmd_KinContour.go | 6 +- pkg/fbs/script/manager/fbtypes/Cmd_KinJog.go | 15 +- .../manager/fbtypes/Cmd_KinMoveDirect.go | 13 +- .../manager/fbtypes/Cmd_KinMoveDirectAsync.go | 15 +- .../script/manager/fbtypes/Cmd_KinMoveLin.go | 15 +- pkg/fbs/script/manager/fbtypes/DL_Write.go | 22 +- pkg/fbs/script/manager/fbtypes/DiagInfo.go | 13 +- pkg/fbs/script/manager/fbtypes/GlobalCfg.go | 9 +- .../script/manager/fbtypes/Misc_ActCmdData.go | 16 +- .../manager/fbtypes/Misc_CmdOptionInfoReq.go | 27 +- .../manager/fbtypes/Misc_CmdOptionInfoResp.go | 14 +- .../fbtypes/Misc_ListRegisteredCmdsOptions.go | 20 +- .../manager/fbtypes/Misc_SetErrLevel.go | 9 +- .../manager/fbtypes/Misc_SetOverride.go | 4 +- .../fbtypes/ObjectType_CmdOptionInfoReq.go | 14 +- .../fbtypes/ObjectType_GenCmdOption.go | 14 +- .../ObjectType_ListRegisteredCmdsOptions.go | 14 +- pkg/fbs/script/manager/fbtypes/Resp_Error.go | 13 +- .../manager/fbtypes/ScriptDescription.go | 37 +- .../manager/fbtypes/State_AxsActValues.go | 10 +- .../fbtypes/State_AxsBrakingDistanceExReq.go | 9 +- .../fbtypes/State_AxsBrakingDistanceExResp.go | 4 +- .../manager/fbtypes/State_AxsIpoValues.go | 8 +- .../State_AxsRunCalculationPipelineData.go | 25 +- .../script/manager/fbtypes/State_CmdState.go | 21 +- .../fbtypes/State_KinCoordTransform.go | 23 +- .../script/manager/fbtypes/State_KinGetPos.go | 14 +- .../manager/fbtypes/State_KinIpoValues.go | 8 +- .../script/manager/fbtypes/Task_RunScript.go | 9 +- .../script/manager/fbtypes/cmd_AxsProbe.go | 6 +- .../manager/fbtypes/cmd_AxsProbeBase.go | 16 +- .../script/manager/fbtypes/script_Instance.go | 14 +- .../fbtypes/state_AxsProbeActualValuesReq.go | 14 +- .../fbtypes/state_AxsProbeActualValuesResp.go | 23 +- pkg/fbs/web/automation/Settings.go | 24 +- pkg/fbs/web/automation/Stats.go | 10 +- pkg/fbs/web/automation/StatsDlClient.go | 2 +- pkg/fbs/web/automation/StatsRestbed.go | 2 +- pkg/fbs/web/automation/StatsSSE.go | 30 +- 606 files changed, 5963 insertions(+), 3160 deletions(-) diff --git a/pkg/fbs/comm/axisprofile/fbtypes/APRBootState.go b/pkg/fbs/comm/axisprofile/fbtypes/APRBootState.go index f0711cf..92b32f3 100644 --- a/pkg/fbs/comm/axisprofile/fbtypes/APRBootState.go +++ b/pkg/fbs/comm/axisprofile/fbtypes/APRBootState.go @@ -8,14 +8,17 @@ import ( /// return type of requests of the current boot state type APRBootStateT struct { - Text string - ActStep uint32 - MaxSteps uint32 + Text string `json:"text"` + ActStep uint32 `json:"actStep"` + MaxSteps uint32 `json:"maxSteps"` } func (t *APRBootStateT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - textOffset := builder.CreateString(t.Text) + textOffset := flatbuffers.UOffsetT(0) + if t.Text != "" { + textOffset = builder.CreateString(t.Text) + } APRBootStateStart(builder) APRBootStateAddText(builder, textOffset) APRBootStateAddActStep(builder, t.ActStep) diff --git a/pkg/fbs/comm/axisprofile/fbtypes/dummyFbs.go b/pkg/fbs/comm/axisprofile/fbtypes/dummyFbs.go index a904635..4629d34 100644 --- a/pkg/fbs/comm/axisprofile/fbtypes/dummyFbs.go +++ b/pkg/fbs/comm/axisprofile/fbtypes/dummyFbs.go @@ -7,16 +7,19 @@ import ( ) type dummyFbsT struct { - DummyByte int8 - DummyStr string - DummyInt int32 - DummyDouble float64 - DummyDoublePtr []float64 + DummyByte int8 `json:"dummyByte"` + DummyStr string `json:"dummyStr"` + DummyInt int32 `json:"dummyInt"` + DummyDouble float64 `json:"dummyDouble"` + DummyDoublePtr []float64 `json:"dummyDoublePtr"` } func (t *dummyFbsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - dummyStrOffset := builder.CreateString(t.DummyStr) + dummyStrOffset := flatbuffers.UOffsetT(0) + if t.DummyStr != "" { + dummyStrOffset = builder.CreateString(t.DummyStr) + } dummyDoublePtrOffset := flatbuffers.UOffsetT(0) if t.DummyDoublePtr != nil { dummyDoublePtrLength := len(t.DummyDoublePtr) diff --git a/pkg/fbs/comm/axisprofile/fbtypes/mappingEntry.go b/pkg/fbs/comm/axisprofile/fbtypes/mappingEntry.go index 51bf2d4..5d7be3d 100644 --- a/pkg/fbs/comm/axisprofile/fbtypes/mappingEntry.go +++ b/pkg/fbs/comm/axisprofile/fbtypes/mappingEntry.go @@ -3,29 +3,36 @@ package fbtypes import ( + "bytes" flatbuffers "github.com/google/flatbuffers/go" ) type mappingEntryT struct { - ValueID string - DatalayerURI string - ProfileVar variableType + ValueId string `json:"valueID"` + DatalayerUri string `json:"datalayerURI"` + ProfileVar variableType `json:"profileVar"` } func (t *mappingEntryT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - valueIDOffset := builder.CreateString(t.ValueID) - datalayerURIOffset := builder.CreateString(t.DatalayerURI) + valueIdOffset := flatbuffers.UOffsetT(0) + if t.ValueId != "" { + valueIdOffset = builder.CreateString(t.ValueId) + } + datalayerUriOffset := flatbuffers.UOffsetT(0) + if t.DatalayerUri != "" { + datalayerUriOffset = builder.CreateString(t.DatalayerUri) + } mappingEntryStart(builder) - mappingEntryAddValueID(builder, valueIDOffset) - mappingEntryAddDatalayerURI(builder, datalayerURIOffset) + mappingEntryAddValueId(builder, valueIdOffset) + mappingEntryAddDatalayerUri(builder, datalayerUriOffset) mappingEntryAddProfileVar(builder, t.ProfileVar) return mappingEntryEnd(builder) } func (rcv *mappingEntry) UnPackTo(t *mappingEntryT) { - t.ValueID = string(rcv.ValueID()) - t.DatalayerURI = string(rcv.DatalayerURI()) + t.ValueId = string(rcv.ValueId()) + t.DatalayerUri = string(rcv.DatalayerUri()) t.ProfileVar = rcv.ProfileVar() } @@ -63,7 +70,7 @@ func (rcv *mappingEntry) Table() flatbuffers.Table { return rcv._tab } -func (rcv *mappingEntry) ValueID() []byte { +func (rcv *mappingEntry) ValueId() []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) if o != 0 { return rcv._tab.ByteVector(o + rcv._tab.Pos) @@ -71,7 +78,39 @@ func (rcv *mappingEntry) ValueID() []byte { return nil } -func (rcv *mappingEntry) DatalayerURI() []byte { +func mappingEntryKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &mappingEntry{} + obj2 := &mappingEntry{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.ValueId()) < string(obj2.ValueId()) +} + +func (rcv *mappingEntry) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &mappingEntry{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.ValueId(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + +func (rcv *mappingEntry) DatalayerUri() []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { return rcv._tab.ByteVector(o + rcv._tab.Pos) @@ -94,11 +133,11 @@ func (rcv *mappingEntry) MutateProfileVar(n variableType) bool { func mappingEntryStart(builder *flatbuffers.Builder) { builder.StartObject(3) } -func mappingEntryAddValueID(builder *flatbuffers.Builder, valueID flatbuffers.UOffsetT) { - builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(valueID), 0) +func mappingEntryAddValueId(builder *flatbuffers.Builder, valueId flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(valueId), 0) } -func mappingEntryAddDatalayerURI(builder *flatbuffers.Builder, datalayerURI flatbuffers.UOffsetT) { - builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(datalayerURI), 0) +func mappingEntryAddDatalayerUri(builder *flatbuffers.Builder, datalayerUri flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(datalayerUri), 0) } func mappingEntryAddProfileVar(builder *flatbuffers.Builder, profileVar variableType) { builder.PrependInt8Slot(2, int8(profileVar), 0) diff --git a/pkg/fbs/comm/axisprofile/fbtypes/profile.go b/pkg/fbs/comm/axisprofile/fbtypes/profile.go index 778b1ef..04c672e 100644 --- a/pkg/fbs/comm/axisprofile/fbtypes/profile.go +++ b/pkg/fbs/comm/axisprofile/fbtypes/profile.go @@ -7,13 +7,16 @@ import ( ) type profileT struct { - Name string - Type ProfileType + Name string `json:"name"` + Type ProfileType `json:"type"` } func (t *profileT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } profileStart(builder) profileAddName(builder, nameOffset) profileAddType(builder, t.Type) diff --git a/pkg/fbs/comm/axisprofile/fbtypes/profileConfig.go b/pkg/fbs/comm/axisprofile/fbtypes/profileConfig.go index b7417d3..93b0ee9 100644 --- a/pkg/fbs/comm/axisprofile/fbtypes/profileConfig.go +++ b/pkg/fbs/comm/axisprofile/fbtypes/profileConfig.go @@ -7,25 +7,34 @@ import ( ) type profileConfigT struct { - DeviceAddress uint32 - InputBuffer string - OutputBuffer string - ProfileBasicData *profileT - InputMapping *valueMappingT - OutputMapping *valueMappingT - ScalingInfo *profileScalingCfgT - DeviceName string + DeviceAddress uint32 `json:"deviceAddress"` + InputBuffer string `json:"inputBuffer"` + OutputBuffer string `json:"outputBuffer"` + ProfileBasicData *profileT `json:"profileBasicData"` + InputMapping *valueMappingT `json:"inputMapping"` + OutputMapping *valueMappingT `json:"outputMapping"` + ScalingInfo *profileScalingCfgT `json:"scalingInfo"` + DeviceName string `json:"deviceName"` } func (t *profileConfigT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - inputBufferOffset := builder.CreateString(t.InputBuffer) - outputBufferOffset := builder.CreateString(t.OutputBuffer) + inputBufferOffset := flatbuffers.UOffsetT(0) + if t.InputBuffer != "" { + inputBufferOffset = builder.CreateString(t.InputBuffer) + } + outputBufferOffset := flatbuffers.UOffsetT(0) + if t.OutputBuffer != "" { + outputBufferOffset = builder.CreateString(t.OutputBuffer) + } profileBasicDataOffset := t.ProfileBasicData.Pack(builder) inputMappingOffset := t.InputMapping.Pack(builder) outputMappingOffset := t.OutputMapping.Pack(builder) scalingInfoOffset := t.ScalingInfo.Pack(builder) - deviceNameOffset := builder.CreateString(t.DeviceName) + deviceNameOffset := flatbuffers.UOffsetT(0) + if t.DeviceName != "" { + deviceNameOffset = builder.CreateString(t.DeviceName) + } profileConfigStart(builder) profileConfigAddDeviceAddress(builder, t.DeviceAddress) profileConfigAddInputBuffer(builder, inputBufferOffset) diff --git a/pkg/fbs/comm/axisprofile/fbtypes/profileConfigInfo.go b/pkg/fbs/comm/axisprofile/fbtypes/profileConfigInfo.go index 5ddc8b8..388575d 100644 --- a/pkg/fbs/comm/axisprofile/fbtypes/profileConfigInfo.go +++ b/pkg/fbs/comm/axisprofile/fbtypes/profileConfigInfo.go @@ -7,27 +7,39 @@ import ( ) type profileConfigInfoT struct { - DeviceAddress uint32 - InputBuffer string - OutputBuffer string - ProfileType *profileTypeDataT - ProfileName string - InputMapping *valueMappingT - OutputMapping *valueMappingT - ScalingInfo *profileScalingCfgT - DeviceName string + DeviceAddress uint32 `json:"deviceAddress"` + InputBuffer string `json:"inputBuffer"` + OutputBuffer string `json:"outputBuffer"` + ProfileType *profileTypeDataT `json:"profileType"` + ProfileName string `json:"profileName"` + InputMapping *valueMappingT `json:"inputMapping"` + OutputMapping *valueMappingT `json:"outputMapping"` + ScalingInfo *profileScalingCfgT `json:"scalingInfo"` + DeviceName string `json:"deviceName"` } func (t *profileConfigInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - inputBufferOffset := builder.CreateString(t.InputBuffer) - outputBufferOffset := builder.CreateString(t.OutputBuffer) + inputBufferOffset := flatbuffers.UOffsetT(0) + if t.InputBuffer != "" { + inputBufferOffset = builder.CreateString(t.InputBuffer) + } + outputBufferOffset := flatbuffers.UOffsetT(0) + if t.OutputBuffer != "" { + outputBufferOffset = builder.CreateString(t.OutputBuffer) + } profileTypeOffset := t.ProfileType.Pack(builder) - profileNameOffset := builder.CreateString(t.ProfileName) + profileNameOffset := flatbuffers.UOffsetT(0) + if t.ProfileName != "" { + profileNameOffset = builder.CreateString(t.ProfileName) + } inputMappingOffset := t.InputMapping.Pack(builder) outputMappingOffset := t.OutputMapping.Pack(builder) scalingInfoOffset := t.ScalingInfo.Pack(builder) - deviceNameOffset := builder.CreateString(t.DeviceName) + deviceNameOffset := flatbuffers.UOffsetT(0) + if t.DeviceName != "" { + deviceNameOffset = builder.CreateString(t.DeviceName) + } profileConfigInfoStart(builder) profileConfigInfoAddDeviceAddress(builder, t.DeviceAddress) profileConfigInfoAddInputBuffer(builder, inputBufferOffset) diff --git a/pkg/fbs/comm/axisprofile/fbtypes/profileDeviceScalingType.go b/pkg/fbs/comm/axisprofile/fbtypes/profileDeviceScalingType.go index 673fb56..8c333a5 100644 --- a/pkg/fbs/comm/axisprofile/fbtypes/profileDeviceScalingType.go +++ b/pkg/fbs/comm/axisprofile/fbtypes/profileDeviceScalingType.go @@ -7,7 +7,7 @@ import ( ) type profileDeviceScalingTypeT struct { - ScalingType deviceScalingType + ScalingType deviceScalingType `json:"scalingType"` } func (t *profileDeviceScalingTypeT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/axisprofile/fbtypes/profileScalingCfg.go b/pkg/fbs/comm/axisprofile/fbtypes/profileScalingCfg.go index 43f7ed2..c865bd5 100644 --- a/pkg/fbs/comm/axisprofile/fbtypes/profileScalingCfg.go +++ b/pkg/fbs/comm/axisprofile/fbtypes/profileScalingCfg.go @@ -7,11 +7,11 @@ import ( ) type profileScalingCfgT struct { - ScalingStrategy *profileScalingStrategyT - ScalingType *profileDeviceScalingTypeT - Numerator uint32 - Denominator uint32 - Resolution uint32 + ScalingStrategy *profileScalingStrategyT `json:"scalingStrategy"` + ScalingType *profileDeviceScalingTypeT `json:"scalingType"` + Numerator uint32 `json:"numerator"` + Denominator uint32 `json:"denominator"` + Resolution uint32 `json:"resolution"` } func (t *profileScalingCfgT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/axisprofile/fbtypes/profileScalingStrategy.go b/pkg/fbs/comm/axisprofile/fbtypes/profileScalingStrategy.go index 6f98ad3..f3c5776 100644 --- a/pkg/fbs/comm/axisprofile/fbtypes/profileScalingStrategy.go +++ b/pkg/fbs/comm/axisprofile/fbtypes/profileScalingStrategy.go @@ -7,7 +7,7 @@ import ( ) type profileScalingStrategyT struct { - Strategy ScalingStrategy + Strategy ScalingStrategy `json:"strategy"` } func (t *profileScalingStrategyT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/axisprofile/fbtypes/profileTypeData.go b/pkg/fbs/comm/axisprofile/fbtypes/profileTypeData.go index a3cca9b..9466f3c 100644 --- a/pkg/fbs/comm/axisprofile/fbtypes/profileTypeData.go +++ b/pkg/fbs/comm/axisprofile/fbtypes/profileTypeData.go @@ -7,7 +7,7 @@ import ( ) type profileTypeDataT struct { - Type ProfileType + Type ProfileType `json:"type"` } func (t *profileTypeDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/axisprofile/fbtypes/valueMapping.go b/pkg/fbs/comm/axisprofile/fbtypes/valueMapping.go index 5bffc56..ae2140c 100644 --- a/pkg/fbs/comm/axisprofile/fbtypes/valueMapping.go +++ b/pkg/fbs/comm/axisprofile/fbtypes/valueMapping.go @@ -7,7 +7,7 @@ import ( ) type valueMappingT struct { - Mapping []*mappingEntryT + Mapping []*mappingEntryT `json:"mapping"` } func (t *valueMappingT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -86,6 +86,15 @@ func (rcv *valueMapping) Mapping(obj *mappingEntry, j int) bool { return false } +func (rcv *valueMapping) MappingByKey(obj *mappingEntry, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *valueMapping) MappingLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) if o != 0 { diff --git a/pkg/fbs/comm/axisprofile/fbtypes/variableType.go b/pkg/fbs/comm/axisprofile/fbtypes/variableType.go index f24f016..03ba00e 100644 --- a/pkg/fbs/comm/axisprofile/fbtypes/variableType.go +++ b/pkg/fbs/comm/axisprofile/fbtypes/variableType.go @@ -7,24 +7,30 @@ import "strconv" type variableType int8 const ( - variableTypeBASE variableType = 0 - variableTypeVELOCITY variableType = 1 - variableTypeHOMING variableType = 2 - variableTypePROBE variableType = 3 + variableTypeUNKNOWN variableType = -1 + variableTypeBASE variableType = 0 + variableTypeVELOCITY variableType = 1 + variableTypeHOMING variableType = 2 + variableTypePROBE variableType = 3 + variableTypeTORQUE_FORCE variableType = 4 ) var EnumNamesvariableType = map[variableType]string{ - variableTypeBASE: "BASE", - variableTypeVELOCITY: "VELOCITY", - variableTypeHOMING: "HOMING", - variableTypePROBE: "PROBE", + variableTypeUNKNOWN: "UNKNOWN", + variableTypeBASE: "BASE", + variableTypeVELOCITY: "VELOCITY", + variableTypeHOMING: "HOMING", + variableTypePROBE: "PROBE", + variableTypeTORQUE_FORCE: "TORQUE_FORCE", } var EnumValuesvariableType = map[string]variableType{ - "BASE": variableTypeBASE, - "VELOCITY": variableTypeVELOCITY, - "HOMING": variableTypeHOMING, - "PROBE": variableTypePROBE, + "UNKNOWN": variableTypeUNKNOWN, + "BASE": variableTypeBASE, + "VELOCITY": variableTypeVELOCITY, + "HOMING": variableTypeHOMING, + "PROBE": variableTypePROBE, + "TORQUE_FORCE": variableTypeTORQUE_FORCE, } func (v variableType) String() string { diff --git a/pkg/fbs/comm/datalayer/AllowedOperations.go b/pkg/fbs/comm/datalayer/AllowedOperations.go index f955b03..4a1a93a 100644 --- a/pkg/fbs/comm/datalayer/AllowedOperations.go +++ b/pkg/fbs/comm/datalayer/AllowedOperations.go @@ -7,11 +7,11 @@ import ( ) type AllowedOperationsT struct { - Read bool - Write bool - Create bool - Delete bool - Browse bool + Read bool `json:"read"` + Write bool `json:"write"` + Create bool `json:"create"` + Delete bool `json:"delete"` + Browse bool `json:"browse"` } func (t *AllowedOperationsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/ArrayOfBool8.go b/pkg/fbs/comm/datalayer/ArrayOfBool8.go index d8ee1b2..303886d 100644 --- a/pkg/fbs/comm/datalayer/ArrayOfBool8.go +++ b/pkg/fbs/comm/datalayer/ArrayOfBool8.go @@ -7,7 +7,7 @@ import ( ) type ArrayOfBool8T struct { - Value []bool + Value []bool `json:"value"` } func (t *ArrayOfBool8T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/ArrayOfDouble.go b/pkg/fbs/comm/datalayer/ArrayOfDouble.go index 3007b42..e225ace 100644 --- a/pkg/fbs/comm/datalayer/ArrayOfDouble.go +++ b/pkg/fbs/comm/datalayer/ArrayOfDouble.go @@ -7,7 +7,7 @@ import ( ) type ArrayOfDoubleT struct { - Value []float64 + Value []float64 `json:"value"` } func (t *ArrayOfDoubleT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/ArrayOfFloat32.go b/pkg/fbs/comm/datalayer/ArrayOfFloat32.go index e38c7f3..e9fd266 100644 --- a/pkg/fbs/comm/datalayer/ArrayOfFloat32.go +++ b/pkg/fbs/comm/datalayer/ArrayOfFloat32.go @@ -7,7 +7,7 @@ import ( ) type ArrayOfFloat32T struct { - Value []float32 + Value []float32 `json:"value"` } func (t *ArrayOfFloat32T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/ArrayOfFloat64.go b/pkg/fbs/comm/datalayer/ArrayOfFloat64.go index 4fb2332..5e9b240 100644 --- a/pkg/fbs/comm/datalayer/ArrayOfFloat64.go +++ b/pkg/fbs/comm/datalayer/ArrayOfFloat64.go @@ -7,7 +7,7 @@ import ( ) type ArrayOfFloat64T struct { - Value []float64 + Value []float64 `json:"value"` } func (t *ArrayOfFloat64T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/ArrayOfInt16.go b/pkg/fbs/comm/datalayer/ArrayOfInt16.go index 3c82bf7..1d85076 100644 --- a/pkg/fbs/comm/datalayer/ArrayOfInt16.go +++ b/pkg/fbs/comm/datalayer/ArrayOfInt16.go @@ -7,7 +7,7 @@ import ( ) type ArrayOfInt16T struct { - Value []int16 + Value []int16 `json:"value"` } func (t *ArrayOfInt16T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/ArrayOfInt32.go b/pkg/fbs/comm/datalayer/ArrayOfInt32.go index 084cc79..5e1b2a0 100644 --- a/pkg/fbs/comm/datalayer/ArrayOfInt32.go +++ b/pkg/fbs/comm/datalayer/ArrayOfInt32.go @@ -7,7 +7,7 @@ import ( ) type ArrayOfInt32T struct { - Value []int32 + Value []int32 `json:"value"` } func (t *ArrayOfInt32T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/ArrayOfInt64.go b/pkg/fbs/comm/datalayer/ArrayOfInt64.go index 97e3ae9..86c6701 100644 --- a/pkg/fbs/comm/datalayer/ArrayOfInt64.go +++ b/pkg/fbs/comm/datalayer/ArrayOfInt64.go @@ -7,7 +7,7 @@ import ( ) type ArrayOfInt64T struct { - Value []int64 + Value []int64 `json:"value"` } func (t *ArrayOfInt64T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/ArrayOfInt8.go b/pkg/fbs/comm/datalayer/ArrayOfInt8.go index 0d9e31e..fb2e4b8 100644 --- a/pkg/fbs/comm/datalayer/ArrayOfInt8.go +++ b/pkg/fbs/comm/datalayer/ArrayOfInt8.go @@ -7,7 +7,7 @@ import ( ) type ArrayOfInt8T struct { - Value []int8 + Value []int8 `json:"value"` } func (t *ArrayOfInt8T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/ArrayOfString.go b/pkg/fbs/comm/datalayer/ArrayOfString.go index d519598..24c7c5d 100644 --- a/pkg/fbs/comm/datalayer/ArrayOfString.go +++ b/pkg/fbs/comm/datalayer/ArrayOfString.go @@ -7,7 +7,7 @@ import ( ) type ArrayOfStringT struct { - Value []string + Value []string `json:"value"` } func (t *ArrayOfStringT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/ArrayOfTimestamp.go b/pkg/fbs/comm/datalayer/ArrayOfTimestamp.go index bd39bc8..898107f 100644 --- a/pkg/fbs/comm/datalayer/ArrayOfTimestamp.go +++ b/pkg/fbs/comm/datalayer/ArrayOfTimestamp.go @@ -7,7 +7,7 @@ import ( ) type ArrayOfTimestampT struct { - Value []uint64 + Value []uint64 `json:"value"` } func (t *ArrayOfTimestampT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/ArrayOfUInt16.go b/pkg/fbs/comm/datalayer/ArrayOfUInt16.go index 9791423..d348ae9 100644 --- a/pkg/fbs/comm/datalayer/ArrayOfUInt16.go +++ b/pkg/fbs/comm/datalayer/ArrayOfUInt16.go @@ -7,7 +7,7 @@ import ( ) type ArrayOfUInt16T struct { - Value []uint16 + Value []uint16 `json:"value"` } func (t *ArrayOfUInt16T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/ArrayOfUInt32.go b/pkg/fbs/comm/datalayer/ArrayOfUInt32.go index 1fb1f55..aeccbdf 100644 --- a/pkg/fbs/comm/datalayer/ArrayOfUInt32.go +++ b/pkg/fbs/comm/datalayer/ArrayOfUInt32.go @@ -7,7 +7,7 @@ import ( ) type ArrayOfUInt32T struct { - Value []uint32 + Value []uint32 `json:"value"` } func (t *ArrayOfUInt32T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/ArrayOfUInt64.go b/pkg/fbs/comm/datalayer/ArrayOfUInt64.go index 8b249a7..0e1e436 100644 --- a/pkg/fbs/comm/datalayer/ArrayOfUInt64.go +++ b/pkg/fbs/comm/datalayer/ArrayOfUInt64.go @@ -7,7 +7,7 @@ import ( ) type ArrayOfUInt64T struct { - Value []uint64 + Value []uint64 `json:"value"` } func (t *ArrayOfUInt64T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/ArrayOfUInt8.go b/pkg/fbs/comm/datalayer/ArrayOfUInt8.go index 0f3ceb3..3079353 100644 --- a/pkg/fbs/comm/datalayer/ArrayOfUInt8.go +++ b/pkg/fbs/comm/datalayer/ArrayOfUInt8.go @@ -7,7 +7,7 @@ import ( ) type ArrayOfUInt8T struct { - Value []byte + Value []byte `json:"value"` } func (t *ArrayOfUInt8T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/Bool8.go b/pkg/fbs/comm/datalayer/Bool8.go index a462f78..5e20e09 100644 --- a/pkg/fbs/comm/datalayer/Bool8.go +++ b/pkg/fbs/comm/datalayer/Bool8.go @@ -7,7 +7,7 @@ import ( ) type Bool8T struct { - Value bool + Value bool `json:"value"` } func (t *Bool8T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/ChangeEvents.go b/pkg/fbs/comm/datalayer/ChangeEvents.go index f39ac4c..5957d36 100644 --- a/pkg/fbs/comm/datalayer/ChangeEvents.go +++ b/pkg/fbs/comm/datalayer/ChangeEvents.go @@ -7,9 +7,9 @@ import ( ) type ChangeEventsT struct { - ValueChange DataChangeTrigger - BrowselistChange bool - MetadataChange bool + ValueChange DataChangeTrigger `json:"valueChange"` + BrowselistChange bool `json:"browselistChange"` + MetadataChange bool `json:"metadataChange"` } func (t *ChangeEventsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/CheckOperations.go b/pkg/fbs/comm/datalayer/CheckOperations.go index d371522..f729dee 100644 --- a/pkg/fbs/comm/datalayer/CheckOperations.go +++ b/pkg/fbs/comm/datalayer/CheckOperations.go @@ -7,14 +7,20 @@ import ( ) type CheckOperationsT struct { - Address string - Token string + Address string `json:"address"` + Token string `json:"token"` } func (t *CheckOperationsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - addressOffset := builder.CreateString(t.Address) - tokenOffset := builder.CreateString(t.Token) + addressOffset := flatbuffers.UOffsetT(0) + if t.Address != "" { + addressOffset = builder.CreateString(t.Address) + } + tokenOffset := flatbuffers.UOffsetT(0) + if t.Token != "" { + tokenOffset = builder.CreateString(t.Token) + } CheckOperationsStart(builder) CheckOperationsAddAddress(builder, addressOffset) CheckOperationsAddToken(builder, tokenOffset) diff --git a/pkg/fbs/comm/datalayer/Claim.go b/pkg/fbs/comm/datalayer/Claim.go index 6417909..a4ca4eb 100644 --- a/pkg/fbs/comm/datalayer/Claim.go +++ b/pkg/fbs/comm/datalayer/Claim.go @@ -3,18 +3,25 @@ package datalayer import ( + "bytes" flatbuffers "github.com/google/flatbuffers/go" ) type ClaimT struct { - Claim string - Value string + Claim string `json:"claim"` + Value string `json:"value"` } func (t *ClaimT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - claimOffset := builder.CreateString(t.Claim) - valueOffset := builder.CreateString(t.Value) + claimOffset := flatbuffers.UOffsetT(0) + if t.Claim != "" { + claimOffset = builder.CreateString(t.Claim) + } + valueOffset := flatbuffers.UOffsetT(0) + if t.Value != "" { + valueOffset = builder.CreateString(t.Value) + } ClaimStart(builder) ClaimAddClaim(builder, claimOffset) ClaimAddValue(builder, valueOffset) @@ -68,6 +75,38 @@ func (rcv *Claim) Claim() []byte { return nil } +func ClaimKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &Claim{} + obj2 := &Claim{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.Claim()) < string(obj2.Claim()) +} + +func (rcv *Claim) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &Claim{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.Claim(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + func (rcv *Claim) Value() []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { diff --git a/pkg/fbs/comm/datalayer/Counting.go b/pkg/fbs/comm/datalayer/Counting.go index 736f3ca..a3a87d8 100644 --- a/pkg/fbs/comm/datalayer/Counting.go +++ b/pkg/fbs/comm/datalayer/Counting.go @@ -7,7 +7,7 @@ import ( ) type CountingT struct { - CountSubscriptions bool + CountSubscriptions bool `json:"countSubscriptions"` } func (t *CountingT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/DataChangeFilter.go b/pkg/fbs/comm/datalayer/DataChangeFilter.go index 428a977..0c4e479 100644 --- a/pkg/fbs/comm/datalayer/DataChangeFilter.go +++ b/pkg/fbs/comm/datalayer/DataChangeFilter.go @@ -7,7 +7,7 @@ import ( ) type DataChangeFilterT struct { - DeadBandValue float32 + DeadBandValue float32 `json:"deadBandValue"` } func (t *DataChangeFilterT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/DebugChannel.go b/pkg/fbs/comm/datalayer/DebugChannel.go index 20b4d3d..a9d11be 100644 --- a/pkg/fbs/comm/datalayer/DebugChannel.go +++ b/pkg/fbs/comm/datalayer/DebugChannel.go @@ -7,15 +7,21 @@ import ( ) type DebugChannelT struct { - Name string - Address string - IsTrigger bool + Name string `json:"name"` + Address string `json:"address"` + IsTrigger bool `json:"isTrigger"` } func (t *DebugChannelT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - addressOffset := builder.CreateString(t.Address) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + addressOffset := flatbuffers.UOffsetT(0) + if t.Address != "" { + addressOffset = builder.CreateString(t.Address) + } DebugChannelStart(builder) DebugChannelAddName(builder, nameOffset) DebugChannelAddAddress(builder, addressOffset) diff --git a/pkg/fbs/comm/datalayer/DiagMoreInfo.go b/pkg/fbs/comm/datalayer/DiagMoreInfo.go index d0b5d8c..a6b1546 100644 --- a/pkg/fbs/comm/datalayer/DiagMoreInfo.go +++ b/pkg/fbs/comm/datalayer/DiagMoreInfo.go @@ -3,18 +3,25 @@ package datalayer import ( + "bytes" flatbuffers "github.com/google/flatbuffers/go" ) type DiagMoreInfoT struct { - Key string - Value string + Key string `json:"key"` + Value string `json:"value"` } func (t *DiagMoreInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - keyOffset := builder.CreateString(t.Key) - valueOffset := builder.CreateString(t.Value) + keyOffset := flatbuffers.UOffsetT(0) + if t.Key != "" { + keyOffset = builder.CreateString(t.Key) + } + valueOffset := flatbuffers.UOffsetT(0) + if t.Value != "" { + valueOffset = builder.CreateString(t.Value) + } DiagMoreInfoStart(builder) DiagMoreInfoAddKey(builder, keyOffset) DiagMoreInfoAddValue(builder, valueOffset) @@ -74,6 +81,38 @@ func (rcv *DiagMoreInfo) Key() []byte { /// defined key /// "requiredLicenses": list of required licences seperated by "," /// "requiredScopes": list of required scopes seperated by "," +func DiagMoreInfoKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &DiagMoreInfo{} + obj2 := &DiagMoreInfo{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.Key()) < string(obj2.Key()) +} + +func (rcv *DiagMoreInfo) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &DiagMoreInfo{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.Key(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + /// corresponding value func (rcv *DiagMoreInfo) Value() []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) diff --git a/pkg/fbs/comm/datalayer/Diagnosis.go b/pkg/fbs/comm/datalayer/Diagnosis.go index 165e8bc..e1144a1 100644 --- a/pkg/fbs/comm/datalayer/Diagnosis.go +++ b/pkg/fbs/comm/datalayer/Diagnosis.go @@ -7,18 +7,24 @@ import ( ) type DiagnosisT struct { - MainDiagnosisCode uint32 - DetailedDiagnosisCode uint32 - DynamicDescription string - Entity string - MoreInfo []*DiagMoreInfoT - Cause []*DiagnosisT + MainDiagnosisCode uint32 `json:"mainDiagnosisCode"` + DetailedDiagnosisCode uint32 `json:"detailedDiagnosisCode"` + DynamicDescription string `json:"dynamicDescription"` + Entity string `json:"entity"` + MoreInfo []*DiagMoreInfoT `json:"moreInfo"` + Cause []*DiagnosisT `json:"cause"` } func (t *DiagnosisT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - dynamicDescriptionOffset := builder.CreateString(t.DynamicDescription) - entityOffset := builder.CreateString(t.Entity) + dynamicDescriptionOffset := flatbuffers.UOffsetT(0) + if t.DynamicDescription != "" { + dynamicDescriptionOffset = builder.CreateString(t.DynamicDescription) + } + entityOffset := flatbuffers.UOffsetT(0) + if t.Entity != "" { + entityOffset = builder.CreateString(t.Entity) + } moreInfoOffset := flatbuffers.UOffsetT(0) if t.MoreInfo != nil { moreInfoLength := len(t.MoreInfo) @@ -171,6 +177,15 @@ func (rcv *Diagnosis) MoreInfo(obj *DiagMoreInfo, j int) bool { return false } +func (rcv *Diagnosis) MoreInfoByKey(obj *DiagMoreInfo, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *Diagnosis) MoreInfoLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) if o != 0 { diff --git a/pkg/fbs/comm/datalayer/Double.go b/pkg/fbs/comm/datalayer/Double.go index 0e4045c..1bd5449 100644 --- a/pkg/fbs/comm/datalayer/Double.go +++ b/pkg/fbs/comm/datalayer/Double.go @@ -7,7 +7,7 @@ import ( ) type DoubleT struct { - Value float64 + Value float64 `json:"value"` } func (t *DoubleT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/Extension.go b/pkg/fbs/comm/datalayer/Extension.go index 53e3f78..efc8c71 100644 --- a/pkg/fbs/comm/datalayer/Extension.go +++ b/pkg/fbs/comm/datalayer/Extension.go @@ -3,18 +3,25 @@ package datalayer import ( + "bytes" flatbuffers "github.com/google/flatbuffers/go" ) type ExtensionT struct { - Key string - Value string + Key string `json:"key"` + Value string `json:"value"` } func (t *ExtensionT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - keyOffset := builder.CreateString(t.Key) - valueOffset := builder.CreateString(t.Value) + keyOffset := flatbuffers.UOffsetT(0) + if t.Key != "" { + keyOffset = builder.CreateString(t.Key) + } + valueOffset := flatbuffers.UOffsetT(0) + if t.Value != "" { + valueOffset = builder.CreateString(t.Value) + } ExtensionStart(builder) ExtensionAddKey(builder, keyOffset) ExtensionAddValue(builder, valueOffset) @@ -68,6 +75,38 @@ func (rcv *Extension) Key() []byte { return nil } +func ExtensionKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &Extension{} + obj2 := &Extension{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.Key()) < string(obj2.Key()) +} + +func (rcv *Extension) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &Extension{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.Key(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + func (rcv *Extension) Value() []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { diff --git a/pkg/fbs/comm/datalayer/FactoryStats.go b/pkg/fbs/comm/datalayer/FactoryStats.go index f5f301c..01bd3c5 100644 --- a/pkg/fbs/comm/datalayer/FactoryStats.go +++ b/pkg/fbs/comm/datalayer/FactoryStats.go @@ -7,10 +7,10 @@ import ( ) type FactoryStatsT struct { - NumClients uint32 - NumProviders uint32 - OpenClientRequests uint32 - OpenProviderRequests uint32 + NumClients uint32 `json:"numClients"` + NumProviders uint32 `json:"numProviders"` + OpenClientRequests uint32 `json:"openClientRequests"` + OpenProviderRequests uint32 `json:"openProviderRequests"` } func (t *FactoryStatsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/Float32.go b/pkg/fbs/comm/datalayer/Float32.go index 6cc17cd..5fe9094 100644 --- a/pkg/fbs/comm/datalayer/Float32.go +++ b/pkg/fbs/comm/datalayer/Float32.go @@ -7,7 +7,7 @@ import ( ) type Float32T struct { - Value float32 + Value float32 `json:"value"` } func (t *Float32T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/Float64.go b/pkg/fbs/comm/datalayer/Float64.go index e21878e..5aaedf3 100644 --- a/pkg/fbs/comm/datalayer/Float64.go +++ b/pkg/fbs/comm/datalayer/Float64.go @@ -7,7 +7,7 @@ import ( ) type Float64T struct { - Value float64 + Value float64 `json:"value"` } func (t *Float64T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/Int16.go b/pkg/fbs/comm/datalayer/Int16.go index 7f4e9bf..0f5d48d 100644 --- a/pkg/fbs/comm/datalayer/Int16.go +++ b/pkg/fbs/comm/datalayer/Int16.go @@ -7,7 +7,7 @@ import ( ) type Int16T struct { - Value int16 + Value int16 `json:"value"` } func (t *Int16T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/Int32.go b/pkg/fbs/comm/datalayer/Int32.go index d1de6bf..451c91a 100644 --- a/pkg/fbs/comm/datalayer/Int32.go +++ b/pkg/fbs/comm/datalayer/Int32.go @@ -7,7 +7,7 @@ import ( ) type Int32T struct { - Value int32 + Value int32 `json:"value"` } func (t *Int32T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/Int64.go b/pkg/fbs/comm/datalayer/Int64.go index 4ea0468..e68220e 100644 --- a/pkg/fbs/comm/datalayer/Int64.go +++ b/pkg/fbs/comm/datalayer/Int64.go @@ -7,7 +7,7 @@ import ( ) type Int64T struct { - Value int64 + Value int64 `json:"value"` } func (t *Int64T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/Int8.go b/pkg/fbs/comm/datalayer/Int8.go index c8250ba..ec36ecf 100644 --- a/pkg/fbs/comm/datalayer/Int8.go +++ b/pkg/fbs/comm/datalayer/Int8.go @@ -7,7 +7,7 @@ import ( ) type Int8T struct { - Value int8 + Value int8 `json:"value"` } func (t *Int8T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/LocaleText.go b/pkg/fbs/comm/datalayer/LocaleText.go index 9c5418d..3987ad7 100644 --- a/pkg/fbs/comm/datalayer/LocaleText.go +++ b/pkg/fbs/comm/datalayer/LocaleText.go @@ -3,18 +3,25 @@ package datalayer import ( + "bytes" flatbuffers "github.com/google/flatbuffers/go" ) type LocaleTextT struct { - Id string - Text string + Id string `json:"id"` + Text string `json:"text"` } func (t *LocaleTextT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - idOffset := builder.CreateString(t.Id) - textOffset := builder.CreateString(t.Text) + idOffset := flatbuffers.UOffsetT(0) + if t.Id != "" { + idOffset = builder.CreateString(t.Id) + } + textOffset := flatbuffers.UOffsetT(0) + if t.Text != "" { + textOffset = builder.CreateString(t.Text) + } LocaleTextStart(builder) LocaleTextAddId(builder, idOffset) LocaleTextAddText(builder, textOffset) @@ -70,6 +77,38 @@ func (rcv *LocaleText) Id() []byte { } /// iso 639.1 +func LocaleTextKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &LocaleText{} + obj2 := &LocaleText{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.Id()) < string(obj2.Id()) +} + +func (rcv *LocaleText) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &LocaleText{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.Id(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + func (rcv *LocaleText) Text() []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { diff --git a/pkg/fbs/comm/datalayer/Memory.go b/pkg/fbs/comm/datalayer/Memory.go index 8990c5b..be683a8 100644 --- a/pkg/fbs/comm/datalayer/Memory.go +++ b/pkg/fbs/comm/datalayer/Memory.go @@ -7,15 +7,18 @@ import ( ) type MemoryT struct { - Type MemoryType - Id string - SizeBytes uint32 - AccessType AccessType + Type MemoryType `json:"type"` + Id string `json:"id"` + SizeBytes uint32 `json:"sizeBytes"` + AccessType AccessType `json:"accessType"` } func (t *MemoryT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - idOffset := builder.CreateString(t.Id) + idOffset := flatbuffers.UOffsetT(0) + if t.Id != "" { + idOffset = builder.CreateString(t.Id) + } MemoryStart(builder) MemoryAddType(builder, t.Type) MemoryAddId(builder, idOffset) diff --git a/pkg/fbs/comm/datalayer/MemoryMap.go b/pkg/fbs/comm/datalayer/MemoryMap.go index b7503ff..a5121d7 100644 --- a/pkg/fbs/comm/datalayer/MemoryMap.go +++ b/pkg/fbs/comm/datalayer/MemoryMap.go @@ -7,9 +7,9 @@ import ( ) type MemoryMapT struct { - Variables []*VariableT - Revision uint32 - DisableInputImage bool + Variables []*VariableT `json:"variables"` + Revision uint32 `json:"revision"` + DisableInputImage bool `json:"disableInputImage"` } func (t *MemoryMapT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -93,6 +93,15 @@ func (rcv *MemoryMap) Variables(obj *Variable, j int) bool { return false } +func (rcv *MemoryMap) VariablesByKey(obj *Variable, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *MemoryMap) VariablesLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) if o != 0 { diff --git a/pkg/fbs/comm/datalayer/MemoryType.go b/pkg/fbs/comm/datalayer/MemoryType.go index a95fca5..94a7de0 100644 --- a/pkg/fbs/comm/datalayer/MemoryType.go +++ b/pkg/fbs/comm/datalayer/MemoryType.go @@ -7,31 +7,39 @@ import "strconv" type MemoryType int8 const ( - MemoryTypeUnknown MemoryType = 0 + MemoryTypeUnknown MemoryType = 0 /// data flow from owner to user - MemoryTypeInput MemoryType = 1 + MemoryTypeInput MemoryType = 1 /// data flow from user to owner - MemoryTypeOutput MemoryType = 2 + MemoryTypeOutput MemoryType = 2 /// shared ram in retain area - MemoryTypeSharedRetain MemoryType = 3 + MemoryTypeSharedRetain MemoryType = 3 /// shared ram - MemoryTypeShared MemoryType = 4 + MemoryTypeShared MemoryType = 4 + /// trigger input + MemoryTypeTriggerInput MemoryType = 5 + /// trigger output + MemoryTypeTriggerOutput MemoryType = 6 ) var EnumNamesMemoryType = map[MemoryType]string{ - MemoryTypeUnknown: "Unknown", - MemoryTypeInput: "Input", - MemoryTypeOutput: "Output", - MemoryTypeSharedRetain: "SharedRetain", - MemoryTypeShared: "Shared", + MemoryTypeUnknown: "Unknown", + MemoryTypeInput: "Input", + MemoryTypeOutput: "Output", + MemoryTypeSharedRetain: "SharedRetain", + MemoryTypeShared: "Shared", + MemoryTypeTriggerInput: "TriggerInput", + MemoryTypeTriggerOutput: "TriggerOutput", } var EnumValuesMemoryType = map[string]MemoryType{ - "Unknown": MemoryTypeUnknown, - "Input": MemoryTypeInput, - "Output": MemoryTypeOutput, - "SharedRetain": MemoryTypeSharedRetain, - "Shared": MemoryTypeShared, + "Unknown": MemoryTypeUnknown, + "Input": MemoryTypeInput, + "Output": MemoryTypeOutput, + "SharedRetain": MemoryTypeSharedRetain, + "Shared": MemoryTypeShared, + "TriggerInput": MemoryTypeTriggerInput, + "TriggerOutput": MemoryTypeTriggerOutput, } func (v MemoryType) String() string { diff --git a/pkg/fbs/comm/datalayer/MessageDetail.go b/pkg/fbs/comm/datalayer/MessageDetail.go index 8340819..ea63b61 100644 --- a/pkg/fbs/comm/datalayer/MessageDetail.go +++ b/pkg/fbs/comm/datalayer/MessageDetail.go @@ -7,7 +7,7 @@ import ( ) type MessageDetailT struct { - Timestamp uint64 + Timestamp uint64 `json:"timestamp"` } func (t *MessageDetailT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/Metadata.go b/pkg/fbs/comm/datalayer/Metadata.go index 9c039f7..4fac5fe 100644 --- a/pkg/fbs/comm/datalayer/Metadata.go +++ b/pkg/fbs/comm/datalayer/Metadata.go @@ -7,26 +7,38 @@ import ( ) type MetadataT struct { - NodeClass NodeClass - Operations *AllowedOperationsT - Description string - DescriptionUrl string - DisplayName string - DisplayFormat DisplayFormat - Unit string - Extensions []*ExtensionT - References []*ReferenceT - Descriptions []*LocaleTextT - DisplayNames []*LocaleTextT + NodeClass NodeClass `json:"nodeClass"` + Operations *AllowedOperationsT `json:"operations"` + Description string `json:"description"` + DescriptionUrl string `json:"descriptionUrl"` + DisplayName string `json:"displayName"` + DisplayFormat DisplayFormat `json:"displayFormat"` + Unit string `json:"unit"` + Extensions []*ExtensionT `json:"extensions"` + References []*ReferenceT `json:"references"` + Descriptions []*LocaleTextT `json:"descriptions"` + DisplayNames []*LocaleTextT `json:"displayNames"` } func (t *MetadataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } operationsOffset := t.Operations.Pack(builder) - descriptionOffset := builder.CreateString(t.Description) - descriptionUrlOffset := builder.CreateString(t.DescriptionUrl) - displayNameOffset := builder.CreateString(t.DisplayName) - unitOffset := builder.CreateString(t.Unit) + descriptionOffset := flatbuffers.UOffsetT(0) + if t.Description != "" { + descriptionOffset = builder.CreateString(t.Description) + } + descriptionUrlOffset := flatbuffers.UOffsetT(0) + if t.DescriptionUrl != "" { + descriptionUrlOffset = builder.CreateString(t.DescriptionUrl) + } + displayNameOffset := flatbuffers.UOffsetT(0) + if t.DisplayName != "" { + displayNameOffset = builder.CreateString(t.DisplayName) + } + unitOffset := flatbuffers.UOffsetT(0) + if t.Unit != "" { + unitOffset = builder.CreateString(t.Unit) + } extensionsOffset := flatbuffers.UOffsetT(0) if t.Extensions != nil { extensionsLength := len(t.Extensions) @@ -251,6 +263,15 @@ func (rcv *Metadata) Extensions(obj *Extension, j int) bool { return false } +func (rcv *Metadata) ExtensionsByKey(obj *Extension, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(18)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *Metadata) ExtensionsLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(18)) if o != 0 { @@ -271,6 +292,15 @@ func (rcv *Metadata) References(obj *Reference, j int) bool { return false } +func (rcv *Metadata) ReferencesByKey(obj *Reference, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(20)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *Metadata) ReferencesLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(20)) if o != 0 { @@ -291,6 +321,15 @@ func (rcv *Metadata) Descriptions(obj *LocaleText, j int) bool { return false } +func (rcv *Metadata) DescriptionsByKey(obj *LocaleText, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(22)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *Metadata) DescriptionsLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(22)) if o != 0 { @@ -311,6 +350,15 @@ func (rcv *Metadata) DisplayNames(obj *LocaleText, j int) bool { return false } +func (rcv *Metadata) DisplayNamesByKey(obj *LocaleText, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(24)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *Metadata) DisplayNamesLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(24)) if o != 0 { diff --git a/pkg/fbs/comm/datalayer/MetadataDB.go b/pkg/fbs/comm/datalayer/MetadataDB.go index 7face3e..09be746 100644 --- a/pkg/fbs/comm/datalayer/MetadataDB.go +++ b/pkg/fbs/comm/datalayer/MetadataDB.go @@ -3,19 +3,23 @@ package datalayer import ( + "bytes" flatbuffers "github.com/google/flatbuffers/go" ) type MetadataDBT struct { - Address string - Childs []*MetadataDBT - Asterisk *MetadataDBT - Metadata *MetadataT + Address string `json:"address"` + Childs []*MetadataDBT `json:"childs"` + Asterisk *MetadataDBT `json:"asterisk"` + Metadata *MetadataT `json:"metadata"` } func (t *MetadataDBT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - addressOffset := builder.CreateString(t.Address) + addressOffset := flatbuffers.UOffsetT(0) + if t.Address != "" { + addressOffset = builder.CreateString(t.Address) + } childsOffset := flatbuffers.UOffsetT(0) if t.Childs != nil { childsLength := len(t.Childs) @@ -94,6 +98,38 @@ func (rcv *MetadataDB) Address() []byte { return nil } +func MetadataDBKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &MetadataDB{} + obj2 := &MetadataDB{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.Address()) < string(obj2.Address()) +} + +func (rcv *MetadataDB) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &MetadataDB{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.Address(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + func (rcv *MetadataDB) Childs(obj *MetadataDB, j int) bool { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { @@ -106,6 +142,15 @@ func (rcv *MetadataDB) Childs(obj *MetadataDB, j int) bool { return false } +func (rcv *MetadataDB) ChildsByKey(obj *MetadataDB, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *MetadataDB) ChildsLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { diff --git a/pkg/fbs/comm/datalayer/NTelBufferConfig.go b/pkg/fbs/comm/datalayer/NTelBufferConfig.go index 0fd20f3..5069cfe 100644 --- a/pkg/fbs/comm/datalayer/NTelBufferConfig.go +++ b/pkg/fbs/comm/datalayer/NTelBufferConfig.go @@ -7,7 +7,7 @@ import ( ) type NTelBufferConfigT struct { - DefaultN uint16 + DefaultN uint16 `json:"defaultN"` } func (t *NTelBufferConfigT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/NotifyInfo.go b/pkg/fbs/comm/datalayer/NotifyInfo.go index d6abdc9..1ce1d4e 100644 --- a/pkg/fbs/comm/datalayer/NotifyInfo.go +++ b/pkg/fbs/comm/datalayer/NotifyInfo.go @@ -7,14 +7,17 @@ import ( ) type NotifyInfoT struct { - Node string - Timestamp uint64 - NotifyType NotifyType + Node string `json:"node"` + Timestamp uint64 `json:"timestamp"` + NotifyType NotifyType `json:"notifyType"` } func (t *NotifyInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nodeOffset := builder.CreateString(t.Node) + nodeOffset := flatbuffers.UOffsetT(0) + if t.Node != "" { + nodeOffset = builder.CreateString(t.Node) + } NotifyInfoStart(builder) NotifyInfoAddNode(builder, nodeOffset) NotifyInfoAddTimestamp(builder, t.Timestamp) diff --git a/pkg/fbs/comm/datalayer/NotifyType.go b/pkg/fbs/comm/datalayer/NotifyType.go index 8f5eda5..d5bf9cf 100644 --- a/pkg/fbs/comm/datalayer/NotifyType.go +++ b/pkg/fbs/comm/datalayer/NotifyType.go @@ -11,6 +11,7 @@ const ( NotifyTypeBrowse NotifyType = 1 NotifyTypeMetadata NotifyType = 2 NotifyTypeKeepalive NotifyType = 3 + NotifyTypeType NotifyType = 4 ) var EnumNamesNotifyType = map[NotifyType]string{ @@ -18,6 +19,7 @@ var EnumNamesNotifyType = map[NotifyType]string{ NotifyTypeBrowse: "Browse", NotifyTypeMetadata: "Metadata", NotifyTypeKeepalive: "Keepalive", + NotifyTypeType: "Type", } var EnumValuesNotifyType = map[string]NotifyType{ @@ -25,6 +27,7 @@ var EnumValuesNotifyType = map[string]NotifyType{ "Browse": NotifyTypeBrowse, "Metadata": NotifyTypeMetadata, "Keepalive": NotifyTypeKeepalive, + "Type": NotifyTypeType, } func (v NotifyType) String() string { diff --git a/pkg/fbs/comm/datalayer/PersistenceParam.go b/pkg/fbs/comm/datalayer/PersistenceParam.go index 9e044c8..ff6d852 100644 --- a/pkg/fbs/comm/datalayer/PersistenceParam.go +++ b/pkg/fbs/comm/datalayer/PersistenceParam.go @@ -10,16 +10,25 @@ import ( /// the type inforamtion of this flatbuffer is provided under "types/datalayer/persistence-param" /// at implementation of "onMetadata()" return this path as create type reference type PersistenceParamT struct { - ConfigurationPath string - Id string - Phase string + ConfigurationPath string `json:"configurationPath"` + Id string `json:"id"` + Phase string `json:"phase"` } func (t *PersistenceParamT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - configurationPathOffset := builder.CreateString(t.ConfigurationPath) - idOffset := builder.CreateString(t.Id) - phaseOffset := builder.CreateString(t.Phase) + configurationPathOffset := flatbuffers.UOffsetT(0) + if t.ConfigurationPath != "" { + configurationPathOffset = builder.CreateString(t.ConfigurationPath) + } + idOffset := flatbuffers.UOffsetT(0) + if t.Id != "" { + idOffset = builder.CreateString(t.Id) + } + phaseOffset := flatbuffers.UOffsetT(0) + if t.Phase != "" { + phaseOffset = builder.CreateString(t.Phase) + } PersistenceParamStart(builder) PersistenceParamAddConfigurationPath(builder, configurationPathOffset) PersistenceParamAddId(builder, idOffset) diff --git a/pkg/fbs/comm/datalayer/Problem.go b/pkg/fbs/comm/datalayer/Problem.go index ff3e020..f20c653 100644 --- a/pkg/fbs/comm/datalayer/Problem.go +++ b/pkg/fbs/comm/datalayer/Problem.go @@ -7,30 +7,51 @@ import ( ) type ProblemT struct { - Type string - Title string - Status int32 - Detail string - Instance string - MainDiagnosisCode string - DetailedDiagnosisCode string - DynamicDescription string - Severity Severity - Links []string - Entity string - MoreInfo []byte - Cause []*ProblemT + Type string `json:"type"` + Title string `json:"title"` + Status int32 `json:"status"` + Detail string `json:"detail"` + Instance string `json:"instance"` + MainDiagnosisCode string `json:"mainDiagnosisCode"` + DetailedDiagnosisCode string `json:"detailedDiagnosisCode"` + DynamicDescription string `json:"dynamicDescription"` + Severity Severity `json:"severity"` + Links []string `json:"links"` + Entity string `json:"entity"` + MoreInfo []byte `json:"moreInfo"` + Cause []*ProblemT `json:"cause"` } func (t *ProblemT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - typeOffset := builder.CreateString(t.Type) - titleOffset := builder.CreateString(t.Title) - detailOffset := builder.CreateString(t.Detail) - instanceOffset := builder.CreateString(t.Instance) - mainDiagnosisCodeOffset := builder.CreateString(t.MainDiagnosisCode) - detailedDiagnosisCodeOffset := builder.CreateString(t.DetailedDiagnosisCode) - dynamicDescriptionOffset := builder.CreateString(t.DynamicDescription) + type_Offset := flatbuffers.UOffsetT(0) + if t.Type != "" { + type_Offset = builder.CreateString(t.Type) + } + titleOffset := flatbuffers.UOffsetT(0) + if t.Title != "" { + titleOffset = builder.CreateString(t.Title) + } + detailOffset := flatbuffers.UOffsetT(0) + if t.Detail != "" { + detailOffset = builder.CreateString(t.Detail) + } + instanceOffset := flatbuffers.UOffsetT(0) + if t.Instance != "" { + instanceOffset = builder.CreateString(t.Instance) + } + mainDiagnosisCodeOffset := flatbuffers.UOffsetT(0) + if t.MainDiagnosisCode != "" { + mainDiagnosisCodeOffset = builder.CreateString(t.MainDiagnosisCode) + } + detailedDiagnosisCodeOffset := flatbuffers.UOffsetT(0) + if t.DetailedDiagnosisCode != "" { + detailedDiagnosisCodeOffset = builder.CreateString(t.DetailedDiagnosisCode) + } + dynamicDescriptionOffset := flatbuffers.UOffsetT(0) + if t.DynamicDescription != "" { + dynamicDescriptionOffset = builder.CreateString(t.DynamicDescription) + } linksOffset := flatbuffers.UOffsetT(0) if t.Links != nil { linksLength := len(t.Links) @@ -44,7 +65,10 @@ func (t *ProblemT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { } linksOffset = builder.EndVector(linksLength) } - entityOffset := builder.CreateString(t.Entity) + entityOffset := flatbuffers.UOffsetT(0) + if t.Entity != "" { + entityOffset = builder.CreateString(t.Entity) + } moreInfoOffset := flatbuffers.UOffsetT(0) if t.MoreInfo != nil { moreInfoOffset = builder.CreateByteString(t.MoreInfo) @@ -63,7 +87,7 @@ func (t *ProblemT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { causeOffset = builder.EndVector(causeLength) } ProblemStart(builder) - ProblemAddType(builder, typeOffset) + ProblemAddType(builder, type_Offset) ProblemAddTitle(builder, titleOffset) ProblemAddStatus(builder, t.Status) ProblemAddDetail(builder, detailOffset) diff --git a/pkg/fbs/comm/datalayer/ProgramTask.go b/pkg/fbs/comm/datalayer/ProgramTask.go index 3cf40e1..4fe3cf3 100644 --- a/pkg/fbs/comm/datalayer/ProgramTask.go +++ b/pkg/fbs/comm/datalayer/ProgramTask.go @@ -3,28 +3,50 @@ package datalayer import ( + "bytes" flatbuffers "github.com/google/flatbuffers/go" ) type ProgramTaskT struct { - Id string - State ProgramTaskState - Progress uint32 - Result *DiagnosisT - ProgressInfo string + Id string `json:"id"` + State ProgramTaskState `json:"state"` + Progress uint32 `json:"progress"` + Result *DiagnosisT `json:"result"` + ProgressInfo string `json:"progressInfo"` + ProgressData []*ProgressDataT `json:"progressData"` } func (t *ProgramTaskT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - idOffset := builder.CreateString(t.Id) + idOffset := flatbuffers.UOffsetT(0) + if t.Id != "" { + idOffset = builder.CreateString(t.Id) + } resultOffset := t.Result.Pack(builder) - progressInfoOffset := builder.CreateString(t.ProgressInfo) + progressInfoOffset := flatbuffers.UOffsetT(0) + if t.ProgressInfo != "" { + progressInfoOffset = builder.CreateString(t.ProgressInfo) + } + progressDataOffset := flatbuffers.UOffsetT(0) + if t.ProgressData != nil { + progressDataLength := len(t.ProgressData) + progressDataOffsets := make([]flatbuffers.UOffsetT, progressDataLength) + for j := 0; j < progressDataLength; j++ { + progressDataOffsets[j] = t.ProgressData[j].Pack(builder) + } + ProgramTaskStartProgressDataVector(builder, progressDataLength) + for j := progressDataLength - 1; j >= 0; j-- { + builder.PrependUOffsetT(progressDataOffsets[j]) + } + progressDataOffset = builder.EndVector(progressDataLength) + } ProgramTaskStart(builder) ProgramTaskAddId(builder, idOffset) ProgramTaskAddState(builder, t.State) ProgramTaskAddProgress(builder, t.Progress) ProgramTaskAddResult(builder, resultOffset) ProgramTaskAddProgressInfo(builder, progressInfoOffset) + ProgramTaskAddProgressData(builder, progressDataOffset) return ProgramTaskEnd(builder) } @@ -34,6 +56,13 @@ func (rcv *ProgramTask) UnPackTo(t *ProgramTaskT) { t.Progress = rcv.Progress() t.Result = rcv.Result(nil).UnPack() t.ProgressInfo = string(rcv.ProgressInfo()) + progressDataLength := rcv.ProgressDataLength() + t.ProgressData = make([]*ProgressDataT, progressDataLength) + for j := 0; j < progressDataLength; j++ { + x := ProgressData{} + rcv.ProgressData(&x, j) + t.ProgressData[j] = x.UnPack() + } } func (rcv *ProgramTask) UnPack() *ProgramTaskT { @@ -80,6 +109,38 @@ func (rcv *ProgramTask) Id() []byte { } /// id of the task +func ProgramTaskKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &ProgramTask{} + obj2 := &ProgramTask{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.Id()) < string(obj2.Id()) +} + +func (rcv *ProgramTask) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &ProgramTask{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.Id(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + /// state of the task func (rcv *ProgramTask) State() ProgramTaskState { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) @@ -133,8 +194,39 @@ func (rcv *ProgramTask) ProgressInfo() []byte { } /// Additional progress information +/// Additional progress information as key value pair +func (rcv *ProgramTask) ProgressData(obj *ProgressData, j int) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) + if o != 0 { + x := rcv._tab.Vector(o) + x += flatbuffers.UOffsetT(j) * 4 + x = rcv._tab.Indirect(x) + obj.Init(rcv._tab.Bytes, x) + return true + } + return false +} + +func (rcv *ProgramTask) ProgressDataByKey(obj *ProgressData, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + +func (rcv *ProgramTask) ProgressDataLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +/// Additional progress information as key value pair func ProgramTaskStart(builder *flatbuffers.Builder) { - builder.StartObject(5) + builder.StartObject(6) } func ProgramTaskAddId(builder *flatbuffers.Builder, id flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(id), 0) @@ -151,6 +243,12 @@ func ProgramTaskAddResult(builder *flatbuffers.Builder, result flatbuffers.UOffs func ProgramTaskAddProgressInfo(builder *flatbuffers.Builder, progressInfo flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(4, flatbuffers.UOffsetT(progressInfo), 0) } +func ProgramTaskAddProgressData(builder *flatbuffers.Builder, progressData flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(5, flatbuffers.UOffsetT(progressData), 0) +} +func ProgramTaskStartProgressDataVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} func ProgramTaskEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() } diff --git a/pkg/fbs/comm/datalayer/ProgramTaskAll.go b/pkg/fbs/comm/datalayer/ProgramTaskAll.go index e7a0fe7..f5b0fa4 100644 --- a/pkg/fbs/comm/datalayer/ProgramTaskAll.go +++ b/pkg/fbs/comm/datalayer/ProgramTaskAll.go @@ -7,33 +7,33 @@ import ( ) type ProgramTaskAllT struct { - Tasks []*ProgramTaskT + Tasks []*ProgramTaskT `json:"Tasks"` } func (t *ProgramTaskAllT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - TasksOffset := flatbuffers.UOffsetT(0) + tasksOffset := flatbuffers.UOffsetT(0) if t.Tasks != nil { - TasksLength := len(t.Tasks) - TasksOffsets := make([]flatbuffers.UOffsetT, TasksLength) - for j := 0; j < TasksLength; j++ { - TasksOffsets[j] = t.Tasks[j].Pack(builder) + tasksLength := len(t.Tasks) + tasksOffsets := make([]flatbuffers.UOffsetT, tasksLength) + for j := 0; j < tasksLength; j++ { + tasksOffsets[j] = t.Tasks[j].Pack(builder) } - ProgramTaskAllStartTasksVector(builder, TasksLength) - for j := TasksLength - 1; j >= 0; j-- { - builder.PrependUOffsetT(TasksOffsets[j]) + ProgramTaskAllStartTasksVector(builder, tasksLength) + for j := tasksLength - 1; j >= 0; j-- { + builder.PrependUOffsetT(tasksOffsets[j]) } - TasksOffset = builder.EndVector(TasksLength) + tasksOffset = builder.EndVector(tasksLength) } ProgramTaskAllStart(builder) - ProgramTaskAllAddTasks(builder, TasksOffset) + ProgramTaskAllAddTasks(builder, tasksOffset) return ProgramTaskAllEnd(builder) } func (rcv *ProgramTaskAll) UnPackTo(t *ProgramTaskAllT) { - TasksLength := rcv.TasksLength() - t.Tasks = make([]*ProgramTaskT, TasksLength) - for j := 0; j < TasksLength; j++ { + tasksLength := rcv.TasksLength() + t.Tasks = make([]*ProgramTaskT, tasksLength) + for j := 0; j < tasksLength; j++ { x := ProgramTask{} rcv.Tasks(&x, j) t.Tasks[j] = x.UnPack() @@ -86,6 +86,15 @@ func (rcv *ProgramTaskAll) Tasks(obj *ProgramTask, j int) bool { return false } +func (rcv *ProgramTaskAll) TasksByKey(obj *ProgramTask, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *ProgramTaskAll) TasksLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) if o != 0 { @@ -97,8 +106,8 @@ func (rcv *ProgramTaskAll) TasksLength() int { func ProgramTaskAllStart(builder *flatbuffers.Builder) { builder.StartObject(1) } -func ProgramTaskAllAddTasks(builder *flatbuffers.Builder, Tasks flatbuffers.UOffsetT) { - builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(Tasks), 0) +func ProgramTaskAllAddTasks(builder *flatbuffers.Builder, tasks flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(tasks), 0) } func ProgramTaskAllStartTasksVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { return builder.StartVector(4, numElems, 4) diff --git a/pkg/fbs/comm/datalayer/Queueing.go b/pkg/fbs/comm/datalayer/Queueing.go index 1c940a9..9d0a2e7 100644 --- a/pkg/fbs/comm/datalayer/Queueing.go +++ b/pkg/fbs/comm/datalayer/Queueing.go @@ -7,8 +7,8 @@ import ( ) type QueueingT struct { - QueueSize uint32 - Behaviour QueueBehaviour + QueueSize uint32 `json:"queueSize"` + Behaviour QueueBehaviour `json:"behaviour"` } func (t *QueueingT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/Raw.go b/pkg/fbs/comm/datalayer/Raw.go index 5f891a8..b70c1b1 100644 --- a/pkg/fbs/comm/datalayer/Raw.go +++ b/pkg/fbs/comm/datalayer/Raw.go @@ -7,7 +7,7 @@ import ( ) type RawT struct { - Value []int8 + Value []int8 `json:"value"` } func (t *RawT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/RealtimeConfig.go b/pkg/fbs/comm/datalayer/RealtimeConfig.go index 47e229e..e70ce39 100644 --- a/pkg/fbs/comm/datalayer/RealtimeConfig.go +++ b/pkg/fbs/comm/datalayer/RealtimeConfig.go @@ -8,8 +8,8 @@ import ( /// configuration of realtime input buffer system type RealtimeConfigT struct { - DefaultInputAcessType AccessType - NTelBufConfig *NTelBufferConfigT + DefaultInputAcessType AccessType `json:"defaultInputAcessType"` + NTelBufConfig *NTelBufferConfigT `json:"nTelBufConfig"` } func (t *RealtimeConfigT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/Reference.go b/pkg/fbs/comm/datalayer/Reference.go index 5cc867e..665b193 100644 --- a/pkg/fbs/comm/datalayer/Reference.go +++ b/pkg/fbs/comm/datalayer/Reference.go @@ -3,20 +3,27 @@ package datalayer import ( + "bytes" flatbuffers "github.com/google/flatbuffers/go" ) type ReferenceT struct { - Type string - TargetAddress string + Type string `json:"type"` + TargetAddress string `json:"targetAddress"` } func (t *ReferenceT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - typeOffset := builder.CreateString(t.Type) - targetAddressOffset := builder.CreateString(t.TargetAddress) + type_Offset := flatbuffers.UOffsetT(0) + if t.Type != "" { + type_Offset = builder.CreateString(t.Type) + } + targetAddressOffset := flatbuffers.UOffsetT(0) + if t.TargetAddress != "" { + targetAddressOffset = builder.CreateString(t.TargetAddress) + } ReferenceStart(builder) - ReferenceAddType(builder, typeOffset) + ReferenceAddType(builder, type_Offset) ReferenceAddTargetAddress(builder, targetAddressOffset) return ReferenceEnd(builder) } @@ -70,6 +77,38 @@ func (rcv *Reference) Type() []byte { } /// nodeid of type "readType", "writeType", "createType", ... +func ReferenceKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &Reference{} + obj2 := &Reference{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.Type()) < string(obj2.Type()) +} + +func (rcv *Reference) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &Reference{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.Type(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + /// full qualified address of target func (rcv *Reference) TargetAddress() []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) diff --git a/pkg/fbs/comm/datalayer/RetainStats.go b/pkg/fbs/comm/datalayer/RetainStats.go index 8109f56..db1c413 100644 --- a/pkg/fbs/comm/datalayer/RetainStats.go +++ b/pkg/fbs/comm/datalayer/RetainStats.go @@ -7,18 +7,23 @@ import ( ) type RetainStatsT struct { - Total uint32 - Free uint32 - Used uint32 - BiggestFree uint32 - SyncCounter uint32 - LastUsed uint32 - Info string + Total uint32 `json:"total"` + Free uint32 `json:"free"` + Used uint32 `json:"used"` + BiggestFree uint32 `json:"biggestFree"` + SyncCounter uint32 `json:"syncCounter"` + LastUsed uint32 `json:"lastUsed"` + Info string `json:"info"` + Diagnosis *RetainDiagnosisT `json:"diagnosis"` } func (t *RetainStatsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - infoOffset := builder.CreateString(t.Info) + infoOffset := flatbuffers.UOffsetT(0) + if t.Info != "" { + infoOffset = builder.CreateString(t.Info) + } + diagnosisOffset := t.Diagnosis.Pack(builder) RetainStatsStart(builder) RetainStatsAddTotal(builder, t.Total) RetainStatsAddFree(builder, t.Free) @@ -27,6 +32,7 @@ func (t *RetainStatsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { RetainStatsAddSyncCounter(builder, t.SyncCounter) RetainStatsAddLastUsed(builder, t.LastUsed) RetainStatsAddInfo(builder, infoOffset) + RetainStatsAddDiagnosis(builder, diagnosisOffset) return RetainStatsEnd(builder) } @@ -38,6 +44,7 @@ func (rcv *RetainStats) UnPackTo(t *RetainStatsT) { t.SyncCounter = rcv.SyncCounter() t.LastUsed = rcv.LastUsed() t.Info = string(rcv.Info()) + t.Diagnosis = rcv.Diagnosis(nil).UnPack() } func (rcv *RetainStats) UnPack() *RetainStatsT { @@ -168,8 +175,23 @@ func (rcv *RetainStats) Info() []byte { } /// debug information of shared memory +/// diagnosis of nvram +func (rcv *RetainStats) Diagnosis(obj *RetainDiagnosis) *RetainDiagnosis { + o := flatbuffers.UOffsetT(rcv._tab.Offset(18)) + if o != 0 { + x := rcv._tab.Indirect(o + rcv._tab.Pos) + if obj == nil { + obj = new(RetainDiagnosis) + } + obj.Init(rcv._tab.Bytes, x) + return obj + } + return nil +} + +/// diagnosis of nvram func RetainStatsStart(builder *flatbuffers.Builder) { - builder.StartObject(7) + builder.StartObject(8) } func RetainStatsAddTotal(builder *flatbuffers.Builder, total uint32) { builder.PrependUint32Slot(0, total, 0) @@ -192,6 +214,9 @@ func RetainStatsAddLastUsed(builder *flatbuffers.Builder, lastUsed uint32) { func RetainStatsAddInfo(builder *flatbuffers.Builder, info flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(6, flatbuffers.UOffsetT(info), 0) } +func RetainStatsAddDiagnosis(builder *flatbuffers.Builder, diagnosis flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(7, flatbuffers.UOffsetT(diagnosis), 0) +} func RetainStatsEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() } diff --git a/pkg/fbs/comm/datalayer/Sampling.go b/pkg/fbs/comm/datalayer/Sampling.go index 4b18cec..7b50432 100644 --- a/pkg/fbs/comm/datalayer/Sampling.go +++ b/pkg/fbs/comm/datalayer/Sampling.go @@ -7,7 +7,7 @@ import ( ) type SamplingT struct { - SamplingInterval uint64 + SamplingInterval uint64 `json:"samplingInterval"` } func (t *SamplingT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/Scope.go b/pkg/fbs/comm/datalayer/Scope.go index 6ecb00a..b6a18c9 100644 --- a/pkg/fbs/comm/datalayer/Scope.go +++ b/pkg/fbs/comm/datalayer/Scope.go @@ -3,24 +3,34 @@ package datalayer import ( + "bytes" flatbuffers "github.com/google/flatbuffers/go" ) type ScopeT struct { - Identifier string - Name string - Description string - PermissionsR []string - PermissionsRW []string - PermissionsX []string - PermissionsRWX []string + Identifier string `json:"identifier"` + Name string `json:"name"` + Description string `json:"description"` + PermissionsR []string `json:"permissionsR"` + PermissionsRw []string `json:"permissionsRW"` + PermissionsX []string `json:"permissionsX"` + PermissionsRwx []string `json:"permissionsRWX"` } func (t *ScopeT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - identifierOffset := builder.CreateString(t.Identifier) - nameOffset := builder.CreateString(t.Name) - descriptionOffset := builder.CreateString(t.Description) + identifierOffset := flatbuffers.UOffsetT(0) + if t.Identifier != "" { + identifierOffset = builder.CreateString(t.Identifier) + } + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + descriptionOffset := flatbuffers.UOffsetT(0) + if t.Description != "" { + descriptionOffset = builder.CreateString(t.Description) + } permissionsROffset := flatbuffers.UOffsetT(0) if t.PermissionsR != nil { permissionsRLength := len(t.PermissionsR) @@ -34,18 +44,18 @@ func (t *ScopeT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { } permissionsROffset = builder.EndVector(permissionsRLength) } - permissionsRWOffset := flatbuffers.UOffsetT(0) - if t.PermissionsRW != nil { - permissionsRWLength := len(t.PermissionsRW) - permissionsRWOffsets := make([]flatbuffers.UOffsetT, permissionsRWLength) - for j := 0; j < permissionsRWLength; j++ { - permissionsRWOffsets[j] = builder.CreateString(t.PermissionsRW[j]) + permissionsRwOffset := flatbuffers.UOffsetT(0) + if t.PermissionsRw != nil { + permissionsRwLength := len(t.PermissionsRw) + permissionsRwOffsets := make([]flatbuffers.UOffsetT, permissionsRwLength) + for j := 0; j < permissionsRwLength; j++ { + permissionsRwOffsets[j] = builder.CreateString(t.PermissionsRw[j]) } - ScopeStartPermissionsRWVector(builder, permissionsRWLength) - for j := permissionsRWLength - 1; j >= 0; j-- { - builder.PrependUOffsetT(permissionsRWOffsets[j]) + ScopeStartPermissionsRwVector(builder, permissionsRwLength) + for j := permissionsRwLength - 1; j >= 0; j-- { + builder.PrependUOffsetT(permissionsRwOffsets[j]) } - permissionsRWOffset = builder.EndVector(permissionsRWLength) + permissionsRwOffset = builder.EndVector(permissionsRwLength) } permissionsXOffset := flatbuffers.UOffsetT(0) if t.PermissionsX != nil { @@ -60,27 +70,27 @@ func (t *ScopeT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { } permissionsXOffset = builder.EndVector(permissionsXLength) } - permissionsRWXOffset := flatbuffers.UOffsetT(0) - if t.PermissionsRWX != nil { - permissionsRWXLength := len(t.PermissionsRWX) - permissionsRWXOffsets := make([]flatbuffers.UOffsetT, permissionsRWXLength) - for j := 0; j < permissionsRWXLength; j++ { - permissionsRWXOffsets[j] = builder.CreateString(t.PermissionsRWX[j]) + permissionsRwxOffset := flatbuffers.UOffsetT(0) + if t.PermissionsRwx != nil { + permissionsRwxLength := len(t.PermissionsRwx) + permissionsRwxOffsets := make([]flatbuffers.UOffsetT, permissionsRwxLength) + for j := 0; j < permissionsRwxLength; j++ { + permissionsRwxOffsets[j] = builder.CreateString(t.PermissionsRwx[j]) } - ScopeStartPermissionsRWXVector(builder, permissionsRWXLength) - for j := permissionsRWXLength - 1; j >= 0; j-- { - builder.PrependUOffsetT(permissionsRWXOffsets[j]) + ScopeStartPermissionsRwxVector(builder, permissionsRwxLength) + for j := permissionsRwxLength - 1; j >= 0; j-- { + builder.PrependUOffsetT(permissionsRwxOffsets[j]) } - permissionsRWXOffset = builder.EndVector(permissionsRWXLength) + permissionsRwxOffset = builder.EndVector(permissionsRwxLength) } ScopeStart(builder) ScopeAddIdentifier(builder, identifierOffset) ScopeAddName(builder, nameOffset) ScopeAddDescription(builder, descriptionOffset) ScopeAddPermissionsR(builder, permissionsROffset) - ScopeAddPermissionsRW(builder, permissionsRWOffset) + ScopeAddPermissionsRw(builder, permissionsRwOffset) ScopeAddPermissionsX(builder, permissionsXOffset) - ScopeAddPermissionsRWX(builder, permissionsRWXOffset) + ScopeAddPermissionsRwx(builder, permissionsRwxOffset) return ScopeEnd(builder) } @@ -93,20 +103,20 @@ func (rcv *Scope) UnPackTo(t *ScopeT) { for j := 0; j < permissionsRLength; j++ { t.PermissionsR[j] = string(rcv.PermissionsR(j)) } - permissionsRWLength := rcv.PermissionsRWLength() - t.PermissionsRW = make([]string, permissionsRWLength) - for j := 0; j < permissionsRWLength; j++ { - t.PermissionsRW[j] = string(rcv.PermissionsRW(j)) + permissionsRwLength := rcv.PermissionsRwLength() + t.PermissionsRw = make([]string, permissionsRwLength) + for j := 0; j < permissionsRwLength; j++ { + t.PermissionsRw[j] = string(rcv.PermissionsRw(j)) } permissionsXLength := rcv.PermissionsXLength() t.PermissionsX = make([]string, permissionsXLength) for j := 0; j < permissionsXLength; j++ { t.PermissionsX[j] = string(rcv.PermissionsX(j)) } - permissionsRWXLength := rcv.PermissionsRWXLength() - t.PermissionsRWX = make([]string, permissionsRWXLength) - for j := 0; j < permissionsRWXLength; j++ { - t.PermissionsRWX[j] = string(rcv.PermissionsRWX(j)) + permissionsRwxLength := rcv.PermissionsRwxLength() + t.PermissionsRwx = make([]string, permissionsRwxLength) + for j := 0; j < permissionsRwxLength; j++ { + t.PermissionsRwx[j] = string(rcv.PermissionsRwx(j)) } } @@ -154,6 +164,38 @@ func (rcv *Scope) Identifier() []byte { } /// Identifier of the Scope +func ScopeKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &Scope{} + obj2 := &Scope{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.Identifier()) < string(obj2.Identifier()) +} + +func (rcv *Scope) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &Scope{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.Identifier(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + /// Human readable name of the Scope func (rcv *Scope) Name() []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) @@ -194,7 +236,7 @@ func (rcv *Scope) PermissionsRLength() int { /// List of permission string for read operations /// List of permission string for read/write operations -func (rcv *Scope) PermissionsRW(j int) []byte { +func (rcv *Scope) PermissionsRw(j int) []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) if o != 0 { a := rcv._tab.Vector(o) @@ -203,7 +245,7 @@ func (rcv *Scope) PermissionsRW(j int) []byte { return nil } -func (rcv *Scope) PermissionsRWLength() int { +func (rcv *Scope) PermissionsRwLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) if o != 0 { return rcv._tab.VectorLen(o) @@ -232,7 +274,7 @@ func (rcv *Scope) PermissionsXLength() int { /// List of permission string for execute operations /// List of permission string for all operations -func (rcv *Scope) PermissionsRWX(j int) []byte { +func (rcv *Scope) PermissionsRwx(j int) []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(16)) if o != 0 { a := rcv._tab.Vector(o) @@ -241,7 +283,7 @@ func (rcv *Scope) PermissionsRWX(j int) []byte { return nil } -func (rcv *Scope) PermissionsRWXLength() int { +func (rcv *Scope) PermissionsRwxLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(16)) if o != 0 { return rcv._tab.VectorLen(o) @@ -268,10 +310,10 @@ func ScopeAddPermissionsR(builder *flatbuffers.Builder, permissionsR flatbuffers func ScopeStartPermissionsRVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { return builder.StartVector(4, numElems, 4) } -func ScopeAddPermissionsRW(builder *flatbuffers.Builder, permissionsRW flatbuffers.UOffsetT) { - builder.PrependUOffsetTSlot(4, flatbuffers.UOffsetT(permissionsRW), 0) +func ScopeAddPermissionsRw(builder *flatbuffers.Builder, permissionsRw flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(4, flatbuffers.UOffsetT(permissionsRw), 0) } -func ScopeStartPermissionsRWVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { +func ScopeStartPermissionsRwVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { return builder.StartVector(4, numElems, 4) } func ScopeAddPermissionsX(builder *flatbuffers.Builder, permissionsX flatbuffers.UOffsetT) { @@ -280,10 +322,10 @@ func ScopeAddPermissionsX(builder *flatbuffers.Builder, permissionsX flatbuffers func ScopeStartPermissionsXVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { return builder.StartVector(4, numElems, 4) } -func ScopeAddPermissionsRWX(builder *flatbuffers.Builder, permissionsRWX flatbuffers.UOffsetT) { - builder.PrependUOffsetTSlot(6, flatbuffers.UOffsetT(permissionsRWX), 0) +func ScopeAddPermissionsRwx(builder *flatbuffers.Builder, permissionsRwx flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(6, flatbuffers.UOffsetT(permissionsRwx), 0) } -func ScopeStartPermissionsRWXVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { +func ScopeStartPermissionsRwxVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { return builder.StartVector(4, numElems, 4) } func ScopeEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/Scopes.go b/pkg/fbs/comm/datalayer/Scopes.go index 2e54fb1..77f0bdf 100644 --- a/pkg/fbs/comm/datalayer/Scopes.go +++ b/pkg/fbs/comm/datalayer/Scopes.go @@ -7,7 +7,7 @@ import ( ) type ScopesT struct { - Scopes []*ScopeT + Scopes []*ScopeT `json:"scopes"` } func (t *ScopesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -87,6 +87,15 @@ func (rcv *Scopes) Scopes(obj *Scope, j int) bool { return false } +func (rcv *Scopes) ScopesByKey(obj *Scope, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *Scopes) ScopesLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) if o != 0 { diff --git a/pkg/fbs/comm/datalayer/ServerSettings.go b/pkg/fbs/comm/datalayer/ServerSettings.go index fb34981..d5eb55c 100644 --- a/pkg/fbs/comm/datalayer/ServerSettings.go +++ b/pkg/fbs/comm/datalayer/ServerSettings.go @@ -7,17 +7,34 @@ import ( ) type ServerSettingsT struct { - ServerIdlePingTimeout uint32 - ServerWaitResponseTimeout uint32 - ServerMaxMessageSize uint32 - DebugAddress string - ServerMaxRtSize uint32 - ServerEmulatedNvramSize uint32 + ServerIdlePingTimeout uint32 `json:"serverIdlePingTimeout"` + ServerWaitResponseTimeout uint32 `json:"serverWaitResponseTimeout"` + ServerMaxMessageSize uint32 `json:"serverMaxMessageSize"` + DebugAddress string `json:"debugAddress"` + ServerMaxRtSize uint32 `json:"serverMaxRtSize"` + ServerEmulatedNvramSize uint32 `json:"serverEmulatedNvramSize"` + ExperimentalFeatures []string `json:"experimentalFeatures"` } func (t *ServerSettingsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - debugAddressOffset := builder.CreateString(t.DebugAddress) + debugAddressOffset := flatbuffers.UOffsetT(0) + if t.DebugAddress != "" { + debugAddressOffset = builder.CreateString(t.DebugAddress) + } + experimentalFeaturesOffset := flatbuffers.UOffsetT(0) + if t.ExperimentalFeatures != nil { + experimentalFeaturesLength := len(t.ExperimentalFeatures) + experimentalFeaturesOffsets := make([]flatbuffers.UOffsetT, experimentalFeaturesLength) + for j := 0; j < experimentalFeaturesLength; j++ { + experimentalFeaturesOffsets[j] = builder.CreateString(t.ExperimentalFeatures[j]) + } + ServerSettingsStartExperimentalFeaturesVector(builder, experimentalFeaturesLength) + for j := experimentalFeaturesLength - 1; j >= 0; j-- { + builder.PrependUOffsetT(experimentalFeaturesOffsets[j]) + } + experimentalFeaturesOffset = builder.EndVector(experimentalFeaturesLength) + } ServerSettingsStart(builder) ServerSettingsAddServerIdlePingTimeout(builder, t.ServerIdlePingTimeout) ServerSettingsAddServerWaitResponseTimeout(builder, t.ServerWaitResponseTimeout) @@ -25,6 +42,7 @@ func (t *ServerSettingsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffset ServerSettingsAddDebugAddress(builder, debugAddressOffset) ServerSettingsAddServerMaxRtSize(builder, t.ServerMaxRtSize) ServerSettingsAddServerEmulatedNvramSize(builder, t.ServerEmulatedNvramSize) + ServerSettingsAddExperimentalFeatures(builder, experimentalFeaturesOffset) return ServerSettingsEnd(builder) } @@ -35,6 +53,11 @@ func (rcv *ServerSettings) UnPackTo(t *ServerSettingsT) { t.DebugAddress = string(rcv.DebugAddress()) t.ServerMaxRtSize = rcv.ServerMaxRtSize() t.ServerEmulatedNvramSize = rcv.ServerEmulatedNvramSize() + experimentalFeaturesLength := rcv.ExperimentalFeaturesLength() + t.ExperimentalFeatures = make([]string, experimentalFeaturesLength) + for j := 0; j < experimentalFeaturesLength; j++ { + t.ExperimentalFeatures[j] = string(rcv.ExperimentalFeatures(j)) + } } func (rcv *ServerSettings) UnPack() *ServerSettingsT { @@ -151,8 +174,27 @@ func (rcv *ServerSettings) MutateServerEmulatedNvramSize(n uint32) bool { return rcv._tab.MutateUint32Slot(14, n) } +/// Add the names of the experimental feature you want to enable here +func (rcv *ServerSettings) ExperimentalFeatures(j int) []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(16)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.ByteVector(a + flatbuffers.UOffsetT(j*4)) + } + return nil +} + +func (rcv *ServerSettings) ExperimentalFeaturesLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(16)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +/// Add the names of the experimental feature you want to enable here func ServerSettingsStart(builder *flatbuffers.Builder) { - builder.StartObject(6) + builder.StartObject(7) } func ServerSettingsAddServerIdlePingTimeout(builder *flatbuffers.Builder, serverIdlePingTimeout uint32) { builder.PrependUint32Slot(0, serverIdlePingTimeout, 30000) @@ -172,6 +214,12 @@ func ServerSettingsAddServerMaxRtSize(builder *flatbuffers.Builder, serverMaxRtS func ServerSettingsAddServerEmulatedNvramSize(builder *flatbuffers.Builder, serverEmulatedNvramSize uint32) { builder.PrependUint32Slot(5, serverEmulatedNvramSize, 122880) } +func ServerSettingsAddExperimentalFeatures(builder *flatbuffers.Builder, experimentalFeatures flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(6, flatbuffers.UOffsetT(experimentalFeatures), 0) +} +func ServerSettingsStartExperimentalFeaturesVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} func ServerSettingsEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() } diff --git a/pkg/fbs/comm/datalayer/String.go b/pkg/fbs/comm/datalayer/String.go index dff8a56..12b5557 100644 --- a/pkg/fbs/comm/datalayer/String.go +++ b/pkg/fbs/comm/datalayer/String.go @@ -7,12 +7,15 @@ import ( ) type StringT struct { - Value string + Value string `json:"value"` } func (t *StringT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - valueOffset := builder.CreateString(t.Value) + valueOffset := flatbuffers.UOffsetT(0) + if t.Value != "" { + valueOffset = builder.CreateString(t.Value) + } StringStart(builder) StringAddValue(builder, valueOffset) return StringEnd(builder) diff --git a/pkg/fbs/comm/datalayer/SubscriptionData.go b/pkg/fbs/comm/datalayer/SubscriptionData.go index d44b1bf..fa5443c 100644 --- a/pkg/fbs/comm/datalayer/SubscriptionData.go +++ b/pkg/fbs/comm/datalayer/SubscriptionData.go @@ -7,8 +7,8 @@ import ( ) type SubscriptionDataT struct { - Properties *SubscriptionPropertiesT - Nodes []string + Properties *SubscriptionPropertiesT `json:"properties"` + Nodes []string `json:"nodes"` } func (t *SubscriptionDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/SubscriptionProperties.go b/pkg/fbs/comm/datalayer/SubscriptionProperties.go index ea4d74d..82239a3 100644 --- a/pkg/fbs/comm/datalayer/SubscriptionProperties.go +++ b/pkg/fbs/comm/datalayer/SubscriptionProperties.go @@ -7,16 +7,19 @@ import ( ) type SubscriptionPropertiesT struct { - Id string - KeepaliveInterval uint32 - PublishInterval uint32 - Rules []*PropertyT - ErrorInterval uint32 + Id string `json:"id"` + KeepaliveInterval uint32 `json:"keepaliveInterval"` + PublishInterval uint32 `json:"publishInterval"` + Rules []*PropertyT `json:"rules"` + ErrorInterval uint32 `json:"errorInterval"` } func (t *SubscriptionPropertiesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - idOffset := builder.CreateString(t.Id) + idOffset := flatbuffers.UOffsetT(0) + if t.Id != "" { + idOffset = builder.CreateString(t.Id) + } rulesOffset := flatbuffers.UOffsetT(0) if t.Rules != nil { rulesLength := len(t.Rules) diff --git a/pkg/fbs/comm/datalayer/SubscriptionSettings.go b/pkg/fbs/comm/datalayer/SubscriptionSettings.go index 6fb00ba..57ca28e 100644 --- a/pkg/fbs/comm/datalayer/SubscriptionSettings.go +++ b/pkg/fbs/comm/datalayer/SubscriptionSettings.go @@ -7,11 +7,11 @@ import ( ) type SubscriptionSettingsT struct { - MinimumPublishInterval uint32 - MinimumSampleInterval uint64 - MaximumBufferSize uint32 - MinimumErrorInterval uint32 - MaximumRTSubscribedNodes uint32 + MinimumPublishInterval uint32 `json:"minimumPublishInterval"` + MinimumSampleInterval uint64 `json:"minimumSampleInterval"` + MaximumBufferSize uint32 `json:"maximumBufferSize"` + MinimumErrorInterval uint32 `json:"minimumErrorInterval"` + MaximumRtsubscribedNodes uint32 `json:"maximumRTSubscribedNodes"` } func (t *SubscriptionSettingsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -21,7 +21,7 @@ func (t *SubscriptionSettingsT) Pack(builder *flatbuffers.Builder) flatbuffers.U SubscriptionSettingsAddMinimumSampleInterval(builder, t.MinimumSampleInterval) SubscriptionSettingsAddMaximumBufferSize(builder, t.MaximumBufferSize) SubscriptionSettingsAddMinimumErrorInterval(builder, t.MinimumErrorInterval) - SubscriptionSettingsAddMaximumRTSubscribedNodes(builder, t.MaximumRTSubscribedNodes) + SubscriptionSettingsAddMaximumRtsubscribedNodes(builder, t.MaximumRtsubscribedNodes) return SubscriptionSettingsEnd(builder) } @@ -30,7 +30,7 @@ func (rcv *SubscriptionSettings) UnPackTo(t *SubscriptionSettingsT) { t.MinimumSampleInterval = rcv.MinimumSampleInterval() t.MaximumBufferSize = rcv.MaximumBufferSize() t.MinimumErrorInterval = rcv.MinimumErrorInterval() - t.MaximumRTSubscribedNodes = rcv.MaximumRTSubscribedNodes() + t.MaximumRtsubscribedNodes = rcv.MaximumRtsubscribedNodes() } func (rcv *SubscriptionSettings) UnPack() *SubscriptionSettingsT { @@ -124,7 +124,7 @@ func (rcv *SubscriptionSettings) MutateMinimumErrorInterval(n uint32) bool { } /// Maximum allowed count of RT Subscriptions to addresses -func (rcv *SubscriptionSettings) MaximumRTSubscribedNodes() uint32 { +func (rcv *SubscriptionSettings) MaximumRtsubscribedNodes() uint32 { o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) if o != 0 { return rcv._tab.GetUint32(o + rcv._tab.Pos) @@ -133,7 +133,7 @@ func (rcv *SubscriptionSettings) MaximumRTSubscribedNodes() uint32 { } /// Maximum allowed count of RT Subscriptions to addresses -func (rcv *SubscriptionSettings) MutateMaximumRTSubscribedNodes(n uint32) bool { +func (rcv *SubscriptionSettings) MutateMaximumRtsubscribedNodes(n uint32) bool { return rcv._tab.MutateUint32Slot(12, n) } @@ -152,8 +152,8 @@ func SubscriptionSettingsAddMaximumBufferSize(builder *flatbuffers.Builder, maxi func SubscriptionSettingsAddMinimumErrorInterval(builder *flatbuffers.Builder, minimumErrorInterval uint32) { builder.PrependUint32Slot(3, minimumErrorInterval, 10000) } -func SubscriptionSettingsAddMaximumRTSubscribedNodes(builder *flatbuffers.Builder, maximumRTSubscribedNodes uint32) { - builder.PrependUint32Slot(4, maximumRTSubscribedNodes, 50) +func SubscriptionSettingsAddMaximumRtsubscribedNodes(builder *flatbuffers.Builder, maximumRtsubscribedNodes uint32) { + builder.PrependUint32Slot(4, maximumRtsubscribedNodes, 50) } func SubscriptionSettingsEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() diff --git a/pkg/fbs/comm/datalayer/SubscriptionStatistics.go b/pkg/fbs/comm/datalayer/SubscriptionStatistics.go index 3b5ec27..3d96ac8 100644 --- a/pkg/fbs/comm/datalayer/SubscriptionStatistics.go +++ b/pkg/fbs/comm/datalayer/SubscriptionStatistics.go @@ -7,10 +7,10 @@ import ( ) type SubscriptionStatisticsT struct { - NumberClients uint32 - NumberSubscriptions uint32 - NumberSubscribedNodes uint32 - NumberRTSubscribedNodes uint32 + NumberClients uint32 `json:"numberClients"` + NumberSubscriptions uint32 `json:"numberSubscriptions"` + NumberSubscribedNodes uint32 `json:"numberSubscribedNodes"` + NumberRtsubscribedNodes uint32 `json:"numberRTSubscribedNodes"` } func (t *SubscriptionStatisticsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -19,7 +19,7 @@ func (t *SubscriptionStatisticsT) Pack(builder *flatbuffers.Builder) flatbuffers SubscriptionStatisticsAddNumberClients(builder, t.NumberClients) SubscriptionStatisticsAddNumberSubscriptions(builder, t.NumberSubscriptions) SubscriptionStatisticsAddNumberSubscribedNodes(builder, t.NumberSubscribedNodes) - SubscriptionStatisticsAddNumberRTSubscribedNodes(builder, t.NumberRTSubscribedNodes) + SubscriptionStatisticsAddNumberRtsubscribedNodes(builder, t.NumberRtsubscribedNodes) return SubscriptionStatisticsEnd(builder) } @@ -27,7 +27,7 @@ func (rcv *SubscriptionStatistics) UnPackTo(t *SubscriptionStatisticsT) { t.NumberClients = rcv.NumberClients() t.NumberSubscriptions = rcv.NumberSubscriptions() t.NumberSubscribedNodes = rcv.NumberSubscribedNodes() - t.NumberRTSubscribedNodes = rcv.NumberRTSubscribedNodes() + t.NumberRtsubscribedNodes = rcv.NumberRtsubscribedNodes() } func (rcv *SubscriptionStatistics) UnPack() *SubscriptionStatisticsT { @@ -107,7 +107,7 @@ func (rcv *SubscriptionStatistics) MutateNumberSubscribedNodes(n uint32) bool { } /// Number of realtime subscribed nodes -func (rcv *SubscriptionStatistics) NumberRTSubscribedNodes() uint32 { +func (rcv *SubscriptionStatistics) NumberRtsubscribedNodes() uint32 { o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) if o != 0 { return rcv._tab.GetUint32(o + rcv._tab.Pos) @@ -116,7 +116,7 @@ func (rcv *SubscriptionStatistics) NumberRTSubscribedNodes() uint32 { } /// Number of realtime subscribed nodes -func (rcv *SubscriptionStatistics) MutateNumberRTSubscribedNodes(n uint32) bool { +func (rcv *SubscriptionStatistics) MutateNumberRtsubscribedNodes(n uint32) bool { return rcv._tab.MutateUint32Slot(10, n) } @@ -132,8 +132,8 @@ func SubscriptionStatisticsAddNumberSubscriptions(builder *flatbuffers.Builder, func SubscriptionStatisticsAddNumberSubscribedNodes(builder *flatbuffers.Builder, numberSubscribedNodes uint32) { builder.PrependUint32Slot(2, numberSubscribedNodes, 0) } -func SubscriptionStatisticsAddNumberRTSubscribedNodes(builder *flatbuffers.Builder, numberRTSubscribedNodes uint32) { - builder.PrependUint32Slot(3, numberRTSubscribedNodes, 0) +func SubscriptionStatisticsAddNumberRtsubscribedNodes(builder *flatbuffers.Builder, numberRtsubscribedNodes uint32) { + builder.PrependUint32Slot(3, numberRtsubscribedNodes, 0) } func SubscriptionStatisticsEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() diff --git a/pkg/fbs/comm/datalayer/Timestamp.go b/pkg/fbs/comm/datalayer/Timestamp.go index 171f2fd..7d71e2e 100644 --- a/pkg/fbs/comm/datalayer/Timestamp.go +++ b/pkg/fbs/comm/datalayer/Timestamp.go @@ -7,7 +7,7 @@ import ( ) type TimestampT struct { - Value uint64 + Value uint64 `json:"value"` } func (t *TimestampT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/Token.go b/pkg/fbs/comm/datalayer/Token.go index d134796..949c0a6 100644 --- a/pkg/fbs/comm/datalayer/Token.go +++ b/pkg/fbs/comm/datalayer/Token.go @@ -7,13 +7,13 @@ import ( ) type TokenT struct { - Claims []*ClaimT - Id string - Iat uint64 - Exp uint64 - Name string - Plchandle uint64 - Scope []string + Claims []*ClaimT `json:"claims"` + Id string `json:"id"` + Iat uint64 `json:"iat"` + Exp uint64 `json:"exp"` + Name string `json:"name"` + Plchandle uint64 `json:"plchandle"` + Scope []string `json:"scope"` } func (t *TokenT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -31,8 +31,14 @@ func (t *TokenT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { } claimsOffset = builder.EndVector(claimsLength) } - idOffset := builder.CreateString(t.Id) - nameOffset := builder.CreateString(t.Name) + idOffset := flatbuffers.UOffsetT(0) + if t.Id != "" { + idOffset = builder.CreateString(t.Id) + } + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } scopeOffset := flatbuffers.UOffsetT(0) if t.Scope != nil { scopeLength := len(t.Scope) @@ -124,6 +130,15 @@ func (rcv *Token) Claims(obj *Claim, j int) bool { return false } +func (rcv *Token) ClaimsByKey(obj *Claim, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *Token) ClaimsLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) if o != 0 { diff --git a/pkg/fbs/comm/datalayer/UInt16.go b/pkg/fbs/comm/datalayer/UInt16.go index 1905eb5..6bc0223 100644 --- a/pkg/fbs/comm/datalayer/UInt16.go +++ b/pkg/fbs/comm/datalayer/UInt16.go @@ -7,7 +7,7 @@ import ( ) type UInt16T struct { - Value uint16 + Value uint16 `json:"value"` } func (t *UInt16T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/UInt32.go b/pkg/fbs/comm/datalayer/UInt32.go index 2e2e9a4..0e7f523 100644 --- a/pkg/fbs/comm/datalayer/UInt32.go +++ b/pkg/fbs/comm/datalayer/UInt32.go @@ -7,7 +7,7 @@ import ( ) type UInt32T struct { - Value uint32 + Value uint32 `json:"value"` } func (t *UInt32T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/UInt64.go b/pkg/fbs/comm/datalayer/UInt64.go index 5b37a7e..42c1de8 100644 --- a/pkg/fbs/comm/datalayer/UInt64.go +++ b/pkg/fbs/comm/datalayer/UInt64.go @@ -7,7 +7,7 @@ import ( ) type UInt64T struct { - Value uint64 + Value uint64 `json:"value"` } func (t *UInt64T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/UInt8.go b/pkg/fbs/comm/datalayer/UInt8.go index 1289f35..31c556f 100644 --- a/pkg/fbs/comm/datalayer/UInt8.go +++ b/pkg/fbs/comm/datalayer/UInt8.go @@ -7,7 +7,7 @@ import ( ) type UInt8T struct { - Value byte + Value byte `json:"value"` } func (t *UInt8T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/Variable.go b/pkg/fbs/comm/datalayer/Variable.go index 164e50a..a9cb9f0 100644 --- a/pkg/fbs/comm/datalayer/Variable.go +++ b/pkg/fbs/comm/datalayer/Variable.go @@ -3,27 +3,34 @@ package datalayer import ( + "bytes" flatbuffers "github.com/google/flatbuffers/go" ) type VariableT struct { - Name string - Bitoffset uint32 - Bitsize uint32 - Type string - Metadata *MetadataT + Name string `json:"name"` + Bitoffset uint32 `json:"bitoffset"` + Bitsize uint32 `json:"bitsize"` + Type string `json:"type"` + Metadata *MetadataT `json:"metadata"` } func (t *VariableT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - typeOffset := builder.CreateString(t.Type) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + type_Offset := flatbuffers.UOffsetT(0) + if t.Type != "" { + type_Offset = builder.CreateString(t.Type) + } metadataOffset := t.Metadata.Pack(builder) VariableStart(builder) VariableAddName(builder, nameOffset) VariableAddBitoffset(builder, t.Bitoffset) VariableAddBitsize(builder, t.Bitsize) - VariableAddType(builder, typeOffset) + VariableAddType(builder, type_Offset) VariableAddMetadata(builder, metadataOffset) return VariableEnd(builder) } @@ -80,6 +87,38 @@ func (rcv *Variable) Name() []byte { } /// Name of the variable +func VariableKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &Variable{} + obj2 := &Variable{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.Name()) < string(obj2.Name()) +} + +func (rcv *Variable) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &Variable{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.Name(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + /// Offset (in bits) of variable in memory func (rcv *Variable) Bitoffset() uint32 { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) diff --git a/pkg/fbs/comm/datalayer/Watchlist.go b/pkg/fbs/comm/datalayer/Watchlist.go index 0a4dbc9..3a2a0ea 100644 --- a/pkg/fbs/comm/datalayer/Watchlist.go +++ b/pkg/fbs/comm/datalayer/Watchlist.go @@ -7,13 +7,16 @@ import ( ) type WatchlistT struct { - Name string - Items []string + Name string `json:"name"` + Items []string `json:"items"` } func (t *WatchlistT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } itemsOffset := flatbuffers.UOffsetT(0) if t.Items != nil { itemsLength := len(t.Items) diff --git a/pkg/fbs/comm/datalayer/Watchlists.go b/pkg/fbs/comm/datalayer/Watchlists.go index 944d1a5..a02ccbc 100644 --- a/pkg/fbs/comm/datalayer/Watchlists.go +++ b/pkg/fbs/comm/datalayer/Watchlists.go @@ -7,7 +7,7 @@ import ( ) type WatchlistsT struct { - Watchlists []*WatchlistT + Watchlists []*WatchlistT `json:"watchlists"` } func (t *WatchlistsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/framework/Bundle.go b/pkg/fbs/comm/datalayer/framework/Bundle.go index c9f9693..266ff8f 100644 --- a/pkg/fbs/comm/datalayer/framework/Bundle.go +++ b/pkg/fbs/comm/datalayer/framework/Bundle.go @@ -7,21 +7,30 @@ import ( ) type BundleT struct { - Name string - Version string - Location string - Id int64 - Components []*ComponentT - State string - Active bool - Installed bool + Name string `json:"name"` + Version string `json:"version"` + Location string `json:"location"` + Id int64 `json:"id"` + Components []*ComponentT `json:"components"` + State string `json:"state"` + Active bool `json:"active"` + Installed bool `json:"installed"` } func (t *BundleT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - versionOffset := builder.CreateString(t.Version) - locationOffset := builder.CreateString(t.Location) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + versionOffset := flatbuffers.UOffsetT(0) + if t.Version != "" { + versionOffset = builder.CreateString(t.Version) + } + locationOffset := flatbuffers.UOffsetT(0) + if t.Location != "" { + locationOffset = builder.CreateString(t.Location) + } componentsOffset := flatbuffers.UOffsetT(0) if t.Components != nil { componentsLength := len(t.Components) @@ -35,7 +44,10 @@ func (t *BundleT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { } componentsOffset = builder.EndVector(componentsLength) } - stateOffset := builder.CreateString(t.State) + stateOffset := flatbuffers.UOffsetT(0) + if t.State != "" { + stateOffset = builder.CreateString(t.State) + } BundleStart(builder) BundleAddName(builder, nameOffset) BundleAddVersion(builder, versionOffset) @@ -147,6 +159,15 @@ func (rcv *Bundle) Components(obj *Component, j int) bool { return false } +func (rcv *Bundle) ComponentsByKey(obj *Component, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *Bundle) ComponentsLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) if o != 0 { diff --git a/pkg/fbs/comm/datalayer/framework/BundleList.go b/pkg/fbs/comm/datalayer/framework/BundleList.go index 56f1405..12d747b 100644 --- a/pkg/fbs/comm/datalayer/framework/BundleList.go +++ b/pkg/fbs/comm/datalayer/framework/BundleList.go @@ -7,7 +7,7 @@ import ( ) type BundleListT struct { - Bundles []*BundleT + Bundles []*BundleT `json:"bundles"` } func (t *BundleListT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/framework/Component.go b/pkg/fbs/comm/datalayer/framework/Component.go index a2fef4e..a5c2c67 100644 --- a/pkg/fbs/comm/datalayer/framework/Component.go +++ b/pkg/fbs/comm/datalayer/framework/Component.go @@ -3,23 +3,33 @@ package framework import ( + "bytes" flatbuffers "github.com/google/flatbuffers/go" ) type ComponentT struct { - Name string - Id string - Active bool - State string - Interfaces []*Interface_T - Dependencies []*DependencyT + Name string `json:"name"` + Id string `json:"id"` + Active bool `json:"active"` + State string `json:"state"` + Interfaces []*Interface_T `json:"interfaces"` + Dependencies []*DependencyT `json:"dependencies"` } func (t *ComponentT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - idOffset := builder.CreateString(t.Id) - stateOffset := builder.CreateString(t.State) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + idOffset := flatbuffers.UOffsetT(0) + if t.Id != "" { + idOffset = builder.CreateString(t.Id) + } + stateOffset := flatbuffers.UOffsetT(0) + if t.State != "" { + stateOffset = builder.CreateString(t.State) + } interfacesOffset := flatbuffers.UOffsetT(0) if t.Interfaces != nil { interfacesLength := len(t.Interfaces) @@ -119,6 +129,38 @@ func (rcv *Component) Name() []byte { return nil } +func ComponentKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &Component{} + obj2 := &Component{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.Name()) < string(obj2.Name()) +} + +func (rcv *Component) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &Component{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.Name(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + func (rcv *Component) Id() []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { @@ -159,6 +201,15 @@ func (rcv *Component) Interfaces(obj *Interface_, j int) bool { return false } +func (rcv *Component) InterfacesByKey(obj *Interface_, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *Component) InterfacesLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) if o != 0 { @@ -179,6 +230,15 @@ func (rcv *Component) Dependencies(obj *Dependency, j int) bool { return false } +func (rcv *Component) DependenciesByKey(obj *Dependency, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *Component) DependenciesLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) if o != 0 { diff --git a/pkg/fbs/comm/datalayer/framework/ComponentList.go b/pkg/fbs/comm/datalayer/framework/ComponentList.go index cd16b2f..cb1e293 100644 --- a/pkg/fbs/comm/datalayer/framework/ComponentList.go +++ b/pkg/fbs/comm/datalayer/framework/ComponentList.go @@ -7,7 +7,7 @@ import ( ) type ComponentListT struct { - Components []*ComponentT + Components []*ComponentT `json:"components"` } func (t *ComponentListT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -86,6 +86,15 @@ func (rcv *ComponentList) Components(obj *Component, j int) bool { return false } +func (rcv *ComponentList) ComponentsByKey(obj *Component, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *ComponentList) ComponentsLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) if o != 0 { diff --git a/pkg/fbs/comm/datalayer/framework/Dependency.go b/pkg/fbs/comm/datalayer/framework/Dependency.go index a25f77f..d95b145 100644 --- a/pkg/fbs/comm/datalayer/framework/Dependency.go +++ b/pkg/fbs/comm/datalayer/framework/Dependency.go @@ -3,20 +3,27 @@ package framework import ( + "bytes" flatbuffers "github.com/google/flatbuffers/go" ) type DependencyT struct { - Name string - Available bool - Required bool - Filter string + Name string `json:"name"` + Available bool `json:"available"` + Required bool `json:"required"` + Filter string `json:"filter"` } func (t *DependencyT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - filterOffset := builder.CreateString(t.Filter) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + filterOffset := flatbuffers.UOffsetT(0) + if t.Filter != "" { + filterOffset = builder.CreateString(t.Filter) + } DependencyStart(builder) DependencyAddName(builder, nameOffset) DependencyAddAvailable(builder, t.Available) @@ -74,6 +81,38 @@ func (rcv *Dependency) Name() []byte { return nil } +func DependencyKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &Dependency{} + obj2 := &Dependency{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.Name()) < string(obj2.Name()) +} + +func (rcv *Dependency) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &Dependency{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.Name(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + func (rcv *Dependency) Available() bool { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { diff --git a/pkg/fbs/comm/datalayer/framework/DependencyList.go b/pkg/fbs/comm/datalayer/framework/DependencyList.go index 98f1709..e9578d2 100644 --- a/pkg/fbs/comm/datalayer/framework/DependencyList.go +++ b/pkg/fbs/comm/datalayer/framework/DependencyList.go @@ -7,7 +7,7 @@ import ( ) type DependencyListT struct { - Dependencies []*DependencyT + Dependencies []*DependencyT `json:"dependencies"` } func (t *DependencyListT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -86,6 +86,15 @@ func (rcv *DependencyList) Dependencies(obj *Dependency, j int) bool { return false } +func (rcv *DependencyList) DependenciesByKey(obj *Dependency, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *DependencyList) DependenciesLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) if o != 0 { diff --git a/pkg/fbs/comm/datalayer/framework/Exception.go b/pkg/fbs/comm/datalayer/framework/Exception.go index 3a4a3ad..9dd0eb9 100644 --- a/pkg/fbs/comm/datalayer/framework/Exception.go +++ b/pkg/fbs/comm/datalayer/framework/Exception.go @@ -7,20 +7,32 @@ import ( ) type ExceptionT struct { - Date string - Name string - Signal string - Code string - Register *RegisterT - Stack []*StackentryT + Date string `json:"date"` + Name string `json:"name"` + Signal string `json:"signal"` + Code string `json:"code"` + Register *RegisterT `json:"register"` + Stack []*StackentryT `json:"stack"` } func (t *ExceptionT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - dateOffset := builder.CreateString(t.Date) - nameOffset := builder.CreateString(t.Name) - signalOffset := builder.CreateString(t.Signal) - codeOffset := builder.CreateString(t.Code) + dateOffset := flatbuffers.UOffsetT(0) + if t.Date != "" { + dateOffset = builder.CreateString(t.Date) + } + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + signalOffset := flatbuffers.UOffsetT(0) + if t.Signal != "" { + signalOffset = builder.CreateString(t.Signal) + } + codeOffset := flatbuffers.UOffsetT(0) + if t.Code != "" { + codeOffset = builder.CreateString(t.Code) + } registerOffset := t.Register.Pack(builder) stackOffset := flatbuffers.UOffsetT(0) if t.Stack != nil { @@ -151,6 +163,15 @@ func (rcv *Exception) Stack(obj *Stackentry, j int) bool { return false } +func (rcv *Exception) StackByKey(obj *Stackentry, key uint32) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *Exception) StackLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) if o != 0 { diff --git a/pkg/fbs/comm/datalayer/framework/Exceptions.go b/pkg/fbs/comm/datalayer/framework/Exceptions.go index 8b37ce6..10533df 100644 --- a/pkg/fbs/comm/datalayer/framework/Exceptions.go +++ b/pkg/fbs/comm/datalayer/framework/Exceptions.go @@ -7,7 +7,7 @@ import ( ) type ExceptionsT struct { - Exceptions []*ExceptionT + Exceptions []*ExceptionT `json:"exceptions"` } func (t *ExceptionsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/datalayer/framework/InterfaceList_.go b/pkg/fbs/comm/datalayer/framework/InterfaceList_.go index 5619e2c..b4483f7 100644 --- a/pkg/fbs/comm/datalayer/framework/InterfaceList_.go +++ b/pkg/fbs/comm/datalayer/framework/InterfaceList_.go @@ -7,7 +7,7 @@ import ( ) type InterfaceList_T struct { - Interfaces []*Interface_T + Interfaces []*Interface_T `json:"interfaces"` } func (t *InterfaceList_T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -86,6 +86,15 @@ func (rcv *InterfaceList_) Interfaces(obj *Interface_, j int) bool { return false } +func (rcv *InterfaceList_) InterfacesByKey(obj *Interface_, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *InterfaceList_) InterfacesLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) if o != 0 { diff --git a/pkg/fbs/comm/datalayer/framework/Interface_.go b/pkg/fbs/comm/datalayer/framework/Interface_.go index 720400b..944fd90 100644 --- a/pkg/fbs/comm/datalayer/framework/Interface_.go +++ b/pkg/fbs/comm/datalayer/framework/Interface_.go @@ -3,21 +3,31 @@ package framework import ( + "bytes" flatbuffers "github.com/google/flatbuffers/go" ) type Interface_T struct { - Name string - Version string - Language string - Properties []*PropertyT + Name string `json:"name"` + Version string `json:"version"` + Language string `json:"language"` + Properties []*PropertyT `json:"properties"` } func (t *Interface_T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - versionOffset := builder.CreateString(t.Version) - languageOffset := builder.CreateString(t.Language) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + versionOffset := flatbuffers.UOffsetT(0) + if t.Version != "" { + versionOffset = builder.CreateString(t.Version) + } + languageOffset := flatbuffers.UOffsetT(0) + if t.Language != "" { + languageOffset = builder.CreateString(t.Language) + } propertiesOffset := flatbuffers.UOffsetT(0) if t.Properties != nil { propertiesLength := len(t.Properties) @@ -94,6 +104,38 @@ func (rcv *Interface_) Name() []byte { return nil } +func Interface_KeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &Interface_{} + obj2 := &Interface_{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.Name()) < string(obj2.Name()) +} + +func (rcv *Interface_) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &Interface_{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.Name(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + func (rcv *Interface_) Version() []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { @@ -122,6 +164,15 @@ func (rcv *Interface_) Properties(obj *Property, j int) bool { return false } +func (rcv *Interface_) PropertiesByKey(obj *Property, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *Interface_) PropertiesLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) if o != 0 { diff --git a/pkg/fbs/comm/datalayer/framework/Property.go b/pkg/fbs/comm/datalayer/framework/Property.go index a44f719..985be47 100644 --- a/pkg/fbs/comm/datalayer/framework/Property.go +++ b/pkg/fbs/comm/datalayer/framework/Property.go @@ -3,18 +3,25 @@ package framework import ( + "bytes" flatbuffers "github.com/google/flatbuffers/go" ) type PropertyT struct { - Name string - Value string + Name string `json:"name"` + Value string `json:"value"` } func (t *PropertyT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - valueOffset := builder.CreateString(t.Value) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + valueOffset := flatbuffers.UOffsetT(0) + if t.Value != "" { + valueOffset = builder.CreateString(t.Value) + } PropertyStart(builder) PropertyAddName(builder, nameOffset) PropertyAddValue(builder, valueOffset) @@ -68,6 +75,38 @@ func (rcv *Property) Name() []byte { return nil } +func PropertyKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &Property{} + obj2 := &Property{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.Name()) < string(obj2.Name()) +} + +func (rcv *Property) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &Property{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.Name(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + func (rcv *Property) Value() []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { diff --git a/pkg/fbs/comm/datalayer/framework/PropertyList.go b/pkg/fbs/comm/datalayer/framework/PropertyList.go index 2f2d918..c4ce0ea 100644 --- a/pkg/fbs/comm/datalayer/framework/PropertyList.go +++ b/pkg/fbs/comm/datalayer/framework/PropertyList.go @@ -7,7 +7,7 @@ import ( ) type PropertyListT struct { - Properties []*PropertyT + Properties []*PropertyT `json:"properties"` } func (t *PropertyListT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -86,6 +86,15 @@ func (rcv *PropertyList) Properties(obj *Property, j int) bool { return false } +func (rcv *PropertyList) PropertiesByKey(obj *Property, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *PropertyList) PropertiesLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) if o != 0 { diff --git a/pkg/fbs/comm/datalayer/framework/Register.go b/pkg/fbs/comm/datalayer/framework/Register.go index 013142f..d236d6e 100644 --- a/pkg/fbs/comm/datalayer/framework/Register.go +++ b/pkg/fbs/comm/datalayer/framework/Register.go @@ -7,27 +7,36 @@ import ( ) type RegisterT struct { - IP string - SP string - BP string + Ip string `json:"IP"` + Sp string `json:"SP"` + Bp string `json:"BP"` } func (t *RegisterT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - IPOffset := builder.CreateString(t.IP) - SPOffset := builder.CreateString(t.SP) - BPOffset := builder.CreateString(t.BP) + ipOffset := flatbuffers.UOffsetT(0) + if t.Ip != "" { + ipOffset = builder.CreateString(t.Ip) + } + spOffset := flatbuffers.UOffsetT(0) + if t.Sp != "" { + spOffset = builder.CreateString(t.Sp) + } + bpOffset := flatbuffers.UOffsetT(0) + if t.Bp != "" { + bpOffset = builder.CreateString(t.Bp) + } RegisterStart(builder) - RegisterAddIP(builder, IPOffset) - RegisterAddSP(builder, SPOffset) - RegisterAddBP(builder, BPOffset) + RegisterAddIp(builder, ipOffset) + RegisterAddSp(builder, spOffset) + RegisterAddBp(builder, bpOffset) return RegisterEnd(builder) } func (rcv *Register) UnPackTo(t *RegisterT) { - t.IP = string(rcv.IP()) - t.SP = string(rcv.SP()) - t.BP = string(rcv.BP()) + t.Ip = string(rcv.Ip()) + t.Sp = string(rcv.Sp()) + t.Bp = string(rcv.Bp()) } func (rcv *Register) UnPack() *RegisterT { @@ -64,7 +73,7 @@ func (rcv *Register) Table() flatbuffers.Table { return rcv._tab } -func (rcv *Register) IP() []byte { +func (rcv *Register) Ip() []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) if o != 0 { return rcv._tab.ByteVector(o + rcv._tab.Pos) @@ -72,7 +81,7 @@ func (rcv *Register) IP() []byte { return nil } -func (rcv *Register) SP() []byte { +func (rcv *Register) Sp() []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { return rcv._tab.ByteVector(o + rcv._tab.Pos) @@ -80,7 +89,7 @@ func (rcv *Register) SP() []byte { return nil } -func (rcv *Register) BP() []byte { +func (rcv *Register) Bp() []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) if o != 0 { return rcv._tab.ByteVector(o + rcv._tab.Pos) @@ -91,14 +100,14 @@ func (rcv *Register) BP() []byte { func RegisterStart(builder *flatbuffers.Builder) { builder.StartObject(3) } -func RegisterAddIP(builder *flatbuffers.Builder, IP flatbuffers.UOffsetT) { - builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(IP), 0) +func RegisterAddIp(builder *flatbuffers.Builder, ip flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(ip), 0) } -func RegisterAddSP(builder *flatbuffers.Builder, SP flatbuffers.UOffsetT) { - builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(SP), 0) +func RegisterAddSp(builder *flatbuffers.Builder, sp flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(sp), 0) } -func RegisterAddBP(builder *flatbuffers.Builder, BP flatbuffers.UOffsetT) { - builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(BP), 0) +func RegisterAddBp(builder *flatbuffers.Builder, bp flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(bp), 0) } func RegisterEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() diff --git a/pkg/fbs/comm/datalayer/framework/Stackentry.go b/pkg/fbs/comm/datalayer/framework/Stackentry.go index f87dfd9..b24c75d 100644 --- a/pkg/fbs/comm/datalayer/framework/Stackentry.go +++ b/pkg/fbs/comm/datalayer/framework/Stackentry.go @@ -7,13 +7,16 @@ import ( ) type StackentryT struct { - Frame uint32 - Stack string + Frame uint32 `json:"frame"` + Stack string `json:"stack"` } func (t *StackentryT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - stackOffset := builder.CreateString(t.Stack) + stackOffset := flatbuffers.UOffsetT(0) + if t.Stack != "" { + stackOffset = builder.CreateString(t.Stack) + } StackentryStart(builder) StackentryAddFrame(builder, t.Frame) StackentryAddStack(builder, stackOffset) @@ -71,6 +74,43 @@ func (rcv *Stackentry) MutateFrame(n uint32) bool { return rcv._tab.MutateUint32Slot(4, n) } +func StackentryKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &Stackentry{} + obj2 := &Stackentry{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return obj1.Frame() < obj2.Frame() +} + +func (rcv *Stackentry) LookupByKey(key uint32, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &Stackentry{} + obj.Init(buf, tableOffset) + val := obj.Frame() + comp := 0 + if val > key { + comp = 1 + } else if val < key { + comp = -1 + } + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + func (rcv *Stackentry) Stack() []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { diff --git a/pkg/fbs/comm/datalayer/remote/ConfigItem.go b/pkg/fbs/comm/datalayer/remote/ConfigItem.go index 2d70ffe..ee714fa 100644 --- a/pkg/fbs/comm/datalayer/remote/ConfigItem.go +++ b/pkg/fbs/comm/datalayer/remote/ConfigItem.go @@ -3,18 +3,25 @@ package remote import ( + "bytes" flatbuffers "github.com/google/flatbuffers/go" ) type ConfigItemT struct { - Name string - Address string + Name string `json:"name"` + Address string `json:"address"` } func (t *ConfigItemT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - addressOffset := builder.CreateString(t.Address) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + addressOffset := flatbuffers.UOffsetT(0) + if t.Address != "" { + addressOffset = builder.CreateString(t.Address) + } ConfigItemStart(builder) ConfigItemAddName(builder, nameOffset) ConfigItemAddAddress(builder, addressOffset) @@ -70,6 +77,38 @@ func (rcv *ConfigItem) Name() []byte { } /// name of the remote connection +func ConfigItemKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &ConfigItem{} + obj2 := &ConfigItem{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.Name()) < string(obj2.Name()) +} + +func (rcv *ConfigItem) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &ConfigItem{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.Name(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + /// remote data layer connection string func (rcv *ConfigItem) Address() []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) diff --git a/pkg/fbs/comm/datalayer/remote/RemoteConfig.go b/pkg/fbs/comm/datalayer/remote/RemoteConfig.go index 8fadbeb..0518643 100644 --- a/pkg/fbs/comm/datalayer/remote/RemoteConfig.go +++ b/pkg/fbs/comm/datalayer/remote/RemoteConfig.go @@ -7,7 +7,7 @@ import ( ) type RemoteConfigT struct { - Remotes []*ConfigItemT + Remotes []*ConfigItemT `json:"remotes"` } func (t *RemoteConfigT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -86,6 +86,15 @@ func (rcv *RemoteConfig) Remotes(obj *ConfigItem, j int) bool { return false } +func (rcv *RemoteConfig) RemotesByKey(obj *ConfigItem, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *RemoteConfig) RemotesLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) if o != 0 { diff --git a/pkg/fbs/comm/ethercat/master/fbs/AddressMappingEntry.go b/pkg/fbs/comm/ethercat/master/fbs/AddressMappingEntry.go index 4846537..3f278d9 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/AddressMappingEntry.go +++ b/pkg/fbs/comm/ethercat/master/fbs/AddressMappingEntry.go @@ -7,14 +7,17 @@ import ( ) type AddressMappingEntryT struct { - Address *AddressedRequestT - SlaveName string + Address *AddressedRequestT `json:"address"` + SlaveName string `json:"slaveName"` } func (t *AddressMappingEntryT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } addressOffset := t.Address.Pack(builder) - slaveNameOffset := builder.CreateString(t.SlaveName) + slaveNameOffset := flatbuffers.UOffsetT(0) + if t.SlaveName != "" { + slaveNameOffset = builder.CreateString(t.SlaveName) + } AddressMappingEntryStart(builder) AddressMappingEntryAddAddress(builder, addressOffset) AddressMappingEntryAddSlaveName(builder, slaveNameOffset) diff --git a/pkg/fbs/comm/ethercat/master/fbs/AddressedRequest.go b/pkg/fbs/comm/ethercat/master/fbs/AddressedRequest.go index 18c4b48..8056af5 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/AddressedRequest.go +++ b/pkg/fbs/comm/ethercat/master/fbs/AddressedRequest.go @@ -7,8 +7,8 @@ import ( ) type AddressedRequestT struct { - AddressType Addresstype - Address uint16 + AddressType Addresstype `json:"addressType"` + Address uint16 `json:"address"` } func (t *AddressedRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/AoeConfigInfo.go b/pkg/fbs/comm/ethercat/master/fbs/AoeConfigInfo.go index 7fa78c8..0abbbed 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/AoeConfigInfo.go +++ b/pkg/fbs/comm/ethercat/master/fbs/AoeConfigInfo.go @@ -7,8 +7,8 @@ import ( ) type AoeConfigInfoT struct { - Request *AddressedRequestT - Response *AoeConfigInfoResponseT + Request *AddressedRequestT `json:"request"` + Response *AoeConfigInfoResponseT `json:"response"` } func (t *AoeConfigInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/AoeConfigInfoResponse.go b/pkg/fbs/comm/ethercat/master/fbs/AoeConfigInfoResponse.go index d57897e..1d286fe 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/AoeConfigInfoResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/AoeConfigInfoResponse.go @@ -7,7 +7,7 @@ import ( ) type AoeConfigInfoResponseT struct { - NetId []byte + NetId []byte `json:"netId"` } func (t *AoeConfigInfoResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/AoeControl.go b/pkg/fbs/comm/ethercat/master/fbs/AoeControl.go index ffb1324..526dea4 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/AoeControl.go +++ b/pkg/fbs/comm/ethercat/master/fbs/AoeControl.go @@ -7,8 +7,8 @@ import ( ) type AoeControlT struct { - Request *AoeControlRequestT - Response *AoeControlResponseT + Request *AoeControlRequestT `json:"request"` + Response *AoeControlResponseT `json:"response"` } func (t *AoeControlT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/AoeControlRequest.go b/pkg/fbs/comm/ethercat/master/fbs/AoeControlRequest.go index bcbe952..5f7750b 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/AoeControlRequest.go +++ b/pkg/fbs/comm/ethercat/master/fbs/AoeControlRequest.go @@ -7,13 +7,13 @@ import ( ) type AoeControlRequestT struct { - AddressType Addresstype - Address uint16 - TargetNetId []byte - TargetPort uint16 - AoeState uint16 - DeviceState uint16 - Data []byte + AddressType Addresstype `json:"addressType"` + Address uint16 `json:"address"` + TargetNetId []byte `json:"targetNetId"` + TargetPort uint16 `json:"targetPort"` + AoeState uint16 `json:"aoeState"` + DeviceState uint16 `json:"deviceState"` + Data []byte `json:"data"` } func (t *AoeControlRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/AoeControlResponse.go b/pkg/fbs/comm/ethercat/master/fbs/AoeControlResponse.go index 68bcabc..75a2694 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/AoeControlResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/AoeControlResponse.go @@ -7,8 +7,8 @@ import ( ) type AoeControlResponseT struct { - ErrorCode uint32 - CmdResult uint32 + ErrorCode uint32 `json:"errorCode"` + CmdResult uint32 `json:"cmdResult"` } func (t *AoeControlResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/AoeData.go b/pkg/fbs/comm/ethercat/master/fbs/AoeData.go index 7e3cdbe..4eb8ffe 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/AoeData.go +++ b/pkg/fbs/comm/ethercat/master/fbs/AoeData.go @@ -7,8 +7,8 @@ import ( ) type AoeDataT struct { - Request *AoeDataRequestT - Response *AoeDataResponseT + Request *AoeDataRequestT `json:"request"` + Response *AoeDataResponseT `json:"response"` } func (t *AoeDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/AoeDataRequest.go b/pkg/fbs/comm/ethercat/master/fbs/AoeDataRequest.go index 00ff4fd..7e06256 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/AoeDataRequest.go +++ b/pkg/fbs/comm/ethercat/master/fbs/AoeDataRequest.go @@ -7,14 +7,14 @@ import ( ) type AoeDataRequestT struct { - AddressType Addresstype - Address uint16 - TargetNetId []byte - TargetPort uint16 - IndexGroup uint32 - IndexOffset uint32 - Data []byte - MaxLength uint32 + AddressType Addresstype `json:"addressType"` + Address uint16 `json:"address"` + TargetNetId []byte `json:"targetNetId"` + TargetPort uint16 `json:"targetPort"` + IndexGroup uint32 `json:"indexGroup"` + IndexOffset uint32 `json:"indexOffset"` + Data []byte `json:"data"` + MaxLength uint32 `json:"maxLength"` } func (t *AoeDataRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/AoeDataResponse.go b/pkg/fbs/comm/ethercat/master/fbs/AoeDataResponse.go index a4ef956..f7105a9 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/AoeDataResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/AoeDataResponse.go @@ -7,9 +7,9 @@ import ( ) type AoeDataResponseT struct { - Data []byte - ErrorCode uint32 - CmdResult uint32 + Data []byte `json:"data"` + ErrorCode uint32 `json:"errorCode"` + CmdResult uint32 `json:"cmdResult"` } func (t *AoeDataResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/BusLoadStatisticCounters.go b/pkg/fbs/comm/ethercat/master/fbs/BusLoadStatisticCounters.go index 7ef2dcc..2087fb7 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/BusLoadStatisticCounters.go +++ b/pkg/fbs/comm/ethercat/master/fbs/BusLoadStatisticCounters.go @@ -7,7 +7,7 @@ import ( ) type BusLoadStatisticCountersT struct { - Response *BusLoadStatisticCountersResponseT + Response *BusLoadStatisticCountersResponseT `json:"response"` } func (t *BusLoadStatisticCountersT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/BusLoadStatisticCountersResponse.go b/pkg/fbs/comm/ethercat/master/fbs/BusLoadStatisticCountersResponse.go index 3dc2041..0853eca 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/BusLoadStatisticCountersResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/BusLoadStatisticCountersResponse.go @@ -7,8 +7,8 @@ import ( ) type BusLoadStatisticCountersResponseT struct { - TxBytesPerSecond *MinActMaxValuesT - TxBytesPerCycle *MinActMaxValuesT + TxBytesPerSecond *MinActMaxValuesT `json:"txBytesPerSecond"` + TxBytesPerCycle *MinActMaxValuesT `json:"txBytesPerCycle"` } func (t *BusLoadStatisticCountersResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/Capability.go b/pkg/fbs/comm/ethercat/master/fbs/Capability.go index 995f5ba..a24acd1 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/Capability.go +++ b/pkg/fbs/comm/ethercat/master/fbs/Capability.go @@ -7,14 +7,20 @@ import ( ) type CapabilityT struct { - Name string - Value string + Name string `json:"name"` + Value string `json:"value"` } func (t *CapabilityT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - valueOffset := builder.CreateString(t.Value) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + valueOffset := flatbuffers.UOffsetT(0) + if t.Value != "" { + valueOffset = builder.CreateString(t.Value) + } CapabilityStart(builder) CapabilityAddName(builder, nameOffset) CapabilityAddValue(builder, valueOffset) diff --git a/pkg/fbs/comm/ethercat/master/fbs/CapableInterfaces.go b/pkg/fbs/comm/ethercat/master/fbs/CapableInterfaces.go index 96eb93e..c0463aa 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/CapableInterfaces.go +++ b/pkg/fbs/comm/ethercat/master/fbs/CapableInterfaces.go @@ -7,7 +7,7 @@ import ( ) type CapableInterfacesT struct { - InterfaceList []*InterfaceT + InterfaceList []*InterfaceT `json:"interfaceList"` } func (t *CapableInterfacesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/Checksum.go b/pkg/fbs/comm/ethercat/master/fbs/Checksum.go index 7e01b3d..932f758 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/Checksum.go +++ b/pkg/fbs/comm/ethercat/master/fbs/Checksum.go @@ -7,7 +7,7 @@ import ( ) type ChecksumT struct { - Response *ChecksumResponseT + Response *ChecksumResponseT `json:"response"` } func (t *ChecksumT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/ChecksumElement.go b/pkg/fbs/comm/ethercat/master/fbs/ChecksumElement.go index 2614564..9865315 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/ChecksumElement.go +++ b/pkg/fbs/comm/ethercat/master/fbs/ChecksumElement.go @@ -3,17 +3,21 @@ package fbs import ( + "bytes" flatbuffers "github.com/google/flatbuffers/go" ) type ChecksumElementT struct { - Id string - Checksum []byte + Id string `json:"id"` + Checksum []byte `json:"checksum"` } func (t *ChecksumElementT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - idOffset := builder.CreateString(t.Id) + idOffset := flatbuffers.UOffsetT(0) + if t.Id != "" { + idOffset = builder.CreateString(t.Id) + } checksumOffset := flatbuffers.UOffsetT(0) if t.Checksum != nil { checksumOffset = builder.CreateByteString(t.Checksum) @@ -71,6 +75,38 @@ func (rcv *ChecksumElement) Id() []byte { return nil } +func ChecksumElementKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &ChecksumElement{} + obj2 := &ChecksumElement{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.Id()) < string(obj2.Id()) +} + +func (rcv *ChecksumElement) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &ChecksumElement{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.Id(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + func (rcv *ChecksumElement) Checksum(j int) byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { diff --git a/pkg/fbs/comm/ethercat/master/fbs/ChecksumResponse.go b/pkg/fbs/comm/ethercat/master/fbs/ChecksumResponse.go index 56dfeb2..f4157c9 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/ChecksumResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/ChecksumResponse.go @@ -7,7 +7,7 @@ import ( ) type ChecksumResponseT struct { - Checksums []*ChecksumElementT + Checksums []*ChecksumElementT `json:"checksums"` } func (t *ChecksumResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -86,6 +86,15 @@ func (rcv *ChecksumResponse) Checksums(obj *ChecksumElement, j int) bool { return false } +func (rcv *ChecksumResponse) ChecksumsByKey(obj *ChecksumElement, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *ChecksumResponse) ChecksumsLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) if o != 0 { diff --git a/pkg/fbs/comm/ethercat/master/fbs/CoeVariableInfo.go b/pkg/fbs/comm/ethercat/master/fbs/CoeVariableInfo.go index a407cfd..29ffb89 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/CoeVariableInfo.go +++ b/pkg/fbs/comm/ethercat/master/fbs/CoeVariableInfo.go @@ -7,9 +7,9 @@ import ( ) type CoeVariableInfoT struct { - PdoIndex uint16 - ObjectIndex uint16 - SubIndex byte + PdoIndex uint16 `json:"pdoIndex"` + ObjectIndex uint16 `json:"objectIndex"` + SubIndex byte `json:"subIndex"` } func (t *CoeVariableInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/DcConfigInfo.go b/pkg/fbs/comm/ethercat/master/fbs/DcConfigInfo.go index feb3b14..c1530de 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/DcConfigInfo.go +++ b/pkg/fbs/comm/ethercat/master/fbs/DcConfigInfo.go @@ -7,7 +7,7 @@ import ( ) type DcConfigInfoT struct { - Response *DcConfigInfoResponseT + Response *DcConfigInfoResponseT `json:"response"` } func (t *DcConfigInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/DcConfigInfoResponse.go b/pkg/fbs/comm/ethercat/master/fbs/DcConfigInfoResponse.go index ae2482f..46e690e 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/DcConfigInfoResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/DcConfigInfoResponse.go @@ -7,12 +7,12 @@ import ( ) type DcConfigInfoResponseT struct { - SyncMode SyncMode - CycleTime uint32 - SyncShiftTime uint32 - SyncWindowMonitoring bool - DeviationLimit uint32 - ContinuousDelayCompensation bool + SyncMode SyncMode `json:"syncMode"` + CycleTime uint32 `json:"cycleTime"` + SyncShiftTime uint32 `json:"syncShiftTime"` + SyncWindowMonitoring bool `json:"syncWindowMonitoring"` + DeviationLimit uint32 `json:"deviationLimit"` + ContinuousDelayCompensation bool `json:"continuousDelayCompensation"` } func (t *DcConfigInfoResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/DcOnlineInfo.go b/pkg/fbs/comm/ethercat/master/fbs/DcOnlineInfo.go index a6b406a..0c65c5b 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/DcOnlineInfo.go +++ b/pkg/fbs/comm/ethercat/master/fbs/DcOnlineInfo.go @@ -7,7 +7,7 @@ import ( ) type DcOnlineInfoT struct { - Response *DcOnlineInfoResponseT + Response *DcOnlineInfoResponseT `json:"response"` } func (t *DcOnlineInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/DcOnlineInfoResponse.go b/pkg/fbs/comm/ethercat/master/fbs/DcOnlineInfoResponse.go index 69f779f..2f8c996 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/DcOnlineInfoResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/DcOnlineInfoResponse.go @@ -7,13 +7,13 @@ import ( ) type DcOnlineInfoResponseT struct { - SyncMode SyncMode - CycleTime uint32 - SyncShiftTime uint32 - SyncWindowMonitoring bool - DeviationLimit uint32 - ContinuousDelayCompensation bool - SystemTime uint64 + SyncMode SyncMode `json:"syncMode"` + CycleTime uint32 `json:"cycleTime"` + SyncShiftTime uint32 `json:"syncShiftTime"` + SyncWindowMonitoring bool `json:"syncWindowMonitoring"` + DeviationLimit uint32 `json:"deviationLimit"` + ContinuousDelayCompensation bool `json:"continuousDelayCompensation"` + SystemTime uint64 `json:"systemTime"` } func (t *DcOnlineInfoResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/EntryDescription.go b/pkg/fbs/comm/ethercat/master/fbs/EntryDescription.go index 6c44506..0cb2559 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/EntryDescription.go +++ b/pkg/fbs/comm/ethercat/master/fbs/EntryDescription.go @@ -7,8 +7,8 @@ import ( ) type EntryDescriptionT struct { - Request *EntryDescriptionRequestT - Response *EntryDescriptionResponseT + Request *EntryDescriptionRequestT `json:"request"` + Response *EntryDescriptionResponseT `json:"response"` } func (t *EntryDescriptionT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/EntryDescriptionRequest.go b/pkg/fbs/comm/ethercat/master/fbs/EntryDescriptionRequest.go index 00711d3..733ccb1 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/EntryDescriptionRequest.go +++ b/pkg/fbs/comm/ethercat/master/fbs/EntryDescriptionRequest.go @@ -7,12 +7,12 @@ import ( ) type EntryDescriptionRequestT struct { - AddressType Addresstype - Address uint16 - ObjectIndex uint16 - SubIndex byte - ValueInfo byte - MaxLength uint32 + AddressType Addresstype `json:"addressType"` + Address uint16 `json:"address"` + ObjectIndex uint16 `json:"objectIndex"` + SubIndex byte `json:"subIndex"` + ValueInfo byte `json:"valueInfo"` + MaxLength uint32 `json:"maxLength"` } func (t *EntryDescriptionRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/EntryDescriptionResponse.go b/pkg/fbs/comm/ethercat/master/fbs/EntryDescriptionResponse.go index 966850e..0d7a588 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/EntryDescriptionResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/EntryDescriptionResponse.go @@ -7,7 +7,7 @@ import ( ) type EntryDescriptionResponseT struct { - Data []byte + Data []byte `json:"data"` } func (t *EntryDescriptionResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/EoeConfigInfo.go b/pkg/fbs/comm/ethercat/master/fbs/EoeConfigInfo.go index 2989b91..64dceef 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/EoeConfigInfo.go +++ b/pkg/fbs/comm/ethercat/master/fbs/EoeConfigInfo.go @@ -7,8 +7,8 @@ import ( ) type EoeConfigInfoT struct { - Request *AddressedRequestT - Response *EoeConfigInfoResponseT + Request *AddressedRequestT `json:"request"` + Response *EoeConfigInfoResponseT `json:"response"` } func (t *EoeConfigInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/EoeConfigInfoResponse.go b/pkg/fbs/comm/ethercat/master/fbs/EoeConfigInfoResponse.go index 4064c7d..9f5e3d8 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/EoeConfigInfoResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/EoeConfigInfoResponse.go @@ -7,12 +7,12 @@ import ( ) type EoeConfigInfoResponseT struct { - MacAddress []byte - IpAddress []byte - SubnetMask []byte - DefaultGateway []byte - DnsIpAddress []byte - DnsName string + MacAddress []byte `json:"macAddress"` + IpAddress []byte `json:"ipAddress"` + SubnetMask []byte `json:"subnetMask"` + DefaultGateway []byte `json:"defaultGateway"` + DnsIpAddress []byte `json:"dnsIpAddress"` + DnsName string `json:"dnsName"` } func (t *EoeConfigInfoResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -37,7 +37,10 @@ func (t *EoeConfigInfoResponseT) Pack(builder *flatbuffers.Builder) flatbuffers. if t.DnsIpAddress != nil { dnsIpAddressOffset = builder.CreateByteString(t.DnsIpAddress) } - dnsNameOffset := builder.CreateString(t.DnsName) + dnsNameOffset := flatbuffers.UOffsetT(0) + if t.DnsName != "" { + dnsNameOffset = builder.CreateString(t.DnsName) + } EoeConfigInfoResponseStart(builder) EoeConfigInfoResponseAddMacAddress(builder, macAddressOffset) EoeConfigInfoResponseAddIpAddress(builder, ipAddressOffset) diff --git a/pkg/fbs/comm/ethercat/master/fbs/EthercatIdentityInfo.go b/pkg/fbs/comm/ethercat/master/fbs/EthercatIdentityInfo.go index bc5186d..def8fd2 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/EthercatIdentityInfo.go +++ b/pkg/fbs/comm/ethercat/master/fbs/EthercatIdentityInfo.go @@ -7,10 +7,10 @@ import ( ) type EthercatIdentityInfoT struct { - VendorId uint32 - ProductCode uint32 - RevisionNumber uint32 - SerialNumber uint32 + VendorId uint32 `json:"vendorId"` + ProductCode uint32 `json:"productCode"` + RevisionNumber uint32 `json:"revisionNumber"` + SerialNumber uint32 `json:"serialNumber"` } func (t *EthercatIdentityInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/EthercatMailboxInfo.go b/pkg/fbs/comm/ethercat/master/fbs/EthercatMailboxInfo.go index 236d07e..3d99820 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/EthercatMailboxInfo.go +++ b/pkg/fbs/comm/ethercat/master/fbs/EthercatMailboxInfo.go @@ -7,8 +7,8 @@ import ( ) type EthercatMailboxInfoT struct { - SizeIn uint32 - SizeOut uint32 + SizeIn uint32 `json:"sizeIn"` + SizeOut uint32 `json:"sizeOut"` } func (t *EthercatMailboxInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/EthercatMemoryInfo.go b/pkg/fbs/comm/ethercat/master/fbs/EthercatMemoryInfo.go index 037410d..63771e8 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/EthercatMemoryInfo.go +++ b/pkg/fbs/comm/ethercat/master/fbs/EthercatMemoryInfo.go @@ -7,8 +7,8 @@ import ( ) type EthercatMemoryInfoT struct { - Offset uint32 - Size uint32 + Offset uint32 `json:"offset"` + Size uint32 `json:"size"` } func (t *EthercatMemoryInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/FieldbusConfig.go b/pkg/fbs/comm/ethercat/master/fbs/FieldbusConfig.go index 9d3eb1f..3b747ca 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/FieldbusConfig.go +++ b/pkg/fbs/comm/ethercat/master/fbs/FieldbusConfig.go @@ -7,8 +7,8 @@ import ( ) type FieldbusConfigT struct { - Request *FieldbusConfigRequestT - Response *FieldbusConfigResponseT + Request *FieldbusConfigRequestT `json:"request"` + Response *FieldbusConfigResponseT `json:"response"` } func (t *FieldbusConfigT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/FieldbusConfigRequest.go b/pkg/fbs/comm/ethercat/master/fbs/FieldbusConfigRequest.go index 895fb59..7730127 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/FieldbusConfigRequest.go +++ b/pkg/fbs/comm/ethercat/master/fbs/FieldbusConfigRequest.go @@ -7,8 +7,8 @@ import ( ) type FieldbusConfigRequestT struct { - Ini []byte - Eni []byte + Ini []byte `json:"ini"` + Eni []byte `json:"eni"` } func (t *FieldbusConfigRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/FieldbusConfigResponse.go b/pkg/fbs/comm/ethercat/master/fbs/FieldbusConfigResponse.go index 954d262..3b93c59 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/FieldbusConfigResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/FieldbusConfigResponse.go @@ -7,8 +7,8 @@ import ( ) type FieldbusConfigResponseT struct { - Ini []byte - Eni []byte + Ini []byte `json:"ini"` + Eni []byte `json:"eni"` } func (t *FieldbusConfigResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/Foe.go b/pkg/fbs/comm/ethercat/master/fbs/Foe.go index 940f258..1b0cb11 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/Foe.go +++ b/pkg/fbs/comm/ethercat/master/fbs/Foe.go @@ -7,8 +7,8 @@ import ( ) type FoeT struct { - Request *FoeRequestT - Response *FoeResponseT + Request *FoeRequestT `json:"request"` + Response *FoeResponseT `json:"response"` } func (t *FoeT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/FoeRequest.go b/pkg/fbs/comm/ethercat/master/fbs/FoeRequest.go index 8c50c6a..e15703b 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/FoeRequest.go +++ b/pkg/fbs/comm/ethercat/master/fbs/FoeRequest.go @@ -7,13 +7,13 @@ import ( ) type FoeRequestT struct { - AddressType Addresstype - Address uint16 - Data []byte - MaxLength uint32 - Filename string - Password uint32 - Timeout uint32 + AddressType Addresstype `json:"addressType"` + Address uint16 `json:"address"` + Data []byte `json:"data"` + MaxLength uint32 `json:"maxLength"` + Filename string `json:"filename"` + Password uint32 `json:"password"` + Timeout uint32 `json:"timeout"` } func (t *FoeRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -22,7 +22,10 @@ func (t *FoeRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t.Data != nil { dataOffset = builder.CreateByteString(t.Data) } - filenameOffset := builder.CreateString(t.Filename) + filenameOffset := flatbuffers.UOffsetT(0) + if t.Filename != "" { + filenameOffset = builder.CreateString(t.Filename) + } FoeRequestStart(builder) FoeRequestAddAddressType(builder, t.AddressType) FoeRequestAddAddress(builder, t.Address) diff --git a/pkg/fbs/comm/ethercat/master/fbs/FoeResponse.go b/pkg/fbs/comm/ethercat/master/fbs/FoeResponse.go index 5304b3b..3dc8a12 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/FoeResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/FoeResponse.go @@ -7,7 +7,7 @@ import ( ) type FoeResponseT struct { - Data []byte + Data []byte `json:"data"` } func (t *FoeResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/FrameStatisticCounters.go b/pkg/fbs/comm/ethercat/master/fbs/FrameStatisticCounters.go index 6b94198..b46b71e 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/FrameStatisticCounters.go +++ b/pkg/fbs/comm/ethercat/master/fbs/FrameStatisticCounters.go @@ -7,7 +7,7 @@ import ( ) type FrameStatisticCountersT struct { - Response *FrameStatisticCountersResponseT + Response *FrameStatisticCountersResponseT `json:"response"` } func (t *FrameStatisticCountersT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/FrameStatisticCountersResponse.go b/pkg/fbs/comm/ethercat/master/fbs/FrameStatisticCountersResponse.go index fb5067e..8be6e68 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/FrameStatisticCountersResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/FrameStatisticCountersResponse.go @@ -7,15 +7,15 @@ import ( ) type FrameStatisticCountersResponseT struct { - NumTxFrames uint32 - NumRxFrames uint32 - NumCyclicFrames uint32 - NumCyclicDatagrams uint32 - NumAcyclicFrames uint32 - NumAcyclicDatagrams uint32 - NumLostFrames uint32 - NumLostCyclicFrames uint32 - NumLostAcyclicFrames uint32 + NumTxFrames uint32 `json:"numTxFrames"` + NumRxFrames uint32 `json:"numRxFrames"` + NumCyclicFrames uint32 `json:"numCyclicFrames"` + NumCyclicDatagrams uint32 `json:"numCyclicDatagrams"` + NumAcyclicFrames uint32 `json:"numAcyclicFrames"` + NumAcyclicDatagrams uint32 `json:"numAcyclicDatagrams"` + NumLostFrames uint32 `json:"numLostFrames"` + NumLostCyclicFrames uint32 `json:"numLostCyclicFrames"` + NumLostAcyclicFrames uint32 `json:"numLostAcyclicFrames"` } func (t *FrameStatisticCountersResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/FrameStatisticReset.go b/pkg/fbs/comm/ethercat/master/fbs/FrameStatisticReset.go index 362391d..0c95e2d 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/FrameStatisticReset.go +++ b/pkg/fbs/comm/ethercat/master/fbs/FrameStatisticReset.go @@ -7,7 +7,7 @@ import ( ) type FrameStatisticResetT struct { - Request *FrameStatisticResetRequestT + Request *FrameStatisticResetRequestT `json:"request"` } func (t *FrameStatisticResetT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/FrameStatisticResetRequest.go b/pkg/fbs/comm/ethercat/master/fbs/FrameStatisticResetRequest.go index c85394a..7f5b8d1 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/FrameStatisticResetRequest.go +++ b/pkg/fbs/comm/ethercat/master/fbs/FrameStatisticResetRequest.go @@ -7,15 +7,15 @@ import ( ) type FrameStatisticResetRequestT struct { - NumTxFrames bool - NumRxFrames bool - NumCyclicFrames bool - NumCyclicDatagrams bool - NumAcyclicFrames bool - NumAcyclicDatagrams bool - NumLostFrames bool - NumLostCyclicFrames bool - NumLostAcyclicFrames bool + NumTxFrames bool `json:"numTxFrames"` + NumRxFrames bool `json:"numRxFrames"` + NumCyclicFrames bool `json:"numCyclicFrames"` + NumCyclicDatagrams bool `json:"numCyclicDatagrams"` + NumAcyclicFrames bool `json:"numAcyclicFrames"` + NumAcyclicDatagrams bool `json:"numAcyclicDatagrams"` + NumLostFrames bool `json:"numLostFrames"` + NumLostCyclicFrames bool `json:"numLostCyclicFrames"` + NumLostAcyclicFrames bool `json:"numLostAcyclicFrames"` } func (t *FrameStatisticResetRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/InhibitTime.go b/pkg/fbs/comm/ethercat/master/fbs/InhibitTime.go index 061183e..d3b222c 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/InhibitTime.go +++ b/pkg/fbs/comm/ethercat/master/fbs/InhibitTime.go @@ -7,7 +7,7 @@ import ( ) type InhibitTimeT struct { - Response *InhibitTimeResponseT + Response *InhibitTimeResponseT `json:"response"` } func (t *InhibitTimeT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/InhibitTimeResponse.go b/pkg/fbs/comm/ethercat/master/fbs/InhibitTimeResponse.go index 1a40a8d..afbf57f 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/InhibitTimeResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/InhibitTimeResponse.go @@ -7,7 +7,7 @@ import ( ) type InhibitTimeResponseT struct { - Time uint32 + Time uint32 `json:"time"` } func (t *InhibitTimeResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/InstancesCreate.go b/pkg/fbs/comm/ethercat/master/fbs/InstancesCreate.go index cf44d0e..9f4bbc9 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/InstancesCreate.go +++ b/pkg/fbs/comm/ethercat/master/fbs/InstancesCreate.go @@ -7,7 +7,7 @@ import ( ) type InstancesCreateT struct { - Request *InstancesCreateRequestT + Request *InstancesCreateRequestT `json:"request"` } func (t *InstancesCreateT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/InstancesCreateRequest.go b/pkg/fbs/comm/ethercat/master/fbs/InstancesCreateRequest.go index dc24f79..5510832 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/InstancesCreateRequest.go +++ b/pkg/fbs/comm/ethercat/master/fbs/InstancesCreateRequest.go @@ -7,18 +7,30 @@ import ( ) type InstancesCreateRequestT struct { - InstanceName string - Port string - LinkLayer string - Arguments string + InstanceName string `json:"instanceName"` + Port string `json:"port"` + LinkLayer string `json:"linkLayer"` + Arguments string `json:"arguments"` } func (t *InstancesCreateRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - instanceNameOffset := builder.CreateString(t.InstanceName) - portOffset := builder.CreateString(t.Port) - linkLayerOffset := builder.CreateString(t.LinkLayer) - argumentsOffset := builder.CreateString(t.Arguments) + instanceNameOffset := flatbuffers.UOffsetT(0) + if t.InstanceName != "" { + instanceNameOffset = builder.CreateString(t.InstanceName) + } + portOffset := flatbuffers.UOffsetT(0) + if t.Port != "" { + portOffset = builder.CreateString(t.Port) + } + linkLayerOffset := flatbuffers.UOffsetT(0) + if t.LinkLayer != "" { + linkLayerOffset = builder.CreateString(t.LinkLayer) + } + argumentsOffset := flatbuffers.UOffsetT(0) + if t.Arguments != "" { + argumentsOffset = builder.CreateString(t.Arguments) + } InstancesCreateRequestStart(builder) InstancesCreateRequestAddInstanceName(builder, instanceNameOffset) InstancesCreateRequestAddPort(builder, portOffset) diff --git a/pkg/fbs/comm/ethercat/master/fbs/Interface.go b/pkg/fbs/comm/ethercat/master/fbs/Interface.go index 31de45d..b905faf 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/Interface.go +++ b/pkg/fbs/comm/ethercat/master/fbs/Interface.go @@ -7,17 +7,26 @@ import ( ) type InterfaceT struct { - Port string - Device string - LinkLayer string - CapabilityList []*CapabilityT + Port string `json:"port"` + Device string `json:"device"` + LinkLayer string `json:"linkLayer"` + CapabilityList []*CapabilityT `json:"capabilityList"` } func (t *InterfaceT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - portOffset := builder.CreateString(t.Port) - deviceOffset := builder.CreateString(t.Device) - linkLayerOffset := builder.CreateString(t.LinkLayer) + portOffset := flatbuffers.UOffsetT(0) + if t.Port != "" { + portOffset = builder.CreateString(t.Port) + } + deviceOffset := flatbuffers.UOffsetT(0) + if t.Device != "" { + deviceOffset = builder.CreateString(t.Device) + } + linkLayerOffset := flatbuffers.UOffsetT(0) + if t.LinkLayer != "" { + linkLayerOffset = builder.CreateString(t.LinkLayer) + } capabilityListOffset := flatbuffers.UOffsetT(0) if t.CapabilityList != nil { capabilityListLength := len(t.CapabilityList) diff --git a/pkg/fbs/comm/ethercat/master/fbs/LinkLayerConfigInfo.go b/pkg/fbs/comm/ethercat/master/fbs/LinkLayerConfigInfo.go index 6b20933..351571a 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/LinkLayerConfigInfo.go +++ b/pkg/fbs/comm/ethercat/master/fbs/LinkLayerConfigInfo.go @@ -7,7 +7,7 @@ import ( ) type LinkLayerConfigInfoT struct { - Response *LinkLayerConfigInfoResponseT + Response *LinkLayerConfigInfoResponseT `json:"response"` } func (t *LinkLayerConfigInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/LinkLayerConfigInfoResponse.go b/pkg/fbs/comm/ethercat/master/fbs/LinkLayerConfigInfoResponse.go index d43ac14..4ddcdd2 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/LinkLayerConfigInfoResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/LinkLayerConfigInfoResponse.go @@ -7,16 +7,25 @@ import ( ) type LinkLayerConfigInfoResponseT struct { - Port string - LinkLayer string - Arguments string + Port string `json:"port"` + LinkLayer string `json:"linkLayer"` + Arguments string `json:"arguments"` } func (t *LinkLayerConfigInfoResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - portOffset := builder.CreateString(t.Port) - linkLayerOffset := builder.CreateString(t.LinkLayer) - argumentsOffset := builder.CreateString(t.Arguments) + portOffset := flatbuffers.UOffsetT(0) + if t.Port != "" { + portOffset = builder.CreateString(t.Port) + } + linkLayerOffset := flatbuffers.UOffsetT(0) + if t.LinkLayer != "" { + linkLayerOffset = builder.CreateString(t.LinkLayer) + } + argumentsOffset := flatbuffers.UOffsetT(0) + if t.Arguments != "" { + argumentsOffset = builder.CreateString(t.Arguments) + } LinkLayerConfigInfoResponseStart(builder) LinkLayerConfigInfoResponseAddPort(builder, portOffset) LinkLayerConfigInfoResponseAddLinkLayer(builder, linkLayerOffset) diff --git a/pkg/fbs/comm/ethercat/master/fbs/LinkLayerOnlineInfo.go b/pkg/fbs/comm/ethercat/master/fbs/LinkLayerOnlineInfo.go index 3c243e1..eb88538 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/LinkLayerOnlineInfo.go +++ b/pkg/fbs/comm/ethercat/master/fbs/LinkLayerOnlineInfo.go @@ -7,7 +7,7 @@ import ( ) type LinkLayerOnlineInfoT struct { - Response *LinkLayerOnlineInfoResponseT + Response *LinkLayerOnlineInfoResponseT `json:"response"` } func (t *LinkLayerOnlineInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/LinkLayerOnlineInfoResponse.go b/pkg/fbs/comm/ethercat/master/fbs/LinkLayerOnlineInfoResponse.go index dc4110a..d8112e0 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/LinkLayerOnlineInfoResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/LinkLayerOnlineInfoResponse.go @@ -7,27 +7,39 @@ import ( ) type LinkLayerOnlineInfoResponseT struct { - Port string - LinkLayer string - Arguments string - Message string - MacAddress []byte - FrameRepeatCntSupport bool - LinkSpeed uint32 - LinkMode LinkMode - LinkStatus LinkStatus - RefClockWidth uint32 - SystemTime uint64 - PhysicalErrorCnt uint32 - TelegramErrorCnt uint32 + Port string `json:"port"` + LinkLayer string `json:"linkLayer"` + Arguments string `json:"arguments"` + Message string `json:"message"` + MacAddress []byte `json:"macAddress"` + FrameRepeatCntSupport bool `json:"frameRepeatCntSupport"` + LinkSpeed uint32 `json:"linkSpeed"` + LinkMode LinkMode `json:"linkMode"` + LinkStatus LinkStatus `json:"linkStatus"` + RefClockWidth uint32 `json:"refClockWidth"` + SystemTime uint64 `json:"systemTime"` + PhysicalErrorCnt uint32 `json:"physicalErrorCnt"` + TelegramErrorCnt uint32 `json:"telegramErrorCnt"` } func (t *LinkLayerOnlineInfoResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - portOffset := builder.CreateString(t.Port) - linkLayerOffset := builder.CreateString(t.LinkLayer) - argumentsOffset := builder.CreateString(t.Arguments) - messageOffset := builder.CreateString(t.Message) + portOffset := flatbuffers.UOffsetT(0) + if t.Port != "" { + portOffset = builder.CreateString(t.Port) + } + linkLayerOffset := flatbuffers.UOffsetT(0) + if t.LinkLayer != "" { + linkLayerOffset = builder.CreateString(t.LinkLayer) + } + argumentsOffset := flatbuffers.UOffsetT(0) + if t.Arguments != "" { + argumentsOffset = builder.CreateString(t.Arguments) + } + messageOffset := flatbuffers.UOffsetT(0) + if t.Message != "" { + messageOffset = builder.CreateString(t.Message) + } macAddressOffset := flatbuffers.UOffsetT(0) if t.MacAddress != nil { macAddressOffset = builder.CreateByteString(t.MacAddress) diff --git a/pkg/fbs/comm/ethercat/master/fbs/MailboxStatisticCounters.go b/pkg/fbs/comm/ethercat/master/fbs/MailboxStatisticCounters.go index 45ca52d..bab86ad 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/MailboxStatisticCounters.go +++ b/pkg/fbs/comm/ethercat/master/fbs/MailboxStatisticCounters.go @@ -7,7 +7,7 @@ import ( ) type MailboxStatisticCountersT struct { - Response *MailboxStatisticCountersResponseT + Response *MailboxStatisticCountersResponseT `json:"response"` } func (t *MailboxStatisticCountersT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/MailboxStatisticCountersResponse.go b/pkg/fbs/comm/ethercat/master/fbs/MailboxStatisticCountersResponse.go index f02c75f..e9df4ce 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/MailboxStatisticCountersResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/MailboxStatisticCountersResponse.go @@ -7,13 +7,13 @@ import ( ) type MailboxStatisticCountersResponseT struct { - Aoe *ProtocolStatisticT - Coe *ProtocolStatisticT - Eoe *ProtocolStatisticT - Foe *ProtocolStatisticT - Soe *ProtocolStatisticT - Voe *ProtocolStatisticT - Raw *ProtocolStatisticT + Aoe *ProtocolStatisticT `json:"aoe"` + Coe *ProtocolStatisticT `json:"coe"` + Eoe *ProtocolStatisticT `json:"eoe"` + Foe *ProtocolStatisticT `json:"foe"` + Soe *ProtocolStatisticT `json:"soe"` + Voe *ProtocolStatisticT `json:"voe"` + Raw *ProtocolStatisticT `json:"raw"` } func (t *MailboxStatisticCountersResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/MailboxStatisticReset.go b/pkg/fbs/comm/ethercat/master/fbs/MailboxStatisticReset.go index 503af5c..0bf9cb4 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/MailboxStatisticReset.go +++ b/pkg/fbs/comm/ethercat/master/fbs/MailboxStatisticReset.go @@ -7,8 +7,8 @@ import ( ) type MailboxStatisticResetT struct { - Request *MailboxStatisticResetRequestT - Response *MailboxStatisticResetResponseT + Request *MailboxStatisticResetRequestT `json:"request"` + Response *MailboxStatisticResetResponseT `json:"response"` } func (t *MailboxStatisticResetT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/MailboxStatisticResetRequest.go b/pkg/fbs/comm/ethercat/master/fbs/MailboxStatisticResetRequest.go index 3928ec0..3c6ad2b 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/MailboxStatisticResetRequest.go +++ b/pkg/fbs/comm/ethercat/master/fbs/MailboxStatisticResetRequest.go @@ -7,13 +7,13 @@ import ( ) type MailboxStatisticResetRequestT struct { - Aoe *ProtocolStatisticResetT - Coe *ProtocolStatisticResetT - Foe *ProtocolStatisticResetT - Eoe *ProtocolStatisticResetT - Soe *ProtocolStatisticResetT - Voe *ProtocolStatisticResetT - Raw *ProtocolStatisticResetT + Aoe *ProtocolStatisticResetT `json:"aoe"` + Coe *ProtocolStatisticResetT `json:"coe"` + Foe *ProtocolStatisticResetT `json:"foe"` + Eoe *ProtocolStatisticResetT `json:"eoe"` + Soe *ProtocolStatisticResetT `json:"soe"` + Voe *ProtocolStatisticResetT `json:"voe"` + Raw *ProtocolStatisticResetT `json:"raw"` } func (t *MailboxStatisticResetRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/MasterInfo.go b/pkg/fbs/comm/ethercat/master/fbs/MasterInfo.go index 4f35223..c592711 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/MasterInfo.go +++ b/pkg/fbs/comm/ethercat/master/fbs/MasterInfo.go @@ -7,7 +7,7 @@ import ( ) type MasterInfoT struct { - Response *MasterInfoResponseT + Response *MasterInfoResponseT `json:"response"` } func (t *MasterInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/MasterInfoResponse.go b/pkg/fbs/comm/ethercat/master/fbs/MasterInfoResponse.go index b48c7c9..970a4e4 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/MasterInfoResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/MasterInfoResponse.go @@ -9,13 +9,13 @@ import ( ) type MasterInfoResponseT struct { - MasterState *MasterStateResponseT - MasterStatus uint32 - Checksums []*ChecksumElementT - TopologyStatus *TopologyStatusResponseT - SystemTime uint64 - TaskInfos []*taskInfoT - ComponentState *common__scheduler__fbs2.StateT + MasterState *MasterStateResponseT `json:"masterState"` + MasterStatus uint32 `json:"masterStatus"` + Checksums []*ChecksumElementT `json:"checksums"` + TopologyStatus *TopologyStatusResponseT `json:"topologyStatus"` + SystemTime uint64 `json:"systemTime"` + TaskInfos []*taskInfoT `json:"taskInfos"` + ComponentState *common__scheduler__fbs2.StateT `json:"componentState"` } func (t *MasterInfoResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -153,6 +153,15 @@ func (rcv *MasterInfoResponse) Checksums(obj *ChecksumElement, j int) bool { return false } +func (rcv *MasterInfoResponse) ChecksumsByKey(obj *ChecksumElement, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *MasterInfoResponse) ChecksumsLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) if o != 0 { diff --git a/pkg/fbs/comm/ethercat/master/fbs/MasterState.go b/pkg/fbs/comm/ethercat/master/fbs/MasterState.go index 9a52182..77994ae 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/MasterState.go +++ b/pkg/fbs/comm/ethercat/master/fbs/MasterState.go @@ -7,8 +7,8 @@ import ( ) type MasterStateT struct { - Request *MasterStateRequestT - Response *MasterStateResponseT + Request *MasterStateRequestT `json:"request"` + Response *MasterStateResponseT `json:"response"` } func (t *MasterStateT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/MasterStateRequest.go b/pkg/fbs/comm/ethercat/master/fbs/MasterStateRequest.go index e1cd9f1..c30880c 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/MasterStateRequest.go +++ b/pkg/fbs/comm/ethercat/master/fbs/MasterStateRequest.go @@ -7,7 +7,7 @@ import ( ) type MasterStateRequestT struct { - NewState EthercatState + NewState EthercatState `json:"newState"` } func (t *MasterStateRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/MasterStateResponse.go b/pkg/fbs/comm/ethercat/master/fbs/MasterStateResponse.go index d2286f5..4e037f7 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/MasterStateResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/MasterStateResponse.go @@ -7,8 +7,8 @@ import ( ) type MasterStateResponseT struct { - CurrentState EthercatState - RequestedState EthercatState + CurrentState EthercatState `json:"currentState"` + RequestedState EthercatState `json:"requestedState"` } func (t *MasterStateResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/MasterStatus.go b/pkg/fbs/comm/ethercat/master/fbs/MasterStatus.go index c3905b1..4a89225 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/MasterStatus.go +++ b/pkg/fbs/comm/ethercat/master/fbs/MasterStatus.go @@ -7,7 +7,7 @@ import ( ) type MasterStatusT struct { - Response *MasterStatusResponseT + Response *MasterStatusResponseT `json:"response"` } func (t *MasterStatusT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/MasterStatusResponse.go b/pkg/fbs/comm/ethercat/master/fbs/MasterStatusResponse.go index 5559e8a..97120f6 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/MasterStatusResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/MasterStatusResponse.go @@ -7,7 +7,7 @@ import ( ) type MasterStatusResponseT struct { - Status uint32 + Status uint32 `json:"status"` } func (t *MasterStatusResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/MinActMaxValues.go b/pkg/fbs/comm/ethercat/master/fbs/MinActMaxValues.go index ff6d49f..ab63f25 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/MinActMaxValues.go +++ b/pkg/fbs/comm/ethercat/master/fbs/MinActMaxValues.go @@ -7,9 +7,9 @@ import ( ) type MinActMaxValuesT struct { - Minimum uint32 - Actual uint32 - Maximum uint32 + Minimum uint32 `json:"minimum"` + Actual uint32 `json:"actual"` + Maximum uint32 `json:"maximum"` } func (t *MinActMaxValuesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/NumConfiguredMailboxSlaves.go b/pkg/fbs/comm/ethercat/master/fbs/NumConfiguredMailboxSlaves.go index 9b0a463..db928ea 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/NumConfiguredMailboxSlaves.go +++ b/pkg/fbs/comm/ethercat/master/fbs/NumConfiguredMailboxSlaves.go @@ -7,7 +7,7 @@ import ( ) type NumConfiguredMailboxSlavesT struct { - Response *NumConfiguredMailboxSlavesResponseT + Response *NumConfiguredMailboxSlavesResponseT `json:"response"` } func (t *NumConfiguredMailboxSlavesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/NumConfiguredMailboxSlavesResponse.go b/pkg/fbs/comm/ethercat/master/fbs/NumConfiguredMailboxSlavesResponse.go index 416f92a..eab910c 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/NumConfiguredMailboxSlavesResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/NumConfiguredMailboxSlavesResponse.go @@ -7,7 +7,7 @@ import ( ) type NumConfiguredMailboxSlavesResponseT struct { - NumSlaves uint32 + NumSlaves uint32 `json:"numSlaves"` } func (t *NumConfiguredMailboxSlavesResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/NumConfiguredSlaves.go b/pkg/fbs/comm/ethercat/master/fbs/NumConfiguredSlaves.go index af2e9c8..231f2e1 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/NumConfiguredSlaves.go +++ b/pkg/fbs/comm/ethercat/master/fbs/NumConfiguredSlaves.go @@ -7,7 +7,7 @@ import ( ) type NumConfiguredSlavesT struct { - Response *NumConfiguredSlavesResponseT + Response *NumConfiguredSlavesResponseT `json:"response"` } func (t *NumConfiguredSlavesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/NumConfiguredSlavesResponse.go b/pkg/fbs/comm/ethercat/master/fbs/NumConfiguredSlavesResponse.go index aa19cd0..a4adf0b 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/NumConfiguredSlavesResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/NumConfiguredSlavesResponse.go @@ -7,7 +7,7 @@ import ( ) type NumConfiguredSlavesResponseT struct { - NumSlaves uint32 + NumSlaves uint32 `json:"numSlaves"` } func (t *NumConfiguredSlavesResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/NumConnectedDcSlaves.go b/pkg/fbs/comm/ethercat/master/fbs/NumConnectedDcSlaves.go index 364bc00..7bce850 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/NumConnectedDcSlaves.go +++ b/pkg/fbs/comm/ethercat/master/fbs/NumConnectedDcSlaves.go @@ -7,7 +7,7 @@ import ( ) type NumConnectedDcSlavesT struct { - Response *NumConnectedDcSlavesResponseT + Response *NumConnectedDcSlavesResponseT `json:"response"` } func (t *NumConnectedDcSlavesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/NumConnectedDcSlavesResponse.go b/pkg/fbs/comm/ethercat/master/fbs/NumConnectedDcSlavesResponse.go index 2e81c2c..71a27f6 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/NumConnectedDcSlavesResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/NumConnectedDcSlavesResponse.go @@ -7,7 +7,7 @@ import ( ) type NumConnectedDcSlavesResponseT struct { - NumSlaves uint32 + NumSlaves uint32 `json:"numSlaves"` } func (t *NumConnectedDcSlavesResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/NumConnectedSlaves.go b/pkg/fbs/comm/ethercat/master/fbs/NumConnectedSlaves.go index 64767ce..8f8b44f 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/NumConnectedSlaves.go +++ b/pkg/fbs/comm/ethercat/master/fbs/NumConnectedSlaves.go @@ -7,7 +7,7 @@ import ( ) type NumConnectedSlavesT struct { - Response *NumConnectedSlavesResponseT + Response *NumConnectedSlavesResponseT `json:"response"` } func (t *NumConnectedSlavesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/NumConnectedSlavesResponse.go b/pkg/fbs/comm/ethercat/master/fbs/NumConnectedSlavesResponse.go index a8a5274..3328aba 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/NumConnectedSlavesResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/NumConnectedSlavesResponse.go @@ -7,7 +7,7 @@ import ( ) type NumConnectedSlavesResponseT struct { - NumSlaves uint32 + NumSlaves uint32 `json:"numSlaves"` } func (t *NumConnectedSlavesResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/ObjectDescription.go b/pkg/fbs/comm/ethercat/master/fbs/ObjectDescription.go index 5ad97c5..75bbe25 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/ObjectDescription.go +++ b/pkg/fbs/comm/ethercat/master/fbs/ObjectDescription.go @@ -7,8 +7,8 @@ import ( ) type ObjectDescriptionT struct { - Request *ObjectDescriptionRequestT - Response *ObjectDescriptionResponseT + Request *ObjectDescriptionRequestT `json:"request"` + Response *ObjectDescriptionResponseT `json:"response"` } func (t *ObjectDescriptionT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/ObjectDescriptionRequest.go b/pkg/fbs/comm/ethercat/master/fbs/ObjectDescriptionRequest.go index 2685293..a41700b 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/ObjectDescriptionRequest.go +++ b/pkg/fbs/comm/ethercat/master/fbs/ObjectDescriptionRequest.go @@ -7,10 +7,10 @@ import ( ) type ObjectDescriptionRequestT struct { - AddressType Addresstype - Address uint16 - ObjectIndex uint16 - MaxLength uint32 + AddressType Addresstype `json:"addressType"` + Address uint16 `json:"address"` + ObjectIndex uint16 `json:"objectIndex"` + MaxLength uint32 `json:"maxLength"` } func (t *ObjectDescriptionRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/ObjectDescriptionResponse.go b/pkg/fbs/comm/ethercat/master/fbs/ObjectDescriptionResponse.go index 40b83db..45a8296 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/ObjectDescriptionResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/ObjectDescriptionResponse.go @@ -7,7 +7,7 @@ import ( ) type ObjectDescriptionResponseT struct { - Data []byte + Data []byte `json:"data"` } func (t *ObjectDescriptionResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/ObjectDictionaryList.go b/pkg/fbs/comm/ethercat/master/fbs/ObjectDictionaryList.go index a99b16f..6d3aa25 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/ObjectDictionaryList.go +++ b/pkg/fbs/comm/ethercat/master/fbs/ObjectDictionaryList.go @@ -7,8 +7,8 @@ import ( ) type ObjectDictionaryListT struct { - Request *ObjectDictionaryListRequestT - Response *ObjectDictionaryListResponseT + Request *ObjectDictionaryListRequestT `json:"request"` + Response *ObjectDictionaryListResponseT `json:"response"` } func (t *ObjectDictionaryListT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/ObjectDictionaryListRequest.go b/pkg/fbs/comm/ethercat/master/fbs/ObjectDictionaryListRequest.go index edc9bf7..5a54523 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/ObjectDictionaryListRequest.go +++ b/pkg/fbs/comm/ethercat/master/fbs/ObjectDictionaryListRequest.go @@ -7,10 +7,10 @@ import ( ) type ObjectDictionaryListRequestT struct { - AddressType Addresstype - Address uint16 - ListType ObjectDictionaryListType - MaxElements uint32 + AddressType Addresstype `json:"addressType"` + Address uint16 `json:"address"` + ListType ObjectDictionaryListType `json:"listType"` + MaxElements uint32 `json:"maxElements"` } func (t *ObjectDictionaryListRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/ObjectDictionaryListResponse.go b/pkg/fbs/comm/ethercat/master/fbs/ObjectDictionaryListResponse.go index ecdf79b..712e568 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/ObjectDictionaryListResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/ObjectDictionaryListResponse.go @@ -7,7 +7,7 @@ import ( ) type ObjectDictionaryListResponseT struct { - Indices []uint16 + Indices []uint16 `json:"indices"` } func (t *ObjectDictionaryListResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/Parameter.go b/pkg/fbs/comm/ethercat/master/fbs/Parameter.go index 2b619f4..3c7a257 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/Parameter.go +++ b/pkg/fbs/comm/ethercat/master/fbs/Parameter.go @@ -7,8 +7,8 @@ import ( ) type ParameterT struct { - Request *ParameterRequestT - Response *ParameterResponseT + Request *ParameterRequestT `json:"request"` + Response *ParameterResponseT `json:"response"` } func (t *ParameterT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/ParameterRequest.go b/pkg/fbs/comm/ethercat/master/fbs/ParameterRequest.go index 7dfa28c..bcc037f 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/ParameterRequest.go +++ b/pkg/fbs/comm/ethercat/master/fbs/ParameterRequest.go @@ -7,13 +7,13 @@ import ( ) type ParameterRequestT struct { - AddressType Addresstype - Address uint16 - DriveNumber byte - ElementFlags ElementFlags - Idn uint16 - Data []byte - MaxLength uint32 + AddressType Addresstype `json:"addressType"` + Address uint16 `json:"address"` + DriveNumber byte `json:"driveNumber"` + ElementFlags ElementFlags `json:"elementFlags"` + Idn uint16 `json:"idn"` + Data []byte `json:"data"` + MaxLength uint32 `json:"maxLength"` } func (t *ParameterRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/ParameterResponse.go b/pkg/fbs/comm/ethercat/master/fbs/ParameterResponse.go index 196668b..fae2980 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/ParameterResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/ParameterResponse.go @@ -7,8 +7,8 @@ import ( ) type ParameterResponseT struct { - ElementFlags ElementFlags - Data []byte + ElementFlags ElementFlags `json:"elementFlags"` + Data []byte `json:"data"` } func (t *ParameterResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/PortErrorCounters.go b/pkg/fbs/comm/ethercat/master/fbs/PortErrorCounters.go index 30f1893..570c307 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/PortErrorCounters.go +++ b/pkg/fbs/comm/ethercat/master/fbs/PortErrorCounters.go @@ -7,10 +7,10 @@ import ( ) type PortErrorCountersT struct { - InvalidFrameCounter byte - RxErrorCounter byte - FwdRxErrorCounter byte - LostLinkCounter byte + InvalidFrameCounter byte `json:"invalidFrameCounter"` + RxErrorCounter byte `json:"rxErrorCounter"` + FwdRxErrorCounter byte `json:"fwdRxErrorCounter"` + LostLinkCounter byte `json:"lostLinkCounter"` } func (t *PortErrorCountersT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/ProfileChannelInfo.go b/pkg/fbs/comm/ethercat/master/fbs/ProfileChannelInfo.go index eda2303..573abd8 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/ProfileChannelInfo.go +++ b/pkg/fbs/comm/ethercat/master/fbs/ProfileChannelInfo.go @@ -7,8 +7,8 @@ import ( ) type ProfileChannelInfoT struct { - Request *ProfileChannelInfoRequestT - Response *ProfileChannelInfoResponseT + Request *ProfileChannelInfoRequestT `json:"request"` + Response *ProfileChannelInfoResponseT `json:"response"` } func (t *ProfileChannelInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/ProfileChannelInfoRequest.go b/pkg/fbs/comm/ethercat/master/fbs/ProfileChannelInfoRequest.go index b281923..8748ff8 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/ProfileChannelInfoRequest.go +++ b/pkg/fbs/comm/ethercat/master/fbs/ProfileChannelInfoRequest.go @@ -7,9 +7,9 @@ import ( ) type ProfileChannelInfoRequestT struct { - AddressType Addresstype - Address uint16 - Channel uint32 + AddressType Addresstype `json:"addressType"` + Address uint16 `json:"address"` + Channel uint32 `json:"channel"` } func (t *ProfileChannelInfoRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/ProfileChannelInfoResponse.go b/pkg/fbs/comm/ethercat/master/fbs/ProfileChannelInfoResponse.go index 4a73030..1539710 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/ProfileChannelInfoResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/ProfileChannelInfoResponse.go @@ -7,18 +7,21 @@ import ( ) type ProfileChannelInfoResponseT struct { - ProfileNo uint16 - AddInfo uint16 - DisplayName string + ProfileNo uint16 `json:"ProfileNo"` + AddInfo uint16 `json:"AddInfo"` + DisplayName string `json:"DisplayName"` } func (t *ProfileChannelInfoResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - DisplayNameOffset := builder.CreateString(t.DisplayName) + displayNameOffset := flatbuffers.UOffsetT(0) + if t.DisplayName != "" { + displayNameOffset = builder.CreateString(t.DisplayName) + } ProfileChannelInfoResponseStart(builder) ProfileChannelInfoResponseAddProfileNo(builder, t.ProfileNo) ProfileChannelInfoResponseAddAddInfo(builder, t.AddInfo) - ProfileChannelInfoResponseAddDisplayName(builder, DisplayNameOffset) + ProfileChannelInfoResponseAddDisplayName(builder, displayNameOffset) return ProfileChannelInfoResponseEnd(builder) } @@ -97,14 +100,14 @@ func (rcv *ProfileChannelInfoResponse) DisplayName() []byte { func ProfileChannelInfoResponseStart(builder *flatbuffers.Builder) { builder.StartObject(3) } -func ProfileChannelInfoResponseAddProfileNo(builder *flatbuffers.Builder, ProfileNo uint16) { - builder.PrependUint16Slot(0, ProfileNo, 0) +func ProfileChannelInfoResponseAddProfileNo(builder *flatbuffers.Builder, profileNo uint16) { + builder.PrependUint16Slot(0, profileNo, 0) } -func ProfileChannelInfoResponseAddAddInfo(builder *flatbuffers.Builder, AddInfo uint16) { - builder.PrependUint16Slot(1, AddInfo, 0) +func ProfileChannelInfoResponseAddAddInfo(builder *flatbuffers.Builder, addInfo uint16) { + builder.PrependUint16Slot(1, addInfo, 0) } -func ProfileChannelInfoResponseAddDisplayName(builder *flatbuffers.Builder, DisplayName flatbuffers.UOffsetT) { - builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(DisplayName), 0) +func ProfileChannelInfoResponseAddDisplayName(builder *flatbuffers.Builder, displayName flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(displayName), 0) } func ProfileChannelInfoResponseEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() diff --git a/pkg/fbs/comm/ethercat/master/fbs/ProtocolStatistic.go b/pkg/fbs/comm/ethercat/master/fbs/ProtocolStatistic.go index 69f579b..80d762f 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/ProtocolStatistic.go +++ b/pkg/fbs/comm/ethercat/master/fbs/ProtocolStatistic.go @@ -7,8 +7,8 @@ import ( ) type ProtocolStatisticT struct { - Read *ProtocolStatisticPeriodCountersT - Write *ProtocolStatisticPeriodCountersT + Read *ProtocolStatisticPeriodCountersT `json:"read"` + Write *ProtocolStatisticPeriodCountersT `json:"write"` } func (t *ProtocolStatisticT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/ProtocolStatisticCounters.go b/pkg/fbs/comm/ethercat/master/fbs/ProtocolStatisticCounters.go index 944f4e2..3dd6626 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/ProtocolStatisticCounters.go +++ b/pkg/fbs/comm/ethercat/master/fbs/ProtocolStatisticCounters.go @@ -7,8 +7,8 @@ import ( ) type ProtocolStatisticCountersT struct { - NumRequests uint32 - NumBytes uint32 + NumRequests uint32 `json:"numRequests"` + NumBytes uint32 `json:"numBytes"` } func (t *ProtocolStatisticCountersT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/ProtocolStatisticPeriodCounters.go b/pkg/fbs/comm/ethercat/master/fbs/ProtocolStatisticPeriodCounters.go index 27e9730..279c01a 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/ProtocolStatisticPeriodCounters.go +++ b/pkg/fbs/comm/ethercat/master/fbs/ProtocolStatisticPeriodCounters.go @@ -7,8 +7,8 @@ import ( ) type ProtocolStatisticPeriodCountersT struct { - Total *ProtocolStatisticCountersT - LastSecond *ProtocolStatisticCountersT + Total *ProtocolStatisticCountersT `json:"total"` + LastSecond *ProtocolStatisticCountersT `json:"lastSecond"` } func (t *ProtocolStatisticPeriodCountersT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/ProtocolStatisticPeriodReset.go b/pkg/fbs/comm/ethercat/master/fbs/ProtocolStatisticPeriodReset.go index 2c1997b..00d7e21 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/ProtocolStatisticPeriodReset.go +++ b/pkg/fbs/comm/ethercat/master/fbs/ProtocolStatisticPeriodReset.go @@ -7,8 +7,8 @@ import ( ) type ProtocolStatisticPeriodResetT struct { - Total *ProtocolStatisticResetFlagsT - LastSecond *ProtocolStatisticResetFlagsT + Total *ProtocolStatisticResetFlagsT `json:"total"` + LastSecond *ProtocolStatisticResetFlagsT `json:"lastSecond"` } func (t *ProtocolStatisticPeriodResetT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/ProtocolStatisticReset.go b/pkg/fbs/comm/ethercat/master/fbs/ProtocolStatisticReset.go index 09707b8..85227a8 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/ProtocolStatisticReset.go +++ b/pkg/fbs/comm/ethercat/master/fbs/ProtocolStatisticReset.go @@ -7,8 +7,8 @@ import ( ) type ProtocolStatisticResetT struct { - Read *ProtocolStatisticPeriodResetT - Write *ProtocolStatisticPeriodResetT + Read *ProtocolStatisticPeriodResetT `json:"read"` + Write *ProtocolStatisticPeriodResetT `json:"write"` } func (t *ProtocolStatisticResetT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/ProtocolStatisticResetFlags.go b/pkg/fbs/comm/ethercat/master/fbs/ProtocolStatisticResetFlags.go index 7b0f2d0..874eb05 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/ProtocolStatisticResetFlags.go +++ b/pkg/fbs/comm/ethercat/master/fbs/ProtocolStatisticResetFlags.go @@ -7,8 +7,8 @@ import ( ) type ProtocolStatisticResetFlagsT struct { - NumRequests bool - NumBytes bool + NumRequests bool `json:"numRequests"` + NumBytes bool `json:"numBytes"` } func (t *ProtocolStatisticResetFlagsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SDO.go b/pkg/fbs/comm/ethercat/master/fbs/SDO.go index dd0a8fb..f8e4588 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SDO.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SDO.go @@ -7,8 +7,8 @@ import ( ) type SDOT struct { - Request *SDORequestT - Response *SDOResponseT + Request *SDORequestT `json:"request"` + Response *SDOResponseT `json:"response"` } func (t *SDOT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SDORequest.go b/pkg/fbs/comm/ethercat/master/fbs/SDORequest.go index 689d2a8..d993cd4 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SDORequest.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SDORequest.go @@ -7,13 +7,13 @@ import ( ) type SDORequestT struct { - AddressType Addresstype - Address uint16 - ObjectIndex uint16 - SubIndex byte - Flags SDOFlags - Data []byte - MaxLength uint32 + AddressType Addresstype `json:"addressType"` + Address uint16 `json:"address"` + ObjectIndex uint16 `json:"objectIndex"` + SubIndex byte `json:"subIndex"` + Flags SDOFlags `json:"flags"` + Data []byte `json:"data"` + MaxLength uint32 `json:"maxLength"` } func (t *SDORequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SDOResponse.go b/pkg/fbs/comm/ethercat/master/fbs/SDOResponse.go index ee39524..443396c 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SDOResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SDOResponse.go @@ -7,7 +7,7 @@ import ( ) type SDOResponseT struct { - Data []byte + Data []byte `json:"data"` } func (t *SDOResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveAddressMapping.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveAddressMapping.go index f40f31f..36eb517 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveAddressMapping.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveAddressMapping.go @@ -7,8 +7,8 @@ import ( ) type SlaveAddressMappingT struct { - Request *SlaveAddressMappingRequestT - Response *SlaveAddressMappingResponseT + Request *SlaveAddressMappingRequestT `json:"request"` + Response *SlaveAddressMappingResponseT `json:"response"` } func (t *SlaveAddressMappingT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveAddressMappingRequest.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveAddressMappingRequest.go index 1d32f61..aba6e3e 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveAddressMappingRequest.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveAddressMappingRequest.go @@ -7,14 +7,17 @@ import ( ) type SlaveAddressMappingRequestT struct { - Address *AddressedRequestT - SlaveName string + Address *AddressedRequestT `json:"address"` + SlaveName string `json:"slaveName"` } func (t *SlaveAddressMappingRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } addressOffset := t.Address.Pack(builder) - slaveNameOffset := builder.CreateString(t.SlaveName) + slaveNameOffset := flatbuffers.UOffsetT(0) + if t.SlaveName != "" { + slaveNameOffset = builder.CreateString(t.SlaveName) + } SlaveAddressMappingRequestStart(builder) SlaveAddressMappingRequestAddAddress(builder, addressOffset) SlaveAddressMappingRequestAddSlaveName(builder, slaveNameOffset) diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveAddressMappingResponse.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveAddressMappingResponse.go index 5f88399..fd4aa64 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveAddressMappingResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveAddressMappingResponse.go @@ -7,33 +7,33 @@ import ( ) type SlaveAddressMappingResponseT struct { - AddressMappingEntryList []*AddressMappingEntryT + AddressMappingEntryList []*AddressMappingEntryT `json:"AddressMappingEntryList"` } func (t *SlaveAddressMappingResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - AddressMappingEntryListOffset := flatbuffers.UOffsetT(0) + addressMappingEntryListOffset := flatbuffers.UOffsetT(0) if t.AddressMappingEntryList != nil { - AddressMappingEntryListLength := len(t.AddressMappingEntryList) - AddressMappingEntryListOffsets := make([]flatbuffers.UOffsetT, AddressMappingEntryListLength) - for j := 0; j < AddressMappingEntryListLength; j++ { - AddressMappingEntryListOffsets[j] = t.AddressMappingEntryList[j].Pack(builder) + addressMappingEntryListLength := len(t.AddressMappingEntryList) + addressMappingEntryListOffsets := make([]flatbuffers.UOffsetT, addressMappingEntryListLength) + for j := 0; j < addressMappingEntryListLength; j++ { + addressMappingEntryListOffsets[j] = t.AddressMappingEntryList[j].Pack(builder) } - SlaveAddressMappingResponseStartAddressMappingEntryListVector(builder, AddressMappingEntryListLength) - for j := AddressMappingEntryListLength - 1; j >= 0; j-- { - builder.PrependUOffsetT(AddressMappingEntryListOffsets[j]) + SlaveAddressMappingResponseStartAddressMappingEntryListVector(builder, addressMappingEntryListLength) + for j := addressMappingEntryListLength - 1; j >= 0; j-- { + builder.PrependUOffsetT(addressMappingEntryListOffsets[j]) } - AddressMappingEntryListOffset = builder.EndVector(AddressMappingEntryListLength) + addressMappingEntryListOffset = builder.EndVector(addressMappingEntryListLength) } SlaveAddressMappingResponseStart(builder) - SlaveAddressMappingResponseAddAddressMappingEntryList(builder, AddressMappingEntryListOffset) + SlaveAddressMappingResponseAddAddressMappingEntryList(builder, addressMappingEntryListOffset) return SlaveAddressMappingResponseEnd(builder) } func (rcv *SlaveAddressMappingResponse) UnPackTo(t *SlaveAddressMappingResponseT) { - AddressMappingEntryListLength := rcv.AddressMappingEntryListLength() - t.AddressMappingEntryList = make([]*AddressMappingEntryT, AddressMappingEntryListLength) - for j := 0; j < AddressMappingEntryListLength; j++ { + addressMappingEntryListLength := rcv.AddressMappingEntryListLength() + t.AddressMappingEntryList = make([]*AddressMappingEntryT, addressMappingEntryListLength) + for j := 0; j < addressMappingEntryListLength; j++ { x := AddressMappingEntry{} rcv.AddressMappingEntryList(&x, j) t.AddressMappingEntryList[j] = x.UnPack() @@ -97,8 +97,8 @@ func (rcv *SlaveAddressMappingResponse) AddressMappingEntryListLength() int { func SlaveAddressMappingResponseStart(builder *flatbuffers.Builder) { builder.StartObject(1) } -func SlaveAddressMappingResponseAddAddressMappingEntryList(builder *flatbuffers.Builder, AddressMappingEntryList flatbuffers.UOffsetT) { - builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(AddressMappingEntryList), 0) +func SlaveAddressMappingResponseAddAddressMappingEntryList(builder *flatbuffers.Builder, addressMappingEntryList flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(addressMappingEntryList), 0) } func SlaveAddressMappingResponseStartAddressMappingEntryListVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { return builder.StartVector(4, numElems, 4) diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveConfigInfo.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveConfigInfo.go index daaae6d..0e8182f 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveConfigInfo.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveConfigInfo.go @@ -7,8 +7,8 @@ import ( ) type SlaveConfigInfoT struct { - Request *AddressedRequestT - Response *SlaveConfigInfoResponseT + Request *AddressedRequestT `json:"request"` + Response *SlaveConfigInfoResponseT `json:"response"` } func (t *SlaveConfigInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveConfigInfoResponse.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveConfigInfoResponse.go index d177369..4613456 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveConfigInfoResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveConfigInfoResponse.go @@ -7,36 +7,39 @@ import ( ) type SlaveConfigInfoResponseT struct { - AutoIncAddr uint16 - EthercatAddr uint16 - IdentifyAdo uint16 - IdentifyValue uint16 - SlaveHandle uint32 - HcGroupIdx uint32 - PreviousEthercatAddr uint16 - PreviousPort uint16 - SlaveIdentity *EthercatIdentityInfoT - SlaveName string - MbxProtocols uint32 - MbxStandard *EthercatMailboxInfoT - MbxBootstrap *EthercatMailboxInfoT - ProcessDataIn []*EthercatMemoryInfoT - ProcessDataOut []*EthercatMemoryInfoT - NumProcessVarsIn uint16 - NumProcessVarsOut uint16 - PortDescriptor byte - Reserved01 []byte - WkcStateDiagOffsIn []uint16 - WkcStateDiagOffsOut []uint16 - Reserved02 []uint32 - IsPresent bool - IsHcGroupPresent bool - DcSupport bool + AutoIncAddr uint16 `json:"autoIncAddr"` + EthercatAddr uint16 `json:"ethercatAddr"` + IdentifyAdo uint16 `json:"identifyAdo"` + IdentifyValue uint16 `json:"identifyValue"` + SlaveHandle uint32 `json:"slaveHandle"` + HcGroupIdx uint32 `json:"hcGroupIdx"` + PreviousEthercatAddr uint16 `json:"previousEthercatAddr"` + PreviousPort uint16 `json:"previousPort"` + SlaveIdentity *EthercatIdentityInfoT `json:"slaveIdentity"` + SlaveName string `json:"slaveName"` + MbxProtocols uint32 `json:"mbxProtocols"` + MbxStandard *EthercatMailboxInfoT `json:"mbxStandard"` + MbxBootstrap *EthercatMailboxInfoT `json:"mbxBootstrap"` + ProcessDataIn []*EthercatMemoryInfoT `json:"processDataIn"` + ProcessDataOut []*EthercatMemoryInfoT `json:"processDataOut"` + NumProcessVarsIn uint16 `json:"numProcessVarsIn"` + NumProcessVarsOut uint16 `json:"numProcessVarsOut"` + PortDescriptor byte `json:"portDescriptor"` + Reserved01 []byte `json:"reserved01"` + WkcStateDiagOffsIn []uint16 `json:"wkcStateDiagOffsIn"` + WkcStateDiagOffsOut []uint16 `json:"wkcStateDiagOffsOut"` + Reserved02 []uint32 `json:"reserved02"` + IsPresent bool `json:"isPresent"` + IsHcGroupPresent bool `json:"isHcGroupPresent"` + DcSupport bool `json:"dcSupport"` } func (t *SlaveConfigInfoResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - slaveNameOffset := builder.CreateString(t.SlaveName) + slaveNameOffset := flatbuffers.UOffsetT(0) + if t.SlaveName != "" { + slaveNameOffset = builder.CreateString(t.SlaveName) + } processDataInOffset := flatbuffers.UOffsetT(0) if t.ProcessDataIn != nil { processDataInLength := len(t.ProcessDataIn) diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveEeprom.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveEeprom.go index fd50a36..aae7d91 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveEeprom.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveEeprom.go @@ -7,8 +7,8 @@ import ( ) type SlaveEepromT struct { - Request *SlaveEepromRequestT - Response *SlaveEepromResponseT + Request *SlaveEepromRequestT `json:"request"` + Response *SlaveEepromResponseT `json:"response"` } func (t *SlaveEepromT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveEepromRequest.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveEepromRequest.go index f980316..d2ba4cb 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveEepromRequest.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveEepromRequest.go @@ -7,11 +7,11 @@ import ( ) type SlaveEepromRequestT struct { - AddressType Addresstype - Address uint16 - EepromOffset uint16 - Data []uint16 - MaxLength uint32 + AddressType Addresstype `json:"addressType"` + Address uint16 `json:"address"` + EepromOffset uint16 `json:"eepromOffset"` + Data []uint16 `json:"data"` + MaxLength uint32 `json:"maxLength"` } func (t *SlaveEepromRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveEepromResponse.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveEepromResponse.go index 593b4c1..f12f397 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveEepromResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveEepromResponse.go @@ -7,7 +7,7 @@ import ( ) type SlaveEepromResponseT struct { - Data []uint16 + Data []uint16 `json:"data"` } func (t *SlaveEepromResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveOnlineInfo.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveOnlineInfo.go index f651096..d109bed 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveOnlineInfo.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveOnlineInfo.go @@ -7,8 +7,8 @@ import ( ) type SlaveOnlineInfoT struct { - Request *AddressedRequestT - Response *SlaveOnlineInfoResponseT + Request *AddressedRequestT `json:"request"` + Response *SlaveOnlineInfoResponseT `json:"response"` } func (t *SlaveOnlineInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveOnlineInfoResponse.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveOnlineInfoResponse.go index 83c399b..21597d2 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveOnlineInfoResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveOnlineInfoResponse.go @@ -7,33 +7,33 @@ import ( ) type SlaveOnlineInfoResponseT struct { - AutoIncAddr uint16 - EthercatAddr uint16 - StationAlias uint16 - IdentifyValue uint16 - SlaveHandle uint32 - PortSlaveHandles []uint32 - SlaveIdentity *EthercatIdentityInfoT - EscType byte - EscRevision byte - EscBuild uint16 - EscFeatures uint16 - PortDescriptor byte - Reserved01 byte - AlStatus uint16 - AlStatusCode uint16 - MbxProtocols uint16 - DlStatus uint16 - PortState uint16 - PreviousPort uint16 - SystemTimeDifference uint32 - SlaveDelay uint32 - PropagationDelay uint32 - Reserved02 []uint32 - DcSupport bool - Dc64Support bool - IsRefClock bool - LineCrossed bool + AutoIncAddr uint16 `json:"autoIncAddr"` + EthercatAddr uint16 `json:"ethercatAddr"` + StationAlias uint16 `json:"stationAlias"` + IdentifyValue uint16 `json:"identifyValue"` + SlaveHandle uint32 `json:"slaveHandle"` + PortSlaveHandles []uint32 `json:"portSlaveHandles"` + SlaveIdentity *EthercatIdentityInfoT `json:"slaveIdentity"` + EscType byte `json:"escType"` + EscRevision byte `json:"escRevision"` + EscBuild uint16 `json:"escBuild"` + EscFeatures uint16 `json:"escFeatures"` + PortDescriptor byte `json:"portDescriptor"` + Reserved01 byte `json:"reserved01"` + AlStatus uint16 `json:"alStatus"` + AlStatusCode uint16 `json:"alStatusCode"` + MbxProtocols uint16 `json:"mbxProtocols"` + DlStatus uint16 `json:"dlStatus"` + PortState uint16 `json:"portState"` + PreviousPort uint16 `json:"previousPort"` + SystemTimeDifference uint32 `json:"systemTimeDifference"` + SlaveDelay uint32 `json:"slaveDelay"` + PropagationDelay uint32 `json:"propagationDelay"` + Reserved02 []uint32 `json:"reserved02"` + DcSupport bool `json:"dcSupport"` + Dc64Support bool `json:"dc64Support"` + IsRefClock bool `json:"isRefClock"` + LineCrossed bool `json:"lineCrossed"` } func (t *SlaveOnlineInfoResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveRegister.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveRegister.go index 4ac45d1..3d27da2 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveRegister.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveRegister.go @@ -7,8 +7,8 @@ import ( ) type SlaveRegisterT struct { - Request *SlaveRegisterRequestT - Response *SlaveRegisterResponseT + Request *SlaveRegisterRequestT `json:"request"` + Response *SlaveRegisterResponseT `json:"response"` } func (t *SlaveRegisterT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveRegisterRequest.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveRegisterRequest.go index fe8a4a6..7e2195a 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveRegisterRequest.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveRegisterRequest.go @@ -7,11 +7,11 @@ import ( ) type SlaveRegisterRequestT struct { - AddressType Addresstype - Address uint16 - RegisterOffset uint16 - Data []byte - MaxLength uint32 + AddressType Addresstype `json:"addressType"` + Address uint16 `json:"address"` + RegisterOffset uint16 `json:"registerOffset"` + Data []byte `json:"data"` + MaxLength uint32 `json:"maxLength"` } func (t *SlaveRegisterRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveRegisterResponse.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveRegisterResponse.go index 33d0cf7..4be31cf 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveRegisterResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveRegisterResponse.go @@ -7,7 +7,7 @@ import ( ) type SlaveRegisterResponseT struct { - Data []byte + Data []byte `json:"data"` } func (t *SlaveRegisterResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveState.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveState.go index dbeef6c..343f6a2 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveState.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveState.go @@ -7,8 +7,8 @@ import ( ) type SlaveStateT struct { - Request *SlaveStateRequestT - Response *SlaveStateResponseT + Request *SlaveStateRequestT `json:"request"` + Response *SlaveStateResponseT `json:"response"` } func (t *SlaveStateT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveStateRequest.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveStateRequest.go index 92fc600..3d72b92 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveStateRequest.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveStateRequest.go @@ -7,9 +7,9 @@ import ( ) type SlaveStateRequestT struct { - AddressType Addresstype - Address uint16 - NewState EthercatState + AddressType Addresstype `json:"addressType"` + Address uint16 `json:"address"` + NewState EthercatState `json:"newState"` } func (t *SlaveStateRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveStateResponse.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveStateResponse.go index f292b2d..469828c 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveStateResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveStateResponse.go @@ -7,8 +7,8 @@ import ( ) type SlaveStateResponseT struct { - CurrentState EthercatState - RequestedState EthercatState + CurrentState EthercatState `json:"currentState"` + RequestedState EthercatState `json:"requestedState"` } func (t *SlaveStateResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticCounters.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticCounters.go index 21a5956..0f33c0d 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticCounters.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticCounters.go @@ -7,8 +7,8 @@ import ( ) type SlaveStatisticCountersT struct { - Request *AddressedRequestT - Response *SlaveStatisticCountersResponseT + Request *AddressedRequestT `json:"request"` + Response *SlaveStatisticCountersResponseT `json:"response"` } func (t *SlaveStatisticCountersT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticCountersResponse.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticCountersResponse.go index df7ced7..a667a76 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticCountersResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticCountersResponse.go @@ -7,10 +7,10 @@ import ( ) type SlaveStatisticCountersResponseT struct { - AlStatusCode uint16 - ProcUnitErrorCounter byte - PdiErrorCounter byte - PortErrorCounters []*PortErrorCountersT + AlStatusCode uint16 `json:"alStatusCode"` + ProcUnitErrorCounter byte `json:"procUnitErrorCounter"` + PdiErrorCounter byte `json:"pdiErrorCounter"` + PortErrorCounters []*PortErrorCountersT `json:"portErrorCounters"` } func (t *SlaveStatisticCountersResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticModeAuto.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticModeAuto.go index 16140d7..20846fe 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticModeAuto.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticModeAuto.go @@ -7,8 +7,8 @@ import ( ) type SlaveStatisticModeAutoT struct { - Request *SlaveStatisticModeAutoRequestT - Response *SlaveStatisticModeAutoResponseT + Request *SlaveStatisticModeAutoRequestT `json:"request"` + Response *SlaveStatisticModeAutoResponseT `json:"response"` } func (t *SlaveStatisticModeAutoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticModeAutoRequest.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticModeAutoRequest.go index 5cccc79..9ff88e0 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticModeAutoRequest.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticModeAutoRequest.go @@ -7,8 +7,8 @@ import ( ) type SlaveStatisticModeAutoRequestT struct { - Enable bool - IdleTime uint32 + Enable bool `json:"enable"` + IdleTime uint32 `json:"idleTime"` } func (t *SlaveStatisticModeAutoRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticModeAutoResponse.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticModeAutoResponse.go index bd3bbbb..8d70a59 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticModeAutoResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticModeAutoResponse.go @@ -7,8 +7,8 @@ import ( ) type SlaveStatisticModeAutoResponseT struct { - Enable bool - IdleTime uint32 + Enable bool `json:"enable"` + IdleTime uint32 `json:"idleTime"` } func (t *SlaveStatisticModeAutoResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticModeSingleShotTrigger.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticModeSingleShotTrigger.go index 4617159..d9e4b96 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticModeSingleShotTrigger.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticModeSingleShotTrigger.go @@ -7,8 +7,8 @@ import ( ) type SlaveStatisticModeSingleShotTriggerT struct { - Request *SlaveStatisticModeSingleShotTriggerRequestT - Response *SlaveStatisticModeSingleShotTriggerResponseT + Request *SlaveStatisticModeSingleShotTriggerRequestT `json:"request"` + Response *SlaveStatisticModeSingleShotTriggerResponseT `json:"response"` } func (t *SlaveStatisticModeSingleShotTriggerT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticModeSingleShotTriggerRequest.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticModeSingleShotTriggerRequest.go index 359f6c4..4a97087 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticModeSingleShotTriggerRequest.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticModeSingleShotTriggerRequest.go @@ -7,7 +7,7 @@ import ( ) type SlaveStatisticModeSingleShotTriggerRequestT struct { - Force bool + Force bool `json:"force"` } func (t *SlaveStatisticModeSingleShotTriggerRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticModeSingleShotTriggerResponse.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticModeSingleShotTriggerResponse.go index c633c68..d9c68b1 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticModeSingleShotTriggerResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveStatisticModeSingleShotTriggerResponse.go @@ -7,8 +7,8 @@ import ( ) type SlaveStatisticModeSingleShotTriggerResponseT struct { - Forced bool - Discarded bool + Forced bool `json:"forced"` + Discarded bool `json:"discarded"` } func (t *SlaveStatisticModeSingleShotTriggerResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveStatus.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveStatus.go index c56ecf6..f028be0 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveStatus.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveStatus.go @@ -7,8 +7,8 @@ import ( ) type SlaveStatusT struct { - Request *AddressedRequestT - Response *SlaveStatusResponseT + Request *AddressedRequestT `json:"request"` + Response *SlaveStatusResponseT `json:"response"` } func (t *SlaveStatusT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveStatusResponse.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveStatusResponse.go index ec75152..73722ec 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveStatusResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveStatusResponse.go @@ -7,7 +7,7 @@ import ( ) type SlaveStatusResponseT struct { - Status uint32 + Status uint32 `json:"status"` } func (t *SlaveStatusResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveVariablesConfigInfo.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveVariablesConfigInfo.go index d997421..e1edfad 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveVariablesConfigInfo.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveVariablesConfigInfo.go @@ -7,8 +7,8 @@ import ( ) type SlaveVariablesConfigInfoT struct { - Request *SlaveVariablesConfigInfoRequestT - Response *SlaveVariablesConfigInfoResponseListT + Request *SlaveVariablesConfigInfoRequestT `json:"request"` + Response *SlaveVariablesConfigInfoResponseListT `json:"response"` } func (t *SlaveVariablesConfigInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveVariablesConfigInfoEntry.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveVariablesConfigInfoEntry.go index 63f4413..1160e38 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveVariablesConfigInfoEntry.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveVariablesConfigInfoEntry.go @@ -9,9 +9,9 @@ import ( ) type SlaveVariablesConfigInfoEntryT struct { - VariableInfo *comm__datalayer.VariableT - EtgBaseType uint16 - ProtocolInfo *VariableProtocolInfoT + VariableInfo *comm__datalayer.VariableT `json:"variableInfo"` + EtgBaseType uint16 `json:"etgBaseType"` + ProtocolInfo *VariableProtocolInfoT `json:"protocolInfo"` } func (t *SlaveVariablesConfigInfoEntryT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveVariablesConfigInfoRequest.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveVariablesConfigInfoRequest.go index 0b134b3..e78e027 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveVariablesConfigInfoRequest.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveVariablesConfigInfoRequest.go @@ -7,14 +7,17 @@ import ( ) type SlaveVariablesConfigInfoRequestT struct { - AddressedRequest *AddressedRequestT - VarType string + AddressedRequest *AddressedRequestT `json:"addressedRequest"` + VarType string `json:"varType"` } func (t *SlaveVariablesConfigInfoRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } addressedRequestOffset := t.AddressedRequest.Pack(builder) - varTypeOffset := builder.CreateString(t.VarType) + varTypeOffset := flatbuffers.UOffsetT(0) + if t.VarType != "" { + varTypeOffset = builder.CreateString(t.VarType) + } SlaveVariablesConfigInfoRequestStart(builder) SlaveVariablesConfigInfoRequestAddAddressedRequest(builder, addressedRequestOffset) SlaveVariablesConfigInfoRequestAddVarType(builder, varTypeOffset) diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveVariablesConfigInfoResponseList.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveVariablesConfigInfoResponseList.go index 1ea086e..1f91bb8 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SlaveVariablesConfigInfoResponseList.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveVariablesConfigInfoResponseList.go @@ -7,7 +7,7 @@ import ( ) type SlaveVariablesConfigInfoResponseListT struct { - SlVarConfInfoResponseList []*SlaveVariablesConfigInfoEntryT + SlVarConfInfoResponseList []*SlaveVariablesConfigInfoEntryT `json:"slVarConfInfoResponseList"` } func (t *SlaveVariablesConfigInfoResponseListT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/SoeVariableInfo.go b/pkg/fbs/comm/ethercat/master/fbs/SoeVariableInfo.go index c57d7ce..b59ac75 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/SoeVariableInfo.go +++ b/pkg/fbs/comm/ethercat/master/fbs/SoeVariableInfo.go @@ -7,8 +7,8 @@ import ( ) type SoeVariableInfoT struct { - ConfigurationListIdn uint16 - Idn uint16 + ConfigurationListIdn uint16 `json:"configurationListIdn"` + Idn uint16 `json:"idn"` } func (t *SoeVariableInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/TopologyStatus.go b/pkg/fbs/comm/ethercat/master/fbs/TopologyStatus.go index 73695fc..5aef847 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/TopologyStatus.go +++ b/pkg/fbs/comm/ethercat/master/fbs/TopologyStatus.go @@ -7,7 +7,7 @@ import ( ) type TopologyStatusT struct { - Response *TopologyStatusResponseT + Response *TopologyStatusResponseT `json:"response"` } func (t *TopologyStatusT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/TopologyStatusResponse.go b/pkg/fbs/comm/ethercat/master/fbs/TopologyStatusResponse.go index cf3c907..13d72b5 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/TopologyStatusResponse.go +++ b/pkg/fbs/comm/ethercat/master/fbs/TopologyStatusResponse.go @@ -7,8 +7,8 @@ import ( ) type TopologyStatusResponseT struct { - State TopologyState - NumChanges uint32 + State TopologyState `json:"state"` + NumChanges uint32 `json:"numChanges"` } func (t *TopologyStatusResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/VariableProtocolInfo.go b/pkg/fbs/comm/ethercat/master/fbs/VariableProtocolInfo.go index 5c7330c..80d503c 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/VariableProtocolInfo.go +++ b/pkg/fbs/comm/ethercat/master/fbs/VariableProtocolInfo.go @@ -7,8 +7,8 @@ import ( ) type VariableProtocolInfoT struct { - Coe *CoeVariableInfoT - Soe *SoeVariableInfoT + Coe *CoeVariableInfoT `json:"coe"` + Soe *SoeVariableInfoT `json:"soe"` } func (t *VariableProtocolInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/ethercat/master/fbs/taskInfo.go b/pkg/fbs/comm/ethercat/master/fbs/taskInfo.go index 0ed75f3..99bede7 100644 --- a/pkg/fbs/comm/ethercat/master/fbs/taskInfo.go +++ b/pkg/fbs/comm/ethercat/master/fbs/taskInfo.go @@ -9,8 +9,8 @@ import ( ) type taskInfoT struct { - Task *common__scheduler__fbs.TaskT - Counter uint64 + Task *common__scheduler__fbs.TaskT `json:"task"` + Counter uint64 `json:"counter"` } func (t *taskInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/opcua/client/ClientConfiguration.go b/pkg/fbs/comm/opcua/client/ClientConfiguration.go index d8b2952..f136792 100644 --- a/pkg/fbs/comm/opcua/client/ClientConfiguration.go +++ b/pkg/fbs/comm/opcua/client/ClientConfiguration.go @@ -7,17 +7,23 @@ import ( ) type ClientConfigurationT struct { - Name string - EndpointUrl string - SessionConfiguration *SessionConfigurationT - TimeoutConfiguration *TimeoutConfigurationT - Persistent bool + Name string `json:"name"` + EndpointUrl string `json:"endpointUrl"` + SessionConfiguration *SessionConfigurationT `json:"sessionConfiguration"` + TimeoutConfiguration *TimeoutConfigurationT `json:"timeoutConfiguration"` + Persistent bool `json:"persistent"` } func (t *ClientConfigurationT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - endpointUrlOffset := builder.CreateString(t.EndpointUrl) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + endpointUrlOffset := flatbuffers.UOffsetT(0) + if t.EndpointUrl != "" { + endpointUrlOffset = builder.CreateString(t.EndpointUrl) + } sessionConfigurationOffset := t.SessionConfiguration.Pack(builder) timeoutConfigurationOffset := t.TimeoutConfiguration.Pack(builder) ClientConfigurationStart(builder) diff --git a/pkg/fbs/comm/opcua/client/DlResultToUaStatusCode.go b/pkg/fbs/comm/opcua/client/DlResultToUaStatusCode.go index 404aa3a..ebbd45f 100644 --- a/pkg/fbs/comm/opcua/client/DlResultToUaStatusCode.go +++ b/pkg/fbs/comm/opcua/client/DlResultToUaStatusCode.go @@ -7,16 +7,22 @@ import ( ) type DlResultToUaStatusCodeT struct { - DlResult uint32 - UaStatusCode uint32 - UaStatusCodeName string - UaStatusCodeDescr string + DlResult uint32 `json:"dlResult"` + UaStatusCode uint32 `json:"uaStatusCode"` + UaStatusCodeName string `json:"uaStatusCodeName"` + UaStatusCodeDescr string `json:"uaStatusCodeDescr"` } func (t *DlResultToUaStatusCodeT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - uaStatusCodeNameOffset := builder.CreateString(t.UaStatusCodeName) - uaStatusCodeDescrOffset := builder.CreateString(t.UaStatusCodeDescr) + uaStatusCodeNameOffset := flatbuffers.UOffsetT(0) + if t.UaStatusCodeName != "" { + uaStatusCodeNameOffset = builder.CreateString(t.UaStatusCodeName) + } + uaStatusCodeDescrOffset := flatbuffers.UOffsetT(0) + if t.UaStatusCodeDescr != "" { + uaStatusCodeDescrOffset = builder.CreateString(t.UaStatusCodeDescr) + } DlResultToUaStatusCodeStart(builder) DlResultToUaStatusCodeAddDlResult(builder, t.DlResult) DlResultToUaStatusCodeAddUaStatusCode(builder, t.UaStatusCode) diff --git a/pkg/fbs/comm/opcua/client/ErrorCodeMapping.go b/pkg/fbs/comm/opcua/client/ErrorCodeMapping.go index 59548d9..4378011 100644 --- a/pkg/fbs/comm/opcua/client/ErrorCodeMapping.go +++ b/pkg/fbs/comm/opcua/client/ErrorCodeMapping.go @@ -7,7 +7,7 @@ import ( ) type ErrorCodeMappingT struct { - ListDlResultToUaStatusCode []*DlResultToUaStatusCodeT + ListDlResultToUaStatusCode []*DlResultToUaStatusCodeT `json:"listDlResultToUaStatusCode"` } func (t *ErrorCodeMappingT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/opcua/client/MessageSecurityMode.go b/pkg/fbs/comm/opcua/client/MessageSecurityMode.go index 41f92e5..a8a3ddb 100644 --- a/pkg/fbs/comm/opcua/client/MessageSecurityMode.go +++ b/pkg/fbs/comm/opcua/client/MessageSecurityMode.go @@ -7,7 +7,7 @@ import ( ) type MessageSecurityModeT struct { - MessageSecurityMode EnumMessageSecurityMode + MessageSecurityMode EnumMessageSecurityMode `json:"messageSecurityMode"` } func (t *MessageSecurityModeT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/opcua/client/SecurityPolicy.go b/pkg/fbs/comm/opcua/client/SecurityPolicy.go index d682cf1..726176d 100644 --- a/pkg/fbs/comm/opcua/client/SecurityPolicy.go +++ b/pkg/fbs/comm/opcua/client/SecurityPolicy.go @@ -7,7 +7,7 @@ import ( ) type SecurityPolicyT struct { - SecurityPolicy EnumSecurityPolicy + SecurityPolicy EnumSecurityPolicy `json:"securityPolicy"` } func (t *SecurityPolicyT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/opcua/client/SessionConfiguration.go b/pkg/fbs/comm/opcua/client/SessionConfiguration.go index 3dbd7f9..53dc90e 100644 --- a/pkg/fbs/comm/opcua/client/SessionConfiguration.go +++ b/pkg/fbs/comm/opcua/client/SessionConfiguration.go @@ -7,10 +7,10 @@ import ( ) type SessionConfigurationT struct { - UserToken *UserIdentityTokenT - MessageSecurityMode *MessageSecurityModeT - SecurityPolicy *SecurityPolicyT - LocaleIds []string + UserToken *UserIdentityTokenT `json:"userToken"` + MessageSecurityMode *MessageSecurityModeT `json:"messageSecurityMode"` + SecurityPolicy *SecurityPolicyT `json:"securityPolicy"` + LocaleIds []string `json:"localeIds"` } func (t *SessionConfigurationT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/opcua/client/State.go b/pkg/fbs/comm/opcua/client/State.go index f0dae28..65a9b67 100644 --- a/pkg/fbs/comm/opcua/client/State.go +++ b/pkg/fbs/comm/opcua/client/State.go @@ -7,7 +7,7 @@ import ( ) type StateT struct { - State ConnectionState + State ConnectionState `json:"state"` } func (t *StateT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/opcua/client/TimeoutConfiguration.go b/pkg/fbs/comm/opcua/client/TimeoutConfiguration.go index 229ff98..86d53e6 100644 --- a/pkg/fbs/comm/opcua/client/TimeoutConfiguration.go +++ b/pkg/fbs/comm/opcua/client/TimeoutConfiguration.go @@ -7,14 +7,14 @@ import ( ) type TimeoutConfigurationT struct { - BrowseCallTimeout uint32 - DiscoveryTimeout uint32 - PublishTimeout uint32 - ReadCallTimeout uint32 - SessionTimeout float64 - WatchdogTimeout uint32 - WriteCallTimeout uint32 - CallCallTimeout uint32 + BrowseCallTimeout uint32 `json:"browseCallTimeout"` + DiscoveryTimeout uint32 `json:"discoveryTimeout"` + PublishTimeout uint32 `json:"publishTimeout"` + ReadCallTimeout uint32 `json:"readCallTimeout"` + SessionTimeout float64 `json:"sessionTimeout"` + WatchdogTimeout uint32 `json:"watchdogTimeout"` + WriteCallTimeout uint32 `json:"writeCallTimeout"` + CallCallTimeout uint32 `json:"callCallTimeout"` } func (t *TimeoutConfigurationT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/opcua/client/TokenCert.go b/pkg/fbs/comm/opcua/client/TokenCert.go index d4cb1fc..50a7126 100644 --- a/pkg/fbs/comm/opcua/client/TokenCert.go +++ b/pkg/fbs/comm/opcua/client/TokenCert.go @@ -7,14 +7,20 @@ import ( ) type TokenCertT struct { - Location string - Name string + Location string `json:"location"` + Name string `json:"name"` } func (t *TokenCertT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - locationOffset := builder.CreateString(t.Location) - nameOffset := builder.CreateString(t.Name) + locationOffset := flatbuffers.UOffsetT(0) + if t.Location != "" { + locationOffset = builder.CreateString(t.Location) + } + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } TokenCertStart(builder) TokenCertAddLocation(builder, locationOffset) TokenCertAddName(builder, nameOffset) diff --git a/pkg/fbs/comm/opcua/client/TokenUserPassword.go b/pkg/fbs/comm/opcua/client/TokenUserPassword.go index b07f2f0..893e92d 100644 --- a/pkg/fbs/comm/opcua/client/TokenUserPassword.go +++ b/pkg/fbs/comm/opcua/client/TokenUserPassword.go @@ -7,14 +7,20 @@ import ( ) type TokenUserPasswordT struct { - Username string - Password string + Username string `json:"username"` + Password string `json:"password"` } func (t *TokenUserPasswordT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - usernameOffset := builder.CreateString(t.Username) - passwordOffset := builder.CreateString(t.Password) + usernameOffset := flatbuffers.UOffsetT(0) + if t.Username != "" { + usernameOffset = builder.CreateString(t.Username) + } + passwordOffset := flatbuffers.UOffsetT(0) + if t.Password != "" { + passwordOffset = builder.CreateString(t.Password) + } TokenUserPasswordStart(builder) TokenUserPasswordAddUsername(builder, usernameOffset) TokenUserPasswordAddPassword(builder, passwordOffset) diff --git a/pkg/fbs/comm/opcua/client/UserIdentityToken.go b/pkg/fbs/comm/opcua/client/UserIdentityToken.go index 54399f7..34ace0f 100644 --- a/pkg/fbs/comm/opcua/client/UserIdentityToken.go +++ b/pkg/fbs/comm/opcua/client/UserIdentityToken.go @@ -7,7 +7,7 @@ import ( ) type UserIdentityTokenT struct { - UserIdentityToken *UserIdentityTokenUnionT + UserIdentityToken *UserIdentityTokenUnionT `json:"userIdentityToken"` } func (t *UserIdentityTokenT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/opcua/client/UserIdentityTokenUnion.go b/pkg/fbs/comm/opcua/client/UserIdentityTokenUnion.go index 982a4af..5d66476 100644 --- a/pkg/fbs/comm/opcua/client/UserIdentityTokenUnion.go +++ b/pkg/fbs/comm/opcua/client/UserIdentityTokenUnion.go @@ -4,7 +4,6 @@ package client import ( "strconv" - flatbuffers "github.com/google/flatbuffers/go" ) @@ -61,13 +60,16 @@ func (t *UserIdentityTokenUnionT) Pack(builder *flatbuffers.Builder) flatbuffers func (rcv UserIdentityTokenUnion) UnPack(table flatbuffers.Table) *UserIdentityTokenUnionT { switch rcv { case UserIdentityTokenUnionTokenAnonymous: - x := TokenAnonymous{_tab: table} + var x TokenAnonymous + x.Init(table.Bytes, table.Pos) return &UserIdentityTokenUnionT{ Type: UserIdentityTokenUnionTokenAnonymous, Value: x.UnPack() } case UserIdentityTokenUnionTokenUserPassword: - x := TokenUserPassword{_tab: table} + var x TokenUserPassword + x.Init(table.Bytes, table.Pos) return &UserIdentityTokenUnionT{ Type: UserIdentityTokenUnionTokenUserPassword, Value: x.UnPack() } case UserIdentityTokenUnionTokenCert: - x := TokenCert{_tab: table} + var x TokenCert + x.Init(table.Bytes, table.Pos) return &UserIdentityTokenUnionT{ Type: UserIdentityTokenUnionTokenCert, Value: x.UnPack() } } return nil diff --git a/pkg/fbs/comm/opcua/server/ArrayOfSecConfigType.go b/pkg/fbs/comm/opcua/server/ArrayOfSecConfigType.go index ff8c272..493f744 100644 --- a/pkg/fbs/comm/opcua/server/ArrayOfSecConfigType.go +++ b/pkg/fbs/comm/opcua/server/ArrayOfSecConfigType.go @@ -7,7 +7,7 @@ import ( ) type ArrayOfSecConfigTypeT struct { - SecConfigArray []*SecConfigTypeT + SecConfigArray []*SecConfigTypeT `json:"secConfigArray"` } func (t *ArrayOfSecConfigTypeT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/opcua/server/ArrayOfUserTokenType.go b/pkg/fbs/comm/opcua/server/ArrayOfUserTokenType.go index c9a8959..f1b3b65 100644 --- a/pkg/fbs/comm/opcua/server/ArrayOfUserTokenType.go +++ b/pkg/fbs/comm/opcua/server/ArrayOfUserTokenType.go @@ -7,7 +7,7 @@ import ( ) type ArrayOfUserTokenTypeT struct { - UserTokenArray []*UserTokenTypeT + UserTokenArray []*UserTokenTypeT `json:"userTokenArray"` } func (t *ArrayOfUserTokenTypeT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/opcua/server/BuildInfoType.go b/pkg/fbs/comm/opcua/server/BuildInfoType.go index 29531ef..cf34f69 100644 --- a/pkg/fbs/comm/opcua/server/BuildInfoType.go +++ b/pkg/fbs/comm/opcua/server/BuildInfoType.go @@ -7,21 +7,36 @@ import ( ) type BuildInfoTypeT struct { - BuildDate uint64 - BuildNumber string - ManufacturerName string - ProductName string - ProductUri string - SoftwareVersion string + BuildDate uint64 `json:"buildDate"` + BuildNumber string `json:"buildNumber"` + ManufacturerName string `json:"manufacturerName"` + ProductName string `json:"productName"` + ProductUri string `json:"productUri"` + SoftwareVersion string `json:"softwareVersion"` } func (t *BuildInfoTypeT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - buildNumberOffset := builder.CreateString(t.BuildNumber) - manufacturerNameOffset := builder.CreateString(t.ManufacturerName) - productNameOffset := builder.CreateString(t.ProductName) - productUriOffset := builder.CreateString(t.ProductUri) - softwareVersionOffset := builder.CreateString(t.SoftwareVersion) + buildNumberOffset := flatbuffers.UOffsetT(0) + if t.BuildNumber != "" { + buildNumberOffset = builder.CreateString(t.BuildNumber) + } + manufacturerNameOffset := flatbuffers.UOffsetT(0) + if t.ManufacturerName != "" { + manufacturerNameOffset = builder.CreateString(t.ManufacturerName) + } + productNameOffset := flatbuffers.UOffsetT(0) + if t.ProductName != "" { + productNameOffset = builder.CreateString(t.ProductName) + } + productUriOffset := flatbuffers.UOffsetT(0) + if t.ProductUri != "" { + productUriOffset = builder.CreateString(t.ProductUri) + } + softwareVersionOffset := flatbuffers.UOffsetT(0) + if t.SoftwareVersion != "" { + softwareVersionOffset = builder.CreateString(t.SoftwareVersion) + } BuildInfoTypeStart(builder) BuildInfoTypeAddBuildDate(builder, t.BuildDate) BuildInfoTypeAddBuildNumber(builder, buildNumberOffset) diff --git a/pkg/fbs/comm/opcua/server/SecConfigType.go b/pkg/fbs/comm/opcua/server/SecConfigType.go index 4e1a81e..6845be3 100644 --- a/pkg/fbs/comm/opcua/server/SecConfigType.go +++ b/pkg/fbs/comm/opcua/server/SecConfigType.go @@ -7,10 +7,10 @@ import ( ) type SecConfigTypeT struct { - PolicyId uint32 - ModeNone bool - ModeSign bool - ModeSignAndEncrypt bool + PolicyId uint32 `json:"policyId"` + ModeNone bool `json:"modeNone"` + ModeSign bool `json:"modeSign"` + ModeSignAndEncrypt bool `json:"modeSignAndEncrypt"` } func (t *SecConfigTypeT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/opcua/server/ServerDiagnosticsSummaryType.go b/pkg/fbs/comm/opcua/server/ServerDiagnosticsSummaryType.go index 555b1ea..e5fc01f 100644 --- a/pkg/fbs/comm/opcua/server/ServerDiagnosticsSummaryType.go +++ b/pkg/fbs/comm/opcua/server/ServerDiagnosticsSummaryType.go @@ -7,18 +7,18 @@ import ( ) type ServerDiagnosticsSummaryTypeT struct { - CumulatedSessionCount uint32 - CumulatedSubscriptionCount uint32 - CurrentSessonCount uint32 - CurrentSubscriptionCount uint32 - PublishingIntervalCount uint32 - RejectedRequestsCount uint32 - RejectedSessionCount uint32 - SecurityRejectedRequestsCount uint32 - SecurityRejectedSessionCount uint32 - ServerViewCount uint32 - SessionAbortCount uint32 - SessionTimeoutCount uint32 + CumulatedSessionCount uint32 `json:"cumulatedSessionCount"` + CumulatedSubscriptionCount uint32 `json:"cumulatedSubscriptionCount"` + CurrentSessonCount uint32 `json:"currentSessonCount"` + CurrentSubscriptionCount uint32 `json:"currentSubscriptionCount"` + PublishingIntervalCount uint32 `json:"publishingIntervalCount"` + RejectedRequestsCount uint32 `json:"rejectedRequestsCount"` + RejectedSessionCount uint32 `json:"rejectedSessionCount"` + SecurityRejectedRequestsCount uint32 `json:"securityRejectedRequestsCount"` + SecurityRejectedSessionCount uint32 `json:"securityRejectedSessionCount"` + ServerViewCount uint32 `json:"serverViewCount"` + SessionAbortCount uint32 `json:"sessionAbortCount"` + SessionTimeoutCount uint32 `json:"sessionTimeoutCount"` } func (t *ServerDiagnosticsSummaryTypeT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/opcua/server/ServerStateType.go b/pkg/fbs/comm/opcua/server/ServerStateType.go index b9117a9..31d228b 100644 --- a/pkg/fbs/comm/opcua/server/ServerStateType.go +++ b/pkg/fbs/comm/opcua/server/ServerStateType.go @@ -7,7 +7,7 @@ import ( ) type ServerStateTypeT struct { - State EnumServerState + State EnumServerState `json:"state"` } func (t *ServerStateTypeT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/opcua/server/ServerStatusType.go b/pkg/fbs/comm/opcua/server/ServerStatusType.go index 90008b5..db5e08f 100644 --- a/pkg/fbs/comm/opcua/server/ServerStatusType.go +++ b/pkg/fbs/comm/opcua/server/ServerStatusType.go @@ -7,18 +7,21 @@ import ( ) type ServerStatusTypeT struct { - BuildInfo *BuildInfoTypeT - CurrentTime uint32 - SecondsTillShutdown uint32 - ShutdownReason string - StartTime uint32 - State EnumServerState + BuildInfo *BuildInfoTypeT `json:"buildInfo"` + CurrentTime uint32 `json:"currentTime"` + SecondsTillShutdown uint32 `json:"secondsTillShutdown"` + ShutdownReason string `json:"shutdownReason"` + StartTime uint32 `json:"startTime"` + State EnumServerState `json:"state"` } func (t *ServerStatusTypeT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } buildInfoOffset := t.BuildInfo.Pack(builder) - shutdownReasonOffset := builder.CreateString(t.ShutdownReason) + shutdownReasonOffset := flatbuffers.UOffsetT(0) + if t.ShutdownReason != "" { + shutdownReasonOffset = builder.CreateString(t.ShutdownReason) + } ServerStatusTypeStart(builder) ServerStatusTypeAddBuildInfo(builder, buildInfoOffset) ServerStatusTypeAddCurrentTime(builder, t.CurrentTime) diff --git a/pkg/fbs/comm/opcua/server/UserTokenType.go b/pkg/fbs/comm/opcua/server/UserTokenType.go index c9a37ff..6d07288 100644 --- a/pkg/fbs/comm/opcua/server/UserTokenType.go +++ b/pkg/fbs/comm/opcua/server/UserTokenType.go @@ -7,8 +7,8 @@ import ( ) type UserTokenTypeT struct { - Type uint32 - PolicyId uint32 + Type uint32 `json:"type"` + PolicyId uint32 `json:"policyId"` } func (t *UserTokenTypeT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/osci/fbtypes/BufferCfg.go b/pkg/fbs/comm/osci/fbtypes/BufferCfg.go index a045f9b..a7ac9a8 100644 --- a/pkg/fbs/comm/osci/fbtypes/BufferCfg.go +++ b/pkg/fbs/comm/osci/fbtypes/BufferCfg.go @@ -7,9 +7,9 @@ import ( ) type BufferCfgT struct { - RecordingTime *TimeT - BufferType BufferTypeEnumFb - RecordingInterval *TimeT + RecordingTime *TimeT `json:"recordingTime"` + BufferType BufferTypeEnumFb `json:"bufferType"` + RecordingInterval *TimeT `json:"recordingInterval"` } func (t *BufferCfgT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/osci/fbtypes/ChannelCfg.go b/pkg/fbs/comm/osci/fbtypes/ChannelCfg.go index 57412ea..b1d1ad6 100644 --- a/pkg/fbs/comm/osci/fbtypes/ChannelCfg.go +++ b/pkg/fbs/comm/osci/fbtypes/ChannelCfg.go @@ -7,20 +7,41 @@ import ( ) type ChannelCfgT struct { - Name string - Source string - Type ChannelTypeEnumFb - Unit string + Name string `json:"name"` + Alias string `json:"alias"` + Source string `json:"source"` + DataType string `json:"dataType"` + Type ChannelTypeEnumFb `json:"type"` + Unit string `json:"unit"` } func (t *ChannelCfgT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - sourceOffset := builder.CreateString(t.Source) - unitOffset := builder.CreateString(t.Unit) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + aliasOffset := flatbuffers.UOffsetT(0) + if t.Alias != "" { + aliasOffset = builder.CreateString(t.Alias) + } + sourceOffset := flatbuffers.UOffsetT(0) + if t.Source != "" { + sourceOffset = builder.CreateString(t.Source) + } + dataTypeOffset := flatbuffers.UOffsetT(0) + if t.DataType != "" { + dataTypeOffset = builder.CreateString(t.DataType) + } + unitOffset := flatbuffers.UOffsetT(0) + if t.Unit != "" { + unitOffset = builder.CreateString(t.Unit) + } ChannelCfgStart(builder) ChannelCfgAddName(builder, nameOffset) + ChannelCfgAddAlias(builder, aliasOffset) ChannelCfgAddSource(builder, sourceOffset) + ChannelCfgAddDataType(builder, dataTypeOffset) ChannelCfgAddType(builder, t.Type) ChannelCfgAddUnit(builder, unitOffset) return ChannelCfgEnd(builder) @@ -28,7 +49,9 @@ func (t *ChannelCfgT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { func (rcv *ChannelCfg) UnPackTo(t *ChannelCfgT) { t.Name = string(rcv.Name()) + t.Alias = string(rcv.Alias()) t.Source = string(rcv.Source()) + t.DataType = string(rcv.DataType()) t.Type = rcv.Type() t.Unit = string(rcv.Unit()) } @@ -75,7 +98,7 @@ func (rcv *ChannelCfg) Name() []byte { return nil } -func (rcv *ChannelCfg) Source() []byte { +func (rcv *ChannelCfg) Alias() []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { return rcv._tab.ByteVector(o + rcv._tab.Pos) @@ -83,8 +106,24 @@ func (rcv *ChannelCfg) Source() []byte { return nil } -func (rcv *ChannelCfg) Type() ChannelTypeEnumFb { +func (rcv *ChannelCfg) Source() []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func (rcv *ChannelCfg) DataType() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func (rcv *ChannelCfg) Type() ChannelTypeEnumFb { + o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) if o != 0 { return ChannelTypeEnumFb(rcv._tab.GetInt8(o + rcv._tab.Pos)) } @@ -92,11 +131,11 @@ func (rcv *ChannelCfg) Type() ChannelTypeEnumFb { } func (rcv *ChannelCfg) MutateType(n ChannelTypeEnumFb) bool { - return rcv._tab.MutateInt8Slot(8, int8(n)) + return rcv._tab.MutateInt8Slot(12, int8(n)) } func (rcv *ChannelCfg) Unit() []byte { - o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) + o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) if o != 0 { return rcv._tab.ByteVector(o + rcv._tab.Pos) } @@ -104,19 +143,25 @@ func (rcv *ChannelCfg) Unit() []byte { } func ChannelCfgStart(builder *flatbuffers.Builder) { - builder.StartObject(4) + builder.StartObject(6) } func ChannelCfgAddName(builder *flatbuffers.Builder, name flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(name), 0) } +func ChannelCfgAddAlias(builder *flatbuffers.Builder, alias flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(alias), 0) +} func ChannelCfgAddSource(builder *flatbuffers.Builder, source flatbuffers.UOffsetT) { - builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(source), 0) + builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(source), 0) +} +func ChannelCfgAddDataType(builder *flatbuffers.Builder, dataType flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(dataType), 0) } func ChannelCfgAddType(builder *flatbuffers.Builder, type_ ChannelTypeEnumFb) { - builder.PrependInt8Slot(2, int8(type_), 0) + builder.PrependInt8Slot(4, int8(type_), 0) } func ChannelCfgAddUnit(builder *flatbuffers.Builder, unit flatbuffers.UOffsetT) { - builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(unit), 0) + builder.PrependUOffsetTSlot(5, flatbuffers.UOffsetT(unit), 0) } func ChannelCfgEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() diff --git a/pkg/fbs/comm/osci/fbtypes/DiagramCfg.go b/pkg/fbs/comm/osci/fbtypes/DiagramCfg.go index 5209911..30eb738 100644 --- a/pkg/fbs/comm/osci/fbtypes/DiagramCfg.go +++ b/pkg/fbs/comm/osci/fbtypes/DiagramCfg.go @@ -7,13 +7,16 @@ import ( ) type DiagramCfgT struct { - Name string - Channels []*ViewChannelT + Name string `json:"name"` + Channels []*ViewChannelT `json:"channels"` } func (t *DiagramCfgT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } channelsOffset := flatbuffers.UOffsetT(0) if t.Channels != nil { channelsLength := len(t.Channels) diff --git a/pkg/fbs/comm/osci/fbtypes/Oscilloscope.go b/pkg/fbs/comm/osci/fbtypes/Oscilloscope.go index 8ebcd37..aaf2991 100644 --- a/pkg/fbs/comm/osci/fbtypes/Oscilloscope.go +++ b/pkg/fbs/comm/osci/fbtypes/Oscilloscope.go @@ -7,8 +7,8 @@ import ( ) type OscilloscopeT struct { - Cfg *OscilloscopeCfgT - State *OscilloscopeStateT + Cfg *OscilloscopeCfgT `json:"cfg"` + State *OscilloscopeStateT `json:"state"` } func (t *OscilloscopeT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/osci/fbtypes/OscilloscopeCfg.go b/pkg/fbs/comm/osci/fbtypes/OscilloscopeCfg.go index a7863ac..abe4d08 100644 --- a/pkg/fbs/comm/osci/fbtypes/OscilloscopeCfg.go +++ b/pkg/fbs/comm/osci/fbtypes/OscilloscopeCfg.go @@ -7,16 +7,19 @@ import ( ) type OscilloscopeCfgT struct { - Name string - Channels []*ChannelCfgT - Buffer *BufferCfgT - Trigger *TriggerCfgT - Diagramview []*DiagramCfgT + Name string `json:"name"` + Channels []*ChannelCfgT `json:"channels"` + Buffer *BufferCfgT `json:"buffer"` + Trigger *TriggerCfgT `json:"trigger"` + Diagramview []*DiagramCfgT `json:"diagramview"` } func (t *OscilloscopeCfgT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } channelsOffset := flatbuffers.UOffsetT(0) if t.Channels != nil { channelsLength := len(t.Channels) diff --git a/pkg/fbs/comm/osci/fbtypes/OscilloscopeDiagnosis.go b/pkg/fbs/comm/osci/fbtypes/OscilloscopeDiagnosis.go index b3ec153..962e39a 100644 --- a/pkg/fbs/comm/osci/fbtypes/OscilloscopeDiagnosis.go +++ b/pkg/fbs/comm/osci/fbtypes/OscilloscopeDiagnosis.go @@ -7,14 +7,17 @@ import ( ) type OscilloscopeDiagnosisT struct { - MainDiagnosisCode uint32 - DetailedDiagnosisCode uint32 - DynamicDescription string + MainDiagnosisCode uint32 `json:"mainDiagnosisCode"` + DetailedDiagnosisCode uint32 `json:"detailedDiagnosisCode"` + DynamicDescription string `json:"dynamicDescription"` } func (t *OscilloscopeDiagnosisT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - dynamicDescriptionOffset := builder.CreateString(t.DynamicDescription) + dynamicDescriptionOffset := flatbuffers.UOffsetT(0) + if t.DynamicDescription != "" { + dynamicDescriptionOffset = builder.CreateString(t.DynamicDescription) + } OscilloscopeDiagnosisStart(builder) OscilloscopeDiagnosisAddMainDiagnosisCode(builder, t.MainDiagnosisCode) OscilloscopeDiagnosisAddDetailedDiagnosisCode(builder, t.DetailedDiagnosisCode) diff --git a/pkg/fbs/comm/osci/fbtypes/OscilloscopeRec.go b/pkg/fbs/comm/osci/fbtypes/OscilloscopeRec.go index 8941e7f..6f7bf29 100644 --- a/pkg/fbs/comm/osci/fbtypes/OscilloscopeRec.go +++ b/pkg/fbs/comm/osci/fbtypes/OscilloscopeRec.go @@ -7,8 +7,8 @@ import ( ) type OscilloscopeRecT struct { - Trigger *TimeT - Channels []string + Trigger *TimeT `json:"trigger"` + Channels []string `json:"channels"` } func (t *OscilloscopeRecT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/osci/fbtypes/OscilloscopeState.go b/pkg/fbs/comm/osci/fbtypes/OscilloscopeState.go index a340d3c..b25542e 100644 --- a/pkg/fbs/comm/osci/fbtypes/OscilloscopeState.go +++ b/pkg/fbs/comm/osci/fbtypes/OscilloscopeState.go @@ -7,9 +7,9 @@ import ( ) type OscilloscopeStateT struct { - Opstate OscilloscopeStateEnum - Diagnosis *OscilloscopeDiagnosisT - BufferLevel float64 + Opstate OscilloscopeStateEnum `json:"opstate"` + Diagnosis *OscilloscopeDiagnosisT `json:"diagnosis"` + BufferLevel float64 `json:"bufferLevel"` } func (t *OscilloscopeStateT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/osci/fbtypes/RecAllSignals.go b/pkg/fbs/comm/osci/fbtypes/RecAllSignals.go index e2ef672..ca1af3d 100644 --- a/pkg/fbs/comm/osci/fbtypes/RecAllSignals.go +++ b/pkg/fbs/comm/osci/fbtypes/RecAllSignals.go @@ -7,7 +7,7 @@ import ( ) type RecAllSignalsT struct { - AllSignals []*RecChannelT + AllSignals []*RecChannelT `json:"allSignals"` } func (t *RecAllSignalsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/osci/fbtypes/RecChannel.go b/pkg/fbs/comm/osci/fbtypes/RecChannel.go index 3ff5dca..994f932 100644 --- a/pkg/fbs/comm/osci/fbtypes/RecChannel.go +++ b/pkg/fbs/comm/osci/fbtypes/RecChannel.go @@ -7,13 +7,16 @@ import ( ) type RecChannelT struct { - Name string - Slices []*RecSliceT + Name string `json:"name"` + Slices []*RecSliceT `json:"slices"` } func (t *RecChannelT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } slicesOffset := flatbuffers.UOffsetT(0) if t.Slices != nil { slicesLength := len(t.Slices) diff --git a/pkg/fbs/comm/osci/fbtypes/RecSlice.go b/pkg/fbs/comm/osci/fbtypes/RecSlice.go index af1d06d..85759b5 100644 --- a/pkg/fbs/comm/osci/fbtypes/RecSlice.go +++ b/pkg/fbs/comm/osci/fbtypes/RecSlice.go @@ -7,7 +7,7 @@ import ( ) type RecSliceT struct { - Values []*RecValueT + Values []*RecValueT `json:"values"` } func (t *RecSliceT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/osci/fbtypes/RecValue.go b/pkg/fbs/comm/osci/fbtypes/RecValue.go index ad8db45..1348875 100644 --- a/pkg/fbs/comm/osci/fbtypes/RecValue.go +++ b/pkg/fbs/comm/osci/fbtypes/RecValue.go @@ -7,25 +7,28 @@ import ( ) type RecValueT struct { - Time *TimeT - ValuesBool bool - ValuesByte int8 - ValuesShort int16 - ValuesInt int32 - ValuesLong int64 - ValuesUbyte byte - ValuesUshort uint16 - ValuesUint uint32 - ValuesUlong uint64 - ValuesFloat float32 - ValuesDouble float64 - ValuesString string + Time *TimeT `json:"time"` + ValuesBool bool `json:"values_bool"` + ValuesByte int8 `json:"values_byte"` + ValuesShort int16 `json:"values_short"` + ValuesInt int32 `json:"values_int"` + ValuesLong int64 `json:"values_long"` + ValuesUbyte byte `json:"values_ubyte"` + ValuesUshort uint16 `json:"values_ushort"` + ValuesUint uint32 `json:"values_uint"` + ValuesUlong uint64 `json:"values_ulong"` + ValuesFloat float32 `json:"values_float"` + ValuesDouble float64 `json:"values_double"` + ValuesString string `json:"values_string"` } func (t *RecValueT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } timeOffset := t.Time.Pack(builder) - valuesStringOffset := builder.CreateString(t.ValuesString) + valuesStringOffset := flatbuffers.UOffsetT(0) + if t.ValuesString != "" { + valuesStringOffset = builder.CreateString(t.ValuesString) + } RecValueStart(builder) RecValueAddTime(builder, timeOffset) RecValueAddValuesBool(builder, t.ValuesBool) diff --git a/pkg/fbs/comm/osci/fbtypes/Time.go b/pkg/fbs/comm/osci/fbtypes/Time.go index 7cd3cd1..5d158d7 100644 --- a/pkg/fbs/comm/osci/fbtypes/Time.go +++ b/pkg/fbs/comm/osci/fbtypes/Time.go @@ -7,7 +7,7 @@ import ( ) type TimeT struct { - Value uint64 + Value uint64 `json:"value"` } func (t *TimeT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/osci/fbtypes/TriggerCfg.go b/pkg/fbs/comm/osci/fbtypes/TriggerCfg.go index c5fc8a7..c80ecc4 100644 --- a/pkg/fbs/comm/osci/fbtypes/TriggerCfg.go +++ b/pkg/fbs/comm/osci/fbtypes/TriggerCfg.go @@ -7,15 +7,18 @@ import ( ) type TriggerCfgT struct { - TriggerType TriggerTypeEnumFb - Name string - Level float64 - PreTrigger float64 + TriggerType TriggerTypeEnumFb `json:"triggerType"` + Name string `json:"name"` + Level float64 `json:"level"` + PreTrigger float64 `json:"preTrigger"` } func (t *TriggerCfgT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } TriggerCfgStart(builder) TriggerCfgAddTriggerType(builder, t.TriggerType) TriggerCfgAddName(builder, nameOffset) diff --git a/pkg/fbs/comm/osci/fbtypes/ViewChannel.go b/pkg/fbs/comm/osci/fbtypes/ViewChannel.go index 4e07eb7..51a66e3 100644 --- a/pkg/fbs/comm/osci/fbtypes/ViewChannel.go +++ b/pkg/fbs/comm/osci/fbtypes/ViewChannel.go @@ -7,16 +7,22 @@ import ( ) type ViewChannelT struct { - Source string - Color string - Visible bool - ConnectionType ConnectionTypeEnumFb + Source string `json:"source"` + Color string `json:"color"` + Visible bool `json:"visible"` + ConnectionType ConnectionTypeEnumFb `json:"connectionType"` } func (t *ViewChannelT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - sourceOffset := builder.CreateString(t.Source) - colorOffset := builder.CreateString(t.Color) + sourceOffset := flatbuffers.UOffsetT(0) + if t.Source != "" { + sourceOffset = builder.CreateString(t.Source) + } + colorOffset := flatbuffers.UOffsetT(0) + if t.Color != "" { + colorOffset = builder.CreateString(t.Color) + } ViewChannelStart(builder) ViewChannelAddSource(builder, sourceOffset) ViewChannelAddColor(builder, colorOffset) diff --git a/pkg/fbs/comm/osci/fbtypes/type_bool.go b/pkg/fbs/comm/osci/fbtypes/type_bool.go index e950de4..78fbb57 100644 --- a/pkg/fbs/comm/osci/fbtypes/type_bool.go +++ b/pkg/fbs/comm/osci/fbtypes/type_bool.go @@ -7,7 +7,7 @@ import ( ) type type_boolT struct { - Value bool + Value bool `json:"value"` } func (t *type_boolT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/osci/fbtypes/type_byte.go b/pkg/fbs/comm/osci/fbtypes/type_byte.go index 2a941f7..9a4d097 100644 --- a/pkg/fbs/comm/osci/fbtypes/type_byte.go +++ b/pkg/fbs/comm/osci/fbtypes/type_byte.go @@ -7,7 +7,7 @@ import ( ) type type_byteT struct { - Value int8 + Value int8 `json:"value"` } func (t *type_byteT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/osci/fbtypes/type_double.go b/pkg/fbs/comm/osci/fbtypes/type_double.go index 435d333..7a249b4 100644 --- a/pkg/fbs/comm/osci/fbtypes/type_double.go +++ b/pkg/fbs/comm/osci/fbtypes/type_double.go @@ -7,7 +7,7 @@ import ( ) type type_doubleT struct { - Value float64 + Value float64 `json:"value"` } func (t *type_doubleT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/osci/fbtypes/type_float.go b/pkg/fbs/comm/osci/fbtypes/type_float.go index 3ce9863..2918054 100644 --- a/pkg/fbs/comm/osci/fbtypes/type_float.go +++ b/pkg/fbs/comm/osci/fbtypes/type_float.go @@ -7,7 +7,7 @@ import ( ) type type_floatT struct { - Value float32 + Value float32 `json:"value"` } func (t *type_floatT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/osci/fbtypes/type_int.go b/pkg/fbs/comm/osci/fbtypes/type_int.go index 4a1d57f..3c85a79 100644 --- a/pkg/fbs/comm/osci/fbtypes/type_int.go +++ b/pkg/fbs/comm/osci/fbtypes/type_int.go @@ -7,7 +7,7 @@ import ( ) type type_intT struct { - Value int32 + Value int32 `json:"value"` } func (t *type_intT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/osci/fbtypes/type_long.go b/pkg/fbs/comm/osci/fbtypes/type_long.go index aa1f8de..aa5cd9f 100644 --- a/pkg/fbs/comm/osci/fbtypes/type_long.go +++ b/pkg/fbs/comm/osci/fbtypes/type_long.go @@ -7,7 +7,7 @@ import ( ) type type_longT struct { - Value int64 + Value int64 `json:"value"` } func (t *type_longT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/osci/fbtypes/type_short.go b/pkg/fbs/comm/osci/fbtypes/type_short.go index ee5142b..765ee13 100644 --- a/pkg/fbs/comm/osci/fbtypes/type_short.go +++ b/pkg/fbs/comm/osci/fbtypes/type_short.go @@ -7,7 +7,7 @@ import ( ) type type_shortT struct { - Value int16 + Value int16 `json:"value"` } func (t *type_shortT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/osci/fbtypes/type_string.go b/pkg/fbs/comm/osci/fbtypes/type_string.go index 1a66908..93a0ee9 100644 --- a/pkg/fbs/comm/osci/fbtypes/type_string.go +++ b/pkg/fbs/comm/osci/fbtypes/type_string.go @@ -7,12 +7,15 @@ import ( ) type type_stringT struct { - Value string + Value string `json:"value"` } func (t *type_stringT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - valueOffset := builder.CreateString(t.Value) + valueOffset := flatbuffers.UOffsetT(0) + if t.Value != "" { + valueOffset = builder.CreateString(t.Value) + } type_stringStart(builder) type_stringAddValue(builder, valueOffset) return type_stringEnd(builder) diff --git a/pkg/fbs/comm/osci/fbtypes/type_ubyte.go b/pkg/fbs/comm/osci/fbtypes/type_ubyte.go index c2c21d5..0fd7fb9 100644 --- a/pkg/fbs/comm/osci/fbtypes/type_ubyte.go +++ b/pkg/fbs/comm/osci/fbtypes/type_ubyte.go @@ -7,7 +7,7 @@ import ( ) type type_ubyteT struct { - Value byte + Value byte `json:"value"` } func (t *type_ubyteT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/osci/fbtypes/type_uint.go b/pkg/fbs/comm/osci/fbtypes/type_uint.go index 5319e97..c664492 100644 --- a/pkg/fbs/comm/osci/fbtypes/type_uint.go +++ b/pkg/fbs/comm/osci/fbtypes/type_uint.go @@ -7,7 +7,7 @@ import ( ) type type_uintT struct { - Value uint32 + Value uint32 `json:"value"` } func (t *type_uintT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/osci/fbtypes/type_ulong.go b/pkg/fbs/comm/osci/fbtypes/type_ulong.go index 415504d..93f8833 100644 --- a/pkg/fbs/comm/osci/fbtypes/type_ulong.go +++ b/pkg/fbs/comm/osci/fbtypes/type_ulong.go @@ -7,7 +7,7 @@ import ( ) type type_ulongT struct { - Value uint64 + Value uint64 `json:"value"` } func (t *type_ulongT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/osci/fbtypes/type_ushort.go b/pkg/fbs/comm/osci/fbtypes/type_ushort.go index fc59fae..630a99c 100644 --- a/pkg/fbs/comm/osci/fbtypes/type_ushort.go +++ b/pkg/fbs/comm/osci/fbtypes/type_ushort.go @@ -7,7 +7,7 @@ import ( ) type type_ushortT struct { - Value uint16 + Value uint16 `json:"value"` } func (t *type_ushortT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/profinet/device/fbs/Capability.go b/pkg/fbs/comm/profinet/device/fbs/Capability.go index 995f5ba..a24acd1 100644 --- a/pkg/fbs/comm/profinet/device/fbs/Capability.go +++ b/pkg/fbs/comm/profinet/device/fbs/Capability.go @@ -7,14 +7,20 @@ import ( ) type CapabilityT struct { - Name string - Value string + Name string `json:"name"` + Value string `json:"value"` } func (t *CapabilityT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - valueOffset := builder.CreateString(t.Value) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + valueOffset := flatbuffers.UOffsetT(0) + if t.Value != "" { + valueOffset = builder.CreateString(t.Value) + } CapabilityStart(builder) CapabilityAddName(builder, nameOffset) CapabilityAddValue(builder, valueOffset) diff --git a/pkg/fbs/comm/profinet/device/fbs/CapableInterfaces.go b/pkg/fbs/comm/profinet/device/fbs/CapableInterfaces.go index 96eb93e..c0463aa 100644 --- a/pkg/fbs/comm/profinet/device/fbs/CapableInterfaces.go +++ b/pkg/fbs/comm/profinet/device/fbs/CapableInterfaces.go @@ -7,7 +7,7 @@ import ( ) type CapableInterfacesT struct { - InterfaceList []*InterfaceT + InterfaceList []*InterfaceT `json:"interfaceList"` } func (t *CapableInterfacesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/profinet/device/fbs/ConfigData.go b/pkg/fbs/comm/profinet/device/fbs/ConfigData.go index 532a0d1..450713e 100644 --- a/pkg/fbs/comm/profinet/device/fbs/ConfigData.go +++ b/pkg/fbs/comm/profinet/device/fbs/ConfigData.go @@ -7,15 +7,21 @@ import ( ) type ConfigDataT struct { - Name string - Description string - ConfigdataVector []*ModuleDataT + Name string `json:"name"` + Description string `json:"description"` + ConfigdataVector []*ModuleDataT `json:"configdataVector"` } func (t *ConfigDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - descriptionOffset := builder.CreateString(t.Description) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + descriptionOffset := flatbuffers.UOffsetT(0) + if t.Description != "" { + descriptionOffset = builder.CreateString(t.Description) + } configdataVectorOffset := flatbuffers.UOffsetT(0) if t.ConfigdataVector != nil { configdataVectorLength := len(t.ConfigdataVector) diff --git a/pkg/fbs/comm/profinet/device/fbs/DeviceConfig.go b/pkg/fbs/comm/profinet/device/fbs/DeviceConfig.go index 165139d..58756ed 100644 --- a/pkg/fbs/comm/profinet/device/fbs/DeviceConfig.go +++ b/pkg/fbs/comm/profinet/device/fbs/DeviceConfig.go @@ -7,14 +7,20 @@ import ( ) type DeviceConfigT struct { - Name string - Description string + Name string `json:"name"` + Description string `json:"description"` } func (t *DeviceConfigT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - descriptionOffset := builder.CreateString(t.Description) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + descriptionOffset := flatbuffers.UOffsetT(0) + if t.Description != "" { + descriptionOffset = builder.CreateString(t.Description) + } DeviceConfigStart(builder) DeviceConfigAddName(builder, nameOffset) DeviceConfigAddDescription(builder, descriptionOffset) diff --git a/pkg/fbs/comm/profinet/device/fbs/DeviceConfigRequest.go b/pkg/fbs/comm/profinet/device/fbs/DeviceConfigRequest.go index 1e0b7ed..12d0bfb 100644 --- a/pkg/fbs/comm/profinet/device/fbs/DeviceConfigRequest.go +++ b/pkg/fbs/comm/profinet/device/fbs/DeviceConfigRequest.go @@ -7,13 +7,16 @@ import ( ) type DeviceConfigRequestT struct { - Name string - Configuration []byte + Name string `json:"name"` + Configuration []byte `json:"configuration"` } func (t *DeviceConfigRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } configurationOffset := flatbuffers.UOffsetT(0) if t.Configuration != nil { configurationOffset = builder.CreateByteString(t.Configuration) diff --git a/pkg/fbs/comm/profinet/device/fbs/DeviceConfigResponse.go b/pkg/fbs/comm/profinet/device/fbs/DeviceConfigResponse.go index 13c420c..843335d 100644 --- a/pkg/fbs/comm/profinet/device/fbs/DeviceConfigResponse.go +++ b/pkg/fbs/comm/profinet/device/fbs/DeviceConfigResponse.go @@ -7,14 +7,20 @@ import ( ) type DeviceConfigResponseT struct { - Name string - Description string + Name string `json:"name"` + Description string `json:"description"` } func (t *DeviceConfigResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - descriptionOffset := builder.CreateString(t.Description) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + descriptionOffset := flatbuffers.UOffsetT(0) + if t.Description != "" { + descriptionOffset = builder.CreateString(t.Description) + } DeviceConfigResponseStart(builder) DeviceConfigResponseAddName(builder, nameOffset) DeviceConfigResponseAddDescription(builder, descriptionOffset) diff --git a/pkg/fbs/comm/profinet/device/fbs/DeviceState.go b/pkg/fbs/comm/profinet/device/fbs/DeviceState.go index 5f3be68..2baac12 100644 --- a/pkg/fbs/comm/profinet/device/fbs/DeviceState.go +++ b/pkg/fbs/comm/profinet/device/fbs/DeviceState.go @@ -7,8 +7,8 @@ import ( ) type DeviceStateT struct { - Request *DeviceStateRequestT - Response *DeviceStateResponseT + Request *DeviceStateRequestT `json:"request"` + Response *DeviceStateResponseT `json:"response"` } func (t *DeviceStateT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/profinet/device/fbs/DeviceStateRequest.go b/pkg/fbs/comm/profinet/device/fbs/DeviceStateRequest.go index e3ab50e..3a27ac5 100644 --- a/pkg/fbs/comm/profinet/device/fbs/DeviceStateRequest.go +++ b/pkg/fbs/comm/profinet/device/fbs/DeviceStateRequest.go @@ -7,7 +7,7 @@ import ( ) type DeviceStateRequestT struct { - NewState ProfinetState + NewState ProfinetState `json:"newState"` } func (t *DeviceStateRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/profinet/device/fbs/DeviceStateResponse.go b/pkg/fbs/comm/profinet/device/fbs/DeviceStateResponse.go index 968d1a8..d2c1dca 100644 --- a/pkg/fbs/comm/profinet/device/fbs/DeviceStateResponse.go +++ b/pkg/fbs/comm/profinet/device/fbs/DeviceStateResponse.go @@ -7,8 +7,8 @@ import ( ) type DeviceStateResponseT struct { - CurrentState ProfinetState - RequestedState ProfinetState + CurrentState ProfinetState `json:"currentState"` + RequestedState ProfinetState `json:"requestedState"` } func (t *DeviceStateResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/profinet/device/fbs/DeviceStatus.go b/pkg/fbs/comm/profinet/device/fbs/DeviceStatus.go index 5223675..5a249aa 100644 --- a/pkg/fbs/comm/profinet/device/fbs/DeviceStatus.go +++ b/pkg/fbs/comm/profinet/device/fbs/DeviceStatus.go @@ -7,7 +7,7 @@ import ( ) type DeviceStatusT struct { - Response *DeviceStatusResponseT + Response *DeviceStatusResponseT `json:"response"` } func (t *DeviceStatusT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/profinet/device/fbs/DeviceStatusResponse.go b/pkg/fbs/comm/profinet/device/fbs/DeviceStatusResponse.go index 0fa776e..436c07e 100644 --- a/pkg/fbs/comm/profinet/device/fbs/DeviceStatusResponse.go +++ b/pkg/fbs/comm/profinet/device/fbs/DeviceStatusResponse.go @@ -7,7 +7,7 @@ import ( ) type DeviceStatusResponseT struct { - Status uint32 + Status uint32 `json:"status"` } func (t *DeviceStatusResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/profinet/device/fbs/InstancesCreate.go b/pkg/fbs/comm/profinet/device/fbs/InstancesCreate.go index cf44d0e..9f4bbc9 100644 --- a/pkg/fbs/comm/profinet/device/fbs/InstancesCreate.go +++ b/pkg/fbs/comm/profinet/device/fbs/InstancesCreate.go @@ -7,7 +7,7 @@ import ( ) type InstancesCreateT struct { - Request *InstancesCreateRequestT + Request *InstancesCreateRequestT `json:"request"` } func (t *InstancesCreateT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/profinet/device/fbs/InstancesCreateRequest.go b/pkg/fbs/comm/profinet/device/fbs/InstancesCreateRequest.go index dc24f79..5510832 100644 --- a/pkg/fbs/comm/profinet/device/fbs/InstancesCreateRequest.go +++ b/pkg/fbs/comm/profinet/device/fbs/InstancesCreateRequest.go @@ -7,18 +7,30 @@ import ( ) type InstancesCreateRequestT struct { - InstanceName string - Port string - LinkLayer string - Arguments string + InstanceName string `json:"instanceName"` + Port string `json:"port"` + LinkLayer string `json:"linkLayer"` + Arguments string `json:"arguments"` } func (t *InstancesCreateRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - instanceNameOffset := builder.CreateString(t.InstanceName) - portOffset := builder.CreateString(t.Port) - linkLayerOffset := builder.CreateString(t.LinkLayer) - argumentsOffset := builder.CreateString(t.Arguments) + instanceNameOffset := flatbuffers.UOffsetT(0) + if t.InstanceName != "" { + instanceNameOffset = builder.CreateString(t.InstanceName) + } + portOffset := flatbuffers.UOffsetT(0) + if t.Port != "" { + portOffset = builder.CreateString(t.Port) + } + linkLayerOffset := flatbuffers.UOffsetT(0) + if t.LinkLayer != "" { + linkLayerOffset = builder.CreateString(t.LinkLayer) + } + argumentsOffset := flatbuffers.UOffsetT(0) + if t.Arguments != "" { + argumentsOffset = builder.CreateString(t.Arguments) + } InstancesCreateRequestStart(builder) InstancesCreateRequestAddInstanceName(builder, instanceNameOffset) InstancesCreateRequestAddPort(builder, portOffset) diff --git a/pkg/fbs/comm/profinet/device/fbs/Interface.go b/pkg/fbs/comm/profinet/device/fbs/Interface.go index 31de45d..b905faf 100644 --- a/pkg/fbs/comm/profinet/device/fbs/Interface.go +++ b/pkg/fbs/comm/profinet/device/fbs/Interface.go @@ -7,17 +7,26 @@ import ( ) type InterfaceT struct { - Port string - Device string - LinkLayer string - CapabilityList []*CapabilityT + Port string `json:"port"` + Device string `json:"device"` + LinkLayer string `json:"linkLayer"` + CapabilityList []*CapabilityT `json:"capabilityList"` } func (t *InterfaceT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - portOffset := builder.CreateString(t.Port) - deviceOffset := builder.CreateString(t.Device) - linkLayerOffset := builder.CreateString(t.LinkLayer) + portOffset := flatbuffers.UOffsetT(0) + if t.Port != "" { + portOffset = builder.CreateString(t.Port) + } + deviceOffset := flatbuffers.UOffsetT(0) + if t.Device != "" { + deviceOffset = builder.CreateString(t.Device) + } + linkLayerOffset := flatbuffers.UOffsetT(0) + if t.LinkLayer != "" { + linkLayerOffset = builder.CreateString(t.LinkLayer) + } capabilityListOffset := flatbuffers.UOffsetT(0) if t.CapabilityList != nil { capabilityListLength := len(t.CapabilityList) diff --git a/pkg/fbs/comm/profinet/device/fbs/ModuleData.go b/pkg/fbs/comm/profinet/device/fbs/ModuleData.go index ed86a3d..a9d9ac3 100644 --- a/pkg/fbs/comm/profinet/device/fbs/ModuleData.go +++ b/pkg/fbs/comm/profinet/device/fbs/ModuleData.go @@ -7,10 +7,10 @@ import ( ) type ModuleDataT struct { - ModuleType ModuleType - ModuleIndex uint16 - ContainerType ContainerType - NumberElements uint16 + ModuleType ModuleType `json:"moduleType"` + ModuleIndex uint16 `json:"moduleIndex"` + ContainerType ContainerType `json:"containerType"` + NumberElements uint16 `json:"numberElements"` } func (t *ModuleDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/profinet/device/fbs/Parameter.go b/pkg/fbs/comm/profinet/device/fbs/Parameter.go index 2b619f4..3c7a257 100644 --- a/pkg/fbs/comm/profinet/device/fbs/Parameter.go +++ b/pkg/fbs/comm/profinet/device/fbs/Parameter.go @@ -7,8 +7,8 @@ import ( ) type ParameterT struct { - Request *ParameterRequestT - Response *ParameterResponseT + Request *ParameterRequestT `json:"request"` + Response *ParameterResponseT `json:"response"` } func (t *ParameterT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/profinet/device/fbs/ParameterRequest.go b/pkg/fbs/comm/profinet/device/fbs/ParameterRequest.go index fdbb7ad..b82ee55 100644 --- a/pkg/fbs/comm/profinet/device/fbs/ParameterRequest.go +++ b/pkg/fbs/comm/profinet/device/fbs/ParameterRequest.go @@ -7,8 +7,8 @@ import ( ) type ParameterRequestT struct { - Eidn uint32 - Data []byte + Eidn uint32 `json:"eidn"` + Data []byte `json:"data"` } func (t *ParameterRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/profinet/device/fbs/ParameterResponse.go b/pkg/fbs/comm/profinet/device/fbs/ParameterResponse.go index 1a06f39..089f38f 100644 --- a/pkg/fbs/comm/profinet/device/fbs/ParameterResponse.go +++ b/pkg/fbs/comm/profinet/device/fbs/ParameterResponse.go @@ -7,7 +7,7 @@ import ( ) type ParameterResponseT struct { - Data []byte + Data []byte `json:"data"` } func (t *ParameterResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/comm/profinet/device/fbs/SelectableDeviceConfigs.go b/pkg/fbs/comm/profinet/device/fbs/SelectableDeviceConfigs.go index f64de36..1648ec5 100644 --- a/pkg/fbs/comm/profinet/device/fbs/SelectableDeviceConfigs.go +++ b/pkg/fbs/comm/profinet/device/fbs/SelectableDeviceConfigs.go @@ -7,7 +7,7 @@ import ( ) type SelectableDeviceConfigsT struct { - DeviceConfigsList []*DeviceConfigT + DeviceConfigsList []*DeviceConfigT `json:"deviceConfigsList"` } func (t *SelectableDeviceConfigsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/log/diagnosis/fbs/ClassConfig.go b/pkg/fbs/common/log/diagnosis/fbs/ClassConfig.go index ef98a56..d5916e0 100644 --- a/pkg/fbs/common/log/diagnosis/fbs/ClassConfig.go +++ b/pkg/fbs/common/log/diagnosis/fbs/ClassConfig.go @@ -8,7 +8,7 @@ import ( /// This table defines which log class is selected. type ClassConfigT struct { - ClassConfig Class + ClassConfig Class `json:"classConfig"` } func (t *ClassConfigT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/log/diagnosis/fbs/DetailedDiagnostic.go b/pkg/fbs/common/log/diagnosis/fbs/DetailedDiagnostic.go index 5d64239..c306b3c 100644 --- a/pkg/fbs/common/log/diagnosis/fbs/DetailedDiagnostic.go +++ b/pkg/fbs/common/log/diagnosis/fbs/DetailedDiagnostic.go @@ -8,15 +8,21 @@ import ( /// This table defines the elements of one detailed diagnostics that should be registered. type DetailedDiagnosticT struct { - Number string - Version uint32 - Text string + Number string `json:"number"` + Version uint32 `json:"version"` + Text string `json:"text"` } func (t *DetailedDiagnosticT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - numberOffset := builder.CreateString(t.Number) - textOffset := builder.CreateString(t.Text) + numberOffset := flatbuffers.UOffsetT(0) + if t.Number != "" { + numberOffset = builder.CreateString(t.Number) + } + textOffset := flatbuffers.UOffsetT(0) + if t.Text != "" { + textOffset = builder.CreateString(t.Text) + } DetailedDiagnosticStart(builder) DetailedDiagnosticAddNumber(builder, numberOffset) DetailedDiagnosticAddVersion(builder, t.Version) diff --git a/pkg/fbs/common/log/diagnosis/fbs/DiagnosisElement.go b/pkg/fbs/common/log/diagnosis/fbs/DiagnosisElement.go index ef48218..c09d00e 100644 --- a/pkg/fbs/common/log/diagnosis/fbs/DiagnosisElement.go +++ b/pkg/fbs/common/log/diagnosis/fbs/DiagnosisElement.go @@ -8,14 +8,17 @@ import ( /// This table defines the elements of a main or detailed diagnostics that should be registered. type DiagnosisElementT struct { - DiagnosisNumber uint32 - Version byte - TextEnglish string + DiagnosisNumber uint32 `json:"diagnosisNumber"` + Version byte `json:"version"` + TextEnglish string `json:"textEnglish"` } func (t *DiagnosisElementT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - textEnglishOffset := builder.CreateString(t.TextEnglish) + textEnglishOffset := flatbuffers.UOffsetT(0) + if t.TextEnglish != "" { + textEnglishOffset = builder.CreateString(t.TextEnglish) + } DiagnosisElementStart(builder) DiagnosisElementAddDiagnosisNumber(builder, t.DiagnosisNumber) DiagnosisElementAddVersion(builder, t.Version) diff --git a/pkg/fbs/common/log/diagnosis/fbs/DiagnosisElements.go b/pkg/fbs/common/log/diagnosis/fbs/DiagnosisElements.go index 7529956..6520fb1 100644 --- a/pkg/fbs/common/log/diagnosis/fbs/DiagnosisElements.go +++ b/pkg/fbs/common/log/diagnosis/fbs/DiagnosisElements.go @@ -8,7 +8,7 @@ import ( /// This table defines a list of main or detailed diagnostics that should be registered. type DiagnosisElementsT struct { - DiagnosisElements []*DiagnosisElementT + DiagnosisElements []*DiagnosisElementT `json:"diagnosisElements"` } func (t *DiagnosisElementsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/log/diagnosis/fbs/DiagnosisIdentification.go b/pkg/fbs/common/log/diagnosis/fbs/DiagnosisIdentification.go index e70ecc5..f6c5315 100644 --- a/pkg/fbs/common/log/diagnosis/fbs/DiagnosisIdentification.go +++ b/pkg/fbs/common/log/diagnosis/fbs/DiagnosisIdentification.go @@ -8,16 +8,25 @@ import ( /// This table defines all diagnostic elements that are required to uniquely identify a diagnostic log. type DiagnosisIdentificationT struct { - MainDiagnosisNumber string - DetailedDiagnosisNumber string - Entity string + MainDiagnosisNumber string `json:"mainDiagnosisNumber"` + DetailedDiagnosisNumber string `json:"detailedDiagnosisNumber"` + Entity string `json:"entity"` } func (t *DiagnosisIdentificationT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - mainDiagnosisNumberOffset := builder.CreateString(t.MainDiagnosisNumber) - detailedDiagnosisNumberOffset := builder.CreateString(t.DetailedDiagnosisNumber) - entityOffset := builder.CreateString(t.Entity) + mainDiagnosisNumberOffset := flatbuffers.UOffsetT(0) + if t.MainDiagnosisNumber != "" { + mainDiagnosisNumberOffset = builder.CreateString(t.MainDiagnosisNumber) + } + detailedDiagnosisNumberOffset := flatbuffers.UOffsetT(0) + if t.DetailedDiagnosisNumber != "" { + detailedDiagnosisNumberOffset = builder.CreateString(t.DetailedDiagnosisNumber) + } + entityOffset := flatbuffers.UOffsetT(0) + if t.Entity != "" { + entityOffset = builder.CreateString(t.Entity) + } DiagnosisIdentificationStart(builder) DiagnosisIdentificationAddMainDiagnosisNumber(builder, mainDiagnosisNumberOffset) DiagnosisIdentificationAddDetailedDiagnosisNumber(builder, detailedDiagnosisNumberOffset) diff --git a/pkg/fbs/common/log/diagnosis/fbs/DiagnosisIdentificationWithTimestamp.go b/pkg/fbs/common/log/diagnosis/fbs/DiagnosisIdentificationWithTimestamp.go index e8c89cc..004ebe0 100644 --- a/pkg/fbs/common/log/diagnosis/fbs/DiagnosisIdentificationWithTimestamp.go +++ b/pkg/fbs/common/log/diagnosis/fbs/DiagnosisIdentificationWithTimestamp.go @@ -8,14 +8,17 @@ import ( /// This table defines the unique identification of a diagnostic log in combination with the timestamp of the log. type DiagnosisIdentificationWithTimestampT struct { - DiagnosisIdentification *DiagnosisIdentificationT - Timestamp string + DiagnosisIdentification *DiagnosisIdentificationT `json:"diagnosisIdentification"` + Timestamp string `json:"timestamp"` } func (t *DiagnosisIdentificationWithTimestampT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } diagnosisIdentificationOffset := t.DiagnosisIdentification.Pack(builder) - timestampOffset := builder.CreateString(t.Timestamp) + timestampOffset := flatbuffers.UOffsetT(0) + if t.Timestamp != "" { + timestampOffset = builder.CreateString(t.Timestamp) + } DiagnosisIdentificationWithTimestampStart(builder) DiagnosisIdentificationWithTimestampAddDiagnosisIdentification(builder, diagnosisIdentificationOffset) DiagnosisIdentificationWithTimestampAddTimestamp(builder, timestampOffset) diff --git a/pkg/fbs/common/log/diagnosis/fbs/EventType1.go b/pkg/fbs/common/log/diagnosis/fbs/EventType1.go index 6e71a72..33d7e8e 100644 --- a/pkg/fbs/common/log/diagnosis/fbs/EventType1.go +++ b/pkg/fbs/common/log/diagnosis/fbs/EventType1.go @@ -8,7 +8,7 @@ import ( /// This table defines the generic event type 1 that is used to evaluate specific diagnostic events. type EventType1T struct { - EventCounter uint64 + EventCounter uint64 `json:"eventCounter"` } func (t *EventType1T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/log/diagnosis/fbs/EventType2.go b/pkg/fbs/common/log/diagnosis/fbs/EventType2.go index c7a2883..2dc04b8 100644 --- a/pkg/fbs/common/log/diagnosis/fbs/EventType2.go +++ b/pkg/fbs/common/log/diagnosis/fbs/EventType2.go @@ -8,7 +8,7 @@ import ( /// This table defines the generic event type 2 that is used to evaluate specific diagnostic events. type EventType2T struct { - EventCounter uint64 + EventCounter uint64 `json:"eventCounter"` } func (t *EventType2T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/log/diagnosis/fbs/GetDetailedDiagnosisText.go b/pkg/fbs/common/log/diagnosis/fbs/GetDetailedDiagnosisText.go index 476ab01..551b55a 100644 --- a/pkg/fbs/common/log/diagnosis/fbs/GetDetailedDiagnosisText.go +++ b/pkg/fbs/common/log/diagnosis/fbs/GetDetailedDiagnosisText.go @@ -8,14 +8,20 @@ import ( /// This table defines the required elements to request the diagnostic text of a diagnostic log. type GetDetailedDiagnosisTextT struct { - DetailedDiagnosisNumber string - RelatedMainDiagnosisNumber string + DetailedDiagnosisNumber string `json:"detailedDiagnosisNumber"` + RelatedMainDiagnosisNumber string `json:"relatedMainDiagnosisNumber"` } func (t *GetDetailedDiagnosisTextT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - detailedDiagnosisNumberOffset := builder.CreateString(t.DetailedDiagnosisNumber) - relatedMainDiagnosisNumberOffset := builder.CreateString(t.RelatedMainDiagnosisNumber) + detailedDiagnosisNumberOffset := flatbuffers.UOffsetT(0) + if t.DetailedDiagnosisNumber != "" { + detailedDiagnosisNumberOffset = builder.CreateString(t.DetailedDiagnosisNumber) + } + relatedMainDiagnosisNumberOffset := flatbuffers.UOffsetT(0) + if t.RelatedMainDiagnosisNumber != "" { + relatedMainDiagnosisNumberOffset = builder.CreateString(t.RelatedMainDiagnosisNumber) + } GetDetailedDiagnosisTextStart(builder) GetDetailedDiagnosisTextAddDetailedDiagnosisNumber(builder, detailedDiagnosisNumberOffset) GetDetailedDiagnosisTextAddRelatedMainDiagnosisNumber(builder, relatedMainDiagnosisNumberOffset) diff --git a/pkg/fbs/common/log/diagnosis/fbs/GetMainDiagnosisText.go b/pkg/fbs/common/log/diagnosis/fbs/GetMainDiagnosisText.go index 4114598..2c00640 100644 --- a/pkg/fbs/common/log/diagnosis/fbs/GetMainDiagnosisText.go +++ b/pkg/fbs/common/log/diagnosis/fbs/GetMainDiagnosisText.go @@ -8,12 +8,15 @@ import ( /// This table defines the required element to request the main diagnostic text of a diagnostic log. type GetMainDiagnosisTextT struct { - MainDiagnosisNumber string + MainDiagnosisNumber string `json:"mainDiagnosisNumber"` } func (t *GetMainDiagnosisTextT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - mainDiagnosisNumberOffset := builder.CreateString(t.MainDiagnosisNumber) + mainDiagnosisNumberOffset := flatbuffers.UOffsetT(0) + if t.MainDiagnosisNumber != "" { + mainDiagnosisNumberOffset = builder.CreateString(t.MainDiagnosisNumber) + } GetMainDiagnosisTextStart(builder) GetMainDiagnosisTextAddMainDiagnosisNumber(builder, mainDiagnosisNumberOffset) return GetMainDiagnosisTextEnd(builder) diff --git a/pkg/fbs/common/log/diagnosis/fbs/ListDiagnosisIdentificationWithTimestamp.go b/pkg/fbs/common/log/diagnosis/fbs/ListDiagnosisIdentificationWithTimestamp.go index f0aab3e..2eb6731 100644 --- a/pkg/fbs/common/log/diagnosis/fbs/ListDiagnosisIdentificationWithTimestamp.go +++ b/pkg/fbs/common/log/diagnosis/fbs/ListDiagnosisIdentificationWithTimestamp.go @@ -8,7 +8,7 @@ import ( /// This table defines a list of uniquely identifiable diagnostic logs with the related timestamp (e.g. it is used for the pending diagnostics). type ListDiagnosisIdentificationWithTimestampT struct { - ListDiagnosisIdentificationWithTimestamp []*DiagnosisIdentificationWithTimestampT + ListDiagnosisIdentificationWithTimestamp []*DiagnosisIdentificationWithTimestampT `json:"listDiagnosisIdentificationWithTimestamp"` } func (t *ListDiagnosisIdentificationWithTimestampT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/log/diagnosis/fbs/LogParameters.go b/pkg/fbs/common/log/diagnosis/fbs/LogParameters.go index 07fa7c9..58a3810 100644 --- a/pkg/fbs/common/log/diagnosis/fbs/LogParameters.go +++ b/pkg/fbs/common/log/diagnosis/fbs/LogParameters.go @@ -9,29 +9,56 @@ import ( /// This table defines all elements that can be used to set a diagnostic log. /// It is used for diagnostic messages, warnings and errors. type LogParametersT struct { - MainDiagnosisCode string - DetailedDiagnosisCode string - UserId string - Entity string - Origin string - UnitName string - FileName string - FunctionName string - LineNumber uint32 - DynamicDescription string + MainDiagnosisCode string `json:"mainDiagnosisCode"` + DetailedDiagnosisCode string `json:"detailedDiagnosisCode"` + UserId string `json:"userId"` + Entity string `json:"entity"` + Origin string `json:"origin"` + UnitName string `json:"unitName"` + FileName string `json:"fileName"` + FunctionName string `json:"functionName"` + LineNumber uint32 `json:"lineNumber"` + DynamicDescription string `json:"dynamicDescription"` } func (t *LogParametersT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - mainDiagnosisCodeOffset := builder.CreateString(t.MainDiagnosisCode) - detailedDiagnosisCodeOffset := builder.CreateString(t.DetailedDiagnosisCode) - userIdOffset := builder.CreateString(t.UserId) - entityOffset := builder.CreateString(t.Entity) - originOffset := builder.CreateString(t.Origin) - unitNameOffset := builder.CreateString(t.UnitName) - fileNameOffset := builder.CreateString(t.FileName) - functionNameOffset := builder.CreateString(t.FunctionName) - dynamicDescriptionOffset := builder.CreateString(t.DynamicDescription) + mainDiagnosisCodeOffset := flatbuffers.UOffsetT(0) + if t.MainDiagnosisCode != "" { + mainDiagnosisCodeOffset = builder.CreateString(t.MainDiagnosisCode) + } + detailedDiagnosisCodeOffset := flatbuffers.UOffsetT(0) + if t.DetailedDiagnosisCode != "" { + detailedDiagnosisCodeOffset = builder.CreateString(t.DetailedDiagnosisCode) + } + userIdOffset := flatbuffers.UOffsetT(0) + if t.UserId != "" { + userIdOffset = builder.CreateString(t.UserId) + } + entityOffset := flatbuffers.UOffsetT(0) + if t.Entity != "" { + entityOffset = builder.CreateString(t.Entity) + } + originOffset := flatbuffers.UOffsetT(0) + if t.Origin != "" { + originOffset = builder.CreateString(t.Origin) + } + unitNameOffset := flatbuffers.UOffsetT(0) + if t.UnitName != "" { + unitNameOffset = builder.CreateString(t.UnitName) + } + fileNameOffset := flatbuffers.UOffsetT(0) + if t.FileName != "" { + fileNameOffset = builder.CreateString(t.FileName) + } + functionNameOffset := flatbuffers.UOffsetT(0) + if t.FunctionName != "" { + functionNameOffset = builder.CreateString(t.FunctionName) + } + dynamicDescriptionOffset := flatbuffers.UOffsetT(0) + if t.DynamicDescription != "" { + dynamicDescriptionOffset = builder.CreateString(t.DynamicDescription) + } LogParametersStart(builder) LogParametersAddMainDiagnosisCode(builder, mainDiagnosisCodeOffset) LogParametersAddDetailedDiagnosisCode(builder, detailedDiagnosisCodeOffset) diff --git a/pkg/fbs/common/log/diagnosis/fbs/MainDiagnostic.go b/pkg/fbs/common/log/diagnosis/fbs/MainDiagnostic.go index eb461e7..255e87c 100644 --- a/pkg/fbs/common/log/diagnosis/fbs/MainDiagnostic.go +++ b/pkg/fbs/common/log/diagnosis/fbs/MainDiagnostic.go @@ -8,16 +8,22 @@ import ( /// This table defines the elements of one main diagnostics that should be registered. type MainDiagnosticT struct { - Number string - Version uint32 - Text string - DetailedDiagnostics []*DetailedDiagnosticT + Number string `json:"number"` + Version uint32 `json:"version"` + Text string `json:"text"` + DetailedDiagnostics []*DetailedDiagnosticT `json:"detailedDiagnostics"` } func (t *MainDiagnosticT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - numberOffset := builder.CreateString(t.Number) - textOffset := builder.CreateString(t.Text) + numberOffset := flatbuffers.UOffsetT(0) + if t.Number != "" { + numberOffset = builder.CreateString(t.Number) + } + textOffset := flatbuffers.UOffsetT(0) + if t.Text != "" { + textOffset = builder.CreateString(t.Text) + } detailedDiagnosticsOffset := flatbuffers.UOffsetT(0) if t.DetailedDiagnostics != nil { detailedDiagnosticsLength := len(t.DetailedDiagnostics) diff --git a/pkg/fbs/common/log/diagnosis/fbs/PendingDiagnosticState.go b/pkg/fbs/common/log/diagnosis/fbs/PendingDiagnosticState.go index f6e05e7..0c90a3f 100644 --- a/pkg/fbs/common/log/diagnosis/fbs/PendingDiagnosticState.go +++ b/pkg/fbs/common/log/diagnosis/fbs/PendingDiagnosticState.go @@ -8,7 +8,7 @@ import ( /// This table defines the state of one diagnostic log in the pending diagnostics. type PendingDiagnosticStateT struct { - PendingDiagnosticState State + PendingDiagnosticState State `json:"pendingDiagnosticState"` } func (t *PendingDiagnosticStateT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/log/diagnosis/fbs/RegistrationFile.go b/pkg/fbs/common/log/diagnosis/fbs/RegistrationFile.go index ae57449..a7b4080 100644 --- a/pkg/fbs/common/log/diagnosis/fbs/RegistrationFile.go +++ b/pkg/fbs/common/log/diagnosis/fbs/RegistrationFile.go @@ -8,17 +8,26 @@ import ( /// This table defines the structure of the registration json file that is needed to register diagnostics. type RegistrationFileT struct { - Language string - Product string - Component string - MainDiagnostics []*MainDiagnosticT + Language string `json:"language"` + Product string `json:"product"` + Component string `json:"component"` + MainDiagnostics []*MainDiagnosticT `json:"mainDiagnostics"` } func (t *RegistrationFileT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - languageOffset := builder.CreateString(t.Language) - productOffset := builder.CreateString(t.Product) - componentOffset := builder.CreateString(t.Component) + languageOffset := flatbuffers.UOffsetT(0) + if t.Language != "" { + languageOffset = builder.CreateString(t.Language) + } + productOffset := flatbuffers.UOffsetT(0) + if t.Product != "" { + productOffset = builder.CreateString(t.Product) + } + componentOffset := flatbuffers.UOffsetT(0) + if t.Component != "" { + componentOffset = builder.CreateString(t.Component) + } mainDiagnosticsOffset := flatbuffers.UOffsetT(0) if t.MainDiagnostics != nil { mainDiagnosticsLength := len(t.MainDiagnostics) diff --git a/pkg/fbs/common/log/trace/fbs/EnablingState.go b/pkg/fbs/common/log/trace/fbs/EnablingState.go index 87d85c9..c80ab6d 100644 --- a/pkg/fbs/common/log/trace/fbs/EnablingState.go +++ b/pkg/fbs/common/log/trace/fbs/EnablingState.go @@ -8,15 +8,18 @@ import ( /// This table holds the enabling state of messages, warnings and errors of one trace unit. type EnablingStateT struct { - UnitName string - Messages bool - Warnings bool - Errors bool + UnitName string `json:"unitName"` + Messages bool `json:"messages"` + Warnings bool `json:"warnings"` + Errors bool `json:"errors"` } func (t *EnablingStateT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - unitNameOffset := builder.CreateString(t.UnitName) + unitNameOffset := flatbuffers.UOffsetT(0) + if t.UnitName != "" { + unitNameOffset = builder.CreateString(t.UnitName) + } EnablingStateStart(builder) EnablingStateAddUnitName(builder, unitNameOffset) EnablingStateAddMessages(builder, t.Messages) diff --git a/pkg/fbs/common/log/trace/fbs/EnablingStates.go b/pkg/fbs/common/log/trace/fbs/EnablingStates.go index 00365f7..15dd897 100644 --- a/pkg/fbs/common/log/trace/fbs/EnablingStates.go +++ b/pkg/fbs/common/log/trace/fbs/EnablingStates.go @@ -8,8 +8,8 @@ import ( /// This table defines the enabling states of all trace units for a specific device. type EnablingStatesT struct { - EnablingStates []*EnablingStateT - MachineIdentification string + EnablingStates []*EnablingStateT `json:"enablingStates"` + MachineIdentification string `json:"machineIdentification"` } func (t *EnablingStatesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -27,7 +27,10 @@ func (t *EnablingStatesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffset } enablingStatesOffset = builder.EndVector(enablingStatesLength) } - machineIdentificationOffset := builder.CreateString(t.MachineIdentification) + machineIdentificationOffset := flatbuffers.UOffsetT(0) + if t.MachineIdentification != "" { + machineIdentificationOffset = builder.CreateString(t.MachineIdentification) + } EnablingStatesStart(builder) EnablingStatesAddEnablingStates(builder, enablingStatesOffset) EnablingStatesAddMachineIdentification(builder, machineIdentificationOffset) diff --git a/pkg/fbs/common/oblivion/OblivionCurrent.go b/pkg/fbs/common/oblivion/OblivionCurrent.go index 35816c9..c4cf551 100644 --- a/pkg/fbs/common/oblivion/OblivionCurrent.go +++ b/pkg/fbs/common/oblivion/OblivionCurrent.go @@ -7,9 +7,9 @@ import ( ) type OblivionCurrentT struct { - Count uint32 - Bytes uint32 - Unobserved uint32 + Count uint32 `json:"count"` + Bytes uint32 `json:"bytes"` + Unobserved uint32 `json:"unobserved"` } func (t *OblivionCurrentT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/oblivion/OblivionOverview.go b/pkg/fbs/common/oblivion/OblivionOverview.go index 42c500f..1a4db48 100644 --- a/pkg/fbs/common/oblivion/OblivionOverview.go +++ b/pkg/fbs/common/oblivion/OblivionOverview.go @@ -7,9 +7,9 @@ import ( ) type OblivionOverviewT struct { - Active bool - Current *OblivionCurrentT - Total *OblivionTotalT + Active bool `json:"active"` + Current *OblivionCurrentT `json:"current"` + Total *OblivionTotalT `json:"total"` } func (t *OblivionOverviewT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/oblivion/OblivionResult.go b/pkg/fbs/common/oblivion/OblivionResult.go index b3ed8ee..b4ce6d7 100644 --- a/pkg/fbs/common/oblivion/OblivionResult.go +++ b/pkg/fbs/common/oblivion/OblivionResult.go @@ -7,7 +7,7 @@ import ( ) type OblivionResultT struct { - Unfreed []*OblivionResultItemT + Unfreed []*OblivionResultItemT `json:"unfreed"` } func (t *OblivionResultT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -74,6 +74,7 @@ func (rcv *OblivionResult) Table() flatbuffers.Table { return rcv._tab } +/// all observed items func (rcv *OblivionResult) Unfreed(obj *OblivionResultItem, j int) bool { o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) if o != 0 { @@ -94,6 +95,7 @@ func (rcv *OblivionResult) UnfreedLength() int { return 0 } +/// all observed items func OblivionResultStart(builder *flatbuffers.Builder) { builder.StartObject(1) } diff --git a/pkg/fbs/common/oblivion/OblivionResultItem.go b/pkg/fbs/common/oblivion/OblivionResultItem.go index 78afa3f..01399d8 100644 --- a/pkg/fbs/common/oblivion/OblivionResultItem.go +++ b/pkg/fbs/common/oblivion/OblivionResultItem.go @@ -7,11 +7,13 @@ import ( ) type OblivionResultItemT struct { - Count uint32 - Bytes uint32 - StackTrace []string - ThreadName string - TaskID uint64 + Count uint32 `json:"count"` + Bytes uint32 `json:"bytes"` + StackTrace []string `json:"stackTrace"` + ThreadName string `json:"threadName"` + TaskId uint64 `json:"taskID"` + CountAlloc uint64 `json:"countAlloc"` + CountFree uint64 `json:"countFree"` } func (t *OblivionResultItemT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -29,13 +31,18 @@ func (t *OblivionResultItemT) Pack(builder *flatbuffers.Builder) flatbuffers.UOf } stackTraceOffset = builder.EndVector(stackTraceLength) } - threadNameOffset := builder.CreateString(t.ThreadName) + threadNameOffset := flatbuffers.UOffsetT(0) + if t.ThreadName != "" { + threadNameOffset = builder.CreateString(t.ThreadName) + } OblivionResultItemStart(builder) OblivionResultItemAddCount(builder, t.Count) OblivionResultItemAddBytes(builder, t.Bytes) OblivionResultItemAddStackTrace(builder, stackTraceOffset) OblivionResultItemAddThreadName(builder, threadNameOffset) - OblivionResultItemAddTaskID(builder, t.TaskID) + OblivionResultItemAddTaskId(builder, t.TaskId) + OblivionResultItemAddCountAlloc(builder, t.CountAlloc) + OblivionResultItemAddCountFree(builder, t.CountFree) return OblivionResultItemEnd(builder) } @@ -48,7 +55,9 @@ func (rcv *OblivionResultItem) UnPackTo(t *OblivionResultItemT) { t.StackTrace[j] = string(rcv.StackTrace(j)) } t.ThreadName = string(rcv.ThreadName()) - t.TaskID = rcv.TaskID() + t.TaskId = rcv.TaskId() + t.CountAlloc = rcv.CountAlloc() + t.CountFree = rcv.CountFree() } func (rcv *OblivionResultItem) UnPack() *OblivionResultItemT { @@ -85,6 +94,7 @@ func (rcv *OblivionResultItem) Table() flatbuffers.Table { return rcv._tab } +/// count of unfreed memory areas func (rcv *OblivionResultItem) Count() uint32 { o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) if o != 0 { @@ -93,10 +103,12 @@ func (rcv *OblivionResultItem) Count() uint32 { return 0 } +/// count of unfreed memory areas func (rcv *OblivionResultItem) MutateCount(n uint32) bool { return rcv._tab.MutateUint32Slot(4, n) } +/// count of unfreed bytes func (rcv *OblivionResultItem) Bytes() uint32 { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { @@ -105,10 +117,12 @@ func (rcv *OblivionResultItem) Bytes() uint32 { return 0 } +/// count of unfreed bytes func (rcv *OblivionResultItem) MutateBytes(n uint32) bool { return rcv._tab.MutateUint32Slot(6, n) } +/// stack trace of item func (rcv *OblivionResultItem) StackTrace(j int) []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) if o != 0 { @@ -126,6 +140,8 @@ func (rcv *OblivionResultItem) StackTraceLength() int { return 0 } +/// stack trace of item +/// name of the thread func (rcv *OblivionResultItem) ThreadName() []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) if o != 0 { @@ -134,7 +150,9 @@ func (rcv *OblivionResultItem) ThreadName() []byte { return nil } -func (rcv *OblivionResultItem) TaskID() uint64 { +/// name of the thread +/// task identifier +func (rcv *OblivionResultItem) TaskId() uint64 { o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) if o != 0 { return rcv._tab.GetUint64(o + rcv._tab.Pos) @@ -142,12 +160,41 @@ func (rcv *OblivionResultItem) TaskID() uint64 { return 0 } -func (rcv *OblivionResultItem) MutateTaskID(n uint64) bool { +/// task identifier +func (rcv *OblivionResultItem) MutateTaskId(n uint64) bool { return rcv._tab.MutateUint64Slot(12, n) } +/// count of allocs +func (rcv *OblivionResultItem) CountAlloc() uint64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) + if o != 0 { + return rcv._tab.GetUint64(o + rcv._tab.Pos) + } + return 0 +} + +/// count of allocs +func (rcv *OblivionResultItem) MutateCountAlloc(n uint64) bool { + return rcv._tab.MutateUint64Slot(14, n) +} + +/// count of frees +func (rcv *OblivionResultItem) CountFree() uint64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(16)) + if o != 0 { + return rcv._tab.GetUint64(o + rcv._tab.Pos) + } + return 0 +} + +/// count of frees +func (rcv *OblivionResultItem) MutateCountFree(n uint64) bool { + return rcv._tab.MutateUint64Slot(16, n) +} + func OblivionResultItemStart(builder *flatbuffers.Builder) { - builder.StartObject(5) + builder.StartObject(7) } func OblivionResultItemAddCount(builder *flatbuffers.Builder, count uint32) { builder.PrependUint32Slot(0, count, 0) @@ -164,8 +211,14 @@ func OblivionResultItemStartStackTraceVector(builder *flatbuffers.Builder, numEl func OblivionResultItemAddThreadName(builder *flatbuffers.Builder, threadName flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(threadName), 0) } -func OblivionResultItemAddTaskID(builder *flatbuffers.Builder, taskID uint64) { - builder.PrependUint64Slot(4, taskID, 0) +func OblivionResultItemAddTaskId(builder *flatbuffers.Builder, taskId uint64) { + builder.PrependUint64Slot(4, taskId, 0) +} +func OblivionResultItemAddCountAlloc(builder *flatbuffers.Builder, countAlloc uint64) { + builder.PrependUint64Slot(5, countAlloc, 0) +} +func OblivionResultItemAddCountFree(builder *flatbuffers.Builder, countFree uint64) { + builder.PrependUint64Slot(6, countFree, 0) } func OblivionResultItemEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() diff --git a/pkg/fbs/common/oblivion/OblivionSettings.go b/pkg/fbs/common/oblivion/OblivionSettings.go index caf6429..706a57e 100644 --- a/pkg/fbs/common/oblivion/OblivionSettings.go +++ b/pkg/fbs/common/oblivion/OblivionSettings.go @@ -7,12 +7,12 @@ import ( ) type OblivionSettingsT struct { - HashSize uint32 - Ignore uint32 - StackDepth uint32 - RecordType RecordType - ObserveThread uint64 - StackUsage bool + HashSize uint32 `json:"hashSize"` + Ignore uint32 `json:"ignore"` + StackDepth uint32 `json:"stackDepth"` + RecordType RecordType `json:"recordType"` + ObserveThread uint64 `json:"observeThread"` + StackUsage bool `json:"stackUsage"` } func (t *OblivionSettingsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/oblivion/OblivionTotal.go b/pkg/fbs/common/oblivion/OblivionTotal.go index c85a2c9..d370390 100644 --- a/pkg/fbs/common/oblivion/OblivionTotal.go +++ b/pkg/fbs/common/oblivion/OblivionTotal.go @@ -7,8 +7,8 @@ import ( ) type OblivionTotalT struct { - Overhead uint32 - Unobserved uint32 + Overhead uint32 `json:"overhead"` + Unobserved uint32 `json:"unobserved"` } func (t *OblivionTotalT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/oblivion/RecordType.go b/pkg/fbs/common/oblivion/RecordType.go index 10ad977..6a321a6 100644 --- a/pkg/fbs/common/oblivion/RecordType.go +++ b/pkg/fbs/common/oblivion/RecordType.go @@ -7,18 +7,21 @@ import "strconv" type RecordType uint32 const ( - RecordTypeStack RecordType = 0 - RecordTypeThread RecordType = 1 + RecordTypeStack RecordType = 0 + RecordTypeThread RecordType = 1 + RecordTypeThreadAlloc RecordType = 2 ) var EnumNamesRecordType = map[RecordType]string{ - RecordTypeStack: "Stack", - RecordTypeThread: "Thread", + RecordTypeStack: "Stack", + RecordTypeThread: "Thread", + RecordTypeThreadAlloc: "ThreadAlloc", } var EnumValuesRecordType = map[string]RecordType{ - "Stack": RecordTypeStack, - "Thread": RecordTypeThread, + "Stack": RecordTypeStack, + "Thread": RecordTypeThread, + "ThreadAlloc": RecordTypeThreadAlloc, } func (v RecordType) String() string { diff --git a/pkg/fbs/common/oblivion/StackInfo.go b/pkg/fbs/common/oblivion/StackInfo.go index aa8e7fa..685d77d 100644 --- a/pkg/fbs/common/oblivion/StackInfo.go +++ b/pkg/fbs/common/oblivion/StackInfo.go @@ -7,17 +7,20 @@ import ( ) type StackInfoT struct { - Id uint32 - State State - Name string - Size uint32 - Used uint32 - Percent uint32 + Id uint32 `json:"id"` + State State `json:"state"` + Name string `json:"name"` + Size uint32 `json:"size"` + Used uint32 `json:"used"` + Percent uint32 `json:"percent"` } func (t *StackInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } StackInfoStart(builder) StackInfoAddId(builder, t.Id) StackInfoAddState(builder, t.State) diff --git a/pkg/fbs/common/oblivion/StackUsage.go b/pkg/fbs/common/oblivion/StackUsage.go index 57cc2f4..09c0fd5 100644 --- a/pkg/fbs/common/oblivion/StackUsage.go +++ b/pkg/fbs/common/oblivion/StackUsage.go @@ -7,7 +7,7 @@ import ( ) type StackUsageT struct { - Stacks []*StackInfoT + Stacks []*StackInfoT `json:"stacks"` } func (t *StackUsageT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/controls/fbs/AdminControls.go b/pkg/fbs/common/scheduler/controls/fbs/AdminControls.go index 6d1c6e0..e4c8bbf 100644 --- a/pkg/fbs/common/scheduler/controls/fbs/AdminControls.go +++ b/pkg/fbs/common/scheduler/controls/fbs/AdminControls.go @@ -8,7 +8,7 @@ import ( /// Special extensions to modify Scheduler and system behavior e.g. activation of DEBUG mode type AdminControlsT struct { - Control *ControlsT + Control *ControlsT `json:"control"` } func (t *AdminControlsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/controls/fbs/Controls.go b/pkg/fbs/common/scheduler/controls/fbs/Controls.go index 894a480..0de003b 100644 --- a/pkg/fbs/common/scheduler/controls/fbs/Controls.go +++ b/pkg/fbs/common/scheduler/controls/fbs/Controls.go @@ -4,7 +4,6 @@ package fbs import ( "strconv" - flatbuffers "github.com/google/flatbuffers/go" ) @@ -53,7 +52,8 @@ func (t *ControlsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { func (rcv Controls) UnPack(table flatbuffers.Table) *ControlsT { switch rcv { case ControlsDebug: - x := Debug{_tab: table} + var x Debug + x.Init(table.Bytes, table.Pos) return &ControlsT{ Type: ControlsDebug, Value: x.UnPack() } } return nil diff --git a/pkg/fbs/common/scheduler/controls/fbs/Debug.go b/pkg/fbs/common/scheduler/controls/fbs/Debug.go index 297aa07..a5b1a8b 100644 --- a/pkg/fbs/common/scheduler/controls/fbs/Debug.go +++ b/pkg/fbs/common/scheduler/controls/fbs/Debug.go @@ -8,12 +8,15 @@ import ( /// Machine ID to use the DEBUG configuration only on the intended machine type DebugT struct { - Machine string + Machine string `json:"machine"` } func (t *DebugT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - machineOffset := builder.CreateString(t.Machine) + machineOffset := flatbuffers.UOffsetT(0) + if t.Machine != "" { + machineOffset = builder.CreateString(t.Machine) + } DebugStart(builder) DebugAddMachine(builder, machineOffset) return DebugEnd(builder) diff --git a/pkg/fbs/common/scheduler/fbs/Admin.go b/pkg/fbs/common/scheduler/fbs/Admin.go index 3b717eb..80fca3e 100644 --- a/pkg/fbs/common/scheduler/fbs/Admin.go +++ b/pkg/fbs/common/scheduler/fbs/Admin.go @@ -9,12 +9,12 @@ import ( ) type AdminT struct { - StartupState CurrentState - StartupTimeout uint32 - StartupErrorReaction CurrentErrorReaction - TriggerSource CurrentTrigger - ControlDebug *common__scheduler__controls__fbs.ControlsT - CpuInfo *CpuInfoT + StartupState CurrentState `json:"startupState"` + StartupTimeout uint32 `json:"startupTimeout"` + StartupErrorReaction CurrentErrorReaction `json:"startupErrorReaction"` + TriggerSource CurrentTrigger `json:"triggerSource"` + ControlDebug *common__scheduler__controls__fbs.ControlsT `json:"controlDebug"` + CpuInfo *CpuInfoT `json:"cpuInfo"` } func (t *AdminT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/fbs/Callable.go b/pkg/fbs/common/scheduler/fbs/Callable.go index 574c28d..1364a33 100644 --- a/pkg/fbs/common/scheduler/fbs/Callable.go +++ b/pkg/fbs/common/scheduler/fbs/Callable.go @@ -8,18 +8,21 @@ import ( /// Callable, executes a job defined by regarding app type CallableT struct { - Name string - Index uint32 - Arguments []string - Id string - Alias string - Sync *SyncPointsT - Watchdog CallableWdgConfig + Name string `json:"name"` + Index uint32 `json:"index"` + Arguments []string `json:"arguments"` + Id string `json:"id"` + Alias string `json:"alias"` + Sync *SyncPointsT `json:"sync"` + Watchdog CallableWdgConfig `json:"watchdog"` } func (t *CallableT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } argumentsOffset := flatbuffers.UOffsetT(0) if t.Arguments != nil { argumentsLength := len(t.Arguments) @@ -33,8 +36,14 @@ func (t *CallableT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { } argumentsOffset = builder.EndVector(argumentsLength) } - idOffset := builder.CreateString(t.Id) - aliasOffset := builder.CreateString(t.Alias) + idOffset := flatbuffers.UOffsetT(0) + if t.Id != "" { + idOffset = builder.CreateString(t.Id) + } + aliasOffset := flatbuffers.UOffsetT(0) + if t.Alias != "" { + aliasOffset = builder.CreateString(t.Alias) + } syncOffset := t.Sync.Pack(builder) CallableStart(builder) CallableAddName(builder, nameOffset) diff --git a/pkg/fbs/common/scheduler/fbs/CallableConfiguration.go b/pkg/fbs/common/scheduler/fbs/CallableConfiguration.go index fa62513..28bf2c9 100644 --- a/pkg/fbs/common/scheduler/fbs/CallableConfiguration.go +++ b/pkg/fbs/common/scheduler/fbs/CallableConfiguration.go @@ -8,16 +8,19 @@ import ( /// Callable configurations of a callable factory type CallableConfigurationT struct { - Alias string - Sync *SyncPointsT - Arguments []string - Watchdog CallableWdgConfig - Task *TaskSpecsT + Alias string `json:"alias"` + Sync *SyncPointsT `json:"sync"` + Arguments []string `json:"arguments"` + Watchdog CallableWdgConfig `json:"watchdog"` + Task *TaskSpecsT `json:"task"` } func (t *CallableConfigurationT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - aliasOffset := builder.CreateString(t.Alias) + aliasOffset := flatbuffers.UOffsetT(0) + if t.Alias != "" { + aliasOffset = builder.CreateString(t.Alias) + } syncOffset := t.Sync.Pack(builder) argumentsOffset := flatbuffers.UOffsetT(0) if t.Arguments != nil { diff --git a/pkg/fbs/common/scheduler/fbs/CallableConfigurations.go b/pkg/fbs/common/scheduler/fbs/CallableConfigurations.go index 2a8de42..c9220da 100644 --- a/pkg/fbs/common/scheduler/fbs/CallableConfigurations.go +++ b/pkg/fbs/common/scheduler/fbs/CallableConfigurations.go @@ -8,7 +8,7 @@ import ( /// Callable configurations of a callable factory type CallableConfigurationsT struct { - Configurations []*CallableConfigurationT + Configurations []*CallableConfigurationT `json:"configurations"` } func (t *CallableConfigurationsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/fbs/CpuInfo.go b/pkg/fbs/common/scheduler/fbs/CpuInfo.go index 7ec1bfa..76b1d25 100644 --- a/pkg/fbs/common/scheduler/fbs/CpuInfo.go +++ b/pkg/fbs/common/scheduler/fbs/CpuInfo.go @@ -7,21 +7,21 @@ import ( ) type CpuInfoT struct { - CpuCoresTotal []uint32 - CpuCoresActive []uint32 - CpuCoresRealtime []uint32 - CpuCoresNonRealtime []uint32 - CpuCoreRealtimeMax int32 - CpuCoreRealtimeMin int32 - CpuCoreRealtimeDefault int32 - CpuCoreNonRealtimeMax int32 - CpuCoreNonRealtimeMin int32 - CpuCoreNonRealtimeDefault int32 - VariationId string - CpuCoreHwWdg uint32 - CpuCorePtpTimer uint32 - CpuCoreScheduler uint32 - CpuCoreAutomation uint32 + CpuCoresTotal []uint32 `json:"cpuCoresTotal"` + CpuCoresActive []uint32 `json:"cpuCoresActive"` + CpuCoresRealtime []uint32 `json:"cpuCoresRealtime"` + CpuCoresNonRealtime []uint32 `json:"cpuCoresNonRealtime"` + CpuCoreRealtimeMax int32 `json:"cpuCoreRealtimeMax"` + CpuCoreRealtimeMin int32 `json:"cpuCoreRealtimeMin"` + CpuCoreRealtimeDefault int32 `json:"cpuCoreRealtimeDefault"` + CpuCoreNonRealtimeMax int32 `json:"cpuCoreNonRealtimeMax"` + CpuCoreNonRealtimeMin int32 `json:"cpuCoreNonRealtimeMin"` + CpuCoreNonRealtimeDefault int32 `json:"cpuCoreNonRealtimeDefault"` + VariationId string `json:"variationId"` + CpuCoreHwWdg uint32 `json:"cpuCoreHwWdg"` + CpuCorePtpTimer uint32 `json:"cpuCorePtpTimer"` + CpuCoreScheduler uint32 `json:"cpuCoreScheduler"` + CpuCoreAutomation uint32 `json:"cpuCoreAutomation"` } func (t *CpuInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -62,7 +62,10 @@ func (t *CpuInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { } cpuCoresNonRealtimeOffset = builder.EndVector(cpuCoresNonRealtimeLength) } - variationIdOffset := builder.CreateString(t.VariationId) + variationIdOffset := flatbuffers.UOffsetT(0) + if t.VariationId != "" { + variationIdOffset = builder.CreateString(t.VariationId) + } CpuInfoStart(builder) CpuInfoAddCpuCoresTotal(builder, cpuCoresTotalOffset) CpuInfoAddCpuCoresActive(builder, cpuCoresActiveOffset) diff --git a/pkg/fbs/common/scheduler/fbs/DataRt.go b/pkg/fbs/common/scheduler/fbs/DataRt.go index a3045db..26373df 100644 --- a/pkg/fbs/common/scheduler/fbs/DataRt.go +++ b/pkg/fbs/common/scheduler/fbs/DataRt.go @@ -8,8 +8,8 @@ import ( /// Information about the current cycle of the task (related to real-time usage) type DataRtT struct { - StartTime uint64 - Counter uint64 + StartTime uint64 `json:"startTime"` + Counter uint64 `json:"counter"` } func (t *DataRtT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/fbs/Duration.go b/pkg/fbs/common/scheduler/fbs/Duration.go index 29c64fa..7f92152 100644 --- a/pkg/fbs/common/scheduler/fbs/Duration.go +++ b/pkg/fbs/common/scheduler/fbs/Duration.go @@ -8,10 +8,10 @@ import ( /// Duration measurement of execution of a task type DurationT struct { - Minimum uint64 - Maximum uint64 - Average uint64 - Active bool + Minimum uint64 `json:"minimum"` + Maximum uint64 `json:"maximum"` + Average uint64 `json:"average"` + Active bool `json:"active"` } func (t *DurationT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/fbs/DurationRt.go b/pkg/fbs/common/scheduler/fbs/DurationRt.go index c5c6995..9e80942 100644 --- a/pkg/fbs/common/scheduler/fbs/DurationRt.go +++ b/pkg/fbs/common/scheduler/fbs/DurationRt.go @@ -8,14 +8,14 @@ import ( /// Duration measurement of execution of the task (related to real-time usage) type DurationRtT struct { - Total uint64 - Task uint64 - Other uint64 - Equidistance uint64 - Deviation uint64 - Counter uint64 - Samplerate uint64 - Remaining uint64 + Total uint64 `json:"total"` + Task uint64 `json:"task"` + Other uint64 `json:"other"` + Equidistance uint64 `json:"equidistance"` + Deviation uint64 `json:"deviation"` + Counter uint64 `json:"counter"` + Samplerate uint64 `json:"samplerate"` + Remaining uint64 `json:"remaining"` } func (t *DurationRtT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/fbs/DurationTimer.go b/pkg/fbs/common/scheduler/fbs/DurationTimer.go index a50ba62..d59df01 100644 --- a/pkg/fbs/common/scheduler/fbs/DurationTimer.go +++ b/pkg/fbs/common/scheduler/fbs/DurationTimer.go @@ -8,7 +8,7 @@ import ( /// Type selector of duration measurement type DurationTimerT struct { - Timer Timer + Timer Timer `json:"timer"` } func (t *DurationTimerT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/fbs/Histogram.go b/pkg/fbs/common/scheduler/fbs/Histogram.go index 17dfa34..ddb0357 100644 --- a/pkg/fbs/common/scheduler/fbs/Histogram.go +++ b/pkg/fbs/common/scheduler/fbs/Histogram.go @@ -8,8 +8,8 @@ import ( /// Timing histogram type HistogramT struct { - Scale uint64 - Values []uint64 + Scale uint64 `json:"scale"` + Values []uint64 `json:"values"` } func (t *HistogramT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/fbs/Program.go b/pkg/fbs/common/scheduler/fbs/Program.go index f904fb1..a4a0af9 100644 --- a/pkg/fbs/common/scheduler/fbs/Program.go +++ b/pkg/fbs/common/scheduler/fbs/Program.go @@ -9,9 +9,9 @@ import ( ) type ProgramT struct { - Task *TaskT - Callables []*CallableT - Watchdog *common__scheduler__watchdog__fbs.WatchdogT + Task *TaskT `json:"task"` + Callables []*CallableT `json:"callables"` + Watchdog *common__scheduler__watchdog__fbs.WatchdogT `json:"watchdog"` } func (t *ProgramT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/fbs/Programs.go b/pkg/fbs/common/scheduler/fbs/Programs.go index f05a0f5..c80acb1 100644 --- a/pkg/fbs/common/scheduler/fbs/Programs.go +++ b/pkg/fbs/common/scheduler/fbs/Programs.go @@ -7,7 +7,7 @@ import ( ) type ProgramsT struct { - Programs []*ProgramT + Programs []*ProgramT `json:"programs"` } func (t *ProgramsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/fbs/StartupErrorReaction.go b/pkg/fbs/common/scheduler/fbs/StartupErrorReaction.go index ba31a4a..0617b48 100644 --- a/pkg/fbs/common/scheduler/fbs/StartupErrorReaction.go +++ b/pkg/fbs/common/scheduler/fbs/StartupErrorReaction.go @@ -8,7 +8,7 @@ import ( /// Error reaction in case of not all configured components are available on startup type StartupErrorReactionT struct { - ErrorReaction CurrentErrorReaction + ErrorReaction CurrentErrorReaction `json:"errorReaction"` } func (t *StartupErrorReactionT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/fbs/State.go b/pkg/fbs/common/scheduler/fbs/State.go index c5aa5d0..8c8a179 100644 --- a/pkg/fbs/common/scheduler/fbs/State.go +++ b/pkg/fbs/common/scheduler/fbs/State.go @@ -7,7 +7,7 @@ import ( ) type StateT struct { - State CurrentState + State CurrentState `json:"state"` } func (t *StateT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/fbs/SyncPoints.go b/pkg/fbs/common/scheduler/fbs/SyncPoints.go index f394cd5..55bc685 100644 --- a/pkg/fbs/common/scheduler/fbs/SyncPoints.go +++ b/pkg/fbs/common/scheduler/fbs/SyncPoints.go @@ -12,8 +12,8 @@ import ( /// - The names of the synchronization points of a callables have match to the Data Layer compliance guide lines meaning any alphanumeric character are allowed [a-zA-Z_][a-zA-Z0-9-._]+ /// - To ensure that other callable can run after or before this callable it's recommended to set at least one synchronization point in each list type SyncPointsT struct { - After []string - Before []string + After []string `json:"after"` + Before []string `json:"before"` } func (t *SyncPointsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/fbs/Task.go b/pkg/fbs/common/scheduler/fbs/Task.go index e65e8cf..a71d0da 100644 --- a/pkg/fbs/common/scheduler/fbs/Task.go +++ b/pkg/fbs/common/scheduler/fbs/Task.go @@ -8,18 +8,24 @@ import ( /// Properties of a task type TaskT struct { - Name string - Priority uint32 - Affinity uint32 - Stacksize uint32 - Event string - Cycletime uint32 + Name string `json:"name"` + Priority uint32 `json:"priority"` + Affinity uint32 `json:"affinity"` + Stacksize uint32 `json:"stacksize"` + Event string `json:"event"` + Cycletime uint32 `json:"cycletime"` } func (t *TaskT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - eventOffset := builder.CreateString(t.Event) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + eventOffset := flatbuffers.UOffsetT(0) + if t.Event != "" { + eventOffset = builder.CreateString(t.Event) + } TaskStart(builder) TaskAddName(builder, nameOffset) TaskAddPriority(builder, t.Priority) diff --git a/pkg/fbs/common/scheduler/fbs/TaskSpecs.go b/pkg/fbs/common/scheduler/fbs/TaskSpecs.go index 247ad9f..455f13a 100644 --- a/pkg/fbs/common/scheduler/fbs/TaskSpecs.go +++ b/pkg/fbs/common/scheduler/fbs/TaskSpecs.go @@ -8,20 +8,29 @@ import ( /// Task specifications to defined callable environment type TaskSpecsT struct { - Name string - Priority string - Type string + Name string `json:"name"` + Priority string `json:"priority"` + Type string `json:"type"` } func (t *TaskSpecsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - priorityOffset := builder.CreateString(t.Priority) - typeOffset := builder.CreateString(t.Type) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + priorityOffset := flatbuffers.UOffsetT(0) + if t.Priority != "" { + priorityOffset = builder.CreateString(t.Priority) + } + type_Offset := flatbuffers.UOffsetT(0) + if t.Type != "" { + type_Offset = builder.CreateString(t.Type) + } TaskSpecsStart(builder) TaskSpecsAddName(builder, nameOffset) TaskSpecsAddPriority(builder, priorityOffset) - TaskSpecsAddType(builder, typeOffset) + TaskSpecsAddType(builder, type_Offset) return TaskSpecsEnd(builder) } diff --git a/pkg/fbs/common/scheduler/fbs/Trigger.go b/pkg/fbs/common/scheduler/fbs/Trigger.go index cfa1f24..dd640b3 100644 --- a/pkg/fbs/common/scheduler/fbs/Trigger.go +++ b/pkg/fbs/common/scheduler/fbs/Trigger.go @@ -8,7 +8,7 @@ import ( /// Type selector of trigger sources of Scheduler type TriggerT struct { - Trigger CurrentTrigger + Trigger CurrentTrigger `json:"trigger"` } func (t *TriggerT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/fbs2/Admin.go b/pkg/fbs/common/scheduler/fbs2/Admin.go index 8b386d1..91119e7 100644 --- a/pkg/fbs/common/scheduler/fbs2/Admin.go +++ b/pkg/fbs/common/scheduler/fbs2/Admin.go @@ -11,16 +11,16 @@ import ( /// General settings of Scheduler, startup behavior, callables, tasks and timing type AdminT struct { - StartupState CurrentState - StartupTimeout uint32 - StartupErrorReaction common__scheduler__fbs.CurrentErrorReaction - TriggerSource common__scheduler__fbs.CurrentTrigger - ControlDebug *common__scheduler__controls__fbs.ControlsT - CpuInfo *CpuInfoT - HardwareWatchdogRequired bool - WatchdogDefaultValue common__scheduler__fbs.CallableWdgConfig - Utilization *UtilizationThresholdT - CallableTimeouts *CallableTimeoutsT + StartupState CurrentState `json:"startupState"` + StartupTimeout uint32 `json:"startupTimeout"` + StartupErrorReaction common__scheduler__fbs.CurrentErrorReaction `json:"startupErrorReaction"` + TriggerSource common__scheduler__fbs.CurrentTrigger `json:"triggerSource"` + ControlDebug *common__scheduler__controls__fbs.ControlsT `json:"controlDebug"` + CpuInfo *CpuInfoT `json:"cpuInfo"` + HardwareWatchdogRequired bool `json:"hardwareWatchdogRequired"` + WatchdogDefaultValue common__scheduler__fbs.CallableWdgConfig `json:"watchdogDefaultValue"` + Utilization *UtilizationThresholdT `json:"utilization"` + CallableTimeouts *CallableTimeoutsT `json:"callableTimeouts"` } func (t *AdminT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/fbs2/CallableTimeouts.go b/pkg/fbs/common/scheduler/fbs2/CallableTimeouts.go index 3a6dd68..de5dcd7 100644 --- a/pkg/fbs/common/scheduler/fbs2/CallableTimeouts.go +++ b/pkg/fbs/common/scheduler/fbs2/CallableTimeouts.go @@ -8,9 +8,9 @@ import ( /// General settings for timeouts when switching callable operation states type CallableTimeoutsT struct { - Begin uint32 - Execute uint32 - End uint32 + Begin uint32 `json:"begin"` + Execute uint32 `json:"execute"` + End uint32 `json:"end"` } func (t *CallableTimeoutsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/fbs2/CpuInfo.go b/pkg/fbs/common/scheduler/fbs2/CpuInfo.go index f48090a..66af7aa 100644 --- a/pkg/fbs/common/scheduler/fbs2/CpuInfo.go +++ b/pkg/fbs/common/scheduler/fbs2/CpuInfo.go @@ -8,21 +8,21 @@ import ( /// Information about CPU cores of ctrlX CORE type CpuInfoT struct { - CpuCoresTotal []uint32 - CpuCoresActive []uint32 - CpuCoresRealtime []uint32 - CpuCoresNonRealtime []uint32 - CpuCoreRealtimeMax int32 - CpuCoreRealtimeMin int32 - CpuCoreRealtimeDefault int32 - CpuCoreNonRealtimeMax int32 - CpuCoreNonRealtimeMin int32 - CpuCoreNonRealtimeDefault int32 - VariationId string - CpuCoreHwWdg uint32 - CpuCorePtpTimer uint32 - CpuCoreScheduler uint32 - CpuCoreAutomation uint32 + CpuCoresTotal []uint32 `json:"cpuCoresTotal"` + CpuCoresActive []uint32 `json:"cpuCoresActive"` + CpuCoresRealtime []uint32 `json:"cpuCoresRealtime"` + CpuCoresNonRealtime []uint32 `json:"cpuCoresNonRealtime"` + CpuCoreRealtimeMax int32 `json:"cpuCoreRealtimeMax"` + CpuCoreRealtimeMin int32 `json:"cpuCoreRealtimeMin"` + CpuCoreRealtimeDefault int32 `json:"cpuCoreRealtimeDefault"` + CpuCoreNonRealtimeMax int32 `json:"cpuCoreNonRealtimeMax"` + CpuCoreNonRealtimeMin int32 `json:"cpuCoreNonRealtimeMin"` + CpuCoreNonRealtimeDefault int32 `json:"cpuCoreNonRealtimeDefault"` + VariationId string `json:"variationId"` + CpuCoreHwWdg uint32 `json:"cpuCoreHwWdg"` + CpuCorePtpTimer uint32 `json:"cpuCorePtpTimer"` + CpuCoreScheduler uint32 `json:"cpuCoreScheduler"` + CpuCoreAutomation uint32 `json:"cpuCoreAutomation"` } func (t *CpuInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -63,7 +63,10 @@ func (t *CpuInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { } cpuCoresNonRealtimeOffset = builder.EndVector(cpuCoresNonRealtimeLength) } - variationIdOffset := builder.CreateString(t.VariationId) + variationIdOffset := flatbuffers.UOffsetT(0) + if t.VariationId != "" { + variationIdOffset = builder.CreateString(t.VariationId) + } CpuInfoStart(builder) CpuInfoAddCpuCoresTotal(builder, cpuCoresTotalOffset) CpuInfoAddCpuCoresActive(builder, cpuCoresActiveOffset) diff --git a/pkg/fbs/common/scheduler/fbs2/Program.go b/pkg/fbs/common/scheduler/fbs2/Program.go index 216dddb..3629851 100644 --- a/pkg/fbs/common/scheduler/fbs2/Program.go +++ b/pkg/fbs/common/scheduler/fbs2/Program.go @@ -11,10 +11,10 @@ import ( /// Composition of callables executed by the task in given sequence type ProgramT struct { - Task *common__scheduler__fbs.TaskT - Callables []*common__scheduler__fbs.CallableT - Watchdog *common__scheduler__watchdog__fbs.WatchdogT - Sequence []string + Task *common__scheduler__fbs.TaskT `json:"task"` + Callables []*common__scheduler__fbs.CallableT `json:"callables"` + Watchdog *common__scheduler__watchdog__fbs.WatchdogT `json:"watchdog"` + Sequence []string `json:"sequence"` } func (t *ProgramT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/fbs2/Programs.go b/pkg/fbs/common/scheduler/fbs2/Programs.go index 9f7596a..6897e2d 100644 --- a/pkg/fbs/common/scheduler/fbs2/Programs.go +++ b/pkg/fbs/common/scheduler/fbs2/Programs.go @@ -8,8 +8,8 @@ import ( /// Composition of programs and available callables factories type ProgramsT struct { - Programs []*ProgramT - CallablePool []string + Programs []*ProgramT `json:"programs"` + CallablePool []string `json:"callablePool"` } func (t *ProgramsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/fbs2/State.go b/pkg/fbs/common/scheduler/fbs2/State.go index 6345d3c..7ac703c 100644 --- a/pkg/fbs/common/scheduler/fbs2/State.go +++ b/pkg/fbs/common/scheduler/fbs2/State.go @@ -8,7 +8,7 @@ import ( /// Type selector of operation state type StateT struct { - State CurrentState + State CurrentState `json:"state"` } func (t *StateT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/fbs2/StateSwitchingInfo.go b/pkg/fbs/common/scheduler/fbs2/StateSwitchingInfo.go index 437c1d1..0b86a1e 100644 --- a/pkg/fbs/common/scheduler/fbs2/StateSwitchingInfo.go +++ b/pkg/fbs/common/scheduler/fbs2/StateSwitchingInfo.go @@ -8,9 +8,9 @@ import ( /// Switching progress (initial / current / target) of Scheduler operation state type StateSwitchingInfoT struct { - Initial CurrentState - Current CurrentState - Target CurrentState + Initial CurrentState `json:"initial"` + Current CurrentState `json:"current"` + Target CurrentState `json:"target"` } func (t *StateSwitchingInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/fbs2/UtilizationThreshold.go b/pkg/fbs/common/scheduler/fbs2/UtilizationThreshold.go index 160783c..5d0a6e8 100644 --- a/pkg/fbs/common/scheduler/fbs2/UtilizationThreshold.go +++ b/pkg/fbs/common/scheduler/fbs2/UtilizationThreshold.go @@ -8,8 +8,8 @@ import ( /// Utilization of the cycle time of Scheduler tick task causes by itself type UtilizationThresholdT struct { - Warning byte - Error byte + Warning byte `json:"warning"` + Error byte `json:"error"` } func (t *UtilizationThresholdT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/watchdog/errorreaction/fbs/Class.go b/pkg/fbs/common/scheduler/watchdog/errorreaction/fbs/Class.go index 94ff21e..a231710 100644 --- a/pkg/fbs/common/scheduler/watchdog/errorreaction/fbs/Class.go +++ b/pkg/fbs/common/scheduler/watchdog/errorreaction/fbs/Class.go @@ -8,7 +8,7 @@ import ( /// Criticality of task watchdog error which cause a pre-defined error reaction type ClassT struct { - Type CurrentClass + Type CurrentClass `json:"type"` } func (t *ClassT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/watchdog/errorreaction/fbs/Configuration.go b/pkg/fbs/common/scheduler/watchdog/errorreaction/fbs/Configuration.go index f850ed4..176b745 100644 --- a/pkg/fbs/common/scheduler/watchdog/errorreaction/fbs/Configuration.go +++ b/pkg/fbs/common/scheduler/watchdog/errorreaction/fbs/Configuration.go @@ -8,7 +8,7 @@ import ( /// Task behavior in case of a task watchdog occurs type ConfigurationT struct { - Type CurrentConfiguration + Type CurrentConfiguration `json:"type"` } func (t *ConfigurationT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/watchdog/fbs/Cyclic.go b/pkg/fbs/common/scheduler/watchdog/fbs/Cyclic.go index ef9e6c4..4fda97b 100644 --- a/pkg/fbs/common/scheduler/watchdog/fbs/Cyclic.go +++ b/pkg/fbs/common/scheduler/watchdog/fbs/Cyclic.go @@ -7,9 +7,9 @@ import ( ) type CyclicT struct { - ErrorCount uint32 - Reset bool - ErrorReaction *ErrorReactionT + ErrorCount uint32 `json:"errorCount"` + Reset bool `json:"reset"` + ErrorReaction *ErrorReactionT `json:"errorReaction"` } func (t *CyclicT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/watchdog/fbs/ErrorReaction.go b/pkg/fbs/common/scheduler/watchdog/fbs/ErrorReaction.go index 84d72f0..b146696 100644 --- a/pkg/fbs/common/scheduler/watchdog/fbs/ErrorReaction.go +++ b/pkg/fbs/common/scheduler/watchdog/fbs/ErrorReaction.go @@ -9,9 +9,9 @@ import ( ) type ErrorReactionT struct { - Class *common__scheduler__watchdog__errorreaction__fbs.ClassT - Configuration *common__scheduler__watchdog__errorreaction__fbs.ConfigurationT - MaxConsecutiveErrors uint32 + Class *common__scheduler__watchdog__errorreaction__fbs.ClassT `json:"class"` + Configuration *common__scheduler__watchdog__errorreaction__fbs.ConfigurationT `json:"configuration"` + MaxConsecutiveErrors uint32 `json:"maxConsecutiveErrors"` } func (t *ErrorReactionT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/watchdog/fbs/Type.go b/pkg/fbs/common/scheduler/watchdog/fbs/Type.go index 9db39c9..4ee4f9c 100644 --- a/pkg/fbs/common/scheduler/watchdog/fbs/Type.go +++ b/pkg/fbs/common/scheduler/watchdog/fbs/Type.go @@ -8,7 +8,7 @@ import ( /// Type of watchdog of the task type TypeT struct { - Type CurrentType + Type CurrentType `json:"type"` } func (t *TypeT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/scheduler/watchdog/fbs/Watchdog.go b/pkg/fbs/common/scheduler/watchdog/fbs/Watchdog.go index 2dd737e..af47e9d 100644 --- a/pkg/fbs/common/scheduler/watchdog/fbs/Watchdog.go +++ b/pkg/fbs/common/scheduler/watchdog/fbs/Watchdog.go @@ -7,20 +7,23 @@ import ( ) type WatchdogT struct { - Name string - Type *TypeT - Variant *WatchdogVariantT + Name string `json:"name"` + Type *TypeT `json:"type"` + Variant *WatchdogVariantT `json:"variant"` } func (t *WatchdogT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - typeOffset := t.Type.Pack(builder) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + type_Offset := t.Type.Pack(builder) variantOffset := t.Variant.Pack(builder) WatchdogStart(builder) WatchdogAddName(builder, nameOffset) - WatchdogAddType(builder, typeOffset) + WatchdogAddType(builder, type_Offset) if t.Variant != nil { WatchdogAddVariantType(builder, t.Variant.Type) } diff --git a/pkg/fbs/common/scheduler/watchdog/fbs/WatchdogVariant.go b/pkg/fbs/common/scheduler/watchdog/fbs/WatchdogVariant.go index 295a8be..14af8e3 100644 --- a/pkg/fbs/common/scheduler/watchdog/fbs/WatchdogVariant.go +++ b/pkg/fbs/common/scheduler/watchdog/fbs/WatchdogVariant.go @@ -4,7 +4,6 @@ package fbs import ( "strconv" - flatbuffers "github.com/google/flatbuffers/go" ) @@ -51,7 +50,8 @@ func (t *WatchdogVariantT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffse func (rcv WatchdogVariant) UnPack(table flatbuffers.Table) *WatchdogVariantT { switch rcv { case WatchdogVariantCyclic: - x := Cyclic{_tab: table} + var x Cyclic + x.Init(table.Bytes, table.Pos) return &WatchdogVariantT{ Type: WatchdogVariantCyclic, Value: x.UnPack() } } return nil diff --git a/pkg/fbs/common/systemcore/licenseproxy/LicenseCapabilities.go b/pkg/fbs/common/systemcore/licenseproxy/LicenseCapabilities.go index 2ff476a..2e7f810 100644 --- a/pkg/fbs/common/systemcore/licenseproxy/LicenseCapabilities.go +++ b/pkg/fbs/common/systemcore/licenseproxy/LicenseCapabilities.go @@ -7,7 +7,7 @@ import ( ) type LicenseCapabilitiesT struct { - Capabilities []*LicenseCapabilityT + Capabilities []*LicenseCapabilityT `json:"capabilities"` } func (t *LicenseCapabilitiesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/common/systemcore/licenseproxy/LicenseCapability.go b/pkg/fbs/common/systemcore/licenseproxy/LicenseCapability.go index 7bff575..4c41cec 100644 --- a/pkg/fbs/common/systemcore/licenseproxy/LicenseCapability.go +++ b/pkg/fbs/common/systemcore/licenseproxy/LicenseCapability.go @@ -7,20 +7,32 @@ import ( ) type LicenseCapabilityT struct { - Name string - Version string - Count int32 - IsPermanent bool - StartDate string - FinalExpirationDate string + Name string `json:"name"` + Version string `json:"version"` + Count int32 `json:"count"` + IsPermanent bool `json:"isPermanent"` + StartDate string `json:"startDate"` + FinalExpirationDate string `json:"finalExpirationDate"` } func (t *LicenseCapabilityT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - versionOffset := builder.CreateString(t.Version) - startDateOffset := builder.CreateString(t.StartDate) - finalExpirationDateOffset := builder.CreateString(t.FinalExpirationDate) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + versionOffset := flatbuffers.UOffsetT(0) + if t.Version != "" { + versionOffset = builder.CreateString(t.Version) + } + startDateOffset := flatbuffers.UOffsetT(0) + if t.StartDate != "" { + startDateOffset = builder.CreateString(t.StartDate) + } + finalExpirationDateOffset := flatbuffers.UOffsetT(0) + if t.FinalExpirationDate != "" { + finalExpirationDateOffset = builder.CreateString(t.FinalExpirationDate) + } LicenseCapabilityStart(builder) LicenseCapabilityAddName(builder, nameOffset) LicenseCapabilityAddVersion(builder, versionOffset) diff --git a/pkg/fbs/common/systemcore/licenseproxy/LicenseRequest.go b/pkg/fbs/common/systemcore/licenseproxy/LicenseRequest.go index 09e8e07..02d12c3 100644 --- a/pkg/fbs/common/systemcore/licenseproxy/LicenseRequest.go +++ b/pkg/fbs/common/systemcore/licenseproxy/LicenseRequest.go @@ -7,14 +7,20 @@ import ( ) type LicenseRequestT struct { - Name string - Version string + Name string `json:"name"` + Version string `json:"version"` } func (t *LicenseRequestT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - versionOffset := builder.CreateString(t.Version) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + versionOffset := flatbuffers.UOffsetT(0) + if t.Version != "" { + versionOffset = builder.CreateString(t.Version) + } LicenseRequestStart(builder) LicenseRequestAddName(builder, nameOffset) LicenseRequestAddVersion(builder, versionOffset) diff --git a/pkg/fbs/common/systemcore/licenseproxy/LicenseResponse.go b/pkg/fbs/common/systemcore/licenseproxy/LicenseResponse.go index ff18431..5f8da6c 100644 --- a/pkg/fbs/common/systemcore/licenseproxy/LicenseResponse.go +++ b/pkg/fbs/common/systemcore/licenseproxy/LicenseResponse.go @@ -7,22 +7,37 @@ import ( ) type LicenseResponseT struct { - Name string - Version string - Id string - IsPermanent bool - StartDate string - EndDate string - Tampered bool + Name string `json:"name"` + Version string `json:"version"` + Id string `json:"id"` + IsPermanent bool `json:"isPermanent"` + StartDate string `json:"startDate"` + EndDate string `json:"endDate"` + Tampered bool `json:"tampered"` } func (t *LicenseResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - versionOffset := builder.CreateString(t.Version) - idOffset := builder.CreateString(t.Id) - startDateOffset := builder.CreateString(t.StartDate) - endDateOffset := builder.CreateString(t.EndDate) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + versionOffset := flatbuffers.UOffsetT(0) + if t.Version != "" { + versionOffset = builder.CreateString(t.Version) + } + idOffset := flatbuffers.UOffsetT(0) + if t.Id != "" { + idOffset = builder.CreateString(t.Id) + } + startDateOffset := flatbuffers.UOffsetT(0) + if t.StartDate != "" { + startDateOffset = builder.CreateString(t.StartDate) + } + endDateOffset := flatbuffers.UOffsetT(0) + if t.EndDate != "" { + endDateOffset = builder.CreateString(t.EndDate) + } LicenseResponseStart(builder) LicenseResponseAddName(builder, nameOffset) LicenseResponseAddVersion(builder, versionOffset) diff --git a/pkg/fbs/common/systemhandler/fbs/CurrentState.go b/pkg/fbs/common/systemhandler/fbs/CurrentState.go index a949240..67d7f54 100644 --- a/pkg/fbs/common/systemhandler/fbs/CurrentState.go +++ b/pkg/fbs/common/systemhandler/fbs/CurrentState.go @@ -4,19 +4,31 @@ package fbs import "strconv" +/// Types of system operation state type CurrentState int8 const ( + /// CurrentStateINIT CurrentState = 0 + /// CurrentStateSTOP CurrentState = 1 + /// CurrentStateRUN CurrentState = 2 + /// At least one error is pending CurrentStateERROR CurrentState = 3 + /// CurrentStateSYSERROR CurrentState = 4 + /// CurrentStateSHUTDOWN CurrentState = 5 + /// At least one warning is pending CurrentStateWARNING CurrentState = 6 + /// User tasks and callables are not executed, action with influence on the real-time behavior can be performed CurrentStateSERVICE CurrentState = 7 + /// User tasks and callables will executed, changes to the configuration are permitted, action with influence on the real-time behavior (like app installation) are not allowed CurrentStateSETUP CurrentState = 8 + /// At least one but not all user tasks and callables are in OPERATING state CurrentStatePARTIAL_OPERATING CurrentState = 9 + /// User tasks and callables will executed, changes to the configuration might not be permitted, action with influence on the real-time behavior (like app installation) are not allowed CurrentStateOPERATING CurrentState = 10 ) diff --git a/pkg/fbs/common/systemhandler/fbs/State.go b/pkg/fbs/common/systemhandler/fbs/State.go index f0de4aa..0b8bae3 100644 --- a/pkg/fbs/common/systemhandler/fbs/State.go +++ b/pkg/fbs/common/systemhandler/fbs/State.go @@ -6,8 +6,9 @@ import ( flatbuffers "github.com/google/flatbuffers/go" ) +/// Type selector of system operation state type StateT struct { - State CurrentState + State CurrentState `json:"state"` } func (t *StateT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -55,6 +56,7 @@ func (rcv *State) Table() flatbuffers.Table { return rcv._tab } +/// Type selector of system operation state func (rcv *State) State() CurrentState { o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) if o != 0 { @@ -63,6 +65,7 @@ func (rcv *State) State() CurrentState { return 0 } +/// Type selector of system operation state func (rcv *State) MutateState(n CurrentState) bool { return rcv._tab.MutateInt8Slot(4, int8(n)) } diff --git a/pkg/fbs/motion/collision_avoidance/fbtypes/CollisionAvoidance.go b/pkg/fbs/motion/collision_avoidance/fbtypes/CollisionAvoidance.go index ea77048..18501af 100644 --- a/pkg/fbs/motion/collision_avoidance/fbtypes/CollisionAvoidance.go +++ b/pkg/fbs/motion/collision_avoidance/fbtypes/CollisionAvoidance.go @@ -8,14 +8,17 @@ import ( /// parameters of the collision avoidance function type CollisionAvoidanceT struct { - AxsName string - Enable bool - Params *GetCollisionGuardStateParamsT + AxsName string `json:"axsName"` + Enable bool `json:"enable"` + Params *GetCollisionGuardStateParamsT `json:"params"` } func (t *CollisionAvoidanceT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - axsNameOffset := builder.CreateString(t.AxsName) + axsNameOffset := flatbuffers.UOffsetT(0) + if t.AxsName != "" { + axsNameOffset = builder.CreateString(t.AxsName) + } paramsOffset := t.Params.Pack(builder) CollisionAvoidanceStart(builder) CollisionAvoidanceAddAxsName(builder, axsNameOffset) diff --git a/pkg/fbs/motion/collision_avoidance/fbtypes/GetCollisionGuardStateParams.go b/pkg/fbs/motion/collision_avoidance/fbtypes/GetCollisionGuardStateParams.go index 12d65e4..319ce76 100644 --- a/pkg/fbs/motion/collision_avoidance/fbtypes/GetCollisionGuardStateParams.go +++ b/pkg/fbs/motion/collision_avoidance/fbtypes/GetCollisionGuardStateParams.go @@ -8,18 +8,18 @@ import ( /// parameters of the get collision guard state function type GetCollisionGuardStateParamsT struct { - EmergencyDist float64 - MinDist float64 - SlowDownDist float64 - SyncDist float64 - ActPos float64 - TargetPos float64 - ActBrakingDist float64 - NeighborPos float64 - NeighborTargetPos float64 - NeighborBrakingDist float64 - HysteresisDist float64 - PrevState CollisionGuardState + EmergencyDist float64 `json:"emergencyDist"` + MinDist float64 `json:"minDist"` + SlowDownDist float64 `json:"slowDownDist"` + SyncDist float64 `json:"syncDist"` + ActPos float64 `json:"actPos"` + TargetPos float64 `json:"targetPos"` + ActBrakingDist float64 `json:"actBrakingDist"` + NeighborPos float64 `json:"neighborPos"` + NeighborTargetPos float64 `json:"neighborTargetPos"` + NeighborBrakingDist float64 `json:"neighborBrakingDist"` + HysteresisDist float64 `json:"hysteresisDist"` + PrevState CollisionGuardState `json:"prevState"` } func (t *GetCollisionGuardStateParamsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/AcquiredLicenses.go b/pkg/fbs/motion/core/fbtypes/AcquiredLicenses.go index 85da44a..9e22843 100644 --- a/pkg/fbs/motion/core/fbtypes/AcquiredLicenses.go +++ b/pkg/fbs/motion/core/fbtypes/AcquiredLicenses.go @@ -8,7 +8,7 @@ import ( /// all currently acquired licenses (motion must be in state RUNNING) type AcquiredLicensesT struct { - Licenses []*SingleLicenseT + Licenses []*SingleLicenseT `json:"licenses"` } func (t *AcquiredLicensesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/AxsActualValues.go b/pkg/fbs/motion/core/fbtypes/AxsActualValues.go index 9fa4d63..973751e 100644 --- a/pkg/fbs/motion/core/fbtypes/AxsActualValues.go +++ b/pkg/fbs/motion/core/fbtypes/AxsActualValues.go @@ -8,25 +8,40 @@ import ( /// actual values from the drives type AxsActualValuesT struct { - ActualPos float64 - ActualVel float64 - ActualAcc float64 - ActualTorque float64 - DistLeft float64 - ActualPosUnit string - ActualVelUnit string - ActualAccUnit string - ActualTorqueUnit string - DistLeftUnit string + ActualPos float64 `json:"actualPos"` + ActualVel float64 `json:"actualVel"` + ActualAcc float64 `json:"actualAcc"` + ActualTorque float64 `json:"actualTorque"` + DistLeft float64 `json:"distLeft"` + ActualPosUnit string `json:"actualPosUnit"` + ActualVelUnit string `json:"actualVelUnit"` + ActualAccUnit string `json:"actualAccUnit"` + ActualTorqueUnit string `json:"actualTorqueUnit"` + DistLeftUnit string `json:"distLeftUnit"` } func (t *AxsActualValuesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - actualPosUnitOffset := builder.CreateString(t.ActualPosUnit) - actualVelUnitOffset := builder.CreateString(t.ActualVelUnit) - actualAccUnitOffset := builder.CreateString(t.ActualAccUnit) - actualTorqueUnitOffset := builder.CreateString(t.ActualTorqueUnit) - distLeftUnitOffset := builder.CreateString(t.DistLeftUnit) + actualPosUnitOffset := flatbuffers.UOffsetT(0) + if t.ActualPosUnit != "" { + actualPosUnitOffset = builder.CreateString(t.ActualPosUnit) + } + actualVelUnitOffset := flatbuffers.UOffsetT(0) + if t.ActualVelUnit != "" { + actualVelUnitOffset = builder.CreateString(t.ActualVelUnit) + } + actualAccUnitOffset := flatbuffers.UOffsetT(0) + if t.ActualAccUnit != "" { + actualAccUnitOffset = builder.CreateString(t.ActualAccUnit) + } + actualTorqueUnitOffset := flatbuffers.UOffsetT(0) + if t.ActualTorqueUnit != "" { + actualTorqueUnitOffset = builder.CreateString(t.ActualTorqueUnit) + } + distLeftUnitOffset := flatbuffers.UOffsetT(0) + if t.DistLeftUnit != "" { + distLeftUnitOffset = builder.CreateString(t.DistLeftUnit) + } AxsActualValuesStart(builder) AxsActualValuesAddActualPos(builder, t.ActualPos) AxsActualValuesAddActualVel(builder, t.ActualVel) diff --git a/pkg/fbs/motion/core/fbtypes/AxsBrakingDistanceEx.go b/pkg/fbs/motion/core/fbtypes/AxsBrakingDistanceEx.go index cc7d1fa..fc9f8da 100644 --- a/pkg/fbs/motion/core/fbtypes/AxsBrakingDistanceEx.go +++ b/pkg/fbs/motion/core/fbtypes/AxsBrakingDistanceEx.go @@ -8,10 +8,10 @@ import ( /// axis braking distance type AxsBrakingDistanceExT struct { - SelectedTypes []BrakingDistanceType - DistanceUnit string - Distance float64 - DistanceType BrakingDistanceType + SelectedTypes []BrakingDistanceType `json:"selectedTypes"` + DistanceUnit string `json:"distanceUnit"` + Distance float64 `json:"distance"` + DistanceType BrakingDistanceType `json:"distanceType"` } func (t *AxsBrakingDistanceExT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -25,7 +25,10 @@ func (t *AxsBrakingDistanceExT) Pack(builder *flatbuffers.Builder) flatbuffers.U } selectedTypesOffset = builder.EndVector(selectedTypesLength) } - distanceUnitOffset := builder.CreateString(t.DistanceUnit) + distanceUnitOffset := flatbuffers.UOffsetT(0) + if t.DistanceUnit != "" { + distanceUnitOffset = builder.CreateString(t.DistanceUnit) + } AxsBrakingDistanceExStart(builder) AxsBrakingDistanceExAddSelectedTypes(builder, selectedTypesOffset) AxsBrakingDistanceExAddDistanceUnit(builder, distanceUnitOffset) diff --git a/pkg/fbs/motion/core/fbtypes/AxsCfg.go b/pkg/fbs/motion/core/fbtypes/AxsCfg.go index 73b0425..f3e86ee 100644 --- a/pkg/fbs/motion/core/fbtypes/AxsCfg.go +++ b/pkg/fbs/motion/core/fbtypes/AxsCfg.go @@ -8,21 +8,27 @@ import ( /// complete configuration of a single axis type AxsCfgT struct { - ObjectType string - AxisProfileName string - Limits *AxsCfgLimitsT - Functions *AxsCfgFunctionsT - Properties *AxsCfgPropertiesT - Units *UnitCfgObjT - KinProperties *AxsCfgKinPropertiesT - DevErrReaction *AxsCfgDeviceErrorReactionT - RtInputs *RTInputsCfgT + ObjectType string `json:"objectType"` + AxisProfileName string `json:"axisProfileName"` + Limits *AxsCfgLimitsT `json:"limits"` + Functions *AxsCfgFunctionsT `json:"functions"` + Properties *AxsCfgPropertiesT `json:"properties"` + Units *UnitCfgObjT `json:"units"` + KinProperties *AxsCfgKinPropertiesT `json:"kinProperties"` + DevErrReaction *AxsCfgDeviceErrorReactionT `json:"devErrReaction"` + RtInputs *RTInputsCfgT `json:"rtInputs"` } func (t *AxsCfgT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - objectTypeOffset := builder.CreateString(t.ObjectType) - axisProfileNameOffset := builder.CreateString(t.AxisProfileName) + objectTypeOffset := flatbuffers.UOffsetT(0) + if t.ObjectType != "" { + objectTypeOffset = builder.CreateString(t.ObjectType) + } + axisProfileNameOffset := flatbuffers.UOffsetT(0) + if t.AxisProfileName != "" { + axisProfileNameOffset = builder.CreateString(t.AxisProfileName) + } limitsOffset := t.Limits.Pack(builder) functionsOffset := t.Functions.Pack(builder) propertiesOffset := t.Properties.Pack(builder) diff --git a/pkg/fbs/motion/core/fbtypes/AxsCfgCoupling.go b/pkg/fbs/motion/core/fbtypes/AxsCfgCoupling.go index fb4c5ab..68b8fcb 100644 --- a/pkg/fbs/motion/core/fbtypes/AxsCfgCoupling.go +++ b/pkg/fbs/motion/core/fbtypes/AxsCfgCoupling.go @@ -10,8 +10,8 @@ import ( /// configuration for coupling functions for a single axis type AxsCfgCouplingT struct { - Gantry *AxsCfgGantryT - Syncmotion *motion__sync__fbtypes.AxsCfgSyncMotionT + Gantry *AxsCfgGantryT `json:"gantry"` + Syncmotion *motion__sync__fbtypes.AxsCfgSyncMotionT `json:"syncmotion"` } func (t *AxsCfgCouplingT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/AxsCfgDeviceErrorReaction.go b/pkg/fbs/motion/core/fbtypes/AxsCfgDeviceErrorReaction.go index 7c4a178..f26bbcf 100644 --- a/pkg/fbs/motion/core/fbtypes/AxsCfgDeviceErrorReaction.go +++ b/pkg/fbs/motion/core/fbtypes/AxsCfgDeviceErrorReaction.go @@ -8,8 +8,8 @@ import ( /// configuration for reaction to device error type AxsCfgDeviceErrorReactionT struct { - UserEstopLim *AxsCfgEstopDynamicLimitsT - EstopSettings *AxsCfgEstopSettingsT + UserEstopLim *AxsCfgEstopDynamicLimitsT `json:"userEstopLim"` + EstopSettings *AxsCfgEstopSettingsT `json:"estopSettings"` } func (t *AxsCfgDeviceErrorReactionT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/AxsCfgEstopDynamicLimits.go b/pkg/fbs/motion/core/fbtypes/AxsCfgEstopDynamicLimits.go index f4ff7d7..19ac8ae 100644 --- a/pkg/fbs/motion/core/fbtypes/AxsCfgEstopDynamicLimits.go +++ b/pkg/fbs/motion/core/fbtypes/AxsCfgEstopDynamicLimits.go @@ -8,16 +8,22 @@ import ( /// configuration for E-Stop dynamic limitation type AxsCfgEstopDynamicLimitsT struct { - Dec float64 - JrkDec float64 - DecUnit string - JrkDecUnit string + Dec float64 `json:"dec"` + JrkDec float64 `json:"jrkDec"` + DecUnit string `json:"decUnit"` + JrkDecUnit string `json:"jrkDecUnit"` } func (t *AxsCfgEstopDynamicLimitsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - decUnitOffset := builder.CreateString(t.DecUnit) - jrkDecUnitOffset := builder.CreateString(t.JrkDecUnit) + decUnitOffset := flatbuffers.UOffsetT(0) + if t.DecUnit != "" { + decUnitOffset = builder.CreateString(t.DecUnit) + } + jrkDecUnitOffset := flatbuffers.UOffsetT(0) + if t.JrkDecUnit != "" { + jrkDecUnitOffset = builder.CreateString(t.JrkDecUnit) + } AxsCfgEstopDynamicLimitsStart(builder) AxsCfgEstopDynamicLimitsAddDec(builder, t.Dec) AxsCfgEstopDynamicLimitsAddJrkDec(builder, t.JrkDec) diff --git a/pkg/fbs/motion/core/fbtypes/AxsCfgEstopSettings.go b/pkg/fbs/motion/core/fbtypes/AxsCfgEstopSettings.go index 4872650..ed2647f 100644 --- a/pkg/fbs/motion/core/fbtypes/AxsCfgEstopSettings.go +++ b/pkg/fbs/motion/core/fbtypes/AxsCfgEstopSettings.go @@ -8,12 +8,12 @@ import ( /// configuration for axis estop to device error type AxsCfgEstopSettingsT struct { - EstopToNoDevErr EstopType - EstopToNoDeviceInfo EstopType - EstopToDevLightErr EstopType - EstopToFieldbusErr EstopType - EstopToDevCriticalErr EstopType - EstopToDevFatalErr EstopType + EstopToNoDevErr EstopType `json:"estopToNoDevErr"` + EstopToNoDeviceInfo EstopType `json:"estopToNoDeviceInfo"` + EstopToDevLightErr EstopType `json:"estopToDevLightErr"` + EstopToFieldbusErr EstopType `json:"estopToFieldbusErr"` + EstopToDevCriticalErr EstopType `json:"estopToDevCriticalErr"` + EstopToDevFatalErr EstopType `json:"estopToDevFatalErr"` } func (t *AxsCfgEstopSettingsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/AxsCfgFunctions.go b/pkg/fbs/motion/core/fbtypes/AxsCfgFunctions.go index 653b246..b6e66e0 100644 --- a/pkg/fbs/motion/core/fbtypes/AxsCfgFunctions.go +++ b/pkg/fbs/motion/core/fbtypes/AxsCfgFunctions.go @@ -10,8 +10,9 @@ import ( /// configuration for specific functions of this axis type AxsCfgFunctionsT struct { - Coupling *AxsCfgCouplingT - CalculationPipelines []*motion__sync__fbtypes.CalcPipelineCfgT + Coupling *AxsCfgCouplingT `json:"coupling"` + CalculationPipelines []*motion__sync__fbtypes.CalcPipelineCfgT `json:"calculationPipelines"` + PosMode *AxsCfgPosModeT `json:"posMode"` } func (t *AxsCfgFunctionsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -30,9 +31,11 @@ func (t *AxsCfgFunctionsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffse } calculationPipelinesOffset = builder.EndVector(calculationPipelinesLength) } + posModeOffset := t.PosMode.Pack(builder) AxsCfgFunctionsStart(builder) AxsCfgFunctionsAddCoupling(builder, couplingOffset) AxsCfgFunctionsAddCalculationPipelines(builder, calculationPipelinesOffset) + AxsCfgFunctionsAddPosMode(builder, posModeOffset) return AxsCfgFunctionsEnd(builder) } @@ -45,6 +48,7 @@ func (rcv *AxsCfgFunctions) UnPackTo(t *AxsCfgFunctionsT) { rcv.CalculationPipelines(&x, j) t.CalculationPipelines[j] = x.UnPack() } + t.PosMode = rcv.PosMode(nil).UnPack() } func (rcv *AxsCfgFunctions) UnPack() *AxsCfgFunctionsT { @@ -118,8 +122,23 @@ func (rcv *AxsCfgFunctions) CalculationPipelinesLength() int { } /// configuration for calculation pipelines for a single axis +/// configuration for position mode function parameters for a single axis +func (rcv *AxsCfgFunctions) PosMode(obj *AxsCfgPosMode) *AxsCfgPosMode { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + x := rcv._tab.Indirect(o + rcv._tab.Pos) + if obj == nil { + obj = new(AxsCfgPosMode) + } + obj.Init(rcv._tab.Bytes, x) + return obj + } + return nil +} + +/// configuration for position mode function parameters for a single axis func AxsCfgFunctionsStart(builder *flatbuffers.Builder) { - builder.StartObject(2) + builder.StartObject(3) } func AxsCfgFunctionsAddCoupling(builder *flatbuffers.Builder, coupling flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(coupling), 0) @@ -130,6 +149,9 @@ func AxsCfgFunctionsAddCalculationPipelines(builder *flatbuffers.Builder, calcul func AxsCfgFunctionsStartCalculationPipelinesVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { return builder.StartVector(4, numElems, 4) } +func AxsCfgFunctionsAddPosMode(builder *flatbuffers.Builder, posMode flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(posMode), 0) +} func AxsCfgFunctionsEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() } diff --git a/pkg/fbs/motion/core/fbtypes/AxsCfgGantry.go b/pkg/fbs/motion/core/fbtypes/AxsCfgGantry.go index f96f96e..e161ba2 100644 --- a/pkg/fbs/motion/core/fbtypes/AxsCfgGantry.go +++ b/pkg/fbs/motion/core/fbtypes/AxsCfgGantry.go @@ -8,9 +8,9 @@ import ( /// configuration for gantry coupling function of a single axis type AxsCfgGantryT struct { - IsMember bool - MoveAllowed bool - MultiBrakeDyn bool + IsMember bool `json:"isMember"` + MoveAllowed bool `json:"moveAllowed"` + MultiBrakeDyn bool `json:"multiBrakeDyn"` } func (t *AxsCfgGantryT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/AxsCfgKinProperties.go b/pkg/fbs/motion/core/fbtypes/AxsCfgKinProperties.go index 013cb00..6429e3f 100644 --- a/pkg/fbs/motion/core/fbtypes/AxsCfgKinProperties.go +++ b/pkg/fbs/motion/core/fbtypes/AxsCfgKinProperties.go @@ -8,8 +8,8 @@ import ( /// kinematic properties for axes type AxsCfgKinPropertiesT struct { - AccReserve float64 - JrkReserve float64 + AccReserve float64 `json:"accReserve"` + JrkReserve float64 `json:"jrkReserve"` } func (t *AxsCfgKinPropertiesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/AxsCfgLimits.go b/pkg/fbs/motion/core/fbtypes/AxsCfgLimits.go index d806aa6..13c052f 100644 --- a/pkg/fbs/motion/core/fbtypes/AxsCfgLimits.go +++ b/pkg/fbs/motion/core/fbtypes/AxsCfgLimits.go @@ -8,34 +8,58 @@ import ( /// configured limits of a single axis type AxsCfgLimitsT struct { - PosMin float64 - PosMax float64 - VelPos float64 - VelNeg float64 - Acc float64 - Dec float64 - JrkAcc float64 - JrkDec float64 - PosMinUnit string - PosMaxUnit string - VelPosUnit string - VelNegUnit string - AccUnit string - DecUnit string - JrkAccUnit string - JrkDecUnit string + PosMin float64 `json:"posMin"` + PosMax float64 `json:"posMax"` + VelPos float64 `json:"velPos"` + VelNeg float64 `json:"velNeg"` + Acc float64 `json:"acc"` + Dec float64 `json:"dec"` + JrkAcc float64 `json:"jrkAcc"` + JrkDec float64 `json:"jrkDec"` + PosMinUnit string `json:"posMinUnit"` + PosMaxUnit string `json:"posMaxUnit"` + VelPosUnit string `json:"velPosUnit"` + VelNegUnit string `json:"velNegUnit"` + AccUnit string `json:"accUnit"` + DecUnit string `json:"decUnit"` + JrkAccUnit string `json:"jrkAccUnit"` + JrkDecUnit string `json:"jrkDecUnit"` } func (t *AxsCfgLimitsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - posMinUnitOffset := builder.CreateString(t.PosMinUnit) - posMaxUnitOffset := builder.CreateString(t.PosMaxUnit) - velPosUnitOffset := builder.CreateString(t.VelPosUnit) - velNegUnitOffset := builder.CreateString(t.VelNegUnit) - accUnitOffset := builder.CreateString(t.AccUnit) - decUnitOffset := builder.CreateString(t.DecUnit) - jrkAccUnitOffset := builder.CreateString(t.JrkAccUnit) - jrkDecUnitOffset := builder.CreateString(t.JrkDecUnit) + posMinUnitOffset := flatbuffers.UOffsetT(0) + if t.PosMinUnit != "" { + posMinUnitOffset = builder.CreateString(t.PosMinUnit) + } + posMaxUnitOffset := flatbuffers.UOffsetT(0) + if t.PosMaxUnit != "" { + posMaxUnitOffset = builder.CreateString(t.PosMaxUnit) + } + velPosUnitOffset := flatbuffers.UOffsetT(0) + if t.VelPosUnit != "" { + velPosUnitOffset = builder.CreateString(t.VelPosUnit) + } + velNegUnitOffset := flatbuffers.UOffsetT(0) + if t.VelNegUnit != "" { + velNegUnitOffset = builder.CreateString(t.VelNegUnit) + } + accUnitOffset := flatbuffers.UOffsetT(0) + if t.AccUnit != "" { + accUnitOffset = builder.CreateString(t.AccUnit) + } + decUnitOffset := flatbuffers.UOffsetT(0) + if t.DecUnit != "" { + decUnitOffset = builder.CreateString(t.DecUnit) + } + jrkAccUnitOffset := flatbuffers.UOffsetT(0) + if t.JrkAccUnit != "" { + jrkAccUnitOffset = builder.CreateString(t.JrkAccUnit) + } + jrkDecUnitOffset := flatbuffers.UOffsetT(0) + if t.JrkDecUnit != "" { + jrkDecUnitOffset = builder.CreateString(t.JrkDecUnit) + } AxsCfgLimitsStart(builder) AxsCfgLimitsAddPosMin(builder, t.PosMin) AxsCfgLimitsAddPosMax(builder, t.PosMax) diff --git a/pkg/fbs/motion/core/fbtypes/AxsCfgProperties.go b/pkg/fbs/motion/core/fbtypes/AxsCfgProperties.go index b237c01..efa81c3 100644 --- a/pkg/fbs/motion/core/fbtypes/AxsCfgProperties.go +++ b/pkg/fbs/motion/core/fbtypes/AxsCfgProperties.go @@ -8,16 +8,22 @@ import ( /// common axis properties for a single axis type AxsCfgPropertiesT struct { - AxsType string - Modulo bool - ModuloValue float64 - ModuloValueUnit string + AxsType string `json:"axsType"` + Modulo bool `json:"modulo"` + ModuloValue float64 `json:"moduloValue"` + ModuloValueUnit string `json:"moduloValueUnit"` } func (t *AxsCfgPropertiesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - axsTypeOffset := builder.CreateString(t.AxsType) - moduloValueUnitOffset := builder.CreateString(t.ModuloValueUnit) + axsTypeOffset := flatbuffers.UOffsetT(0) + if t.AxsType != "" { + axsTypeOffset = builder.CreateString(t.AxsType) + } + moduloValueUnitOffset := flatbuffers.UOffsetT(0) + if t.ModuloValueUnit != "" { + moduloValueUnitOffset = builder.CreateString(t.ModuloValueUnit) + } AxsCfgPropertiesStart(builder) AxsCfgPropertiesAddAxsType(builder, axsTypeOffset) AxsCfgPropertiesAddModulo(builder, t.Modulo) diff --git a/pkg/fbs/motion/core/fbtypes/AxsCmdAbortData.go b/pkg/fbs/motion/core/fbtypes/AxsCmdAbortData.go index 9c69608..02cc07b 100644 --- a/pkg/fbs/motion/core/fbtypes/AxsCmdAbortData.go +++ b/pkg/fbs/motion/core/fbtypes/AxsCmdAbortData.go @@ -8,8 +8,8 @@ import ( /// parameters of the axis abort command type AxsCmdAbortDataT struct { - Dec float64 - JrkDec float64 + Dec float64 `json:"dec"` + JrkDec float64 `json:"jrkDec"` } func (t *AxsCmdAbortDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -65,7 +65,7 @@ func (rcv *AxsCmdAbortData) Dec() float64 { if o != 0 { return rcv._tab.GetFloat64(o + rcv._tab.Pos) } - return 0.0 + return 1.0 } /// commanded deceleration limit (must be a positive value) @@ -91,7 +91,7 @@ func AxsCmdAbortDataStart(builder *flatbuffers.Builder) { builder.StartObject(2) } func AxsCmdAbortDataAddDec(builder *flatbuffers.Builder, dec float64) { - builder.PrependFloat64Slot(0, dec, 0.0) + builder.PrependFloat64Slot(0, dec, 1.0) } func AxsCmdAbortDataAddJrkDec(builder *flatbuffers.Builder, jrkDec float64) { builder.PrependFloat64Slot(1, jrkDec, 0.0) diff --git a/pkg/fbs/motion/core/fbtypes/AxsCmdAddToGantryData.go b/pkg/fbs/motion/core/fbtypes/AxsCmdAddToGantryData.go index ddf90a2..ad459ab 100644 --- a/pkg/fbs/motion/core/fbtypes/AxsCmdAddToGantryData.go +++ b/pkg/fbs/motion/core/fbtypes/AxsCmdAddToGantryData.go @@ -8,13 +8,16 @@ import ( /// parameters of the axis command add-to-gantry type AxsCmdAddToGantryDataT struct { - MasterName string - Buffered bool + MasterName string `json:"masterName"` + Buffered bool `json:"buffered"` } func (t *AxsCmdAddToGantryDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - masterNameOffset := builder.CreateString(t.MasterName) + masterNameOffset := flatbuffers.UOffsetT(0) + if t.MasterName != "" { + masterNameOffset = builder.CreateString(t.MasterName) + } AxsCmdAddToGantryDataStart(builder) AxsCmdAddToGantryDataAddMasterName(builder, masterNameOffset) AxsCmdAddToGantryDataAddBuffered(builder, t.Buffered) diff --git a/pkg/fbs/motion/core/fbtypes/AxsCmdAddToKinData.go b/pkg/fbs/motion/core/fbtypes/AxsCmdAddToKinData.go index 25d4626..58b3657 100644 --- a/pkg/fbs/motion/core/fbtypes/AxsCmdAddToKinData.go +++ b/pkg/fbs/motion/core/fbtypes/AxsCmdAddToKinData.go @@ -8,13 +8,16 @@ import ( /// parameters of the axis command add-to-kin type AxsCmdAddToKinDataT struct { - KinName string - Buffered bool + KinName string `json:"kinName"` + Buffered bool `json:"buffered"` } func (t *AxsCmdAddToKinDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - kinNameOffset := builder.CreateString(t.KinName) + kinNameOffset := flatbuffers.UOffsetT(0) + if t.KinName != "" { + kinNameOffset = builder.CreateString(t.KinName) + } AxsCmdAddToKinDataStart(builder) AxsCmdAddToKinDataAddKinName(builder, kinNameOffset) AxsCmdAddToKinDataAddBuffered(builder, t.Buffered) diff --git a/pkg/fbs/motion/core/fbtypes/AxsCmdJogData.go b/pkg/fbs/motion/core/fbtypes/AxsCmdJogData.go index 7f227b3..e28c285 100644 --- a/pkg/fbs/motion/core/fbtypes/AxsCmdJogData.go +++ b/pkg/fbs/motion/core/fbtypes/AxsCmdJogData.go @@ -8,14 +8,17 @@ import ( /// parameters of the axis jog commands type AxsCmdJogDataT struct { - JogDir string - JogIncrement float64 - Lim *DynamicLimitsT + JogDir string `json:"jogDir"` + JogIncrement float64 `json:"jogIncrement"` + Lim *DynamicLimitsT `json:"lim"` } func (t *AxsCmdJogDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - jogDirOffset := builder.CreateString(t.JogDir) + jogDirOffset := flatbuffers.UOffsetT(0) + if t.JogDir != "" { + jogDirOffset = builder.CreateString(t.JogDir) + } limOffset := t.Lim.Pack(builder) AxsCmdJogDataStart(builder) AxsCmdJogDataAddJogDir(builder, jogDirOffset) diff --git a/pkg/fbs/motion/core/fbtypes/AxsCmdPosData.go b/pkg/fbs/motion/core/fbtypes/AxsCmdPosData.go index fc2cc97..c119090 100644 --- a/pkg/fbs/motion/core/fbtypes/AxsCmdPosData.go +++ b/pkg/fbs/motion/core/fbtypes/AxsCmdPosData.go @@ -8,9 +8,10 @@ import ( /// parameters of the axis position commands type AxsCmdPosDataT struct { - AxsPos float64 - Buffered bool - Lim *DynamicLimitsT + AxsPos float64 `json:"axsPos"` + Buffered bool `json:"buffered"` + Lim *DynamicLimitsT `json:"lim"` + Direction CmdPosAbsDir `json:"direction"` } func (t *AxsCmdPosDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -20,6 +21,7 @@ func (t *AxsCmdPosDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT AxsCmdPosDataAddAxsPos(builder, t.AxsPos) AxsCmdPosDataAddBuffered(builder, t.Buffered) AxsCmdPosDataAddLim(builder, limOffset) + AxsCmdPosDataAddDirection(builder, t.Direction) return AxsCmdPosDataEnd(builder) } @@ -27,6 +29,7 @@ func (rcv *AxsCmdPosData) UnPackTo(t *AxsCmdPosDataT) { t.AxsPos = rcv.AxsPos() t.Buffered = rcv.Buffered() t.Lim = rcv.Lim(nil).UnPack() + t.Direction = rcv.Direction() } func (rcv *AxsCmdPosData) UnPack() *AxsCmdPosDataT { @@ -83,7 +86,7 @@ func (rcv *AxsCmdPosData) Buffered() bool { if o != 0 { return rcv._tab.GetBool(o + rcv._tab.Pos) } - return false + return true } /// should this be a buffered command? @@ -106,18 +109,35 @@ func (rcv *AxsCmdPosData) Lim(obj *DynamicLimits) *DynamicLimits { } /// dynamic limits for the motion of this command +/// Selected direction for PosAbs with modulo axis (ignored in all other cases) +func (rcv *AxsCmdPosData) Direction() CmdPosAbsDir { + o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) + if o != 0 { + return CmdPosAbsDir(rcv._tab.GetInt8(o + rcv._tab.Pos)) + } + return 0 +} + +/// Selected direction for PosAbs with modulo axis (ignored in all other cases) +func (rcv *AxsCmdPosData) MutateDirection(n CmdPosAbsDir) bool { + return rcv._tab.MutateInt8Slot(10, int8(n)) +} + func AxsCmdPosDataStart(builder *flatbuffers.Builder) { - builder.StartObject(3) + builder.StartObject(4) } func AxsCmdPosDataAddAxsPos(builder *flatbuffers.Builder, axsPos float64) { builder.PrependFloat64Slot(0, axsPos, 0.0) } func AxsCmdPosDataAddBuffered(builder *flatbuffers.Builder, buffered bool) { - builder.PrependBoolSlot(1, buffered, false) + builder.PrependBoolSlot(1, buffered, true) } func AxsCmdPosDataAddLim(builder *flatbuffers.Builder, lim flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(lim), 0) } +func AxsCmdPosDataAddDirection(builder *flatbuffers.Builder, direction CmdPosAbsDir) { + builder.PrependInt8Slot(3, int8(direction), 0) +} func AxsCmdPosDataEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() } diff --git a/pkg/fbs/motion/core/fbtypes/AxsCmdProbeBaseData.go b/pkg/fbs/motion/core/fbtypes/AxsCmdProbeBaseData.go index 59dc95d..d764b25 100644 --- a/pkg/fbs/motion/core/fbtypes/AxsCmdProbeBaseData.go +++ b/pkg/fbs/motion/core/fbtypes/AxsCmdProbeBaseData.go @@ -8,14 +8,20 @@ import ( /// base parameters of the axis probe and axis probe abort command type AxsCmdProbeBaseDataT struct { - TriggerSrc string - ProbeIndex string + TriggerSrc string `json:"triggerSrc"` + ProbeIndex string `json:"probeIndex"` } func (t *AxsCmdProbeBaseDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - triggerSrcOffset := builder.CreateString(t.TriggerSrc) - probeIndexOffset := builder.CreateString(t.ProbeIndex) + triggerSrcOffset := flatbuffers.UOffsetT(0) + if t.TriggerSrc != "" { + triggerSrcOffset = builder.CreateString(t.TriggerSrc) + } + probeIndexOffset := flatbuffers.UOffsetT(0) + if t.ProbeIndex != "" { + probeIndexOffset = builder.CreateString(t.ProbeIndex) + } AxsCmdProbeBaseDataStart(builder) AxsCmdProbeBaseDataAddTriggerSrc(builder, triggerSrcOffset) AxsCmdProbeBaseDataAddProbeIndex(builder, probeIndexOffset) diff --git a/pkg/fbs/motion/core/fbtypes/AxsCmdProbeData.go b/pkg/fbs/motion/core/fbtypes/AxsCmdProbeData.go index 9000071..5dddb84 100644 --- a/pkg/fbs/motion/core/fbtypes/AxsCmdProbeData.go +++ b/pkg/fbs/motion/core/fbtypes/AxsCmdProbeData.go @@ -8,8 +8,8 @@ import ( /// parameters of the axis probe command type AxsCmdProbeDataT struct { - BaseData *AxsCmdProbeBaseDataT - CfgData *ProbeCfgDataT + BaseData *AxsCmdProbeBaseDataT `json:"baseData"` + CfgData *ProbeCfgDataT `json:"cfgData"` } func (t *AxsCmdProbeDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/AxsCmdValues.go b/pkg/fbs/motion/core/fbtypes/AxsCmdValues.go index 918ecbc..54afb66 100644 --- a/pkg/fbs/motion/core/fbtypes/AxsCmdValues.go +++ b/pkg/fbs/motion/core/fbtypes/AxsCmdValues.go @@ -8,24 +8,33 @@ import ( /// parameters and data of the active command type AxsCmdValuesT struct { - TargetPos float64 - TargetVel float64 - TargetTrq float64 - Lim *DynamicLimitsStateT - CmdId uint64 - Src *CmdSourceT - TargetPosUnit string - TargetVelUnit string - TargetTrqUnit string + TargetPos float64 `json:"targetPos"` + TargetVel float64 `json:"targetVel"` + TargetTrq float64 `json:"targetTrq"` + Lim *DynamicLimitsStateT `json:"lim"` + CmdId uint64 `json:"cmdId"` + Src *CmdSourceT `json:"src"` + TargetPosUnit string `json:"targetPosUnit"` + TargetVelUnit string `json:"targetVelUnit"` + TargetTrqUnit string `json:"targetTrqUnit"` } func (t *AxsCmdValuesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } limOffset := t.Lim.Pack(builder) srcOffset := t.Src.Pack(builder) - targetPosUnitOffset := builder.CreateString(t.TargetPosUnit) - targetVelUnitOffset := builder.CreateString(t.TargetVelUnit) - targetTrqUnitOffset := builder.CreateString(t.TargetTrqUnit) + targetPosUnitOffset := flatbuffers.UOffsetT(0) + if t.TargetPosUnit != "" { + targetPosUnitOffset = builder.CreateString(t.TargetPosUnit) + } + targetVelUnitOffset := flatbuffers.UOffsetT(0) + if t.TargetVelUnit != "" { + targetVelUnitOffset = builder.CreateString(t.TargetVelUnit) + } + targetTrqUnitOffset := flatbuffers.UOffsetT(0) + if t.TargetTrqUnit != "" { + targetTrqUnitOffset = builder.CreateString(t.TargetTrqUnit) + } AxsCmdValuesStart(builder) AxsCmdValuesAddTargetPos(builder, t.TargetPos) AxsCmdValuesAddTargetVel(builder, t.TargetVel) diff --git a/pkg/fbs/motion/core/fbtypes/AxsCmdVelData.go b/pkg/fbs/motion/core/fbtypes/AxsCmdVelData.go index 7a7ad22..6fe85f8 100644 --- a/pkg/fbs/motion/core/fbtypes/AxsCmdVelData.go +++ b/pkg/fbs/motion/core/fbtypes/AxsCmdVelData.go @@ -8,10 +8,10 @@ import ( /// parameters of the axis velocity command type AxsCmdVelDataT struct { - AxsVel float64 - DriveVelMode bool - Buffered bool - Lim *DynamicLimitsT + AxsVel float64 `json:"axsVel"` + DriveVelMode bool `json:"driveVelMode"` + Buffered bool `json:"buffered"` + Lim *DynamicLimitsT `json:"lim"` } func (t *AxsCmdVelDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -72,7 +72,7 @@ func (rcv *AxsCmdVelData) AxsVel() float64 { if o != 0 { return rcv._tab.GetFloat64(o + rcv._tab.Pos) } - return 0.0 + return 1.0 } /// commanded target velocity (can be negative) @@ -100,7 +100,7 @@ func (rcv *AxsCmdVelData) Buffered() bool { if o != 0 { return rcv._tab.GetBool(o + rcv._tab.Pos) } - return false + return true } /// should this be a buffered command? @@ -127,13 +127,13 @@ func AxsCmdVelDataStart(builder *flatbuffers.Builder) { builder.StartObject(4) } func AxsCmdVelDataAddAxsVel(builder *flatbuffers.Builder, axsVel float64) { - builder.PrependFloat64Slot(0, axsVel, 0.0) + builder.PrependFloat64Slot(0, axsVel, 1.0) } func AxsCmdVelDataAddDriveVelMode(builder *flatbuffers.Builder, driveVelMode bool) { builder.PrependBoolSlot(1, driveVelMode, false) } func AxsCmdVelDataAddBuffered(builder *flatbuffers.Builder, buffered bool) { - builder.PrependBoolSlot(2, buffered, false) + builder.PrependBoolSlot(2, buffered, true) } func AxsCmdVelDataAddLim(builder *flatbuffers.Builder, lim flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(lim), 0) diff --git a/pkg/fbs/motion/core/fbtypes/AxsIpoValues.go b/pkg/fbs/motion/core/fbtypes/AxsIpoValues.go index 26f15bf..6f24aee 100644 --- a/pkg/fbs/motion/core/fbtypes/AxsIpoValues.go +++ b/pkg/fbs/motion/core/fbtypes/AxsIpoValues.go @@ -8,22 +8,34 @@ import ( /// currently interpolated values type AxsIpoValuesT struct { - IpoPos float64 - IpoVel float64 - IpoAcc float64 - IpoJrk float64 - IpoPosUnit string - IpoVelUnit string - IpoAccUnit string - IpoJrkUnit string + IpoPos float64 `json:"ipoPos"` + IpoVel float64 `json:"ipoVel"` + IpoAcc float64 `json:"ipoAcc"` + IpoJrk float64 `json:"ipoJrk"` + IpoPosUnit string `json:"ipoPosUnit"` + IpoVelUnit string `json:"ipoVelUnit"` + IpoAccUnit string `json:"ipoAccUnit"` + IpoJrkUnit string `json:"ipoJrkUnit"` } func (t *AxsIpoValuesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - ipoPosUnitOffset := builder.CreateString(t.IpoPosUnit) - ipoVelUnitOffset := builder.CreateString(t.IpoVelUnit) - ipoAccUnitOffset := builder.CreateString(t.IpoAccUnit) - ipoJrkUnitOffset := builder.CreateString(t.IpoJrkUnit) + ipoPosUnitOffset := flatbuffers.UOffsetT(0) + if t.IpoPosUnit != "" { + ipoPosUnitOffset = builder.CreateString(t.IpoPosUnit) + } + ipoVelUnitOffset := flatbuffers.UOffsetT(0) + if t.IpoVelUnit != "" { + ipoVelUnitOffset = builder.CreateString(t.IpoVelUnit) + } + ipoAccUnitOffset := flatbuffers.UOffsetT(0) + if t.IpoAccUnit != "" { + ipoAccUnitOffset = builder.CreateString(t.IpoAccUnit) + } + ipoJrkUnitOffset := flatbuffers.UOffsetT(0) + if t.IpoJrkUnit != "" { + ipoJrkUnitOffset = builder.CreateString(t.IpoJrkUnit) + } AxsIpoValuesStart(builder) AxsIpoValuesAddIpoPos(builder, t.IpoPos) AxsIpoValuesAddIpoVel(builder, t.IpoVel) diff --git a/pkg/fbs/motion/core/fbtypes/BootState.go b/pkg/fbs/motion/core/fbtypes/BootState.go index acb033d..0fcc49d 100644 --- a/pkg/fbs/motion/core/fbtypes/BootState.go +++ b/pkg/fbs/motion/core/fbtypes/BootState.go @@ -8,14 +8,17 @@ import ( /// return type of requests of the current boot state type BootStateT struct { - Text string - ActStep uint32 - MaxSteps uint32 + Text string `json:"text"` + ActStep uint32 `json:"actStep"` + MaxSteps uint32 `json:"maxSteps"` } func (t *BootStateT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - textOffset := builder.CreateString(t.Text) + textOffset := flatbuffers.UOffsetT(0) + if t.Text != "" { + textOffset = builder.CreateString(t.Text) + } BootStateStart(builder) BootStateAddText(builder, textOffset) BootStateAddActStep(builder, t.ActStep) diff --git a/pkg/fbs/motion/core/fbtypes/BootTimes.go b/pkg/fbs/motion/core/fbtypes/BootTimes.go index d67db97..acbf458 100644 --- a/pkg/fbs/motion/core/fbtypes/BootTimes.go +++ b/pkg/fbs/motion/core/fbtypes/BootTimes.go @@ -8,16 +8,22 @@ import ( /// return type of requests of the times of the last booting type BootTimesT struct { - Elapsed float64 - ElapsedThread float64 - StartedTimeStamp string - EndedTimeStamp string + Elapsed float64 `json:"elapsed"` + ElapsedThread float64 `json:"elapsedThread"` + StartedTimeStamp string `json:"startedTimeStamp"` + EndedTimeStamp string `json:"endedTimeStamp"` } func (t *BootTimesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - startedTimeStampOffset := builder.CreateString(t.StartedTimeStamp) - endedTimeStampOffset := builder.CreateString(t.EndedTimeStamp) + startedTimeStampOffset := flatbuffers.UOffsetT(0) + if t.StartedTimeStamp != "" { + startedTimeStampOffset = builder.CreateString(t.StartedTimeStamp) + } + endedTimeStampOffset := flatbuffers.UOffsetT(0) + if t.EndedTimeStamp != "" { + endedTimeStampOffset = builder.CreateString(t.EndedTimeStamp) + } BootTimesStart(builder) BootTimesAddElapsed(builder, t.Elapsed) BootTimesAddElapsedThread(builder, t.ElapsedThread) diff --git a/pkg/fbs/motion/core/fbtypes/Capability.go b/pkg/fbs/motion/core/fbtypes/Capability.go index bb8f010..4b11304 100644 --- a/pkg/fbs/motion/core/fbtypes/Capability.go +++ b/pkg/fbs/motion/core/fbtypes/Capability.go @@ -8,15 +8,18 @@ import ( /// Response for a single capability type CapabilityT struct { - Count uint32 - MainDiag uint32 - DetailDiag uint32 - AddInfo string + Count uint32 `json:"count"` + MainDiag uint32 `json:"mainDiag"` + DetailDiag uint32 `json:"detailDiag"` + AddInfo string `json:"addInfo"` } func (t *CapabilityT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - addInfoOffset := builder.CreateString(t.AddInfo) + addInfoOffset := flatbuffers.UOffsetT(0) + if t.AddInfo != "" { + addInfoOffset = builder.CreateString(t.AddInfo) + } CapabilityStart(builder) CapabilityAddCount(builder, t.Count) CapabilityAddMainDiag(builder, t.MainDiag) diff --git a/pkg/fbs/motion/core/fbtypes/CmdOptNoParam.go b/pkg/fbs/motion/core/fbtypes/CmdOptNoParam.go index 89e78b0..4e0f3b7 100644 --- a/pkg/fbs/motion/core/fbtypes/CmdOptNoParam.go +++ b/pkg/fbs/motion/core/fbtypes/CmdOptNoParam.go @@ -8,12 +8,15 @@ import ( /// parameters for all command options, that have no parameters (except the perm. type) type CmdOptNoParamT struct { - PermType string + PermType string `json:"permType"` } func (t *CmdOptNoParamT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - permTypeOffset := builder.CreateString(t.PermType) + permTypeOffset := flatbuffers.UOffsetT(0) + if t.PermType != "" { + permTypeOffset = builder.CreateString(t.PermType) + } CmdOptNoParamStart(builder) CmdOptNoParamAddPermType(builder, permTypeOffset) return CmdOptNoParamEnd(builder) diff --git a/pkg/fbs/motion/core/fbtypes/CmdSource.go b/pkg/fbs/motion/core/fbtypes/CmdSource.go index a19157f..284b800 100644 --- a/pkg/fbs/motion/core/fbtypes/CmdSource.go +++ b/pkg/fbs/motion/core/fbtypes/CmdSource.go @@ -8,17 +8,23 @@ import ( /// command source (by which interface was this command inserted into the system (e.g. "PLC")) type CmdSourceT struct { - Type string - Name string - Line uint64 + Type string `json:"type"` + Name string `json:"name"` + Line uint64 `json:"line"` } func (t *CmdSourceT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - typeOffset := builder.CreateString(t.Type) - nameOffset := builder.CreateString(t.Name) + type_Offset := flatbuffers.UOffsetT(0) + if t.Type != "" { + type_Offset = builder.CreateString(t.Type) + } + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } CmdSourceStart(builder) - CmdSourceAddType(builder, typeOffset) + CmdSourceAddType(builder, type_Offset) CmdSourceAddName(builder, nameOffset) CmdSourceAddLine(builder, t.Line) return CmdSourceEnd(builder) diff --git a/pkg/fbs/motion/core/fbtypes/DiagInfo.go b/pkg/fbs/motion/core/fbtypes/DiagInfo.go index 9506239..b5c8e83 100644 --- a/pkg/fbs/motion/core/fbtypes/DiagInfo.go +++ b/pkg/fbs/motion/core/fbtypes/DiagInfo.go @@ -8,31 +8,49 @@ import ( /// informations on the last diagnosis message of this motion object or of the system type DiagInfoT struct { - MainDiagCode uint32 - DetailedDiagCode uint32 - ObjName string - ObjURI string - Source string - AddInfo string - FirstMainDiagCode uint32 - FirstDetailedDiagCode uint32 - FirstSource string - FirstAddInfo string + MainDiagCode uint32 `json:"mainDiagCode"` + DetailedDiagCode uint32 `json:"detailedDiagCode"` + ObjName string `json:"objName"` + ObjUri string `json:"objURI"` + Source string `json:"source"` + AddInfo string `json:"addInfo"` + FirstMainDiagCode uint32 `json:"firstMainDiagCode"` + FirstDetailedDiagCode uint32 `json:"firstDetailedDiagCode"` + FirstSource string `json:"firstSource"` + FirstAddInfo string `json:"firstAddInfo"` } func (t *DiagInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - objNameOffset := builder.CreateString(t.ObjName) - objURIOffset := builder.CreateString(t.ObjURI) - sourceOffset := builder.CreateString(t.Source) - addInfoOffset := builder.CreateString(t.AddInfo) - firstSourceOffset := builder.CreateString(t.FirstSource) - firstAddInfoOffset := builder.CreateString(t.FirstAddInfo) + objNameOffset := flatbuffers.UOffsetT(0) + if t.ObjName != "" { + objNameOffset = builder.CreateString(t.ObjName) + } + objUriOffset := flatbuffers.UOffsetT(0) + if t.ObjUri != "" { + objUriOffset = builder.CreateString(t.ObjUri) + } + sourceOffset := flatbuffers.UOffsetT(0) + if t.Source != "" { + sourceOffset = builder.CreateString(t.Source) + } + addInfoOffset := flatbuffers.UOffsetT(0) + if t.AddInfo != "" { + addInfoOffset = builder.CreateString(t.AddInfo) + } + firstSourceOffset := flatbuffers.UOffsetT(0) + if t.FirstSource != "" { + firstSourceOffset = builder.CreateString(t.FirstSource) + } + firstAddInfoOffset := flatbuffers.UOffsetT(0) + if t.FirstAddInfo != "" { + firstAddInfoOffset = builder.CreateString(t.FirstAddInfo) + } DiagInfoStart(builder) DiagInfoAddMainDiagCode(builder, t.MainDiagCode) DiagInfoAddDetailedDiagCode(builder, t.DetailedDiagCode) DiagInfoAddObjName(builder, objNameOffset) - DiagInfoAddObjURI(builder, objURIOffset) + DiagInfoAddObjUri(builder, objUriOffset) DiagInfoAddSource(builder, sourceOffset) DiagInfoAddAddInfo(builder, addInfoOffset) DiagInfoAddFirstMainDiagCode(builder, t.FirstMainDiagCode) @@ -46,7 +64,7 @@ func (rcv *DiagInfo) UnPackTo(t *DiagInfoT) { t.MainDiagCode = rcv.MainDiagCode() t.DetailedDiagCode = rcv.DetailedDiagCode() t.ObjName = string(rcv.ObjName()) - t.ObjURI = string(rcv.ObjURI()) + t.ObjUri = string(rcv.ObjUri()) t.Source = string(rcv.Source()) t.AddInfo = string(rcv.AddInfo()) t.FirstMainDiagCode = rcv.FirstMainDiagCode() @@ -128,7 +146,7 @@ func (rcv *DiagInfo) ObjName() []byte { /// name of the motion object /// URI of the motion object -func (rcv *DiagInfo) ObjURI() []byte { +func (rcv *DiagInfo) ObjUri() []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) if o != 0 { return rcv._tab.ByteVector(o + rcv._tab.Pos) @@ -217,8 +235,8 @@ func DiagInfoAddDetailedDiagCode(builder *flatbuffers.Builder, detailedDiagCode func DiagInfoAddObjName(builder *flatbuffers.Builder, objName flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(objName), 0) } -func DiagInfoAddObjURI(builder *flatbuffers.Builder, objURI flatbuffers.UOffsetT) { - builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(objURI), 0) +func DiagInfoAddObjUri(builder *flatbuffers.Builder, objUri flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(objUri), 0) } func DiagInfoAddSource(builder *flatbuffers.Builder, source flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(4, flatbuffers.UOffsetT(source), 0) diff --git a/pkg/fbs/motion/core/fbtypes/DynamicLimits.go b/pkg/fbs/motion/core/fbtypes/DynamicLimits.go index aaaedb9..80b0c6e 100644 --- a/pkg/fbs/motion/core/fbtypes/DynamicLimits.go +++ b/pkg/fbs/motion/core/fbtypes/DynamicLimits.go @@ -8,11 +8,11 @@ import ( /// set of dynamic limits (for commands) type DynamicLimitsT struct { - Vel float64 - Acc float64 - Dec float64 - JrkAcc float64 - JrkDec float64 + Vel float64 `json:"vel"` + Acc float64 `json:"acc"` + Dec float64 `json:"dec"` + JrkAcc float64 `json:"jrkAcc"` + JrkDec float64 `json:"jrkDec"` } func (t *DynamicLimitsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -74,7 +74,7 @@ func (rcv *DynamicLimits) Vel() float64 { if o != 0 { return rcv._tab.GetFloat64(o + rcv._tab.Pos) } - return 0.0 + return 1.0 } /// velocity limit (must be greater than zero) @@ -88,7 +88,7 @@ func (rcv *DynamicLimits) Acc() float64 { if o != 0 { return rcv._tab.GetFloat64(o + rcv._tab.Pos) } - return 0.0 + return 1.0 } /// acceleration limit (must be greater than zero) @@ -102,7 +102,7 @@ func (rcv *DynamicLimits) Dec() float64 { if o != 0 { return rcv._tab.GetFloat64(o + rcv._tab.Pos) } - return 0.0 + return 1.0 } /// deceleration limit (must be greater than zero) @@ -142,13 +142,13 @@ func DynamicLimitsStart(builder *flatbuffers.Builder) { builder.StartObject(5) } func DynamicLimitsAddVel(builder *flatbuffers.Builder, vel float64) { - builder.PrependFloat64Slot(0, vel, 0.0) + builder.PrependFloat64Slot(0, vel, 1.0) } func DynamicLimitsAddAcc(builder *flatbuffers.Builder, acc float64) { - builder.PrependFloat64Slot(1, acc, 0.0) + builder.PrependFloat64Slot(1, acc, 1.0) } func DynamicLimitsAddDec(builder *flatbuffers.Builder, dec float64) { - builder.PrependFloat64Slot(2, dec, 0.0) + builder.PrependFloat64Slot(2, dec, 1.0) } func DynamicLimitsAddJrkAcc(builder *flatbuffers.Builder, jrkAcc float64) { builder.PrependFloat64Slot(3, jrkAcc, 0.0) diff --git a/pkg/fbs/motion/core/fbtypes/DynamicLimitsState.go b/pkg/fbs/motion/core/fbtypes/DynamicLimitsState.go index 1bb75db..757c671 100644 --- a/pkg/fbs/motion/core/fbtypes/DynamicLimitsState.go +++ b/pkg/fbs/motion/core/fbtypes/DynamicLimitsState.go @@ -8,25 +8,40 @@ import ( /// set of dynamic limits (for reading them in states) type DynamicLimitsStateT struct { - Vel float64 - Acc float64 - Dec float64 - JrkAcc float64 - JrkDec float64 - VelUnit string - AccUnit string - DecUnit string - JrkAccUnit string - JrkDecUnit string + Vel float64 `json:"vel"` + Acc float64 `json:"acc"` + Dec float64 `json:"dec"` + JrkAcc float64 `json:"jrkAcc"` + JrkDec float64 `json:"jrkDec"` + VelUnit string `json:"velUnit"` + AccUnit string `json:"accUnit"` + DecUnit string `json:"decUnit"` + JrkAccUnit string `json:"jrkAccUnit"` + JrkDecUnit string `json:"jrkDecUnit"` } func (t *DynamicLimitsStateT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - velUnitOffset := builder.CreateString(t.VelUnit) - accUnitOffset := builder.CreateString(t.AccUnit) - decUnitOffset := builder.CreateString(t.DecUnit) - jrkAccUnitOffset := builder.CreateString(t.JrkAccUnit) - jrkDecUnitOffset := builder.CreateString(t.JrkDecUnit) + velUnitOffset := flatbuffers.UOffsetT(0) + if t.VelUnit != "" { + velUnitOffset = builder.CreateString(t.VelUnit) + } + accUnitOffset := flatbuffers.UOffsetT(0) + if t.AccUnit != "" { + accUnitOffset = builder.CreateString(t.AccUnit) + } + decUnitOffset := flatbuffers.UOffsetT(0) + if t.DecUnit != "" { + decUnitOffset = builder.CreateString(t.DecUnit) + } + jrkAccUnitOffset := flatbuffers.UOffsetT(0) + if t.JrkAccUnit != "" { + jrkAccUnitOffset = builder.CreateString(t.JrkAccUnit) + } + jrkDecUnitOffset := flatbuffers.UOffsetT(0) + if t.JrkDecUnit != "" { + jrkDecUnitOffset = builder.CreateString(t.JrkDecUnit) + } DynamicLimitsStateStart(builder) DynamicLimitsStateAddVel(builder, t.Vel) DynamicLimitsStateAddAcc(builder, t.Acc) diff --git a/pkg/fbs/motion/core/fbtypes/FeedGroupSettings.go b/pkg/fbs/motion/core/fbtypes/FeedGroupSettings.go index f0a0287..2922e6c 100644 --- a/pkg/fbs/motion/core/fbtypes/FeedGroupSettings.go +++ b/pkg/fbs/motion/core/fbtypes/FeedGroupSettings.go @@ -7,7 +7,7 @@ import ( ) type FeedGroupSettingsT struct { - Type FeedGroup + Type FeedGroup `json:"type"` } func (t *FeedGroupSettingsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/IpoAddData.go b/pkg/fbs/motion/core/fbtypes/IpoAddData.go index 661ca98..56b4b71 100644 --- a/pkg/fbs/motion/core/fbtypes/IpoAddData.go +++ b/pkg/fbs/motion/core/fbtypes/IpoAddData.go @@ -8,22 +8,34 @@ import ( /// currently interpolated values type IpoAddDataT struct { - DistFromStart float64 - DistToTarget float64 - TimeFromStart float64 - TimeToTarget float64 - DistFromStartUnit string - DistToTargetUnit string - TimeFromStartUnit string - TimeToTargetUnit string + DistFromStart float64 `json:"distFromStart"` + DistToTarget float64 `json:"distToTarget"` + TimeFromStart float64 `json:"timeFromStart"` + TimeToTarget float64 `json:"timeToTarget"` + DistFromStartUnit string `json:"distFromStartUnit"` + DistToTargetUnit string `json:"distToTargetUnit"` + TimeFromStartUnit string `json:"timeFromStartUnit"` + TimeToTargetUnit string `json:"timeToTargetUnit"` } func (t *IpoAddDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - distFromStartUnitOffset := builder.CreateString(t.DistFromStartUnit) - distToTargetUnitOffset := builder.CreateString(t.DistToTargetUnit) - timeFromStartUnitOffset := builder.CreateString(t.TimeFromStartUnit) - timeToTargetUnitOffset := builder.CreateString(t.TimeToTargetUnit) + distFromStartUnitOffset := flatbuffers.UOffsetT(0) + if t.DistFromStartUnit != "" { + distFromStartUnitOffset = builder.CreateString(t.DistFromStartUnit) + } + distToTargetUnitOffset := flatbuffers.UOffsetT(0) + if t.DistToTargetUnit != "" { + distToTargetUnitOffset = builder.CreateString(t.DistToTargetUnit) + } + timeFromStartUnitOffset := flatbuffers.UOffsetT(0) + if t.TimeFromStartUnit != "" { + timeFromStartUnitOffset = builder.CreateString(t.TimeFromStartUnit) + } + timeToTargetUnitOffset := flatbuffers.UOffsetT(0) + if t.TimeToTargetUnit != "" { + timeToTargetUnitOffset = builder.CreateString(t.TimeToTargetUnit) + } IpoAddDataStart(builder) IpoAddDataAddDistFromStart(builder, t.DistFromStart) IpoAddDataAddDistToTarget(builder, t.DistToTarget) diff --git a/pkg/fbs/motion/core/fbtypes/KinActualValues.go b/pkg/fbs/motion/core/fbtypes/KinActualValues.go index 66e56a5..3f393da 100644 --- a/pkg/fbs/motion/core/fbtypes/KinActualValues.go +++ b/pkg/fbs/motion/core/fbtypes/KinActualValues.go @@ -8,14 +8,14 @@ import ( /// actual values of the kinematics type KinActualValuesT struct { - ActualPos []float64 - ActualVel float64 - ActualAcc float64 - ActualJerk float64 - ActualPosUnit []string - ActualVelUnit string - ActualAccUnit string - ActualJerkUnit string + ActualPos []float64 `json:"actualPos"` + ActualVel float64 `json:"actualVel"` + ActualAcc float64 `json:"actualAcc"` + ActualJerk float64 `json:"actualJerk"` + ActualPosUnit []string `json:"actualPosUnit"` + ActualVelUnit string `json:"actualVelUnit"` + ActualAccUnit string `json:"actualAccUnit"` + ActualJerkUnit string `json:"actualJerkUnit"` } func (t *KinActualValuesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -42,9 +42,18 @@ func (t *KinActualValuesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffse } actualPosUnitOffset = builder.EndVector(actualPosUnitLength) } - actualVelUnitOffset := builder.CreateString(t.ActualVelUnit) - actualAccUnitOffset := builder.CreateString(t.ActualAccUnit) - actualJerkUnitOffset := builder.CreateString(t.ActualJerkUnit) + actualVelUnitOffset := flatbuffers.UOffsetT(0) + if t.ActualVelUnit != "" { + actualVelUnitOffset = builder.CreateString(t.ActualVelUnit) + } + actualAccUnitOffset := flatbuffers.UOffsetT(0) + if t.ActualAccUnit != "" { + actualAccUnitOffset = builder.CreateString(t.ActualAccUnit) + } + actualJerkUnitOffset := flatbuffers.UOffsetT(0) + if t.ActualJerkUnit != "" { + actualJerkUnitOffset = builder.CreateString(t.ActualJerkUnit) + } KinActualValuesStart(builder) KinActualValuesAddActualPos(builder, actualPosOffset) KinActualValuesAddActualVel(builder, t.ActualVel) diff --git a/pkg/fbs/motion/core/fbtypes/KinAxsAll.go b/pkg/fbs/motion/core/fbtypes/KinAxsAll.go index 28a4811..e9c217d 100644 --- a/pkg/fbs/motion/core/fbtypes/KinAxsAll.go +++ b/pkg/fbs/motion/core/fbtypes/KinAxsAll.go @@ -8,7 +8,7 @@ import ( /// Data of all axes that are currently added to the kinematics type KinAxsAllT struct { - Info []*KinAxsSingleT + Info []*KinAxsSingleT `json:"info"` } func (t *KinAxsAllT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -88,6 +88,15 @@ func (rcv *KinAxsAll) Info(obj *KinAxsSingle, j int) bool { return false } +func (rcv *KinAxsAll) InfoByKey(obj *KinAxsSingle, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *KinAxsAll) InfoLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) if o != 0 { diff --git a/pkg/fbs/motion/core/fbtypes/KinAxsSingle.go b/pkg/fbs/motion/core/fbtypes/KinAxsSingle.go index 4b66125..e502fba 100644 --- a/pkg/fbs/motion/core/fbtypes/KinAxsSingle.go +++ b/pkg/fbs/motion/core/fbtypes/KinAxsSingle.go @@ -3,22 +3,32 @@ package fbtypes import ( + "bytes" flatbuffers "github.com/google/flatbuffers/go" ) /// informations of an axis that is part of a kinematics type KinAxsSingleT struct { - Meaning string - Name string - Dir string - AcsIndex byte + Meaning string `json:"meaning"` + Name string `json:"name"` + Dir string `json:"dir"` + AcsIndex byte `json:"acsIndex"` } func (t *KinAxsSingleT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - meaningOffset := builder.CreateString(t.Meaning) - nameOffset := builder.CreateString(t.Name) - dirOffset := builder.CreateString(t.Dir) + meaningOffset := flatbuffers.UOffsetT(0) + if t.Meaning != "" { + meaningOffset = builder.CreateString(t.Meaning) + } + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + dirOffset := flatbuffers.UOffsetT(0) + if t.Dir != "" { + dirOffset = builder.CreateString(t.Dir) + } KinAxsSingleStart(builder) KinAxsSingleAddMeaning(builder, meaningOffset) KinAxsSingleAddName(builder, nameOffset) @@ -78,6 +88,38 @@ func (rcv *KinAxsSingle) Meaning() []byte { } /// DEPRECATED; (geometric) meaning of the axis in the kinematics (only useful for simple Cartesian kinematics); use "acsIndex" for all other cases +func KinAxsSingleKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &KinAxsSingle{} + obj2 := &KinAxsSingle{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.Meaning()) < string(obj2.Meaning()) +} + +func (rcv *KinAxsSingle) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &KinAxsSingle{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.Meaning(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + /// name of the axis func (rcv *KinAxsSingle) Name() []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) diff --git a/pkg/fbs/motion/core/fbtypes/KinCfg.go b/pkg/fbs/motion/core/fbtypes/KinCfg.go index fe94876..330821d 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCfg.go +++ b/pkg/fbs/motion/core/fbtypes/KinCfg.go @@ -8,20 +8,23 @@ import ( /// complete configuration of a single kinematics type KinCfgT struct { - ObjectType string - Limits *KinCfgLimitsT - AxsCfg []*KinCfgAxsT - Mcs *KinCfgJntTrafoAllSetsT - Units *UnitCfgKinT - PrepLimits *KinCfgPrepLimitsT - RtInputs *RTInputsCfgT - Dynamics *KinCfgDynamicsT - Geometry *KinGeoCfgT + ObjectType string `json:"objectType"` + Limits *KinCfgLimitsT `json:"limits"` + AxsCfg []*KinCfgAxsT `json:"axsCfg"` + Mcs *KinCfgJntTrafoAllSetsT `json:"mcs"` + Units *UnitCfgKinT `json:"units"` + PrepLimits *KinCfgPrepLimitsT `json:"prepLimits"` + RtInputs *RTInputsCfgT `json:"rtInputs"` + Dynamics *KinCfgDynamicsT `json:"dynamics"` + Geometry *KinGeoCfgT `json:"geometry"` } func (t *KinCfgT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - objectTypeOffset := builder.CreateString(t.ObjectType) + objectTypeOffset := flatbuffers.UOffsetT(0) + if t.ObjectType != "" { + objectTypeOffset = builder.CreateString(t.ObjectType) + } limitsOffset := t.Limits.Pack(builder) axsCfgOffset := flatbuffers.UOffsetT(0) if t.AxsCfg != nil { diff --git a/pkg/fbs/motion/core/fbtypes/KinCfgAxs.go b/pkg/fbs/motion/core/fbtypes/KinCfgAxs.go index 492b6c3..c067ce5 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCfgAxs.go +++ b/pkg/fbs/motion/core/fbtypes/KinCfgAxs.go @@ -8,17 +8,26 @@ import ( /// configuration of an axis that can be added to a kinematics type KinCfgAxsT struct { - AxsName string - AxsMeaning string - AxsDir string - AcsIndex byte + AxsName string `json:"axsName"` + AxsMeaning string `json:"axsMeaning"` + AxsDir string `json:"axsDir"` + AcsIndex byte `json:"acsIndex"` } func (t *KinCfgAxsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - axsNameOffset := builder.CreateString(t.AxsName) - axsMeaningOffset := builder.CreateString(t.AxsMeaning) - axsDirOffset := builder.CreateString(t.AxsDir) + axsNameOffset := flatbuffers.UOffsetT(0) + if t.AxsName != "" { + axsNameOffset = builder.CreateString(t.AxsName) + } + axsMeaningOffset := flatbuffers.UOffsetT(0) + if t.AxsMeaning != "" { + axsMeaningOffset = builder.CreateString(t.AxsMeaning) + } + axsDirOffset := flatbuffers.UOffsetT(0) + if t.AxsDir != "" { + axsDirOffset = builder.CreateString(t.AxsDir) + } KinCfgAxsStart(builder) KinCfgAxsAddAxsName(builder, axsNameOffset) KinCfgAxsAddAxsMeaning(builder, axsMeaningOffset) diff --git a/pkg/fbs/motion/core/fbtypes/KinCfgDynamics.go b/pkg/fbs/motion/core/fbtypes/KinCfgDynamics.go index 9a488de..c2f609b 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCfgDynamics.go +++ b/pkg/fbs/motion/core/fbtypes/KinCfgDynamics.go @@ -8,7 +8,7 @@ import ( /// preparation limits for kinematics type KinCfgDynamicsT struct { - FeedGroup *FeedGroupSettingsT + FeedGroup *FeedGroupSettingsT `json:"feedGroup"` } func (t *KinCfgDynamicsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoAllParam.go b/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoAllParam.go index f1ef39a..49a72d7 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoAllParam.go +++ b/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoAllParam.go @@ -8,9 +8,9 @@ import ( /// configuration parameter of a single joint transformation type KinCfgJntTrafoAllParamT struct { - AxisAssignment *KinCfgJntTrafoAxisAssignmentT - Groups []*KinCfgJntTrafoParamGroupT - AxisOffsets *KinCfgJntTrafoAxisOffsetsT + AxisAssignment *KinCfgJntTrafoAxisAssignmentT `json:"axisAssignment"` + Groups []*KinCfgJntTrafoParamGroupT `json:"groups"` + AxisOffsets *KinCfgJntTrafoAxisOffsetsT `json:"axisOffsets"` } func (t *KinCfgJntTrafoAllParamT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoAllParamGrps.go b/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoAllParamGrps.go index 63daa71..0a73327 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoAllParamGrps.go +++ b/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoAllParamGrps.go @@ -8,7 +8,7 @@ import ( /// configuration parameter of a joint transformation type KinCfgJntTrafoAllParamGrpsT struct { - Groups []*KinCfgJntTrafoParamGroupT + Groups []*KinCfgJntTrafoParamGroupT `json:"groups"` } func (t *KinCfgJntTrafoAllParamGrpsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoAllSets.go b/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoAllSets.go index b487642..985f47c 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoAllSets.go +++ b/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoAllSets.go @@ -8,7 +8,7 @@ import ( /// configuration values of all joint transformation sets type KinCfgJntTrafoAllSetsT struct { - AxsTrafoSets []*KinCfgJntTrafoSetT + AxsTrafoSets []*KinCfgJntTrafoSetT `json:"axsTrafoSets"` } func (t *KinCfgJntTrafoAllSetsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoAxisAssignment.go b/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoAxisAssignment.go index 83133f6..a684dca 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoAxisAssignment.go +++ b/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoAxisAssignment.go @@ -8,7 +8,7 @@ import ( /// data of a all axis assignments for a joint transformation type KinCfgJntTrafoAxisAssignmentT struct { - Assignment []*KinCfgJntTrafoSingleAxisAssignmentT + Assignment []*KinCfgJntTrafoSingleAxisAssignmentT `json:"assignment"` } func (t *KinCfgJntTrafoAxisAssignmentT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoAxisOffsets.go b/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoAxisOffsets.go index 706511d..0e84bd7 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoAxisOffsets.go +++ b/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoAxisOffsets.go @@ -8,7 +8,7 @@ import ( /// data of a all axis zero point offsets for a joint transformation type KinCfgJntTrafoAxisOffsetsT struct { - Offsets []*KinCfgJntTrafoSingleAxisOffsetT + Offsets []*KinCfgJntTrafoSingleAxisOffsetT `json:"offsets"` } func (t *KinCfgJntTrafoAxisOffsetsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoParamGroup.go b/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoParamGroup.go index 0945c14..6883c56 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoParamGroup.go +++ b/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoParamGroup.go @@ -8,13 +8,16 @@ import ( /// configuration of a single parameter group of a joint transformation type KinCfgJntTrafoParamGroupT struct { - Name string - Param []*KinCfgJntTrafoSingleParamT + Name string `json:"name"` + Param []*KinCfgJntTrafoSingleParamT `json:"param"` } func (t *KinCfgJntTrafoParamGroupT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } paramOffset := flatbuffers.UOffsetT(0) if t.Param != nil { paramLength := len(t.Param) diff --git a/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoSet.go b/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoSet.go index febc06e..62bfa27 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoSet.go +++ b/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoSet.go @@ -8,15 +8,21 @@ import ( /// data of a single joint transformation set type KinCfgJntTrafoSetT struct { - Name string - JntTrafo string - Param *KinCfgJntTrafoAllParamT + Name string `json:"name"` + JntTrafo string `json:"jntTrafo"` + Param *KinCfgJntTrafoAllParamT `json:"param"` } func (t *KinCfgJntTrafoSetT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - jntTrafoOffset := builder.CreateString(t.JntTrafo) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + jntTrafoOffset := flatbuffers.UOffsetT(0) + if t.JntTrafo != "" { + jntTrafoOffset = builder.CreateString(t.JntTrafo) + } paramOffset := t.Param.Pack(builder) KinCfgJntTrafoSetStart(builder) KinCfgJntTrafoSetAddName(builder, nameOffset) diff --git a/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoSingleAxisAssignment.go b/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoSingleAxisAssignment.go index 9282ccf..f11d2ab 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoSingleAxisAssignment.go +++ b/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoSingleAxisAssignment.go @@ -8,22 +8,25 @@ import ( /// data of a single axis assignment for a joint transformation type KinCfgJntTrafoSingleAxisAssignmentT struct { - AxisName string - IndexACS byte + AxisName string `json:"axisName"` + IndexAcs byte `json:"indexACS"` } func (t *KinCfgJntTrafoSingleAxisAssignmentT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - axisNameOffset := builder.CreateString(t.AxisName) + axisNameOffset := flatbuffers.UOffsetT(0) + if t.AxisName != "" { + axisNameOffset = builder.CreateString(t.AxisName) + } KinCfgJntTrafoSingleAxisAssignmentStart(builder) KinCfgJntTrafoSingleAxisAssignmentAddAxisName(builder, axisNameOffset) - KinCfgJntTrafoSingleAxisAssignmentAddIndexACS(builder, t.IndexACS) + KinCfgJntTrafoSingleAxisAssignmentAddIndexAcs(builder, t.IndexAcs) return KinCfgJntTrafoSingleAxisAssignmentEnd(builder) } func (rcv *KinCfgJntTrafoSingleAxisAssignment) UnPackTo(t *KinCfgJntTrafoSingleAxisAssignmentT) { t.AxisName = string(rcv.AxisName()) - t.IndexACS = rcv.IndexACS() + t.IndexAcs = rcv.IndexAcs() } func (rcv *KinCfgJntTrafoSingleAxisAssignment) UnPack() *KinCfgJntTrafoSingleAxisAssignmentT { @@ -71,7 +74,7 @@ func (rcv *KinCfgJntTrafoSingleAxisAssignment) AxisName() []byte { /// axis name referring to the joint transformation /// index of the ACS array -func (rcv *KinCfgJntTrafoSingleAxisAssignment) IndexACS() byte { +func (rcv *KinCfgJntTrafoSingleAxisAssignment) IndexAcs() byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { return rcv._tab.GetByte(o + rcv._tab.Pos) @@ -80,7 +83,7 @@ func (rcv *KinCfgJntTrafoSingleAxisAssignment) IndexACS() byte { } /// index of the ACS array -func (rcv *KinCfgJntTrafoSingleAxisAssignment) MutateIndexACS(n byte) bool { +func (rcv *KinCfgJntTrafoSingleAxisAssignment) MutateIndexAcs(n byte) bool { return rcv._tab.MutateByteSlot(6, n) } @@ -90,8 +93,8 @@ func KinCfgJntTrafoSingleAxisAssignmentStart(builder *flatbuffers.Builder) { func KinCfgJntTrafoSingleAxisAssignmentAddAxisName(builder *flatbuffers.Builder, axisName flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(axisName), 0) } -func KinCfgJntTrafoSingleAxisAssignmentAddIndexACS(builder *flatbuffers.Builder, indexACS byte) { - builder.PrependByteSlot(1, indexACS, 0) +func KinCfgJntTrafoSingleAxisAssignmentAddIndexAcs(builder *flatbuffers.Builder, indexAcs byte) { + builder.PrependByteSlot(1, indexAcs, 0) } func KinCfgJntTrafoSingleAxisAssignmentEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() diff --git a/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoSingleAxisOffset.go b/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoSingleAxisOffset.go index 0ae194b..84e1773 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoSingleAxisOffset.go +++ b/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoSingleAxisOffset.go @@ -8,19 +8,27 @@ import ( /// data of a single axis zero point offset for a joint transformation type KinCfgJntTrafoSingleAxisOffsetT struct { - AxisName string - ZeroOffset float64 - ZeroOffsetUnit string + AxisName string `json:"axisName"` + ZeroOffset float64 `json:"zeroOffset"` + ZeroOffsetUnit string `json:"zeroOffsetUnit"` + Valid bool `json:"valid"` } func (t *KinCfgJntTrafoSingleAxisOffsetT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - axisNameOffset := builder.CreateString(t.AxisName) - zeroOffsetUnitOffset := builder.CreateString(t.ZeroOffsetUnit) + axisNameOffset := flatbuffers.UOffsetT(0) + if t.AxisName != "" { + axisNameOffset = builder.CreateString(t.AxisName) + } + zeroOffsetUnitOffset := flatbuffers.UOffsetT(0) + if t.ZeroOffsetUnit != "" { + zeroOffsetUnitOffset = builder.CreateString(t.ZeroOffsetUnit) + } KinCfgJntTrafoSingleAxisOffsetStart(builder) KinCfgJntTrafoSingleAxisOffsetAddAxisName(builder, axisNameOffset) KinCfgJntTrafoSingleAxisOffsetAddZeroOffset(builder, t.ZeroOffset) KinCfgJntTrafoSingleAxisOffsetAddZeroOffsetUnit(builder, zeroOffsetUnitOffset) + KinCfgJntTrafoSingleAxisOffsetAddValid(builder, t.Valid) return KinCfgJntTrafoSingleAxisOffsetEnd(builder) } @@ -28,6 +36,7 @@ func (rcv *KinCfgJntTrafoSingleAxisOffset) UnPackTo(t *KinCfgJntTrafoSingleAxisO t.AxisName = string(rcv.AxisName()) t.ZeroOffset = rcv.ZeroOffset() t.ZeroOffsetUnit = string(rcv.ZeroOffsetUnit()) + t.Valid = rcv.Valid() } func (rcv *KinCfgJntTrafoSingleAxisOffset) UnPack() *KinCfgJntTrafoSingleAxisOffsetT { @@ -100,8 +109,24 @@ func (rcv *KinCfgJntTrafoSingleAxisOffset) ZeroOffsetUnit() []byte { } /// unit of zero point offset +/// READ ONLY: indicates, if the information is valid; it can be invalid, when the axis with axisName does not exists; +/// then, the informations here can not be used (especially unit scaling relies on axis configuration) +func (rcv *KinCfgJntTrafoSingleAxisOffset) Valid() bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) + if o != 0 { + return rcv._tab.GetBool(o + rcv._tab.Pos) + } + return false +} + +/// READ ONLY: indicates, if the information is valid; it can be invalid, when the axis with axisName does not exists; +/// then, the informations here can not be used (especially unit scaling relies on axis configuration) +func (rcv *KinCfgJntTrafoSingleAxisOffset) MutateValid(n bool) bool { + return rcv._tab.MutateBoolSlot(10, n) +} + func KinCfgJntTrafoSingleAxisOffsetStart(builder *flatbuffers.Builder) { - builder.StartObject(3) + builder.StartObject(4) } func KinCfgJntTrafoSingleAxisOffsetAddAxisName(builder *flatbuffers.Builder, axisName flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(axisName), 0) @@ -112,6 +137,9 @@ func KinCfgJntTrafoSingleAxisOffsetAddZeroOffset(builder *flatbuffers.Builder, z func KinCfgJntTrafoSingleAxisOffsetAddZeroOffsetUnit(builder *flatbuffers.Builder, zeroOffsetUnit flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(zeroOffsetUnit), 0) } +func KinCfgJntTrafoSingleAxisOffsetAddValid(builder *flatbuffers.Builder, valid bool) { + builder.PrependBoolSlot(3, valid, false) +} func KinCfgJntTrafoSingleAxisOffsetEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() } diff --git a/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoSingleParam.go b/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoSingleParam.go index 28d6fef..5dc3ebf 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoSingleParam.go +++ b/pkg/fbs/motion/core/fbtypes/KinCfgJntTrafoSingleParam.go @@ -8,18 +8,27 @@ import ( /// configuration of a single parameter of a joint transformation type KinCfgJntTrafoSingleParamT struct { - Name string - ValueDouble float64 - ValueInt int64 - ValueString string - Unit string + Name string `json:"name"` + ValueDouble float64 `json:"valueDouble"` + ValueInt int64 `json:"valueInt"` + ValueString string `json:"valueString"` + Unit string `json:"unit"` } func (t *KinCfgJntTrafoSingleParamT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - valueStringOffset := builder.CreateString(t.ValueString) - unitOffset := builder.CreateString(t.Unit) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + valueStringOffset := flatbuffers.UOffsetT(0) + if t.ValueString != "" { + valueStringOffset = builder.CreateString(t.ValueString) + } + unitOffset := flatbuffers.UOffsetT(0) + if t.Unit != "" { + unitOffset = builder.CreateString(t.Unit) + } KinCfgJntTrafoSingleParamStart(builder) KinCfgJntTrafoSingleParamAddName(builder, nameOffset) KinCfgJntTrafoSingleParamAddValueDouble(builder, t.ValueDouble) diff --git a/pkg/fbs/motion/core/fbtypes/KinCfgLimits.go b/pkg/fbs/motion/core/fbtypes/KinCfgLimits.go index dfb91c2..b3dff08 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCfgLimits.go +++ b/pkg/fbs/motion/core/fbtypes/KinCfgLimits.go @@ -8,25 +8,40 @@ import ( /// all configured limits of this kinematics type KinCfgLimitsT struct { - Vel float64 - Acc float64 - Dec float64 - JrkAcc float64 - JrkDec float64 - VelUnit string - AccUnit string - DecUnit string - JrkAccUnit string - JrkDecUnit string + Vel float64 `json:"vel"` + Acc float64 `json:"acc"` + Dec float64 `json:"dec"` + JrkAcc float64 `json:"jrkAcc"` + JrkDec float64 `json:"jrkDec"` + VelUnit string `json:"velUnit"` + AccUnit string `json:"accUnit"` + DecUnit string `json:"decUnit"` + JrkAccUnit string `json:"jrkAccUnit"` + JrkDecUnit string `json:"jrkDecUnit"` } func (t *KinCfgLimitsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - velUnitOffset := builder.CreateString(t.VelUnit) - accUnitOffset := builder.CreateString(t.AccUnit) - decUnitOffset := builder.CreateString(t.DecUnit) - jrkAccUnitOffset := builder.CreateString(t.JrkAccUnit) - jrkDecUnitOffset := builder.CreateString(t.JrkDecUnit) + velUnitOffset := flatbuffers.UOffsetT(0) + if t.VelUnit != "" { + velUnitOffset = builder.CreateString(t.VelUnit) + } + accUnitOffset := flatbuffers.UOffsetT(0) + if t.AccUnit != "" { + accUnitOffset = builder.CreateString(t.AccUnit) + } + decUnitOffset := flatbuffers.UOffsetT(0) + if t.DecUnit != "" { + decUnitOffset = builder.CreateString(t.DecUnit) + } + jrkAccUnitOffset := flatbuffers.UOffsetT(0) + if t.JrkAccUnit != "" { + jrkAccUnitOffset = builder.CreateString(t.JrkAccUnit) + } + jrkDecUnitOffset := flatbuffers.UOffsetT(0) + if t.JrkDecUnit != "" { + jrkDecUnitOffset = builder.CreateString(t.JrkDecUnit) + } KinCfgLimitsStart(builder) KinCfgLimitsAddVel(builder, t.Vel) KinCfgLimitsAddAcc(builder, t.Acc) diff --git a/pkg/fbs/motion/core/fbtypes/KinCfgPrepLimits.go b/pkg/fbs/motion/core/fbtypes/KinCfgPrepLimits.go index 99456c5..55abf41 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCfgPrepLimits.go +++ b/pkg/fbs/motion/core/fbtypes/KinCfgPrepLimits.go @@ -8,7 +8,7 @@ import ( /// preparation limits for kinematics type KinCfgPrepLimitsT struct { - MaxCmdsInBuffer uint64 + MaxCmdsInBuffer uint64 `json:"maxCmdsInBuffer"` } func (t *KinCfgPrepLimitsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/KinCfgRotToLinConversion.go b/pkg/fbs/motion/core/fbtypes/KinCfgRotToLinConversion.go index 0d55873..e832d04 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCfgRotToLinConversion.go +++ b/pkg/fbs/motion/core/fbtypes/KinCfgRotToLinConversion.go @@ -8,15 +8,21 @@ import ( /// common configuration of orientation. Conversion factor for the relation between linear values and rotation values. type KinCfgRotToLinConversionT struct { - Factor float64 - UnitLin string - UnitRot string + Factor float64 `json:"factor"` + UnitLin string `json:"unit_lin"` + UnitRot string `json:"unit_rot"` } func (t *KinCfgRotToLinConversionT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - unitLinOffset := builder.CreateString(t.UnitLin) - unitRotOffset := builder.CreateString(t.UnitRot) + unitLinOffset := flatbuffers.UOffsetT(0) + if t.UnitLin != "" { + unitLinOffset = builder.CreateString(t.UnitLin) + } + unitRotOffset := flatbuffers.UOffsetT(0) + if t.UnitRot != "" { + unitRotOffset = builder.CreateString(t.UnitRot) + } KinCfgRotToLinConversionStart(builder) KinCfgRotToLinConversionAddFactor(builder, t.Factor) KinCfgRotToLinConversionAddUnitLin(builder, unitLinOffset) diff --git a/pkg/fbs/motion/core/fbtypes/KinCmdAbortData.go b/pkg/fbs/motion/core/fbtypes/KinCmdAbortData.go index a34717b..be1e016 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCmdAbortData.go +++ b/pkg/fbs/motion/core/fbtypes/KinCmdAbortData.go @@ -8,7 +8,7 @@ import ( /// Command data for kinAbort command and kinInterrupt command type KinCmdAbortDataT struct { - Type BrakeLimit + Type BrakeLimit `json:"type"` } func (t *KinCmdAbortDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/KinCmdContourData.go b/pkg/fbs/motion/core/fbtypes/KinCmdContourData.go index 4eeb3ef..263a232 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCmdContourData.go +++ b/pkg/fbs/motion/core/fbtypes/KinCmdContourData.go @@ -8,8 +8,8 @@ import ( /// parameters for the contour command for a kinematics type KinCmdContourDataT struct { - IsStart bool - PrepCmds uint32 + IsStart bool `json:"isStart"` + PrepCmds uint32 `json:"prepCmds"` } func (t *KinCmdContourDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/KinCmdJogData.go b/pkg/fbs/motion/core/fbtypes/KinCmdJogData.go index 0142c6f..25682c0 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCmdJogData.go +++ b/pkg/fbs/motion/core/fbtypes/KinCmdJogData.go @@ -8,10 +8,10 @@ import ( /// parameters for the jog commands for a kinematics type KinCmdJogDataT struct { - JogDir []float64 - CoordSys string - JogIncrement float64 - Lim *DynamicLimitsT + JogDir []float64 `json:"jogDir"` + CoordSys string `json:"coordSys"` + JogIncrement float64 `json:"jogIncrement"` + Lim *DynamicLimitsT `json:"lim"` } func (t *KinCmdJogDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -25,7 +25,10 @@ func (t *KinCmdJogDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT } jogDirOffset = builder.EndVector(jogDirLength) } - coordSysOffset := builder.CreateString(t.CoordSys) + coordSysOffset := flatbuffers.UOffsetT(0) + if t.CoordSys != "" { + coordSysOffset = builder.CreateString(t.CoordSys) + } limOffset := t.Lim.Pack(builder) KinCmdJogDataStart(builder) KinCmdJogDataAddJogDir(builder, jogDirOffset) diff --git a/pkg/fbs/motion/core/fbtypes/KinCmdMoveData.go b/pkg/fbs/motion/core/fbtypes/KinCmdMoveData.go index 98a138c..8761515 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCmdMoveData.go +++ b/pkg/fbs/motion/core/fbtypes/KinCmdMoveData.go @@ -8,10 +8,10 @@ import ( /// parameters for the move linear commands for a kinematics type KinCmdMoveDataT struct { - KinPos []float64 - CoordSys string - Lim *DynamicLimitsT - Buffered bool + KinPos []float64 `json:"kinPos"` + CoordSys string `json:"coordSys"` + Lim *DynamicLimitsT `json:"lim"` + Buffered bool `json:"buffered"` } func (t *KinCmdMoveDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -25,7 +25,10 @@ func (t *KinCmdMoveDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffset } kinPosOffset = builder.EndVector(kinPosLength) } - coordSysOffset := builder.CreateString(t.CoordSys) + coordSysOffset := flatbuffers.UOffsetT(0) + if t.CoordSys != "" { + coordSysOffset = builder.CreateString(t.CoordSys) + } limOffset := t.Lim.Pack(builder) KinCmdMoveDataStart(builder) KinCmdMoveDataAddKinPos(builder, kinPosOffset) diff --git a/pkg/fbs/motion/core/fbtypes/KinCmdMoveDirectAsyncData.go b/pkg/fbs/motion/core/fbtypes/KinCmdMoveDirectAsyncData.go index a2d0b1d..c22e3f5 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCmdMoveDirectAsyncData.go +++ b/pkg/fbs/motion/core/fbtypes/KinCmdMoveDirectAsyncData.go @@ -8,10 +8,10 @@ import ( /// parameters for the move direct asynchronous command for a kinematics type KinCmdMoveDirectAsyncDataT struct { - KinPos []float64 - CoordSys string - DynLimFactors *DynamicLimitsT - Buffered bool + KinPos []float64 `json:"kinPos"` + CoordSys string `json:"coordSys"` + DynLimFactors *DynamicLimitsT `json:"dynLimFactors"` + Buffered bool `json:"buffered"` } func (t *KinCmdMoveDirectAsyncDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -25,7 +25,10 @@ func (t *KinCmdMoveDirectAsyncDataT) Pack(builder *flatbuffers.Builder) flatbuff } kinPosOffset = builder.EndVector(kinPosLength) } - coordSysOffset := builder.CreateString(t.CoordSys) + coordSysOffset := flatbuffers.UOffsetT(0) + if t.CoordSys != "" { + coordSysOffset = builder.CreateString(t.CoordSys) + } dynLimFactorsOffset := t.DynLimFactors.Pack(builder) KinCmdMoveDirectAsyncDataStart(builder) KinCmdMoveDirectAsyncDataAddKinPos(builder, kinPosOffset) diff --git a/pkg/fbs/motion/core/fbtypes/KinCmdMoveDirectData.go b/pkg/fbs/motion/core/fbtypes/KinCmdMoveDirectData.go index acb23a2..a4c0b11 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCmdMoveDirectData.go +++ b/pkg/fbs/motion/core/fbtypes/KinCmdMoveDirectData.go @@ -8,9 +8,9 @@ import ( /// parameters for the move direct commands for a kinematics type KinCmdMoveDirectDataT struct { - KinPos []float64 - CoordSys string - Buffered bool + KinPos []float64 `json:"kinPos"` + CoordSys string `json:"coordSys"` + Buffered bool `json:"buffered"` } func (t *KinCmdMoveDirectDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -24,7 +24,10 @@ func (t *KinCmdMoveDirectDataT) Pack(builder *flatbuffers.Builder) flatbuffers.U } kinPosOffset = builder.EndVector(kinPosLength) } - coordSysOffset := builder.CreateString(t.CoordSys) + coordSysOffset := flatbuffers.UOffsetT(0) + if t.CoordSys != "" { + coordSysOffset = builder.CreateString(t.CoordSys) + } KinCmdMoveDirectDataStart(builder) KinCmdMoveDirectDataAddKinPos(builder, kinPosOffset) KinCmdMoveDirectDataAddCoordSys(builder, coordSysOffset) diff --git a/pkg/fbs/motion/core/fbtypes/KinCmdOptAxsDynLimData.go b/pkg/fbs/motion/core/fbtypes/KinCmdOptAxsDynLimData.go index e65332b..77595df 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCmdOptAxsDynLimData.go +++ b/pkg/fbs/motion/core/fbtypes/KinCmdOptAxsDynLimData.go @@ -8,13 +8,16 @@ import ( /// parameters for the command option SafeArea (monitoring of safe zones and work areas) for kinematics type KinCmdOptAxsDynLimDataT struct { - AxsName string - Lim *DynamicLimitsT + AxsName string `json:"axsName"` + Lim *DynamicLimitsT `json:"lim"` } func (t *KinCmdOptAxsDynLimDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - axsNameOffset := builder.CreateString(t.AxsName) + axsNameOffset := flatbuffers.UOffsetT(0) + if t.AxsName != "" { + axsNameOffset = builder.CreateString(t.AxsName) + } limOffset := t.Lim.Pack(builder) KinCmdOptAxsDynLimDataStart(builder) KinCmdOptAxsDynLimDataAddAxsName(builder, axsNameOffset) diff --git a/pkg/fbs/motion/core/fbtypes/KinCmdOptBlendData.go b/pkg/fbs/motion/core/fbtypes/KinCmdOptBlendData.go index d58e345..2ed1116 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCmdOptBlendData.go +++ b/pkg/fbs/motion/core/fbtypes/KinCmdOptBlendData.go @@ -8,14 +8,17 @@ import ( /// parameters for the command option blending for kinematics type KinCmdOptBlendDataT struct { - PermType string - Dist1 float64 - Dist2 float64 + PermType string `json:"permType"` + Dist1 float64 `json:"dist1"` + Dist2 float64 `json:"dist2"` } func (t *KinCmdOptBlendDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - permTypeOffset := builder.CreateString(t.PermType) + permTypeOffset := flatbuffers.UOffsetT(0) + if t.PermType != "" { + permTypeOffset = builder.CreateString(t.PermType) + } KinCmdOptBlendDataStart(builder) KinCmdOptBlendDataAddPermType(builder, permTypeOffset) KinCmdOptBlendDataAddDist1(builder, t.Dist1) @@ -79,7 +82,7 @@ func (rcv *KinCmdOptBlendData) Dist1() float64 { if o != 0 { return rcv._tab.GetFloat64(o + rcv._tab.Pos) } - return 0.0 + return 1.0 } /// distance D1 (refer to the manual, should be greater than zero) @@ -93,7 +96,7 @@ func (rcv *KinCmdOptBlendData) Dist2() float64 { if o != 0 { return rcv._tab.GetFloat64(o + rcv._tab.Pos) } - return 0.0 + return 1.0 } /// distance D2 (refer to the manual, should be greater than zero) @@ -108,10 +111,10 @@ func KinCmdOptBlendDataAddPermType(builder *flatbuffers.Builder, permType flatbu builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(permType), 0) } func KinCmdOptBlendDataAddDist1(builder *flatbuffers.Builder, dist1 float64) { - builder.PrependFloat64Slot(1, dist1, 0.0) + builder.PrependFloat64Slot(1, dist1, 1.0) } func KinCmdOptBlendDataAddDist2(builder *flatbuffers.Builder, dist2 float64) { - builder.PrependFloat64Slot(2, dist2, 0.0) + builder.PrependFloat64Slot(2, dist2, 1.0) } func KinCmdOptBlendDataEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() diff --git a/pkg/fbs/motion/core/fbtypes/KinCmdOptFeedGroupData.go b/pkg/fbs/motion/core/fbtypes/KinCmdOptFeedGroupData.go index 4a3339f..24ae685 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCmdOptFeedGroupData.go +++ b/pkg/fbs/motion/core/fbtypes/KinCmdOptFeedGroupData.go @@ -8,13 +8,16 @@ import ( /// parameters for the command option FeedGroup (modify the resulting path parameter based on a given feedGroup) for kinematics type KinCmdOptFeedGroupDataT struct { - PermType string - Type FeedGroup + PermType string `json:"permType"` + Type FeedGroup `json:"type"` } func (t *KinCmdOptFeedGroupDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - permTypeOffset := builder.CreateString(t.PermType) + permTypeOffset := flatbuffers.UOffsetT(0) + if t.PermType != "" { + permTypeOffset = builder.CreateString(t.PermType) + } KinCmdOptFeedGroupDataStart(builder) KinCmdOptFeedGroupDataAddPermType(builder, permTypeOffset) KinCmdOptFeedGroupDataAddType(builder, t.Type) diff --git a/pkg/fbs/motion/core/fbtypes/KinCmdOptMCSData.go b/pkg/fbs/motion/core/fbtypes/KinCmdOptMCSData.go index 37d10f4..f8ee3b1 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCmdOptMCSData.go +++ b/pkg/fbs/motion/core/fbtypes/KinCmdOptMCSData.go @@ -8,14 +8,20 @@ import ( /// parameters for the command option MCS (machine coordinate system a.k.a. joint transformation) for kinematics type KinCmdOptMCSDataT struct { - PermType string - SetName string + PermType string `json:"permType"` + SetName string `json:"setName"` } func (t *KinCmdOptMCSDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - permTypeOffset := builder.CreateString(t.PermType) - setNameOffset := builder.CreateString(t.SetName) + permTypeOffset := flatbuffers.UOffsetT(0) + if t.PermType != "" { + permTypeOffset = builder.CreateString(t.PermType) + } + setNameOffset := flatbuffers.UOffsetT(0) + if t.SetName != "" { + setNameOffset = builder.CreateString(t.SetName) + } KinCmdOptMCSDataStart(builder) KinCmdOptMCSDataAddPermType(builder, permTypeOffset) KinCmdOptMCSDataAddSetName(builder, setNameOffset) diff --git a/pkg/fbs/motion/core/fbtypes/KinCmdOptPCSData.go b/pkg/fbs/motion/core/fbtypes/KinCmdOptPCSData.go index 1231ac9..9d6af84 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCmdOptPCSData.go +++ b/pkg/fbs/motion/core/fbtypes/KinCmdOptPCSData.go @@ -8,14 +8,20 @@ import ( /// parameters for the command option PCS (product coordinate system) for kinematics type KinCmdOptPCSDataT struct { - PermType string - SetName string + PermType string `json:"permType"` + SetName string `json:"setName"` } func (t *KinCmdOptPCSDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - permTypeOffset := builder.CreateString(t.PermType) - setNameOffset := builder.CreateString(t.SetName) + permTypeOffset := flatbuffers.UOffsetT(0) + if t.PermType != "" { + permTypeOffset = builder.CreateString(t.PermType) + } + setNameOffset := flatbuffers.UOffsetT(0) + if t.SetName != "" { + setNameOffset = builder.CreateString(t.SetName) + } KinCmdOptPCSDataStart(builder) KinCmdOptPCSDataAddPermType(builder, permTypeOffset) KinCmdOptPCSDataAddSetName(builder, setNameOffset) diff --git a/pkg/fbs/motion/core/fbtypes/KinCmdOptPolyTransData.go b/pkg/fbs/motion/core/fbtypes/KinCmdOptPolyTransData.go index 3656113..9532dd5 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCmdOptPolyTransData.go +++ b/pkg/fbs/motion/core/fbtypes/KinCmdOptPolyTransData.go @@ -8,15 +8,18 @@ import ( /// parameters for the command option PolyTrans (inserting polynomial commands between successively move commands) for kinematics type KinCmdOptPolyTransDataT struct { - PermType string - Dist1 float64 - Dist2 float64 - Eps float64 + PermType string `json:"permType"` + Dist1 float64 `json:"dist1"` + Dist2 float64 `json:"dist2"` + Eps float64 `json:"eps"` } func (t *KinCmdOptPolyTransDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - permTypeOffset := builder.CreateString(t.PermType) + permTypeOffset := flatbuffers.UOffsetT(0) + if t.PermType != "" { + permTypeOffset = builder.CreateString(t.PermType) + } KinCmdOptPolyTransDataStart(builder) KinCmdOptPolyTransDataAddPermType(builder, permTypeOffset) KinCmdOptPolyTransDataAddDist1(builder, t.Dist1) @@ -83,7 +86,7 @@ func (rcv *KinCmdOptPolyTransData) Dist1() float64 { if o != 0 { return rcv._tab.GetFloat64(o + rcv._tab.Pos) } - return 0.0 + return 1.0 } /// optional distance D1 (distance to shorten the start of the precorner, must be greater than zero) @@ -99,7 +102,7 @@ func (rcv *KinCmdOptPolyTransData) Dist2() float64 { if o != 0 { return rcv._tab.GetFloat64(o + rcv._tab.Pos) } - return 0.0 + return 1.0 } /// optional distance D2 (distance to shorten the start of the postcorner, must be greater than zero) @@ -131,10 +134,10 @@ func KinCmdOptPolyTransDataAddPermType(builder *flatbuffers.Builder, permType fl builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(permType), 0) } func KinCmdOptPolyTransDataAddDist1(builder *flatbuffers.Builder, dist1 float64) { - builder.PrependFloat64Slot(1, dist1, 0.0) + builder.PrependFloat64Slot(1, dist1, 1.0) } func KinCmdOptPolyTransDataAddDist2(builder *flatbuffers.Builder, dist2 float64) { - builder.PrependFloat64Slot(2, dist2, 0.0) + builder.PrependFloat64Slot(2, dist2, 1.0) } func KinCmdOptPolyTransDataAddEps(builder *flatbuffers.Builder, eps float64) { builder.PrependFloat64Slot(3, eps, 0.0) diff --git a/pkg/fbs/motion/core/fbtypes/KinCmdOptSafeAreaData.go b/pkg/fbs/motion/core/fbtypes/KinCmdOptSafeAreaData.go index e26bb21..bfd3705 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCmdOptSafeAreaData.go +++ b/pkg/fbs/motion/core/fbtypes/KinCmdOptSafeAreaData.go @@ -8,14 +8,20 @@ import ( /// parameters for the command option SafeArea (monitoring of safe zones and work areas) for kinematics type KinCmdOptSafeAreaDataT struct { - PermType string - SafeArea string + PermType string `json:"permType"` + SafeArea string `json:"safeArea"` } func (t *KinCmdOptSafeAreaDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - permTypeOffset := builder.CreateString(t.PermType) - safeAreaOffset := builder.CreateString(t.SafeArea) + permTypeOffset := flatbuffers.UOffsetT(0) + if t.PermType != "" { + permTypeOffset = builder.CreateString(t.PermType) + } + safeAreaOffset := flatbuffers.UOffsetT(0) + if t.SafeArea != "" { + safeAreaOffset = builder.CreateString(t.SafeArea) + } KinCmdOptSafeAreaDataStart(builder) KinCmdOptSafeAreaDataAddPermType(builder, permTypeOffset) KinCmdOptSafeAreaDataAddSafeArea(builder, safeAreaOffset) diff --git a/pkg/fbs/motion/core/fbtypes/KinCmdValues.go b/pkg/fbs/motion/core/fbtypes/KinCmdValues.go index 5874f8e..f748a42 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCmdValues.go +++ b/pkg/fbs/motion/core/fbtypes/KinCmdValues.go @@ -8,11 +8,11 @@ import ( /// parameters and data of the active command type KinCmdValuesT struct { - TargetPos []float64 - Lim *DynamicLimitsStateT - CoordSys string - CmdId uint64 - Src *CmdSourceT + TargetPos []float64 `json:"targetPos"` + Lim *DynamicLimitsStateT `json:"lim"` + CoordSys string `json:"coordSys"` + CmdId uint64 `json:"cmdId"` + Src *CmdSourceT `json:"src"` } func (t *KinCmdValuesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -27,7 +27,10 @@ func (t *KinCmdValuesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT targetPosOffset = builder.EndVector(targetPosLength) } limOffset := t.Lim.Pack(builder) - coordSysOffset := builder.CreateString(t.CoordSys) + coordSysOffset := flatbuffers.UOffsetT(0) + if t.CoordSys != "" { + coordSysOffset = builder.CreateString(t.CoordSys) + } srcOffset := t.Src.Pack(builder) KinCmdValuesStart(builder) KinCmdValuesAddTargetPos(builder, targetPosOffset) diff --git a/pkg/fbs/motion/core/fbtypes/KinCoordTransform.go b/pkg/fbs/motion/core/fbtypes/KinCoordTransform.go index 0727763..0b3df25 100644 --- a/pkg/fbs/motion/core/fbtypes/KinCoordTransform.go +++ b/pkg/fbs/motion/core/fbtypes/KinCoordTransform.go @@ -8,10 +8,10 @@ import ( /// coordinate transformation based on the currently active transformations of the kinematics type KinCoordTransformT struct { - InPos []float64 - InCoordSys string - OutPos []float64 - OutCoordSys string + InPos []float64 `json:"inPos"` + InCoordSys string `json:"inCoordSys"` + OutPos []float64 `json:"outPos"` + OutCoordSys string `json:"outCoordSys"` } func (t *KinCoordTransformT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -25,7 +25,10 @@ func (t *KinCoordTransformT) Pack(builder *flatbuffers.Builder) flatbuffers.UOff } inPosOffset = builder.EndVector(inPosLength) } - inCoordSysOffset := builder.CreateString(t.InCoordSys) + inCoordSysOffset := flatbuffers.UOffsetT(0) + if t.InCoordSys != "" { + inCoordSysOffset = builder.CreateString(t.InCoordSys) + } outPosOffset := flatbuffers.UOffsetT(0) if t.OutPos != nil { outPosLength := len(t.OutPos) @@ -35,7 +38,10 @@ func (t *KinCoordTransformT) Pack(builder *flatbuffers.Builder) flatbuffers.UOff } outPosOffset = builder.EndVector(outPosLength) } - outCoordSysOffset := builder.CreateString(t.OutCoordSys) + outCoordSysOffset := flatbuffers.UOffsetT(0) + if t.OutCoordSys != "" { + outCoordSysOffset = builder.CreateString(t.OutCoordSys) + } KinCoordTransformStart(builder) KinCoordTransformAddInPos(builder, inPosOffset) KinCoordTransformAddInCoordSys(builder, inCoordSysOffset) diff --git a/pkg/fbs/motion/core/fbtypes/KinGeoCfg.go b/pkg/fbs/motion/core/fbtypes/KinGeoCfg.go index 49df6dd..9e61444 100644 --- a/pkg/fbs/motion/core/fbtypes/KinGeoCfg.go +++ b/pkg/fbs/motion/core/fbtypes/KinGeoCfg.go @@ -8,19 +8,23 @@ import ( /// common configuration of orientation type KinGeoCfgT struct { - Orientation *KinOriCfgT + Orientation *KinOriCfgT `json:"orientation"` + Singularity *KinCfgSingularityT `json:"singularity"` } func (t *KinGeoCfgT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } orientationOffset := t.Orientation.Pack(builder) + singularityOffset := t.Singularity.Pack(builder) KinGeoCfgStart(builder) KinGeoCfgAddOrientation(builder, orientationOffset) + KinGeoCfgAddSingularity(builder, singularityOffset) return KinGeoCfgEnd(builder) } func (rcv *KinGeoCfg) UnPackTo(t *KinGeoCfgT) { t.Orientation = rcv.Orientation(nil).UnPack() + t.Singularity = rcv.Singularity(nil).UnPack() } func (rcv *KinGeoCfg) UnPack() *KinGeoCfgT { @@ -72,12 +76,30 @@ func (rcv *KinGeoCfg) Orientation(obj *KinOriCfg) *KinOriCfg { } /// orientation config +/// configuration for singularity handling +func (rcv *KinGeoCfg) Singularity(obj *KinCfgSingularity) *KinCfgSingularity { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + x := rcv._tab.Indirect(o + rcv._tab.Pos) + if obj == nil { + obj = new(KinCfgSingularity) + } + obj.Init(rcv._tab.Bytes, x) + return obj + } + return nil +} + +/// configuration for singularity handling func KinGeoCfgStart(builder *flatbuffers.Builder) { - builder.StartObject(1) + builder.StartObject(2) } func KinGeoCfgAddOrientation(builder *flatbuffers.Builder, orientation flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(orientation), 0) } +func KinGeoCfgAddSingularity(builder *flatbuffers.Builder, singularity flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(singularity), 0) +} func KinGeoCfgEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() } diff --git a/pkg/fbs/motion/core/fbtypes/KinIpoValues.go b/pkg/fbs/motion/core/fbtypes/KinIpoValues.go index 85b673f..29db418 100644 --- a/pkg/fbs/motion/core/fbtypes/KinIpoValues.go +++ b/pkg/fbs/motion/core/fbtypes/KinIpoValues.go @@ -8,14 +8,14 @@ import ( /// currently interpolated values type KinIpoValuesT struct { - IpoPos []float64 - IpoVel float64 - IpoAcc float64 - IpoJrk float64 - IpoPosUnits []string - IpoVelUnits string - IpoAccUnits string - IpoJrkUnits string + IpoPos []float64 `json:"ipoPos"` + IpoVel float64 `json:"ipoVel"` + IpoAcc float64 `json:"ipoAcc"` + IpoJrk float64 `json:"ipoJrk"` + IpoPosUnits []string `json:"ipoPosUnits"` + IpoVelUnits string `json:"ipoVelUnits"` + IpoAccUnits string `json:"ipoAccUnits"` + IpoJrkUnits string `json:"ipoJrkUnits"` } func (t *KinIpoValuesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -42,9 +42,18 @@ func (t *KinIpoValuesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT } ipoPosUnitsOffset = builder.EndVector(ipoPosUnitsLength) } - ipoVelUnitsOffset := builder.CreateString(t.IpoVelUnits) - ipoAccUnitsOffset := builder.CreateString(t.IpoAccUnits) - ipoJrkUnitsOffset := builder.CreateString(t.IpoJrkUnits) + ipoVelUnitsOffset := flatbuffers.UOffsetT(0) + if t.IpoVelUnits != "" { + ipoVelUnitsOffset = builder.CreateString(t.IpoVelUnits) + } + ipoAccUnitsOffset := flatbuffers.UOffsetT(0) + if t.IpoAccUnits != "" { + ipoAccUnitsOffset = builder.CreateString(t.IpoAccUnits) + } + ipoJrkUnitsOffset := flatbuffers.UOffsetT(0) + if t.IpoJrkUnits != "" { + ipoJrkUnitsOffset = builder.CreateString(t.IpoJrkUnits) + } KinIpoValuesStart(builder) KinIpoValuesAddIpoPos(builder, ipoPosOffset) KinIpoValuesAddIpoVel(builder, t.IpoVel) diff --git a/pkg/fbs/motion/core/fbtypes/KinOriCfg.go b/pkg/fbs/motion/core/fbtypes/KinOriCfg.go index d166bc3..9f88063 100644 --- a/pkg/fbs/motion/core/fbtypes/KinOriCfg.go +++ b/pkg/fbs/motion/core/fbtypes/KinOriCfg.go @@ -8,10 +8,10 @@ import ( /// common configuration of orientation type KinOriCfgT struct { - EffectiveRadius *KinOriRadiusT - Lim *KinCfgLimitsT - Units *UnitCfgObjT - RotToLinConversion *KinCfgRotToLinConversionT + EffectiveRadius *KinOriRadiusT `json:"effective_radius"` + Lim *KinCfgLimitsT `json:"lim"` + Units *UnitCfgObjT `json:"units"` + RotToLinConversion *KinCfgRotToLinConversionT `json:"rotToLinConversion"` } func (t *KinOriCfgT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/KinOriRadius.go b/pkg/fbs/motion/core/fbtypes/KinOriRadius.go index 7bd6472..6aa16a1 100644 --- a/pkg/fbs/motion/core/fbtypes/KinOriRadius.go +++ b/pkg/fbs/motion/core/fbtypes/KinOriRadius.go @@ -9,15 +9,21 @@ import ( /// DEPRECATED; Do not use! Values in this structure are ignored. /// common configuration of orientation. Effective radius as factor for the relation between position to orientation. type KinOriRadiusT struct { - Radius float64 - UnitLin string - UnitRot string + Radius float64 `json:"radius"` + UnitLin string `json:"unit_lin"` + UnitRot string `json:"unit_rot"` } func (t *KinOriRadiusT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - unitLinOffset := builder.CreateString(t.UnitLin) - unitRotOffset := builder.CreateString(t.UnitRot) + unitLinOffset := flatbuffers.UOffsetT(0) + if t.UnitLin != "" { + unitLinOffset = builder.CreateString(t.UnitLin) + } + unitRotOffset := flatbuffers.UOffsetT(0) + if t.UnitRot != "" { + unitRotOffset = builder.CreateString(t.UnitRot) + } KinOriRadiusStart(builder) KinOriRadiusAddRadius(builder, t.Radius) KinOriRadiusAddUnitLin(builder, unitLinOffset) diff --git a/pkg/fbs/motion/core/fbtypes/KinPosValues.go b/pkg/fbs/motion/core/fbtypes/KinPosValues.go index faa9c6a..9d0100c 100644 --- a/pkg/fbs/motion/core/fbtypes/KinPosValues.go +++ b/pkg/fbs/motion/core/fbtypes/KinPosValues.go @@ -8,8 +8,8 @@ import ( /// position of a kinematics type KinPosValuesT struct { - Pos []float64 - Units []string + Pos []float64 `json:"pos"` + Units []string `json:"units"` } func (t *KinPosValuesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/KinStateJntTrafoData.go b/pkg/fbs/motion/core/fbtypes/KinStateJntTrafoData.go index b7308df..d4f7b6d 100644 --- a/pkg/fbs/motion/core/fbtypes/KinStateJntTrafoData.go +++ b/pkg/fbs/motion/core/fbtypes/KinStateJntTrafoData.go @@ -8,7 +8,7 @@ import ( /// data of all registered joint transformations when reading all data of implemented joint transformations type KinStateJntTrafoDataT struct { - JntTrafoData []*KinStateJntTrafoDataSingleT + JntTrafoData []*KinStateJntTrafoDataSingleT `json:"jntTrafoData"` } func (t *KinStateJntTrafoDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/KinStateJntTrafoDataAllParam.go b/pkg/fbs/motion/core/fbtypes/KinStateJntTrafoDataAllParam.go index 053c05c..a4bce26 100644 --- a/pkg/fbs/motion/core/fbtypes/KinStateJntTrafoDataAllParam.go +++ b/pkg/fbs/motion/core/fbtypes/KinStateJntTrafoDataAllParam.go @@ -8,8 +8,8 @@ import ( /// data of a single configuration parameter of an joint transformation when reading all data of an implemented joint transformation type KinStateJntTrafoDataAllParamT struct { - ReqAxes []*KinStateJntTrafoDataReqAxisT - Parameter []*KinStateJntTrafoDataParamT + ReqAxes []*KinStateJntTrafoDataReqAxisT `json:"reqAxes"` + Parameter []*KinStateJntTrafoDataParamT `json:"parameter"` } func (t *KinStateJntTrafoDataAllParamT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/KinStateJntTrafoDataParam.go b/pkg/fbs/motion/core/fbtypes/KinStateJntTrafoDataParam.go index ea597e6..c5c6fca 100644 --- a/pkg/fbs/motion/core/fbtypes/KinStateJntTrafoDataParam.go +++ b/pkg/fbs/motion/core/fbtypes/KinStateJntTrafoDataParam.go @@ -8,26 +8,49 @@ import ( /// data of a single configuration parameter of a joint transformation when reading all data of an implemented joint transformation type KinStateJntTrafoDataParamT struct { - Name string - Description string - Image string - DocRef string - Group string - UnitValueType string - UnitObjType string - Values []string - Type VarType + Name string `json:"name"` + Description string `json:"description"` + Image string `json:"image"` + DocRef string `json:"docRef"` + Group string `json:"group"` + UnitValueType string `json:"unitValueType"` + UnitObjType string `json:"unitObjType"` + Values []string `json:"values"` + Type VarType `json:"type"` + Mandatory bool `json:"mandatory"` + Subgroup string `json:"subgroup"` } func (t *KinStateJntTrafoDataParamT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - descriptionOffset := builder.CreateString(t.Description) - imageOffset := builder.CreateString(t.Image) - docRefOffset := builder.CreateString(t.DocRef) - groupOffset := builder.CreateString(t.Group) - unitValueTypeOffset := builder.CreateString(t.UnitValueType) - unitObjTypeOffset := builder.CreateString(t.UnitObjType) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + descriptionOffset := flatbuffers.UOffsetT(0) + if t.Description != "" { + descriptionOffset = builder.CreateString(t.Description) + } + imageOffset := flatbuffers.UOffsetT(0) + if t.Image != "" { + imageOffset = builder.CreateString(t.Image) + } + docRefOffset := flatbuffers.UOffsetT(0) + if t.DocRef != "" { + docRefOffset = builder.CreateString(t.DocRef) + } + groupOffset := flatbuffers.UOffsetT(0) + if t.Group != "" { + groupOffset = builder.CreateString(t.Group) + } + unitValueTypeOffset := flatbuffers.UOffsetT(0) + if t.UnitValueType != "" { + unitValueTypeOffset = builder.CreateString(t.UnitValueType) + } + unitObjTypeOffset := flatbuffers.UOffsetT(0) + if t.UnitObjType != "" { + unitObjTypeOffset = builder.CreateString(t.UnitObjType) + } valuesOffset := flatbuffers.UOffsetT(0) if t.Values != nil { valuesLength := len(t.Values) @@ -41,6 +64,10 @@ func (t *KinStateJntTrafoDataParamT) Pack(builder *flatbuffers.Builder) flatbuff } valuesOffset = builder.EndVector(valuesLength) } + subgroupOffset := flatbuffers.UOffsetT(0) + if t.Subgroup != "" { + subgroupOffset = builder.CreateString(t.Subgroup) + } KinStateJntTrafoDataParamStart(builder) KinStateJntTrafoDataParamAddName(builder, nameOffset) KinStateJntTrafoDataParamAddDescription(builder, descriptionOffset) @@ -51,6 +78,8 @@ func (t *KinStateJntTrafoDataParamT) Pack(builder *flatbuffers.Builder) flatbuff KinStateJntTrafoDataParamAddUnitObjType(builder, unitObjTypeOffset) KinStateJntTrafoDataParamAddValues(builder, valuesOffset) KinStateJntTrafoDataParamAddType(builder, t.Type) + KinStateJntTrafoDataParamAddMandatory(builder, t.Mandatory) + KinStateJntTrafoDataParamAddSubgroup(builder, subgroupOffset) return KinStateJntTrafoDataParamEnd(builder) } @@ -68,6 +97,8 @@ func (rcv *KinStateJntTrafoDataParam) UnPackTo(t *KinStateJntTrafoDataParamT) { t.Values[j] = string(rcv.Values(j)) } t.Type = rcv.Type() + t.Mandatory = rcv.Mandatory() + t.Subgroup = string(rcv.Subgroup()) } func (rcv *KinStateJntTrafoDataParam) UnPack() *KinStateJntTrafoDataParamT { @@ -207,8 +238,32 @@ func (rcv *KinStateJntTrafoDataParam) MutateType(n VarType) bool { return rcv._tab.MutateInt8Slot(20, int8(n)) } +/// Is this parameter mandatory? +func (rcv *KinStateJntTrafoDataParam) Mandatory() bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(22)) + if o != 0 { + return rcv._tab.GetBool(o + rcv._tab.Pos) + } + return true +} + +/// Is this parameter mandatory? +func (rcv *KinStateJntTrafoDataParam) MutateMandatory(n bool) bool { + return rcv._tab.MutateBoolSlot(22, n) +} + +/// SubGroup of the parameter (for advanced grouping in the HMI) +func (rcv *KinStateJntTrafoDataParam) Subgroup() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(24)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// SubGroup of the parameter (for advanced grouping in the HMI) func KinStateJntTrafoDataParamStart(builder *flatbuffers.Builder) { - builder.StartObject(9) + builder.StartObject(11) } func KinStateJntTrafoDataParamAddName(builder *flatbuffers.Builder, name flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(name), 0) @@ -240,6 +295,12 @@ func KinStateJntTrafoDataParamStartValuesVector(builder *flatbuffers.Builder, nu func KinStateJntTrafoDataParamAddType(builder *flatbuffers.Builder, type_ VarType) { builder.PrependInt8Slot(8, int8(type_), 1) } +func KinStateJntTrafoDataParamAddMandatory(builder *flatbuffers.Builder, mandatory bool) { + builder.PrependBoolSlot(9, mandatory, true) +} +func KinStateJntTrafoDataParamAddSubgroup(builder *flatbuffers.Builder, subgroup flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(10, flatbuffers.UOffsetT(subgroup), 0) +} func KinStateJntTrafoDataParamEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() } diff --git a/pkg/fbs/motion/core/fbtypes/KinStateJntTrafoDataReqAxis.go b/pkg/fbs/motion/core/fbtypes/KinStateJntTrafoDataReqAxis.go index 2f8ec84..d60be46 100644 --- a/pkg/fbs/motion/core/fbtypes/KinStateJntTrafoDataReqAxis.go +++ b/pkg/fbs/motion/core/fbtypes/KinStateJntTrafoDataReqAxis.go @@ -8,20 +8,32 @@ import ( /// data of a single entry of a required axis of a joint transformation when reading all data of an implemented joint transformation type KinStateJntTrafoDataReqAxisT struct { - Name string - Description string - Image string - DocRef string - Type KinStateJntTrafoDataReqAxisType - Mandatory bool + Name string `json:"name"` + Description string `json:"description"` + Image string `json:"image"` + DocRef string `json:"docRef"` + Type KinStateJntTrafoDataReqAxisType `json:"type"` + Mandatory bool `json:"mandatory"` } func (t *KinStateJntTrafoDataReqAxisT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - descriptionOffset := builder.CreateString(t.Description) - imageOffset := builder.CreateString(t.Image) - docRefOffset := builder.CreateString(t.DocRef) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + descriptionOffset := flatbuffers.UOffsetT(0) + if t.Description != "" { + descriptionOffset = builder.CreateString(t.Description) + } + imageOffset := flatbuffers.UOffsetT(0) + if t.Image != "" { + imageOffset = builder.CreateString(t.Image) + } + docRefOffset := flatbuffers.UOffsetT(0) + if t.DocRef != "" { + docRefOffset = builder.CreateString(t.DocRef) + } KinStateJntTrafoDataReqAxisStart(builder) KinStateJntTrafoDataReqAxisAddName(builder, nameOffset) KinStateJntTrafoDataReqAxisAddDescription(builder, descriptionOffset) diff --git a/pkg/fbs/motion/core/fbtypes/KinStateJntTrafoDataSingle.go b/pkg/fbs/motion/core/fbtypes/KinStateJntTrafoDataSingle.go index 00bfe1d..da1a4a7 100644 --- a/pkg/fbs/motion/core/fbtypes/KinStateJntTrafoDataSingle.go +++ b/pkg/fbs/motion/core/fbtypes/KinStateJntTrafoDataSingle.go @@ -8,25 +8,64 @@ import ( /// data of a single registered joint transformation when reading all data of an implemented joint transformation type KinStateJntTrafoDataSingleT struct { - Id string - Name string - Description string - Image string - DocRef string - Version string - Pow POWType - Parameters *KinStateJntTrafoDataAllParamT + Id string `json:"id"` + Name string `json:"name"` + Description string `json:"description"` + Image string `json:"image"` + DocRef string `json:"docRef"` + Version string `json:"version"` + Pow POWType `json:"pow"` + Parameters *KinStateJntTrafoDataAllParamT `json:"parameters"` + License string `json:"license"` + Icon string `json:"icon"` + LicenseInstalled bool `json:"licenseInstalled"` + PosCapability string `json:"posCapability"` + OriCapability string `json:"oriCapability"` } func (t *KinStateJntTrafoDataSingleT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - idOffset := builder.CreateString(t.Id) - nameOffset := builder.CreateString(t.Name) - descriptionOffset := builder.CreateString(t.Description) - imageOffset := builder.CreateString(t.Image) - docRefOffset := builder.CreateString(t.DocRef) - versionOffset := builder.CreateString(t.Version) + idOffset := flatbuffers.UOffsetT(0) + if t.Id != "" { + idOffset = builder.CreateString(t.Id) + } + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + descriptionOffset := flatbuffers.UOffsetT(0) + if t.Description != "" { + descriptionOffset = builder.CreateString(t.Description) + } + imageOffset := flatbuffers.UOffsetT(0) + if t.Image != "" { + imageOffset = builder.CreateString(t.Image) + } + docRefOffset := flatbuffers.UOffsetT(0) + if t.DocRef != "" { + docRefOffset = builder.CreateString(t.DocRef) + } + versionOffset := flatbuffers.UOffsetT(0) + if t.Version != "" { + versionOffset = builder.CreateString(t.Version) + } parametersOffset := t.Parameters.Pack(builder) + licenseOffset := flatbuffers.UOffsetT(0) + if t.License != "" { + licenseOffset = builder.CreateString(t.License) + } + iconOffset := flatbuffers.UOffsetT(0) + if t.Icon != "" { + iconOffset = builder.CreateString(t.Icon) + } + posCapabilityOffset := flatbuffers.UOffsetT(0) + if t.PosCapability != "" { + posCapabilityOffset = builder.CreateString(t.PosCapability) + } + oriCapabilityOffset := flatbuffers.UOffsetT(0) + if t.OriCapability != "" { + oriCapabilityOffset = builder.CreateString(t.OriCapability) + } KinStateJntTrafoDataSingleStart(builder) KinStateJntTrafoDataSingleAddId(builder, idOffset) KinStateJntTrafoDataSingleAddName(builder, nameOffset) @@ -36,6 +75,11 @@ func (t *KinStateJntTrafoDataSingleT) Pack(builder *flatbuffers.Builder) flatbuf KinStateJntTrafoDataSingleAddVersion(builder, versionOffset) KinStateJntTrafoDataSingleAddPow(builder, t.Pow) KinStateJntTrafoDataSingleAddParameters(builder, parametersOffset) + KinStateJntTrafoDataSingleAddLicense(builder, licenseOffset) + KinStateJntTrafoDataSingleAddIcon(builder, iconOffset) + KinStateJntTrafoDataSingleAddLicenseInstalled(builder, t.LicenseInstalled) + KinStateJntTrafoDataSingleAddPosCapability(builder, posCapabilityOffset) + KinStateJntTrafoDataSingleAddOriCapability(builder, oriCapabilityOffset) return KinStateJntTrafoDataSingleEnd(builder) } @@ -48,6 +92,11 @@ func (rcv *KinStateJntTrafoDataSingle) UnPackTo(t *KinStateJntTrafoDataSingleT) t.Version = string(rcv.Version()) t.Pow = rcv.Pow() t.Parameters = rcv.Parameters(nil).UnPack() + t.License = string(rcv.License()) + t.Icon = string(rcv.Icon()) + t.LicenseInstalled = rcv.LicenseInstalled() + t.PosCapability = string(rcv.PosCapability()) + t.OriCapability = string(rcv.OriCapability()) } func (rcv *KinStateJntTrafoDataSingle) UnPack() *KinStateJntTrafoDataSingleT { @@ -173,8 +222,62 @@ func (rcv *KinStateJntTrafoDataSingle) Parameters(obj *KinStateJntTrafoDataAllPa } /// All configuration parameters of the joint transformation +/// Licence information of the joint transformation +func (rcv *KinStateJntTrafoDataSingle) License() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(20)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// Licence information of the joint transformation +/// Icon image (link) of the joint transformation +func (rcv *KinStateJntTrafoDataSingle) Icon() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(22)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// Icon image (link) of the joint transformation +/// is the require license installed on the system? +func (rcv *KinStateJntTrafoDataSingle) LicenseInstalled() bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(24)) + if o != 0 { + return rcv._tab.GetBool(o + rcv._tab.Pos) + } + return false +} + +/// is the require license installed on the system? +func (rcv *KinStateJntTrafoDataSingle) MutateLicenseInstalled(n bool) bool { + return rcv._tab.MutateBoolSlot(24, n) +} + +/// Position capability of this joint transformation (NO_POS, POS_3D, POS_XY, POS_ZX, POS_YZ, POS_X, POS_Y, POS_Z) +func (rcv *KinStateJntTrafoDataSingle) PosCapability() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(26)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// Position capability of this joint transformation (NO_POS, POS_3D, POS_XY, POS_ZX, POS_YZ, POS_X, POS_Y, POS_Z) +/// Orientation capability of this joint transformation (NO_ORI, ORI_3D, ORI_2D, ORI_1D_X, ORI_1D_Y, ORI_1D_Z) +func (rcv *KinStateJntTrafoDataSingle) OriCapability() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(28)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// Orientation capability of this joint transformation (NO_ORI, ORI_3D, ORI_2D, ORI_1D_X, ORI_1D_Y, ORI_1D_Z) func KinStateJntTrafoDataSingleStart(builder *flatbuffers.Builder) { - builder.StartObject(8) + builder.StartObject(13) } func KinStateJntTrafoDataSingleAddId(builder *flatbuffers.Builder, id flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(id), 0) @@ -200,6 +303,21 @@ func KinStateJntTrafoDataSingleAddPow(builder *flatbuffers.Builder, pow POWType) func KinStateJntTrafoDataSingleAddParameters(builder *flatbuffers.Builder, parameters flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(7, flatbuffers.UOffsetT(parameters), 0) } +func KinStateJntTrafoDataSingleAddLicense(builder *flatbuffers.Builder, license flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(8, flatbuffers.UOffsetT(license), 0) +} +func KinStateJntTrafoDataSingleAddIcon(builder *flatbuffers.Builder, icon flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(9, flatbuffers.UOffsetT(icon), 0) +} +func KinStateJntTrafoDataSingleAddLicenseInstalled(builder *flatbuffers.Builder, licenseInstalled bool) { + builder.PrependBoolSlot(10, licenseInstalled, false) +} +func KinStateJntTrafoDataSingleAddPosCapability(builder *flatbuffers.Builder, posCapability flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(11, flatbuffers.UOffsetT(posCapability), 0) +} +func KinStateJntTrafoDataSingleAddOriCapability(builder *flatbuffers.Builder, oriCapability flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(12, flatbuffers.UOffsetT(oriCapability), 0) +} func KinStateJntTrafoDataSingleEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() } diff --git a/pkg/fbs/motion/core/fbtypes/ProbeActualValues.go b/pkg/fbs/motion/core/fbtypes/ProbeActualValues.go index 1d0a751..bc9f6e9 100644 --- a/pkg/fbs/motion/core/fbtypes/ProbeActualValues.go +++ b/pkg/fbs/motion/core/fbtypes/ProbeActualValues.go @@ -8,26 +8,38 @@ import ( /// currently the actual values of the probe type ProbeActualValuesT struct { - Valid bool - PosEdgeValue float64 - NegEdgeValue float64 - DifferValue float64 - DiffCount uint32 - PosEdgeCount uint32 - NegEdgeCount uint32 - MarksEdgeCount uint32 - Status string - PosEdgeValueUnit string - NegEdgeValueUnit string - DifferValueUnit string + Valid bool `json:"valid"` + PosEdgeValue float64 `json:"posEdgeValue"` + NegEdgeValue float64 `json:"negEdgeValue"` + DifferValue float64 `json:"differValue"` + DiffCount uint32 `json:"diffCount"` + PosEdgeCount uint32 `json:"posEdgeCount"` + NegEdgeCount uint32 `json:"negEdgeCount"` + MarksEdgeCount uint32 `json:"marksEdgeCount"` + Status string `json:"status"` + PosEdgeValueUnit string `json:"posEdgeValueUnit"` + NegEdgeValueUnit string `json:"negEdgeValueUnit"` + DifferValueUnit string `json:"differValueUnit"` } func (t *ProbeActualValuesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - statusOffset := builder.CreateString(t.Status) - posEdgeValueUnitOffset := builder.CreateString(t.PosEdgeValueUnit) - negEdgeValueUnitOffset := builder.CreateString(t.NegEdgeValueUnit) - differValueUnitOffset := builder.CreateString(t.DifferValueUnit) + statusOffset := flatbuffers.UOffsetT(0) + if t.Status != "" { + statusOffset = builder.CreateString(t.Status) + } + posEdgeValueUnitOffset := flatbuffers.UOffsetT(0) + if t.PosEdgeValueUnit != "" { + posEdgeValueUnitOffset = builder.CreateString(t.PosEdgeValueUnit) + } + negEdgeValueUnitOffset := flatbuffers.UOffsetT(0) + if t.NegEdgeValueUnit != "" { + negEdgeValueUnitOffset = builder.CreateString(t.NegEdgeValueUnit) + } + differValueUnitOffset := flatbuffers.UOffsetT(0) + if t.DifferValueUnit != "" { + differValueUnitOffset = builder.CreateString(t.DifferValueUnit) + } ProbeActualValuesStart(builder) ProbeActualValuesAddValid(builder, t.Valid) ProbeActualValuesAddPosEdgeValue(builder, t.PosEdgeValue) diff --git a/pkg/fbs/motion/core/fbtypes/ProbeCfgData.go b/pkg/fbs/motion/core/fbtypes/ProbeCfgData.go index 90c87a3..0deecb7 100644 --- a/pkg/fbs/motion/core/fbtypes/ProbeCfgData.go +++ b/pkg/fbs/motion/core/fbtypes/ProbeCfgData.go @@ -8,28 +8,40 @@ import ( /// data of the axis probe type ProbeCfgDataT struct { - MeasurSigSel string - MeasurType string - EvalEdgeType string - EvalDiffType string - ExpWindowEdgeEnable bool - ExpWindowStart float64 - ExpWindowEnd float64 - EnableMarkFailure bool - MaxNumOfMarkFailuer uint32 - TimeCompEnable bool - TimeCompPosEdge float64 - TimeCompNegEdge float64 - LvlMonitorActive bool - IsAutoActivated bool + MeasurSigSel string `json:"measurSigSel"` + MeasurType string `json:"measurType"` + EvalEdgeType string `json:"evalEdgeType"` + EvalDiffType string `json:"evalDiffType"` + ExpWindowEdgeEnable bool `json:"expWindowEdgeEnable"` + ExpWindowStart float64 `json:"expWindowStart"` + ExpWindowEnd float64 `json:"expWindowEnd"` + EnableMarkFailure bool `json:"enableMarkFailure"` + MaxNumOfMarkFailuer uint32 `json:"maxNumOfMarkFailuer"` + TimeCompEnable bool `json:"timeCompEnable"` + TimeCompPosEdge float64 `json:"timeCompPosEdge"` + TimeCompNegEdge float64 `json:"timeCompNegEdge"` + LvlMonitorActive bool `json:"lvlMonitorActive"` + IsAutoActivated bool `json:"isAutoActivated"` } func (t *ProbeCfgDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - measurSigSelOffset := builder.CreateString(t.MeasurSigSel) - measurTypeOffset := builder.CreateString(t.MeasurType) - evalEdgeTypeOffset := builder.CreateString(t.EvalEdgeType) - evalDiffTypeOffset := builder.CreateString(t.EvalDiffType) + measurSigSelOffset := flatbuffers.UOffsetT(0) + if t.MeasurSigSel != "" { + measurSigSelOffset = builder.CreateString(t.MeasurSigSel) + } + measurTypeOffset := flatbuffers.UOffsetT(0) + if t.MeasurType != "" { + measurTypeOffset = builder.CreateString(t.MeasurType) + } + evalEdgeTypeOffset := flatbuffers.UOffsetT(0) + if t.EvalEdgeType != "" { + evalEdgeTypeOffset = builder.CreateString(t.EvalEdgeType) + } + evalDiffTypeOffset := flatbuffers.UOffsetT(0) + if t.EvalDiffType != "" { + evalDiffTypeOffset = builder.CreateString(t.EvalDiffType) + } ProbeCfgDataStart(builder) ProbeCfgDataAddMeasurSigSel(builder, measurSigSelOffset) ProbeCfgDataAddMeasurType(builder, measurTypeOffset) diff --git a/pkg/fbs/motion/core/fbtypes/RTInputsCfg.go b/pkg/fbs/motion/core/fbtypes/RTInputsCfg.go index 6945cc8..775730f 100644 --- a/pkg/fbs/motion/core/fbtypes/RTInputsCfg.go +++ b/pkg/fbs/motion/core/fbtypes/RTInputsCfg.go @@ -8,8 +8,8 @@ import ( /// common configuration of real-time inputs type RTInputsCfgT struct { - DoubleArraySize uint32 - Int64ArraySize uint32 + DoubleArraySize uint32 `json:"doubleArraySize"` + Int64ArraySize uint32 `json:"int64ArraySize"` } func (t *RTInputsCfgT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/SingleLicense.go b/pkg/fbs/motion/core/fbtypes/SingleLicense.go index 92c5c4a..0b77934 100644 --- a/pkg/fbs/motion/core/fbtypes/SingleLicense.go +++ b/pkg/fbs/motion/core/fbtypes/SingleLicense.go @@ -8,14 +8,20 @@ import ( /// information of a single acquired license type SingleLicenseT struct { - Name string - Version string + Name string `json:"name"` + Version string `json:"version"` } func (t *SingleLicenseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - versionOffset := builder.CreateString(t.Version) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + versionOffset := flatbuffers.UOffsetT(0) + if t.Version != "" { + versionOffset = builder.CreateString(t.Version) + } SingleLicenseStart(builder) SingleLicenseAddName(builder, nameOffset) SingleLicenseAddVersion(builder, versionOffset) diff --git a/pkg/fbs/motion/core/fbtypes/SysCfg.go b/pkg/fbs/motion/core/fbtypes/SysCfg.go index c698e65..e0329dc 100644 --- a/pkg/fbs/motion/core/fbtypes/SysCfg.go +++ b/pkg/fbs/motion/core/fbtypes/SysCfg.go @@ -8,11 +8,11 @@ import ( /// general system configuration type SysCfgT struct { - Pcs *SysCfgPcsAllT - Function *SysCfgFunctionT - Internal *SysCfgInternalT - SafeAreas *SysCfgSafeAreaAllT - RtInputs *RTInputsCfgT + Pcs *SysCfgPcsAllT `json:"pcs"` + Function *SysCfgFunctionT `json:"function"` + Internal *SysCfgInternalT `json:"internal"` + SafeAreas *SysCfgSafeAreaAllT `json:"safeAreas"` + RtInputs *RTInputsCfgT `json:"rtInputs"` } func (t *SysCfgT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/SysCfgFunction.go b/pkg/fbs/motion/core/fbtypes/SysCfgFunction.go index 304b1be..b78c61b 100644 --- a/pkg/fbs/motion/core/fbtypes/SysCfgFunction.go +++ b/pkg/fbs/motion/core/fbtypes/SysCfgFunction.go @@ -8,7 +8,7 @@ import ( /// system function configuration items type SysCfgFunctionT struct { - IgnoreAxisProfiles bool + IgnoreAxisProfiles bool `json:"ignoreAxisProfiles"` } func (t *SysCfgFunctionT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/SysCfgInternal.go b/pkg/fbs/motion/core/fbtypes/SysCfgInternal.go index 7de1722..4a51871 100644 --- a/pkg/fbs/motion/core/fbtypes/SysCfgInternal.go +++ b/pkg/fbs/motion/core/fbtypes/SysCfgInternal.go @@ -8,17 +8,17 @@ import ( /// internal system configuration items type SysCfgInternalT struct { - Save bool - UseIpoIVAJ bool - TimeMeasurement bool - DriveResetTimeout float64 + Save bool `json:"save"` + UseIpoIvaj bool `json:"useIpoIVAJ"` + TimeMeasurement bool `json:"timeMeasurement"` + DriveResetTimeout float64 `json:"driveResetTimeout"` } func (t *SysCfgInternalT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } SysCfgInternalStart(builder) SysCfgInternalAddSave(builder, t.Save) - SysCfgInternalAddUseIpoIVAJ(builder, t.UseIpoIVAJ) + SysCfgInternalAddUseIpoIvaj(builder, t.UseIpoIvaj) SysCfgInternalAddTimeMeasurement(builder, t.TimeMeasurement) SysCfgInternalAddDriveResetTimeout(builder, t.DriveResetTimeout) return SysCfgInternalEnd(builder) @@ -26,7 +26,7 @@ func (t *SysCfgInternalT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffset func (rcv *SysCfgInternal) UnPackTo(t *SysCfgInternalT) { t.Save = rcv.Save() - t.UseIpoIVAJ = rcv.UseIpoIVAJ() + t.UseIpoIvaj = rcv.UseIpoIvaj() t.TimeMeasurement = rcv.TimeMeasurement() t.DriveResetTimeout = rcv.DriveResetTimeout() } @@ -80,7 +80,7 @@ func (rcv *SysCfgInternal) MutateSave(n bool) bool { } /// use the new ipo IVAJ? -func (rcv *SysCfgInternal) UseIpoIVAJ() bool { +func (rcv *SysCfgInternal) UseIpoIvaj() bool { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { return rcv._tab.GetBool(o + rcv._tab.Pos) @@ -89,7 +89,7 @@ func (rcv *SysCfgInternal) UseIpoIVAJ() bool { } /// use the new ipo IVAJ? -func (rcv *SysCfgInternal) MutateUseIpoIVAJ(n bool) bool { +func (rcv *SysCfgInternal) MutateUseIpoIvaj(n bool) bool { return rcv._tab.MutateBoolSlot(6, n) } @@ -127,8 +127,8 @@ func SysCfgInternalStart(builder *flatbuffers.Builder) { func SysCfgInternalAddSave(builder *flatbuffers.Builder, save bool) { builder.PrependBoolSlot(0, save, false) } -func SysCfgInternalAddUseIpoIVAJ(builder *flatbuffers.Builder, useIpoIVAJ bool) { - builder.PrependBoolSlot(1, useIpoIVAJ, false) +func SysCfgInternalAddUseIpoIvaj(builder *flatbuffers.Builder, useIpoIvaj bool) { + builder.PrependBoolSlot(1, useIpoIvaj, false) } func SysCfgInternalAddTimeMeasurement(builder *flatbuffers.Builder, timeMeasurement bool) { builder.PrependBoolSlot(2, timeMeasurement, false) diff --git a/pkg/fbs/motion/core/fbtypes/SysCfgPcsAll.go b/pkg/fbs/motion/core/fbtypes/SysCfgPcsAll.go index b8b96e9..b869f2a 100644 --- a/pkg/fbs/motion/core/fbtypes/SysCfgPcsAll.go +++ b/pkg/fbs/motion/core/fbtypes/SysCfgPcsAll.go @@ -8,8 +8,8 @@ import ( /// configuration of the product coordinate system of this kinematics type SysCfgPcsAllT struct { - Sets []*SysCfgPcsSetT - Groups []*SysCfgPcsGroupT + Sets []*SysCfgPcsSetT `json:"sets"` + Groups []*SysCfgPcsGroupT `json:"groups"` } func (t *SysCfgPcsAllT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -110,6 +110,15 @@ func (rcv *SysCfgPcsAll) Sets(obj *SysCfgPcsSet, j int) bool { return false } +func (rcv *SysCfgPcsAll) SetsByKey(obj *SysCfgPcsSet, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *SysCfgPcsAll) SetsLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) if o != 0 { @@ -132,6 +141,15 @@ func (rcv *SysCfgPcsAll) Groups(obj *SysCfgPcsGroup, j int) bool { return false } +func (rcv *SysCfgPcsAll) GroupsByKey(obj *SysCfgPcsGroup, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *SysCfgPcsAll) GroupsLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { diff --git a/pkg/fbs/motion/core/fbtypes/SysCfgPcsGroup.go b/pkg/fbs/motion/core/fbtypes/SysCfgPcsGroup.go index 0f6e363..d7356ef 100644 --- a/pkg/fbs/motion/core/fbtypes/SysCfgPcsGroup.go +++ b/pkg/fbs/motion/core/fbtypes/SysCfgPcsGroup.go @@ -3,18 +3,22 @@ package fbtypes import ( + "bytes" flatbuffers "github.com/google/flatbuffers/go" ) /// configuration of a single group of sets for a product coordinate system type SysCfgPcsGroupT struct { - GroupName string - Sets []string + GroupName string `json:"groupName"` + Sets []string `json:"sets"` } func (t *SysCfgPcsGroupT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - groupNameOffset := builder.CreateString(t.GroupName) + groupNameOffset := flatbuffers.UOffsetT(0) + if t.GroupName != "" { + groupNameOffset = builder.CreateString(t.GroupName) + } setsOffset := flatbuffers.UOffsetT(0) if t.Sets != nil { setsLength := len(t.Sets) @@ -87,6 +91,38 @@ func (rcv *SysCfgPcsGroup) GroupName() []byte { } /// name of the group (required for load/save) +func SysCfgPcsGroupKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &SysCfgPcsGroup{} + obj2 := &SysCfgPcsGroup{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.GroupName()) < string(obj2.GroupName()) +} + +func (rcv *SysCfgPcsGroup) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &SysCfgPcsGroup{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.GroupName(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + /// vector of PCS sets in this group (sequence matters!) func (rcv *SysCfgPcsGroup) Sets(j int) []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) diff --git a/pkg/fbs/motion/core/fbtypes/SysCfgPcsSet.go b/pkg/fbs/motion/core/fbtypes/SysCfgPcsSet.go index dc6d6a7..bd6bd76 100644 --- a/pkg/fbs/motion/core/fbtypes/SysCfgPcsSet.go +++ b/pkg/fbs/motion/core/fbtypes/SysCfgPcsSet.go @@ -3,32 +3,36 @@ package fbtypes import ( + "bytes" flatbuffers "github.com/google/flatbuffers/go" ) /// configuration of a single set for the product coordiate system of a kinematics type SysCfgPcsSetT struct { - SetName string - OffsetXYZ []float64 - Orientation []float64 - OffsetAux []float64 - RelativeToPCS bool - OffsetXYZUnits []string - OrientationUnits []string - OffsetAuxUnits []string + SetName string `json:"setName"` + OffsetXyz []float64 `json:"offsetXYZ"` + Orientation []float64 `json:"orientation"` + OffsetAux []float64 `json:"offsetAux"` + RelativeToPcs bool `json:"relativeToPCS"` + OffsetXyzunits []string `json:"offsetXYZUnits"` + OrientationUnits []string `json:"orientationUnits"` + OffsetAuxUnits []string `json:"offsetAuxUnits"` } func (t *SysCfgPcsSetT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - setNameOffset := builder.CreateString(t.SetName) - offsetXYZOffset := flatbuffers.UOffsetT(0) - if t.OffsetXYZ != nil { - offsetXYZLength := len(t.OffsetXYZ) - SysCfgPcsSetStartOffsetXYZVector(builder, offsetXYZLength) - for j := offsetXYZLength - 1; j >= 0; j-- { - builder.PrependFloat64(t.OffsetXYZ[j]) + setNameOffset := flatbuffers.UOffsetT(0) + if t.SetName != "" { + setNameOffset = builder.CreateString(t.SetName) + } + offsetXyzOffset := flatbuffers.UOffsetT(0) + if t.OffsetXyz != nil { + offsetXyzLength := len(t.OffsetXyz) + SysCfgPcsSetStartOffsetXyzVector(builder, offsetXyzLength) + for j := offsetXyzLength - 1; j >= 0; j-- { + builder.PrependFloat64(t.OffsetXyz[j]) } - offsetXYZOffset = builder.EndVector(offsetXYZLength) + offsetXyzOffset = builder.EndVector(offsetXyzLength) } orientationOffset := flatbuffers.UOffsetT(0) if t.Orientation != nil { @@ -48,18 +52,18 @@ func (t *SysCfgPcsSetT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT } offsetAuxOffset = builder.EndVector(offsetAuxLength) } - offsetXYZUnitsOffset := flatbuffers.UOffsetT(0) - if t.OffsetXYZUnits != nil { - offsetXYZUnitsLength := len(t.OffsetXYZUnits) - offsetXYZUnitsOffsets := make([]flatbuffers.UOffsetT, offsetXYZUnitsLength) - for j := 0; j < offsetXYZUnitsLength; j++ { - offsetXYZUnitsOffsets[j] = builder.CreateString(t.OffsetXYZUnits[j]) + offsetXyzunitsOffset := flatbuffers.UOffsetT(0) + if t.OffsetXyzunits != nil { + offsetXyzunitsLength := len(t.OffsetXyzunits) + offsetXyzunitsOffsets := make([]flatbuffers.UOffsetT, offsetXyzunitsLength) + for j := 0; j < offsetXyzunitsLength; j++ { + offsetXyzunitsOffsets[j] = builder.CreateString(t.OffsetXyzunits[j]) } - SysCfgPcsSetStartOffsetXYZUnitsVector(builder, offsetXYZUnitsLength) - for j := offsetXYZUnitsLength - 1; j >= 0; j-- { - builder.PrependUOffsetT(offsetXYZUnitsOffsets[j]) + SysCfgPcsSetStartOffsetXyzunitsVector(builder, offsetXyzunitsLength) + for j := offsetXyzunitsLength - 1; j >= 0; j-- { + builder.PrependUOffsetT(offsetXyzunitsOffsets[j]) } - offsetXYZUnitsOffset = builder.EndVector(offsetXYZUnitsLength) + offsetXyzunitsOffset = builder.EndVector(offsetXyzunitsLength) } orientationUnitsOffset := flatbuffers.UOffsetT(0) if t.OrientationUnits != nil { @@ -89,11 +93,11 @@ func (t *SysCfgPcsSetT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT } SysCfgPcsSetStart(builder) SysCfgPcsSetAddSetName(builder, setNameOffset) - SysCfgPcsSetAddOffsetXYZ(builder, offsetXYZOffset) + SysCfgPcsSetAddOffsetXyz(builder, offsetXyzOffset) SysCfgPcsSetAddOrientation(builder, orientationOffset) SysCfgPcsSetAddOffsetAux(builder, offsetAuxOffset) - SysCfgPcsSetAddRelativeToPCS(builder, t.RelativeToPCS) - SysCfgPcsSetAddOffsetXYZUnits(builder, offsetXYZUnitsOffset) + SysCfgPcsSetAddRelativeToPcs(builder, t.RelativeToPcs) + SysCfgPcsSetAddOffsetXyzunits(builder, offsetXyzunitsOffset) SysCfgPcsSetAddOrientationUnits(builder, orientationUnitsOffset) SysCfgPcsSetAddOffsetAuxUnits(builder, offsetAuxUnitsOffset) return SysCfgPcsSetEnd(builder) @@ -101,10 +105,10 @@ func (t *SysCfgPcsSetT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT func (rcv *SysCfgPcsSet) UnPackTo(t *SysCfgPcsSetT) { t.SetName = string(rcv.SetName()) - offsetXYZLength := rcv.OffsetXYZLength() - t.OffsetXYZ = make([]float64, offsetXYZLength) - for j := 0; j < offsetXYZLength; j++ { - t.OffsetXYZ[j] = rcv.OffsetXYZ(j) + offsetXyzLength := rcv.OffsetXyzLength() + t.OffsetXyz = make([]float64, offsetXyzLength) + for j := 0; j < offsetXyzLength; j++ { + t.OffsetXyz[j] = rcv.OffsetXyz(j) } orientationLength := rcv.OrientationLength() t.Orientation = make([]float64, orientationLength) @@ -116,11 +120,11 @@ func (rcv *SysCfgPcsSet) UnPackTo(t *SysCfgPcsSetT) { for j := 0; j < offsetAuxLength; j++ { t.OffsetAux[j] = rcv.OffsetAux(j) } - t.RelativeToPCS = rcv.RelativeToPCS() - offsetXYZUnitsLength := rcv.OffsetXYZUnitsLength() - t.OffsetXYZUnits = make([]string, offsetXYZUnitsLength) - for j := 0; j < offsetXYZUnitsLength; j++ { - t.OffsetXYZUnits[j] = string(rcv.OffsetXYZUnits(j)) + t.RelativeToPcs = rcv.RelativeToPcs() + offsetXyzunitsLength := rcv.OffsetXyzunitsLength() + t.OffsetXyzunits = make([]string, offsetXyzunitsLength) + for j := 0; j < offsetXyzunitsLength; j++ { + t.OffsetXyzunits[j] = string(rcv.OffsetXyzunits(j)) } orientationUnitsLength := rcv.OrientationUnitsLength() t.OrientationUnits = make([]string, orientationUnitsLength) @@ -178,8 +182,40 @@ func (rcv *SysCfgPcsSet) SetName() []byte { } /// name of the set (required for load/save) +func SysCfgPcsSetKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &SysCfgPcsSet{} + obj2 := &SysCfgPcsSet{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.SetName()) < string(obj2.SetName()) +} + +func (rcv *SysCfgPcsSet) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &SysCfgPcsSet{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.SetName(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + /// XYZ offsets (must be exactly three values) -func (rcv *SysCfgPcsSet) OffsetXYZ(j int) float64 { +func (rcv *SysCfgPcsSet) OffsetXyz(j int) float64 { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { a := rcv._tab.Vector(o) @@ -188,7 +224,7 @@ func (rcv *SysCfgPcsSet) OffsetXYZ(j int) float64 { return 0 } -func (rcv *SysCfgPcsSet) OffsetXYZLength() int { +func (rcv *SysCfgPcsSet) OffsetXyzLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { return rcv._tab.VectorLen(o) @@ -197,7 +233,7 @@ func (rcv *SysCfgPcsSet) OffsetXYZLength() int { } /// XYZ offsets (must be exactly three values) -func (rcv *SysCfgPcsSet) MutateOffsetXYZ(j int, n float64) bool { +func (rcv *SysCfgPcsSet) MutateOffsetXyz(j int, n float64) bool { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { a := rcv._tab.Vector(o) @@ -263,7 +299,7 @@ func (rcv *SysCfgPcsSet) MutateOffsetAux(j int, n float64) bool { } /// is this set relative to an other pcs set? -func (rcv *SysCfgPcsSet) RelativeToPCS() bool { +func (rcv *SysCfgPcsSet) RelativeToPcs() bool { o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) if o != 0 { return rcv._tab.GetBool(o + rcv._tab.Pos) @@ -272,12 +308,12 @@ func (rcv *SysCfgPcsSet) RelativeToPCS() bool { } /// is this set relative to an other pcs set? -func (rcv *SysCfgPcsSet) MutateRelativeToPCS(n bool) bool { +func (rcv *SysCfgPcsSet) MutateRelativeToPcs(n bool) bool { return rcv._tab.MutateBoolSlot(12, n) } /// Units for XYZ offsets (must be exactly three values) -func (rcv *SysCfgPcsSet) OffsetXYZUnits(j int) []byte { +func (rcv *SysCfgPcsSet) OffsetXyzunits(j int) []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) if o != 0 { a := rcv._tab.Vector(o) @@ -286,7 +322,7 @@ func (rcv *SysCfgPcsSet) OffsetXYZUnits(j int) []byte { return nil } -func (rcv *SysCfgPcsSet) OffsetXYZUnitsLength() int { +func (rcv *SysCfgPcsSet) OffsetXyzunitsLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) if o != 0 { return rcv._tab.VectorLen(o) @@ -339,10 +375,10 @@ func SysCfgPcsSetStart(builder *flatbuffers.Builder) { func SysCfgPcsSetAddSetName(builder *flatbuffers.Builder, setName flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(setName), 0) } -func SysCfgPcsSetAddOffsetXYZ(builder *flatbuffers.Builder, offsetXYZ flatbuffers.UOffsetT) { - builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(offsetXYZ), 0) +func SysCfgPcsSetAddOffsetXyz(builder *flatbuffers.Builder, offsetXyz flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(offsetXyz), 0) } -func SysCfgPcsSetStartOffsetXYZVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { +func SysCfgPcsSetStartOffsetXyzVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { return builder.StartVector(8, numElems, 8) } func SysCfgPcsSetAddOrientation(builder *flatbuffers.Builder, orientation flatbuffers.UOffsetT) { @@ -357,13 +393,13 @@ func SysCfgPcsSetAddOffsetAux(builder *flatbuffers.Builder, offsetAux flatbuffer func SysCfgPcsSetStartOffsetAuxVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { return builder.StartVector(8, numElems, 8) } -func SysCfgPcsSetAddRelativeToPCS(builder *flatbuffers.Builder, relativeToPCS bool) { - builder.PrependBoolSlot(4, relativeToPCS, false) +func SysCfgPcsSetAddRelativeToPcs(builder *flatbuffers.Builder, relativeToPcs bool) { + builder.PrependBoolSlot(4, relativeToPcs, false) } -func SysCfgPcsSetAddOffsetXYZUnits(builder *flatbuffers.Builder, offsetXYZUnits flatbuffers.UOffsetT) { - builder.PrependUOffsetTSlot(5, flatbuffers.UOffsetT(offsetXYZUnits), 0) +func SysCfgPcsSetAddOffsetXyzunits(builder *flatbuffers.Builder, offsetXyzunits flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(5, flatbuffers.UOffsetT(offsetXyzunits), 0) } -func SysCfgPcsSetStartOffsetXYZUnitsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { +func SysCfgPcsSetStartOffsetXyzunitsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { return builder.StartVector(4, numElems, 4) } func SysCfgPcsSetAddOrientationUnits(builder *flatbuffers.Builder, orientationUnits flatbuffers.UOffsetT) { diff --git a/pkg/fbs/motion/core/fbtypes/SysCfgSafeArea.go b/pkg/fbs/motion/core/fbtypes/SysCfgSafeArea.go index add6d6b..cfee204 100644 --- a/pkg/fbs/motion/core/fbtypes/SysCfgSafeArea.go +++ b/pkg/fbs/motion/core/fbtypes/SysCfgSafeArea.go @@ -8,16 +8,22 @@ import ( /// configuration of a single safe area or work area type SysCfgSafeAreaT struct { - Name string - CoordSystem string - Type SafeAreaType - Box []*SysCfgSafeAreaBoxT + Name string `json:"name"` + CoordSystem string `json:"coordSystem"` + Type SafeAreaType `json:"type"` + Box []*SysCfgSafeAreaBoxT `json:"box"` } func (t *SysCfgSafeAreaT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - coordSystemOffset := builder.CreateString(t.CoordSystem) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + coordSystemOffset := flatbuffers.UOffsetT(0) + if t.CoordSystem != "" { + coordSystemOffset = builder.CreateString(t.CoordSystem) + } boxOffset := flatbuffers.UOffsetT(0) if t.Box != nil { boxLength := len(t.Box) diff --git a/pkg/fbs/motion/core/fbtypes/SysCfgSafeAreaAll.go b/pkg/fbs/motion/core/fbtypes/SysCfgSafeAreaAll.go index b5efefc..bb3cce3 100644 --- a/pkg/fbs/motion/core/fbtypes/SysCfgSafeAreaAll.go +++ b/pkg/fbs/motion/core/fbtypes/SysCfgSafeAreaAll.go @@ -8,7 +8,7 @@ import ( /// configuration of all safe areas and work areas for the whole motion system type SysCfgSafeAreaAllT struct { - SafeAreas []*SysCfgSafeAreaT + SafeAreas []*SysCfgSafeAreaT `json:"safeAreas"` } func (t *SysCfgSafeAreaAllT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/SysCfgSafeAreaBox.go b/pkg/fbs/motion/core/fbtypes/SysCfgSafeAreaBox.go index 9ad8184..8c6fb37 100644 --- a/pkg/fbs/motion/core/fbtypes/SysCfgSafeAreaBox.go +++ b/pkg/fbs/motion/core/fbtypes/SysCfgSafeAreaBox.go @@ -8,15 +8,18 @@ import ( /// configuration of the limits in a single dimension of the box of a single safe area type SysCfgSafeAreaBoxT struct { - Min float64 - Max float64 - Unit string - Active bool + Min float64 `json:"min"` + Max float64 `json:"max"` + Unit string `json:"unit"` + Active bool `json:"active"` } func (t *SysCfgSafeAreaBoxT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - unitOffset := builder.CreateString(t.Unit) + unitOffset := flatbuffers.UOffsetT(0) + if t.Unit != "" { + unitOffset = builder.CreateString(t.Unit) + } SysCfgSafeAreaBoxStart(builder) SysCfgSafeAreaBoxAddMin(builder, t.Min) SysCfgSafeAreaBoxAddMax(builder, t.Max) diff --git a/pkg/fbs/motion/core/fbtypes/SysCmdReset.go b/pkg/fbs/motion/core/fbtypes/SysCmdReset.go index 8889b8a..8e22910 100644 --- a/pkg/fbs/motion/core/fbtypes/SysCmdReset.go +++ b/pkg/fbs/motion/core/fbtypes/SysCmdReset.go @@ -8,7 +8,7 @@ import ( /// request structure for the ResetAllMotionObjects nodes type SysCmdResetT struct { - Type SysResetType + Type SysResetType `json:"type"` } func (t *SysCmdResetT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/UnitCfgKin.go b/pkg/fbs/motion/core/fbtypes/UnitCfgKin.go index df9534b..309283f 100644 --- a/pkg/fbs/motion/core/fbtypes/UnitCfgKin.go +++ b/pkg/fbs/motion/core/fbtypes/UnitCfgKin.go @@ -8,24 +8,24 @@ import ( /// General unit configuration for a kinematics object type UnitCfgKinT struct { - Default []*UnitCfgObjSingleT - Position []string + Default []*UnitCfgObjSingleT `json:"default"` + Position []string `json:"position"` } func (t *UnitCfgKinT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - defaultOffset := flatbuffers.UOffsetT(0) + default_Offset := flatbuffers.UOffsetT(0) if t.Default != nil { - defaultLength := len(t.Default) - defaultOffsets := make([]flatbuffers.UOffsetT, defaultLength) - for j := 0; j < defaultLength; j++ { - defaultOffsets[j] = t.Default[j].Pack(builder) + default_Length := len(t.Default) + default_Offsets := make([]flatbuffers.UOffsetT, default_Length) + for j := 0; j < default_Length; j++ { + default_Offsets[j] = t.Default[j].Pack(builder) } - UnitCfgKinStartDefaultVector(builder, defaultLength) - for j := defaultLength - 1; j >= 0; j-- { - builder.PrependUOffsetT(defaultOffsets[j]) + UnitCfgKinStartDefaultVector(builder, default_Length) + for j := default_Length - 1; j >= 0; j-- { + builder.PrependUOffsetT(default_Offsets[j]) } - defaultOffset = builder.EndVector(defaultLength) + default_Offset = builder.EndVector(default_Length) } positionOffset := flatbuffers.UOffsetT(0) if t.Position != nil { @@ -41,15 +41,15 @@ func (t *UnitCfgKinT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { positionOffset = builder.EndVector(positionLength) } UnitCfgKinStart(builder) - UnitCfgKinAddDefault(builder, defaultOffset) + UnitCfgKinAddDefault(builder, default_Offset) UnitCfgKinAddPosition(builder, positionOffset) return UnitCfgKinEnd(builder) } func (rcv *UnitCfgKin) UnPackTo(t *UnitCfgKinT) { - defaultLength := rcv.DefaultLength() - t.Default = make([]*UnitCfgObjSingleT, defaultLength) - for j := 0; j < defaultLength; j++ { + default_Length := rcv.DefaultLength() + t.Default = make([]*UnitCfgObjSingleT, default_Length) + for j := 0; j < default_Length; j++ { x := UnitCfgObjSingle{} rcv.Default(&x, j) t.Default[j] = x.UnPack() @@ -108,6 +108,15 @@ func (rcv *UnitCfgKin) Default(obj *UnitCfgObjSingle, j int) bool { return false } +func (rcv *UnitCfgKin) DefaultByKey(obj *UnitCfgObjSingle, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *UnitCfgKin) DefaultLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) if o != 0 { diff --git a/pkg/fbs/motion/core/fbtypes/UnitCfgObj.go b/pkg/fbs/motion/core/fbtypes/UnitCfgObj.go index eb650bb..de70100 100644 --- a/pkg/fbs/motion/core/fbtypes/UnitCfgObj.go +++ b/pkg/fbs/motion/core/fbtypes/UnitCfgObj.go @@ -8,33 +8,33 @@ import ( /// General unit configuration for a motion object type UnitCfgObjT struct { - Default []*UnitCfgObjSingleT + Default []*UnitCfgObjSingleT `json:"default"` } func (t *UnitCfgObjT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - defaultOffset := flatbuffers.UOffsetT(0) + default_Offset := flatbuffers.UOffsetT(0) if t.Default != nil { - defaultLength := len(t.Default) - defaultOffsets := make([]flatbuffers.UOffsetT, defaultLength) - for j := 0; j < defaultLength; j++ { - defaultOffsets[j] = t.Default[j].Pack(builder) + default_Length := len(t.Default) + default_Offsets := make([]flatbuffers.UOffsetT, default_Length) + for j := 0; j < default_Length; j++ { + default_Offsets[j] = t.Default[j].Pack(builder) } - UnitCfgObjStartDefaultVector(builder, defaultLength) - for j := defaultLength - 1; j >= 0; j-- { - builder.PrependUOffsetT(defaultOffsets[j]) + UnitCfgObjStartDefaultVector(builder, default_Length) + for j := default_Length - 1; j >= 0; j-- { + builder.PrependUOffsetT(default_Offsets[j]) } - defaultOffset = builder.EndVector(defaultLength) + default_Offset = builder.EndVector(default_Length) } UnitCfgObjStart(builder) - UnitCfgObjAddDefault(builder, defaultOffset) + UnitCfgObjAddDefault(builder, default_Offset) return UnitCfgObjEnd(builder) } func (rcv *UnitCfgObj) UnPackTo(t *UnitCfgObjT) { - defaultLength := rcv.DefaultLength() - t.Default = make([]*UnitCfgObjSingleT, defaultLength) - for j := 0; j < defaultLength; j++ { + default_Length := rcv.DefaultLength() + t.Default = make([]*UnitCfgObjSingleT, default_Length) + for j := 0; j < default_Length; j++ { x := UnitCfgObjSingle{} rcv.Default(&x, j) t.Default[j] = x.UnPack() @@ -88,6 +88,15 @@ func (rcv *UnitCfgObj) Default(obj *UnitCfgObjSingle, j int) bool { return false } +func (rcv *UnitCfgObj) DefaultByKey(obj *UnitCfgObjSingle, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *UnitCfgObj) DefaultLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) if o != 0 { diff --git a/pkg/fbs/motion/core/fbtypes/UnitCfgObjSingle.go b/pkg/fbs/motion/core/fbtypes/UnitCfgObjSingle.go index d5a1e0c..6724cbf 100644 --- a/pkg/fbs/motion/core/fbtypes/UnitCfgObjSingle.go +++ b/pkg/fbs/motion/core/fbtypes/UnitCfgObjSingle.go @@ -3,19 +3,26 @@ package fbtypes import ( + "bytes" flatbuffers "github.com/google/flatbuffers/go" ) /// Single entry of the general unit configuration for a motion object type UnitCfgObjSingleT struct { - ValueType string - Abbreviation string + ValueType string `json:"valueType"` + Abbreviation string `json:"abbreviation"` } func (t *UnitCfgObjSingleT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - valueTypeOffset := builder.CreateString(t.ValueType) - abbreviationOffset := builder.CreateString(t.Abbreviation) + valueTypeOffset := flatbuffers.UOffsetT(0) + if t.ValueType != "" { + valueTypeOffset = builder.CreateString(t.ValueType) + } + abbreviationOffset := flatbuffers.UOffsetT(0) + if t.Abbreviation != "" { + abbreviationOffset = builder.CreateString(t.Abbreviation) + } UnitCfgObjSingleStart(builder) UnitCfgObjSingleAddValueType(builder, valueTypeOffset) UnitCfgObjSingleAddAbbreviation(builder, abbreviationOffset) @@ -71,6 +78,38 @@ func (rcv *UnitCfgObjSingle) ValueType() []byte { } /// the unit value type of the entry (position, velocity, jerk, ...) +func UnitCfgObjSingleKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &UnitCfgObjSingle{} + obj2 := &UnitCfgObjSingle{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.ValueType()) < string(obj2.ValueType()) +} + +func (rcv *UnitCfgObjSingle) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &UnitCfgObjSingle{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.ValueType(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + /// abbreviation of the unit (as it will being used in flatbuffers and files) func (rcv *UnitCfgObjSingle) Abbreviation() []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) diff --git a/pkg/fbs/motion/core/fbtypes/UnitDataAll.go b/pkg/fbs/motion/core/fbtypes/UnitDataAll.go index 1cab641..af7930c 100644 --- a/pkg/fbs/motion/core/fbtypes/UnitDataAll.go +++ b/pkg/fbs/motion/core/fbtypes/UnitDataAll.go @@ -8,7 +8,7 @@ import ( /// Data of all supported units type UnitDataAllT struct { - Supported []*UnitDataSingleT + Supported []*UnitDataSingleT `json:"supported"` } func (t *UnitDataAllT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/UnitDataSingle.go b/pkg/fbs/motion/core/fbtypes/UnitDataSingle.go index 18afbb3..0727384 100644 --- a/pkg/fbs/motion/core/fbtypes/UnitDataSingle.go +++ b/pkg/fbs/motion/core/fbtypes/UnitDataSingle.go @@ -8,27 +8,42 @@ import ( /// informations of a single unit, that is supported by the system type UnitDataSingleT struct { - Name string - UnitObjType string - UnitValueType string - Abbreviation string - AbbreviationURI string - IsDefault bool + Name string `json:"name"` + UnitObjType string `json:"unitObjType"` + UnitValueType string `json:"unitValueType"` + Abbreviation string `json:"abbreviation"` + AbbreviationUri string `json:"abbreviationURI"` + IsDefault bool `json:"isDefault"` } func (t *UnitDataSingleT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - unitObjTypeOffset := builder.CreateString(t.UnitObjType) - unitValueTypeOffset := builder.CreateString(t.UnitValueType) - abbreviationOffset := builder.CreateString(t.Abbreviation) - abbreviationURIOffset := builder.CreateString(t.AbbreviationURI) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + unitObjTypeOffset := flatbuffers.UOffsetT(0) + if t.UnitObjType != "" { + unitObjTypeOffset = builder.CreateString(t.UnitObjType) + } + unitValueTypeOffset := flatbuffers.UOffsetT(0) + if t.UnitValueType != "" { + unitValueTypeOffset = builder.CreateString(t.UnitValueType) + } + abbreviationOffset := flatbuffers.UOffsetT(0) + if t.Abbreviation != "" { + abbreviationOffset = builder.CreateString(t.Abbreviation) + } + abbreviationUriOffset := flatbuffers.UOffsetT(0) + if t.AbbreviationUri != "" { + abbreviationUriOffset = builder.CreateString(t.AbbreviationUri) + } UnitDataSingleStart(builder) UnitDataSingleAddName(builder, nameOffset) UnitDataSingleAddUnitObjType(builder, unitObjTypeOffset) UnitDataSingleAddUnitValueType(builder, unitValueTypeOffset) UnitDataSingleAddAbbreviation(builder, abbreviationOffset) - UnitDataSingleAddAbbreviationURI(builder, abbreviationURIOffset) + UnitDataSingleAddAbbreviationUri(builder, abbreviationUriOffset) UnitDataSingleAddIsDefault(builder, t.IsDefault) return UnitDataSingleEnd(builder) } @@ -38,7 +53,7 @@ func (rcv *UnitDataSingle) UnPackTo(t *UnitDataSingleT) { t.UnitObjType = string(rcv.UnitObjType()) t.UnitValueType = string(rcv.UnitValueType()) t.Abbreviation = string(rcv.Abbreviation()) - t.AbbreviationURI = string(rcv.AbbreviationURI()) + t.AbbreviationUri = string(rcv.AbbreviationUri()) t.IsDefault = rcv.IsDefault() } @@ -117,7 +132,7 @@ func (rcv *UnitDataSingle) Abbreviation() []byte { /// abbreviation of the unit (as it will being used in flatbuffers and files) /// URI abbreviation of the unit (as it will being used in datalayer paths) -func (rcv *UnitDataSingle) AbbreviationURI() []byte { +func (rcv *UnitDataSingle) AbbreviationUri() []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) if o != 0 { return rcv._tab.ByteVector(o + rcv._tab.Pos) @@ -155,8 +170,8 @@ func UnitDataSingleAddUnitValueType(builder *flatbuffers.Builder, unitValueType func UnitDataSingleAddAbbreviation(builder *flatbuffers.Builder, abbreviation flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(abbreviation), 0) } -func UnitDataSingleAddAbbreviationURI(builder *flatbuffers.Builder, abbreviationURI flatbuffers.UOffsetT) { - builder.PrependUOffsetTSlot(4, flatbuffers.UOffsetT(abbreviationURI), 0) +func UnitDataSingleAddAbbreviationUri(builder *flatbuffers.Builder, abbreviationUri flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(4, flatbuffers.UOffsetT(abbreviationUri), 0) } func UnitDataSingleAddIsDefault(builder *flatbuffers.Builder, isDefault bool) { builder.PrependBoolSlot(5, isDefault, false) diff --git a/pkg/fbs/motion/core/fbtypes/actCmdJobObjects.go b/pkg/fbs/motion/core/fbtypes/actCmdJobObjects.go index f199414..3da6ec5 100644 --- a/pkg/fbs/motion/core/fbtypes/actCmdJobObjects.go +++ b/pkg/fbs/motion/core/fbtypes/actCmdJobObjects.go @@ -8,13 +8,16 @@ import ( /// get informations of a single active command type actCmdJobObjectsT struct { - CmdName string - JobObjects []string + CmdName string `json:"cmdName"` + JobObjects []string `json:"jobObjects"` } func (t *actCmdJobObjectsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - cmdNameOffset := builder.CreateString(t.CmdName) + cmdNameOffset := flatbuffers.UOffsetT(0) + if t.CmdName != "" { + cmdNameOffset = builder.CreateString(t.CmdName) + } jobObjectsOffset := flatbuffers.UOffsetT(0) if t.JobObjects != nil { jobObjectsLength := len(t.JobObjects) diff --git a/pkg/fbs/motion/core/fbtypes/allActCmdJobObjects.go b/pkg/fbs/motion/core/fbtypes/allActCmdJobObjects.go index 1d142bc..6517a1d 100644 --- a/pkg/fbs/motion/core/fbtypes/allActCmdJobObjects.go +++ b/pkg/fbs/motion/core/fbtypes/allActCmdJobObjects.go @@ -8,7 +8,7 @@ import ( /// get informations of all active commands of a single motion object type allActCmdJobObjectsT struct { - Cmds []*actCmdJobObjectsT + Cmds []*actCmdJobObjectsT `json:"cmds"` } func (t *allActCmdJobObjectsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/allDebugCmdInfo.go b/pkg/fbs/motion/core/fbtypes/allDebugCmdInfo.go index 709307a..729cf82 100644 --- a/pkg/fbs/motion/core/fbtypes/allDebugCmdInfo.go +++ b/pkg/fbs/motion/core/fbtypes/allDebugCmdInfo.go @@ -8,8 +8,8 @@ import ( /// get informations of all active commands and commands that were recently executed of a single motion object type allDebugCmdInfoT struct { - MainCmds []*debugCmdInfoT - AddCmds []*debugCmdInfoT + MainCmds []*debugCmdInfoT `json:"mainCmds"` + AddCmds []*debugCmdInfoT `json:"addCmds"` } func (t *allDebugCmdInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/core/fbtypes/debugCmdInfo.go b/pkg/fbs/motion/core/fbtypes/debugCmdInfo.go index 9b9b204..826581a 100644 --- a/pkg/fbs/motion/core/fbtypes/debugCmdInfo.go +++ b/pkg/fbs/motion/core/fbtypes/debugCmdInfo.go @@ -8,16 +8,19 @@ import ( /// get informations of a single active command type debugCmdInfoT struct { - CmdName string - JobObjects []string - State string - CmdID uint64 - PrepLevel string + CmdName string `json:"cmdName"` + JobObjects []string `json:"jobObjects"` + State string `json:"state"` + CmdId uint64 `json:"cmdID"` + PrepLevel string `json:"prepLevel"` } func (t *debugCmdInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - cmdNameOffset := builder.CreateString(t.CmdName) + cmdNameOffset := flatbuffers.UOffsetT(0) + if t.CmdName != "" { + cmdNameOffset = builder.CreateString(t.CmdName) + } jobObjectsOffset := flatbuffers.UOffsetT(0) if t.JobObjects != nil { jobObjectsLength := len(t.JobObjects) @@ -31,13 +34,19 @@ func (t *debugCmdInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT } jobObjectsOffset = builder.EndVector(jobObjectsLength) } - stateOffset := builder.CreateString(t.State) - prepLevelOffset := builder.CreateString(t.PrepLevel) + stateOffset := flatbuffers.UOffsetT(0) + if t.State != "" { + stateOffset = builder.CreateString(t.State) + } + prepLevelOffset := flatbuffers.UOffsetT(0) + if t.PrepLevel != "" { + prepLevelOffset = builder.CreateString(t.PrepLevel) + } debugCmdInfoStart(builder) debugCmdInfoAddCmdName(builder, cmdNameOffset) debugCmdInfoAddJobObjects(builder, jobObjectsOffset) debugCmdInfoAddState(builder, stateOffset) - debugCmdInfoAddCmdID(builder, t.CmdID) + debugCmdInfoAddCmdId(builder, t.CmdId) debugCmdInfoAddPrepLevel(builder, prepLevelOffset) return debugCmdInfoEnd(builder) } @@ -50,7 +59,7 @@ func (rcv *debugCmdInfo) UnPackTo(t *debugCmdInfoT) { t.JobObjects[j] = string(rcv.JobObjects(j)) } t.State = string(rcv.State()) - t.CmdID = rcv.CmdID() + t.CmdId = rcv.CmdId() t.PrepLevel = string(rcv.PrepLevel()) } @@ -128,7 +137,7 @@ func (rcv *debugCmdInfo) State() []byte { /// command state as string /// command ID -func (rcv *debugCmdInfo) CmdID() uint64 { +func (rcv *debugCmdInfo) CmdId() uint64 { o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) if o != 0 { return rcv._tab.GetUint64(o + rcv._tab.Pos) @@ -137,7 +146,7 @@ func (rcv *debugCmdInfo) CmdID() uint64 { } /// command ID -func (rcv *debugCmdInfo) MutateCmdID(n uint64) bool { +func (rcv *debugCmdInfo) MutateCmdId(n uint64) bool { return rcv._tab.MutateUint64Slot(10, n) } @@ -166,8 +175,8 @@ func debugCmdInfoStartJobObjectsVector(builder *flatbuffers.Builder, numElems in func debugCmdInfoAddState(builder *flatbuffers.Builder, state flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(state), 0) } -func debugCmdInfoAddCmdID(builder *flatbuffers.Builder, cmdID uint64) { - builder.PrependUint64Slot(3, cmdID, 0) +func debugCmdInfoAddCmdId(builder *flatbuffers.Builder, cmdId uint64) { + builder.PrependUint64Slot(3, cmdId, 0) } func debugCmdInfoAddPrepLevel(builder *flatbuffers.Builder, prepLevel flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(4, flatbuffers.UOffsetT(prepLevel), 0) diff --git a/pkg/fbs/motion/core/fbtypes/dummyFbs.go b/pkg/fbs/motion/core/fbtypes/dummyFbs.go index 5203f81..2267cd7 100644 --- a/pkg/fbs/motion/core/fbtypes/dummyFbs.go +++ b/pkg/fbs/motion/core/fbtypes/dummyFbs.go @@ -8,16 +8,19 @@ import ( /// dummy flatbuffer for tests type dummyFbsT struct { - DummyByte int8 - DummyStr string - DummyInt int32 - DummyDouble float64 - DummyDoublePtr []float64 + DummyByte int8 `json:"dummyByte"` + DummyStr string `json:"dummyStr"` + DummyInt int32 `json:"dummyInt"` + DummyDouble float64 `json:"dummyDouble"` + DummyDoublePtr []float64 `json:"dummyDoublePtr"` } func (t *dummyFbsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - dummyStrOffset := builder.CreateString(t.DummyStr) + dummyStrOffset := flatbuffers.UOffsetT(0) + if t.DummyStr != "" { + dummyStrOffset = builder.CreateString(t.DummyStr) + } dummyDoublePtrOffset := flatbuffers.UOffsetT(0) if t.DummyDoublePtr != nil { dummyDoublePtrLength := len(t.DummyDoublePtr) diff --git a/pkg/fbs/motion/somo/fbtypes/CmdJoin.go b/pkg/fbs/motion/somo/fbtypes/CmdJoin.go index 8e0e567..18a86ce 100644 --- a/pkg/fbs/motion/somo/fbtypes/CmdJoin.go +++ b/pkg/fbs/motion/somo/fbtypes/CmdJoin.go @@ -8,8 +8,8 @@ import ( /// parameters for the command join type CmdJoinT struct { - Group []string - SyncStartNextCmd bool + Group []string `json:"group"` + SyncStartNextCmd bool `json:"syncStartNextCmd"` } func (t *CmdJoinT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/somo/fbtypes/CmdOptionSetSignal.go b/pkg/fbs/motion/somo/fbtypes/CmdOptionSetSignal.go index 8a44fc6..bb46948 100644 --- a/pkg/fbs/motion/somo/fbtypes/CmdOptionSetSignal.go +++ b/pkg/fbs/motion/somo/fbtypes/CmdOptionSetSignal.go @@ -8,13 +8,16 @@ import ( /// parameters for the command wait for signal type CmdOptionSetSignalT struct { - PermType string - SignalId uint32 + PermType string `json:"permType"` + SignalId uint32 `json:"signalId"` } func (t *CmdOptionSetSignalT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - permTypeOffset := builder.CreateString(t.PermType) + permTypeOffset := flatbuffers.UOffsetT(0) + if t.PermType != "" { + permTypeOffset = builder.CreateString(t.PermType) + } CmdOptionSetSignalStart(builder) CmdOptionSetSignalAddPermType(builder, permTypeOffset) CmdOptionSetSignalAddSignalId(builder, t.SignalId) diff --git a/pkg/fbs/motion/somo/fbtypes/CmdResetSignal.go b/pkg/fbs/motion/somo/fbtypes/CmdResetSignal.go index ff4194a..c153036 100644 --- a/pkg/fbs/motion/somo/fbtypes/CmdResetSignal.go +++ b/pkg/fbs/motion/somo/fbtypes/CmdResetSignal.go @@ -8,7 +8,7 @@ import ( /// parameters for the command set signal type CmdResetSignalT struct { - SignalId uint32 + SignalId uint32 `json:"signalId"` } func (t *CmdResetSignalT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/somo/fbtypes/CmdSetSignal.go b/pkg/fbs/motion/somo/fbtypes/CmdSetSignal.go index 0c0d81e..ae63f07 100644 --- a/pkg/fbs/motion/somo/fbtypes/CmdSetSignal.go +++ b/pkg/fbs/motion/somo/fbtypes/CmdSetSignal.go @@ -8,7 +8,7 @@ import ( /// parameters for the command set signal type CmdSetSignalT struct { - SignalId uint32 + SignalId uint32 `json:"signalId"` } func (t *CmdSetSignalT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/somo/fbtypes/CmdWaitForSignal.go b/pkg/fbs/motion/somo/fbtypes/CmdWaitForSignal.go index ce859c4..f81ce83 100644 --- a/pkg/fbs/motion/somo/fbtypes/CmdWaitForSignal.go +++ b/pkg/fbs/motion/somo/fbtypes/CmdWaitForSignal.go @@ -8,8 +8,8 @@ import ( /// parameters for the command wait for signal type CmdWaitForSignalT struct { - SignalId uint32 - AutoReset bool + SignalId uint32 `json:"signalId"` + AutoReset bool `json:"autoReset"` } func (t *CmdWaitForSignalT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCfgCalcPipeline.go b/pkg/fbs/motion/sync/fbtypes/AxsCfgCalcPipeline.go index e18f00d..a2bece5 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsCfgCalcPipeline.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsCfgCalcPipeline.go @@ -8,13 +8,16 @@ import ( /// configuration of a single calculation pipelines type AxsCfgCalcPipelineT struct { - Name string - Steps *AxsCfgCalcStepAllT + Name string `json:"name"` + Steps *AxsCfgCalcStepAllT `json:"steps"` } func (t *AxsCfgCalcPipelineT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } stepsOffset := t.Steps.Pack(builder) AxsCfgCalcPipelineStart(builder) AxsCfgCalcPipelineAddName(builder, nameOffset) diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCfgCalcPipelineAll.go b/pkg/fbs/motion/sync/fbtypes/AxsCfgCalcPipelineAll.go index 6687cb5..42168ac 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsCfgCalcPipelineAll.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsCfgCalcPipelineAll.go @@ -1,111 +1,111 @@ -// Code generated by the FlatBuffers compiler. DO NOT EDIT. - -package fbtypes - -import ( - flatbuffers "github.com/google/flatbuffers/go" -) - -/// configuration of all calculation pipelines of a single axis -type AxsCfgCalcPipelineAllT struct { - Pipelines []*AxsCfgCalcPipelineT -} - -func (t *AxsCfgCalcPipelineAllT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { - if t == nil { return 0 } - pipelinesOffset := flatbuffers.UOffsetT(0) - if t.Pipelines != nil { - pipelinesLength := len(t.Pipelines) - pipelinesOffsets := make([]flatbuffers.UOffsetT, pipelinesLength) - for j := 0; j < pipelinesLength; j++ { - pipelinesOffsets[j] = t.Pipelines[j].Pack(builder) - } - AxsCfgCalcPipelineAllStartPipelinesVector(builder, pipelinesLength) - for j := pipelinesLength - 1; j >= 0; j-- { - builder.PrependUOffsetT(pipelinesOffsets[j]) - } - pipelinesOffset = builder.EndVector(pipelinesLength) - } - AxsCfgCalcPipelineAllStart(builder) - AxsCfgCalcPipelineAllAddPipelines(builder, pipelinesOffset) - return AxsCfgCalcPipelineAllEnd(builder) -} - -func (rcv *AxsCfgCalcPipelineAll) UnPackTo(t *AxsCfgCalcPipelineAllT) { - pipelinesLength := rcv.PipelinesLength() - t.Pipelines = make([]*AxsCfgCalcPipelineT, pipelinesLength) - for j := 0; j < pipelinesLength; j++ { - x := AxsCfgCalcPipeline{} - rcv.Pipelines(&x, j) - t.Pipelines[j] = x.UnPack() - } -} - -func (rcv *AxsCfgCalcPipelineAll) UnPack() *AxsCfgCalcPipelineAllT { - if rcv == nil { return nil } - t := &AxsCfgCalcPipelineAllT{} - rcv.UnPackTo(t) - return t -} - -type AxsCfgCalcPipelineAll struct { - _tab flatbuffers.Table -} - -func GetRootAsAxsCfgCalcPipelineAll(buf []byte, offset flatbuffers.UOffsetT) *AxsCfgCalcPipelineAll { - n := flatbuffers.GetUOffsetT(buf[offset:]) - x := &AxsCfgCalcPipelineAll{} - x.Init(buf, n+offset) - return x -} - -func GetSizePrefixedRootAsAxsCfgCalcPipelineAll(buf []byte, offset flatbuffers.UOffsetT) *AxsCfgCalcPipelineAll { - n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) - x := &AxsCfgCalcPipelineAll{} - x.Init(buf, n+offset+flatbuffers.SizeUint32) - return x -} - -func (rcv *AxsCfgCalcPipelineAll) Init(buf []byte, i flatbuffers.UOffsetT) { - rcv._tab.Bytes = buf - rcv._tab.Pos = i -} - -func (rcv *AxsCfgCalcPipelineAll) Table() flatbuffers.Table { - return rcv._tab -} - -/// vector of all pipelines -func (rcv *AxsCfgCalcPipelineAll) Pipelines(obj *AxsCfgCalcPipeline, j int) bool { - o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) - if o != 0 { - x := rcv._tab.Vector(o) - x += flatbuffers.UOffsetT(j) * 4 - x = rcv._tab.Indirect(x) - obj.Init(rcv._tab.Bytes, x) - return true - } - return false -} - -func (rcv *AxsCfgCalcPipelineAll) PipelinesLength() int { - o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) - if o != 0 { - return rcv._tab.VectorLen(o) - } - return 0 -} - -/// vector of all pipelines -func AxsCfgCalcPipelineAllStart(builder *flatbuffers.Builder) { - builder.StartObject(1) -} -func AxsCfgCalcPipelineAllAddPipelines(builder *flatbuffers.Builder, pipelines flatbuffers.UOffsetT) { - builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(pipelines), 0) -} -func AxsCfgCalcPipelineAllStartPipelinesVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { - return builder.StartVector(4, numElems, 4) -} -func AxsCfgCalcPipelineAllEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { - return builder.EndObject() -} +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// configuration of all calculation pipelines +type AxsCfgCalcPipelineAllT struct { + Pipelines []*AxsCfgCalcPipelineT `json:"pipelines"` +} + +func (t *AxsCfgCalcPipelineAllT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + pipelinesOffset := flatbuffers.UOffsetT(0) + if t.Pipelines != nil { + pipelinesLength := len(t.Pipelines) + pipelinesOffsets := make([]flatbuffers.UOffsetT, pipelinesLength) + for j := 0; j < pipelinesLength; j++ { + pipelinesOffsets[j] = t.Pipelines[j].Pack(builder) + } + AxsCfgCalcPipelineAllStartPipelinesVector(builder, pipelinesLength) + for j := pipelinesLength - 1; j >= 0; j-- { + builder.PrependUOffsetT(pipelinesOffsets[j]) + } + pipelinesOffset = builder.EndVector(pipelinesLength) + } + AxsCfgCalcPipelineAllStart(builder) + AxsCfgCalcPipelineAllAddPipelines(builder, pipelinesOffset) + return AxsCfgCalcPipelineAllEnd(builder) +} + +func (rcv *AxsCfgCalcPipelineAll) UnPackTo(t *AxsCfgCalcPipelineAllT) { + pipelinesLength := rcv.PipelinesLength() + t.Pipelines = make([]*AxsCfgCalcPipelineT, pipelinesLength) + for j := 0; j < pipelinesLength; j++ { + x := AxsCfgCalcPipeline{} + rcv.Pipelines(&x, j) + t.Pipelines[j] = x.UnPack() + } +} + +func (rcv *AxsCfgCalcPipelineAll) UnPack() *AxsCfgCalcPipelineAllT { + if rcv == nil { return nil } + t := &AxsCfgCalcPipelineAllT{} + rcv.UnPackTo(t) + return t +} + +type AxsCfgCalcPipelineAll struct { + _tab flatbuffers.Table +} + +func GetRootAsAxsCfgCalcPipelineAll(buf []byte, offset flatbuffers.UOffsetT) *AxsCfgCalcPipelineAll { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &AxsCfgCalcPipelineAll{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsAxsCfgCalcPipelineAll(buf []byte, offset flatbuffers.UOffsetT) *AxsCfgCalcPipelineAll { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &AxsCfgCalcPipelineAll{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *AxsCfgCalcPipelineAll) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *AxsCfgCalcPipelineAll) Table() flatbuffers.Table { + return rcv._tab +} + +/// vector of all pipelines +func (rcv *AxsCfgCalcPipelineAll) Pipelines(obj *AxsCfgCalcPipeline, j int) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Vector(o) + x += flatbuffers.UOffsetT(j) * 4 + x = rcv._tab.Indirect(x) + obj.Init(rcv._tab.Bytes, x) + return true + } + return false +} + +func (rcv *AxsCfgCalcPipelineAll) PipelinesLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +/// vector of all pipelines +func AxsCfgCalcPipelineAllStart(builder *flatbuffers.Builder) { + builder.StartObject(1) +} +func AxsCfgCalcPipelineAllAddPipelines(builder *flatbuffers.Builder, pipelines flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(pipelines), 0) +} +func AxsCfgCalcPipelineAllStartPipelinesVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} +func AxsCfgCalcPipelineAllEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCfgCalcStep.go b/pkg/fbs/motion/sync/fbtypes/AxsCfgCalcStep.go index 4bbc4f3..f0c17d3 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsCfgCalcStep.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsCfgCalcStep.go @@ -8,15 +8,18 @@ import ( /// configuration of a single calculation step type AxsCfgCalcStepT struct { - StepID uint32 - Type string - Inputs []string - Parameter *AxsCfgCalcStepParamAllT + StepId uint32 `json:"stepID"` + Type string `json:"type"` + Inputs []string `json:"inputs"` + Parameter *AxsCfgCalcStepParamAllT `json:"parameter"` } func (t *AxsCfgCalcStepT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - typeOffset := builder.CreateString(t.Type) + type_Offset := flatbuffers.UOffsetT(0) + if t.Type != "" { + type_Offset = builder.CreateString(t.Type) + } inputsOffset := flatbuffers.UOffsetT(0) if t.Inputs != nil { inputsLength := len(t.Inputs) @@ -32,15 +35,15 @@ func (t *AxsCfgCalcStepT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffset } parameterOffset := t.Parameter.Pack(builder) AxsCfgCalcStepStart(builder) - AxsCfgCalcStepAddStepID(builder, t.StepID) - AxsCfgCalcStepAddType(builder, typeOffset) + AxsCfgCalcStepAddStepId(builder, t.StepId) + AxsCfgCalcStepAddType(builder, type_Offset) AxsCfgCalcStepAddInputs(builder, inputsOffset) AxsCfgCalcStepAddParameter(builder, parameterOffset) return AxsCfgCalcStepEnd(builder) } func (rcv *AxsCfgCalcStep) UnPackTo(t *AxsCfgCalcStepT) { - t.StepID = rcv.StepID() + t.StepId = rcv.StepId() t.Type = string(rcv.Type()) inputsLength := rcv.InputsLength() t.Inputs = make([]string, inputsLength) @@ -85,7 +88,7 @@ func (rcv *AxsCfgCalcStep) Table() flatbuffers.Table { } /// ID of the calculation step -func (rcv *AxsCfgCalcStep) StepID() uint32 { +func (rcv *AxsCfgCalcStep) StepId() uint32 { o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) if o != 0 { return rcv._tab.GetUint32(o + rcv._tab.Pos) @@ -94,7 +97,7 @@ func (rcv *AxsCfgCalcStep) StepID() uint32 { } /// ID of the calculation step -func (rcv *AxsCfgCalcStep) MutateStepID(n uint32) bool { +func (rcv *AxsCfgCalcStep) MutateStepId(n uint32) bool { return rcv._tab.MutateUint32Slot(4, n) } @@ -145,8 +148,8 @@ func (rcv *AxsCfgCalcStep) Parameter(obj *AxsCfgCalcStepParamAll) *AxsCfgCalcSte func AxsCfgCalcStepStart(builder *flatbuffers.Builder) { builder.StartObject(4) } -func AxsCfgCalcStepAddStepID(builder *flatbuffers.Builder, stepID uint32) { - builder.PrependUint32Slot(0, stepID, 0) +func AxsCfgCalcStepAddStepId(builder *flatbuffers.Builder, stepId uint32) { + builder.PrependUint32Slot(0, stepId, 0) } func AxsCfgCalcStepAddType(builder *flatbuffers.Builder, type_ flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(type_), 0) diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCfgCalcStepAll.go b/pkg/fbs/motion/sync/fbtypes/AxsCfgCalcStepAll.go index b6852b3..06a1cb4 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsCfgCalcStepAll.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsCfgCalcStepAll.go @@ -8,7 +8,7 @@ import ( /// configuration of all calculation steps of a single calculation pipeline type AxsCfgCalcStepAllT struct { - Steps []*AxsCfgCalcStepT + Steps []*AxsCfgCalcStepT `json:"steps"` } func (t *AxsCfgCalcStepAllT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCfgCalcStepParam.go b/pkg/fbs/motion/sync/fbtypes/AxsCfgCalcStepParam.go index 53a5732..2a67a07 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsCfgCalcStepParam.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsCfgCalcStepParam.go @@ -6,39 +6,31 @@ import ( flatbuffers "github.com/google/flatbuffers/go" ) -/// a single parameter of a calculation step, when writing it, only name value and unit should be set. +/// a single parameter of a calculation step type AxsCfgCalcStepParamT struct { - Name string - Value string - Unit string - Description string - Mandatory bool - Type ParameterType + Name string `json:"name"` + Value string `json:"value"` } func (t *AxsCfgCalcStepParamT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - valueOffset := builder.CreateString(t.Value) - unitOffset := builder.CreateString(t.Unit) - descriptionOffset := builder.CreateString(t.Description) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + valueOffset := flatbuffers.UOffsetT(0) + if t.Value != "" { + valueOffset = builder.CreateString(t.Value) + } AxsCfgCalcStepParamStart(builder) AxsCfgCalcStepParamAddName(builder, nameOffset) AxsCfgCalcStepParamAddValue(builder, valueOffset) - AxsCfgCalcStepParamAddUnit(builder, unitOffset) - AxsCfgCalcStepParamAddDescription(builder, descriptionOffset) - AxsCfgCalcStepParamAddMandatory(builder, t.Mandatory) - AxsCfgCalcStepParamAddType(builder, t.Type) return AxsCfgCalcStepParamEnd(builder) } func (rcv *AxsCfgCalcStepParam) UnPackTo(t *AxsCfgCalcStepParamT) { t.Name = string(rcv.Name()) t.Value = string(rcv.Value()) - t.Unit = string(rcv.Unit()) - t.Description = string(rcv.Description()) - t.Mandatory = rcv.Mandatory() - t.Type = rcv.Type() } func (rcv *AxsCfgCalcStepParam) UnPack() *AxsCfgCalcStepParamT { @@ -95,56 +87,8 @@ func (rcv *AxsCfgCalcStepParam) Value() []byte { } /// value of the parameter -/// unit of the parameter -func (rcv *AxsCfgCalcStepParam) Unit() []byte { - o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) - if o != 0 { - return rcv._tab.ByteVector(o + rcv._tab.Pos) - } - return nil -} - -/// unit of the parameter -/// what the parameter of the calculation step does, only for reading -func (rcv *AxsCfgCalcStepParam) Description() []byte { - o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) - if o != 0 { - return rcv._tab.ByteVector(o + rcv._tab.Pos) - } - return nil -} - -/// what the parameter of the calculation step does, only for reading -/// is this parameter mandatory, only for reading -func (rcv *AxsCfgCalcStepParam) Mandatory() bool { - o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) - if o != 0 { - return rcv._tab.GetBool(o + rcv._tab.Pos) - } - return false -} - -/// is this parameter mandatory, only for reading -func (rcv *AxsCfgCalcStepParam) MutateMandatory(n bool) bool { - return rcv._tab.MutateBoolSlot(12, n) -} - -/// type of the parameter, only for reading -func (rcv *AxsCfgCalcStepParam) Type() ParameterType { - o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) - if o != 0 { - return ParameterType(rcv._tab.GetInt8(o + rcv._tab.Pos)) - } - return 0 -} - -/// type of the parameter, only for reading -func (rcv *AxsCfgCalcStepParam) MutateType(n ParameterType) bool { - return rcv._tab.MutateInt8Slot(14, int8(n)) -} - func AxsCfgCalcStepParamStart(builder *flatbuffers.Builder) { - builder.StartObject(6) + builder.StartObject(2) } func AxsCfgCalcStepParamAddName(builder *flatbuffers.Builder, name flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(name), 0) @@ -152,18 +96,6 @@ func AxsCfgCalcStepParamAddName(builder *flatbuffers.Builder, name flatbuffers.U func AxsCfgCalcStepParamAddValue(builder *flatbuffers.Builder, value flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(value), 0) } -func AxsCfgCalcStepParamAddUnit(builder *flatbuffers.Builder, unit flatbuffers.UOffsetT) { - builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(unit), 0) -} -func AxsCfgCalcStepParamAddDescription(builder *flatbuffers.Builder, description flatbuffers.UOffsetT) { - builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(description), 0) -} -func AxsCfgCalcStepParamAddMandatory(builder *flatbuffers.Builder, mandatory bool) { - builder.PrependBoolSlot(4, mandatory, false) -} -func AxsCfgCalcStepParamAddType(builder *flatbuffers.Builder, type_ ParameterType) { - builder.PrependInt8Slot(5, int8(type_), 0) -} func AxsCfgCalcStepParamEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() } diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCfgCalcStepParamAll.go b/pkg/fbs/motion/sync/fbtypes/AxsCfgCalcStepParamAll.go index bf723fd..6da1a11 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsCfgCalcStepParamAll.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsCfgCalcStepParamAll.go @@ -8,7 +8,7 @@ import ( /// configuration of all parameters of a single calculation step type AxsCfgCalcStepParamAllT struct { - Params []*AxsCfgCalcStepParamT + Params []*AxsCfgCalcStepParamT `json:"params"` } func (t *AxsCfgCalcStepParamAllT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCfgDynSynchronisation.go b/pkg/fbs/motion/sync/fbtypes/AxsCfgDynSynchronisation.go index a120919..2cd8dc1 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsCfgDynSynchronisation.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsCfgDynSynchronisation.go @@ -8,7 +8,7 @@ import ( /// Configuration of the dynamic synchronisation behavior of a single axis type AxsCfgDynSynchronisationT struct { - Limits *AxsCfgDynSynchronisationLimT + Limits *AxsCfgDynSynchronisationLimT `json:"limits"` } func (t *AxsCfgDynSynchronisationT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCfgDynSynchronisationLim.go b/pkg/fbs/motion/sync/fbtypes/AxsCfgDynSynchronisationLim.go index 90eb02a..dd194a9 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsCfgDynSynchronisationLim.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsCfgDynSynchronisationLim.go @@ -8,12 +8,12 @@ import ( /// Configuration of the dynamic synchronisation limits of a single axis type AxsCfgDynSynchronisationLimT struct { - Acc float64 - Dec float64 - JrkAcc float64 - JrkDec float64 - VelNeg float64 - VelPos float64 + Acc float64 `json:"acc"` + Dec float64 `json:"dec"` + JrkAcc float64 `json:"jrkAcc"` + JrkDec float64 `json:"jrkDec"` + VelNeg float64 `json:"velNeg"` + VelPos float64 `json:"velPos"` } func (t *AxsCfgDynSynchronisationLimT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCfgErrReaction.go b/pkg/fbs/motion/sync/fbtypes/AxsCfgErrReaction.go index 3e5f64e..2649331 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsCfgErrReaction.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsCfgErrReaction.go @@ -8,7 +8,7 @@ import ( /// Configuration of the error reaction behavior of a single axis type AxsCfgErrReactionT struct { - SlaveLimitsExceeded *AxsCfgErrReactionSlaveLimExceededT + SlaveLimitsExceeded *AxsCfgErrReactionSlaveLimExceededT `json:"slaveLimitsExceeded"` } func (t *AxsCfgErrReactionT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCfgErrReactionSlaveLimExceeded.go b/pkg/fbs/motion/sync/fbtypes/AxsCfgErrReactionSlaveLimExceeded.go index af94f11..2db713e 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsCfgErrReactionSlaveLimExceeded.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsCfgErrReactionSlaveLimExceeded.go @@ -8,8 +8,8 @@ import ( /// TODO: Provide description type AxsCfgErrReactionSlaveLimExceededT struct { - Type SlaveCantFollowErrorReaction - Diagnosis SlaveCantFollowMessageType + Type SlaveCantFollowErrorReaction `json:"type"` + Diagnosis SlaveCantFollowMessageType `json:"diagnosis"` } func (t *AxsCfgErrReactionSlaveLimExceededT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCfgSyncMotion.go b/pkg/fbs/motion/sync/fbtypes/AxsCfgSyncMotion.go index db264e9..9457d6c 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsCfgSyncMotion.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsCfgSyncMotion.go @@ -8,9 +8,9 @@ import ( /// Configuration of the synchronized motion behavior of a single axis type AxsCfgSyncMotionT struct { - ErrorReaction *AxsCfgErrReactionT - DynSynchronisation *AxsCfgDynSynchronisationT - CalculationPipelines []*AxsCfgCalcPipelineT + ErrorReaction *AxsCfgErrReactionT `json:"errorReaction"` + DynSynchronisation *AxsCfgDynSynchronisationT `json:"dynSynchronisation"` + CalculationPipelines []*AxsCfgCalcPipelineT `json:"calculationPipelines"` } func (t *AxsCfgSyncMotionT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInPosData.go b/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInPosData.go index 0bc09d5..1e92663 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInPosData.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInPosData.go @@ -8,17 +8,20 @@ import ( /// parameters of the axis GearInPos command type AxsCmdGearInPosDataT struct { - Master string - SyncSource SyncSource - SyncMode SyncMode - SyncDirection SyncDirection - Parameters *AxsCmdGearInPosParamsT - Buffered bool + Master string `json:"master"` + SyncSource SyncSource `json:"syncSource"` + SyncMode SyncMode `json:"syncMode"` + SyncDirection SyncDirection `json:"syncDirection"` + Parameters *AxsCmdGearInPosParamsT `json:"parameters"` + Buffered bool `json:"buffered"` } func (t *AxsCmdGearInPosDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - masterOffset := builder.CreateString(t.Master) + masterOffset := flatbuffers.UOffsetT(0) + if t.Master != "" { + masterOffset = builder.CreateString(t.Master) + } parametersOffset := t.Parameters.Pack(builder) AxsCmdGearInPosDataStart(builder) AxsCmdGearInPosDataAddMaster(builder, masterOffset) diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInPosDlParams.go b/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInPosDlParams.go index f9aba0e..fc4a2d4 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInPosDlParams.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInPosDlParams.go @@ -8,17 +8,17 @@ import ( /// GearInPos calculation pipeline parameters, that are stored in the Datalayer RT, for the axis GearInPosEx command type AxsCmdGearInPosDlParamsT struct { - SoiMasterOffsetDlIdx int32 - SoiMasterOffsetVelDlIdx int32 - SoiMasterOffsetAccDlIdx int32 - SoiSlaveOffsetDlIdx int32 - SoiSlaveOffsetVelDlIdx int32 - SoiSlaveOffsetAccDlIdx int32 - FofMasterOffsetDlIdx int32 - FofMasterOffsetTimeConstantDlIdx int32 - FofSlaveOffsetDlIdx int32 - FofSlaveOffsetTimeConstantDlIdx int32 - FineAdjustDlIdx int32 + SoiMasterOffsetDlIdx int32 `json:"soiMasterOffsetDlIdx"` + SoiMasterOffsetVelDlIdx int32 `json:"soiMasterOffsetVelDlIdx"` + SoiMasterOffsetAccDlIdx int32 `json:"soiMasterOffsetAccDlIdx"` + SoiSlaveOffsetDlIdx int32 `json:"soiSlaveOffsetDlIdx"` + SoiSlaveOffsetVelDlIdx int32 `json:"soiSlaveOffsetVelDlIdx"` + SoiSlaveOffsetAccDlIdx int32 `json:"soiSlaveOffsetAccDlIdx"` + FofMasterOffsetDlIdx int32 `json:"fofMasterOffsetDlIdx"` + FofMasterOffsetTimeConstantDlIdx int32 `json:"fofMasterOffsetTimeConstantDlIdx"` + FofSlaveOffsetDlIdx int32 `json:"fofSlaveOffsetDlIdx"` + FofSlaveOffsetTimeConstantDlIdx int32 `json:"fofSlaveOffsetTimeConstantDlIdx"` + FineAdjustDlIdx int32 `json:"fineAdjustDlIdx"` } func (t *AxsCmdGearInPosDlParamsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInPosExData.go b/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInPosExData.go index bbc13a4..e50764c 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInPosExData.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInPosExData.go @@ -8,18 +8,21 @@ import ( /// parameters of the axis GearInPosEx command type AxsCmdGearInPosExDataT struct { - Master string - SyncSource SyncSource - SyncMode SyncMode - SyncDirection SyncDirection - Parameters *AxsCmdGearInPosParamsT - DlParameters *AxsCmdGearInPosDlParamsT - Buffered bool + Master string `json:"master"` + SyncSource SyncSource `json:"syncSource"` + SyncMode SyncMode `json:"syncMode"` + SyncDirection SyncDirection `json:"syncDirection"` + Parameters *AxsCmdGearInPosParamsT `json:"parameters"` + DlParameters *AxsCmdGearInPosDlParamsT `json:"dlParameters"` + Buffered bool `json:"buffered"` } func (t *AxsCmdGearInPosExDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - masterOffset := builder.CreateString(t.Master) + masterOffset := flatbuffers.UOffsetT(0) + if t.Master != "" { + masterOffset = builder.CreateString(t.Master) + } parametersOffset := t.Parameters.Pack(builder) dlParametersOffset := t.DlParameters.Pack(builder) AxsCmdGearInPosExDataStart(builder) diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInPosParams.go b/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInPosParams.go index 8c48ded..59e7fc5 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInPosParams.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInPosParams.go @@ -8,11 +8,11 @@ import ( /// GearInPos calculation pipeline parameters for the axis GearInPos command type AxsCmdGearInPosParamsT struct { - MasterOffset float64 - SlaveOffset float64 - RatioNumerator int32 - RatioDenominator int32 - FineAdjust float64 + MasterOffset float64 `json:"masterOffset"` + SlaveOffset float64 `json:"slaveOffset"` + RatioNumerator int32 `json:"ratioNumerator"` + RatioDenominator int32 `json:"ratioDenominator"` + FineAdjust float64 `json:"fineAdjust"` } func (t *AxsCmdGearInPosParamsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInVelData.go b/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInVelData.go index 6c3d83c..0a02fef 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInVelData.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInVelData.go @@ -8,15 +8,18 @@ import ( /// parameters of the axis GearInVel commands type AxsCmdGearInVelDataT struct { - Master string - SyncSource SyncSource - Parameters *AxsCmdGearInVelParamsT - Buffered bool + Master string `json:"master"` + SyncSource SyncSource `json:"syncSource"` + Parameters *AxsCmdGearInVelParamsT `json:"parameters"` + Buffered bool `json:"buffered"` } func (t *AxsCmdGearInVelDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - masterOffset := builder.CreateString(t.Master) + masterOffset := flatbuffers.UOffsetT(0) + if t.Master != "" { + masterOffset = builder.CreateString(t.Master) + } parametersOffset := t.Parameters.Pack(builder) AxsCmdGearInVelDataStart(builder) AxsCmdGearInVelDataAddMaster(builder, masterOffset) diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInVelDlParams.go b/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInVelDlParams.go index 30c469b..4a3d51c 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInVelDlParams.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInVelDlParams.go @@ -8,15 +8,15 @@ import ( /// GearInVel calculation pipeline parameters, that are stored in the Datalayer RT, for the axis GearInVelEx command type AxsCmdGearInVelDlParamsT struct { - SoiMasterOffsetDlIdx int32 - SoiMasterOffsetVelDlIdx int32 - SoiMasterOffsetAccDlIdx int32 - FofMasterOffsetDlIdx int32 - FofMasterOffsetTimeConstantDlIdx int32 - SlaveVelOffsetDlIdx int32 - FoiSlaveOffsetDlIdx int32 - FoiSlaveOffsetAccDlIdx int32 - FineAdjustDlIdx int32 + SoiMasterOffsetDlIdx int32 `json:"soiMasterOffsetDlIdx"` + SoiMasterOffsetVelDlIdx int32 `json:"soiMasterOffsetVelDlIdx"` + SoiMasterOffsetAccDlIdx int32 `json:"soiMasterOffsetAccDlIdx"` + FofMasterOffsetDlIdx int32 `json:"fofMasterOffsetDlIdx"` + FofMasterOffsetTimeConstantDlIdx int32 `json:"fofMasterOffsetTimeConstantDlIdx"` + SlaveVelOffsetDlIdx int32 `json:"slaveVelOffsetDlIdx"` + FoiSlaveOffsetDlIdx int32 `json:"foiSlaveOffsetDlIdx"` + FoiSlaveOffsetAccDlIdx int32 `json:"foiSlaveOffsetAccDlIdx"` + FineAdjustDlIdx int32 `json:"fineAdjustDlIdx"` } func (t *AxsCmdGearInVelDlParamsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInVelExData.go b/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInVelExData.go index 52d8120..27505b1 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInVelExData.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInVelExData.go @@ -8,16 +8,19 @@ import ( /// parameters of the axis GearInVelEx command type AxsCmdGearInVelExDataT struct { - Master string - SyncSource SyncSource - Parameters *AxsCmdGearInVelParamsT - DlParameters *AxsCmdGearInVelDlParamsT - Buffered bool + Master string `json:"master"` + SyncSource SyncSource `json:"syncSource"` + Parameters *AxsCmdGearInVelParamsT `json:"parameters"` + DlParameters *AxsCmdGearInVelDlParamsT `json:"dlParameters"` + Buffered bool `json:"buffered"` } func (t *AxsCmdGearInVelExDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - masterOffset := builder.CreateString(t.Master) + masterOffset := flatbuffers.UOffsetT(0) + if t.Master != "" { + masterOffset = builder.CreateString(t.Master) + } parametersOffset := t.Parameters.Pack(builder) dlParametersOffset := t.DlParameters.Pack(builder) AxsCmdGearInVelExDataStart(builder) diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInVelParams.go b/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInVelParams.go index 8a04b44..3b03f09 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInVelParams.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsCmdGearInVelParams.go @@ -8,10 +8,10 @@ import ( /// GearInVel calculation pipeline parameters for the axis GearInVel command type AxsCmdGearInVelParamsT struct { - SlaveVelOffset float64 - RatioNumerator int32 - RatioDenominator int32 - FineAdjust float64 + SlaveVelOffset float64 `json:"slaveVelOffset"` + RatioNumerator int32 `json:"ratioNumerator"` + RatioDenominator int32 `json:"ratioDenominator"` + FineAdjust float64 `json:"fineAdjust"` } func (t *AxsCmdGearInVelParamsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCmdSyncGenericData.go b/pkg/fbs/motion/sync/fbtypes/AxsCmdSyncGenericData.go index 0c5abfd..1a8b363 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsCmdSyncGenericData.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsCmdSyncGenericData.go @@ -8,15 +8,21 @@ import ( /// parameters of the axis command for generic synchronized motion type AxsCmdSyncGenericDataT struct { - Master string - Pipeline string - Buffered bool + Master string `json:"master"` + Pipeline string `json:"pipeline"` + Buffered bool `json:"buffered"` } func (t *AxsCmdSyncGenericDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - masterOffset := builder.CreateString(t.Master) - pipelineOffset := builder.CreateString(t.Pipeline) + masterOffset := flatbuffers.UOffsetT(0) + if t.Master != "" { + masterOffset = builder.CreateString(t.Master) + } + pipelineOffset := flatbuffers.UOffsetT(0) + if t.Pipeline != "" { + pipelineOffset = builder.CreateString(t.Pipeline) + } AxsCmdSyncGenericDataStart(builder) AxsCmdSyncGenericDataAddMaster(builder, masterOffset) AxsCmdSyncGenericDataAddPipeline(builder, pipelineOffset) diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCmdSyncGenericGearInData.go b/pkg/fbs/motion/sync/fbtypes/AxsCmdSyncGenericGearInData.go index cdd9fef..430b014 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsCmdSyncGenericGearInData.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsCmdSyncGenericGearInData.go @@ -8,16 +8,22 @@ import ( /// parameters of the axis generic GearIn command type AxsCmdSyncGenericGearInDataT struct { - Master string - Pipeline string - SyncSource SyncSource - Buffered bool + Master string `json:"master"` + Pipeline string `json:"pipeline"` + SyncSource SyncSource `json:"syncSource"` + Buffered bool `json:"buffered"` } func (t *AxsCmdSyncGenericGearInDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - masterOffset := builder.CreateString(t.Master) - pipelineOffset := builder.CreateString(t.Pipeline) + masterOffset := flatbuffers.UOffsetT(0) + if t.Master != "" { + masterOffset = builder.CreateString(t.Master) + } + pipelineOffset := flatbuffers.UOffsetT(0) + if t.Pipeline != "" { + pipelineOffset = builder.CreateString(t.Pipeline) + } AxsCmdSyncGenericGearInDataStart(builder) AxsCmdSyncGenericGearInDataAddMaster(builder, masterOffset) AxsCmdSyncGenericGearInDataAddPipeline(builder, pipelineOffset) diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCmdSyncGenericGearInPosData.go b/pkg/fbs/motion/sync/fbtypes/AxsCmdSyncGenericGearInPosData.go index a5b8ffa..ab98a50 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsCmdSyncGenericGearInPosData.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsCmdSyncGenericGearInPosData.go @@ -8,18 +8,24 @@ import ( /// parameters of the axis generic GearInPos command type AxsCmdSyncGenericGearInPosDataT struct { - Master string - Pipeline string - SyncSource SyncSource - SyncMode SyncMode - SyncDirection SyncDirection - Buffered bool + Master string `json:"master"` + Pipeline string `json:"pipeline"` + SyncSource SyncSource `json:"syncSource"` + SyncMode SyncMode `json:"syncMode"` + SyncDirection SyncDirection `json:"syncDirection"` + Buffered bool `json:"buffered"` } func (t *AxsCmdSyncGenericGearInPosDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - masterOffset := builder.CreateString(t.Master) - pipelineOffset := builder.CreateString(t.Pipeline) + masterOffset := flatbuffers.UOffsetT(0) + if t.Master != "" { + masterOffset = builder.CreateString(t.Master) + } + pipelineOffset := flatbuffers.UOffsetT(0) + if t.Pipeline != "" { + pipelineOffset = builder.CreateString(t.Pipeline) + } AxsCmdSyncGenericGearInPosDataStart(builder) AxsCmdSyncGenericGearInPosDataAddMaster(builder, masterOffset) AxsCmdSyncGenericGearInPosDataAddPipeline(builder, pipelineOffset) diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCmdSyncGenericGearInVelData.go b/pkg/fbs/motion/sync/fbtypes/AxsCmdSyncGenericGearInVelData.go index effeef5..0049e1d 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsCmdSyncGenericGearInVelData.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsCmdSyncGenericGearInVelData.go @@ -8,16 +8,22 @@ import ( /// parameters of the axis generic GearInVel command type AxsCmdSyncGenericGearInVelDataT struct { - Master string - Pipeline string - SyncSource SyncSource - Buffered bool + Master string `json:"master"` + Pipeline string `json:"pipeline"` + SyncSource SyncSource `json:"syncSource"` + Buffered bool `json:"buffered"` } func (t *AxsCmdSyncGenericGearInVelDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - masterOffset := builder.CreateString(t.Master) - pipelineOffset := builder.CreateString(t.Pipeline) + masterOffset := flatbuffers.UOffsetT(0) + if t.Master != "" { + masterOffset = builder.CreateString(t.Master) + } + pipelineOffset := flatbuffers.UOffsetT(0) + if t.Pipeline != "" { + pipelineOffset = builder.CreateString(t.Pipeline) + } AxsCmdSyncGenericGearInVelDataStart(builder) AxsCmdSyncGenericGearInVelDataAddMaster(builder, masterOffset) AxsCmdSyncGenericGearInVelDataAddPipeline(builder, pipelineOffset) diff --git a/pkg/fbs/motion/sync/fbtypes/AxsStateCalcPipelineInputs.go b/pkg/fbs/motion/sync/fbtypes/AxsStateCalcPipelineInputs.go index bde4c8f..0be1193 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsStateCalcPipelineInputs.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsStateCalcPipelineInputs.go @@ -8,9 +8,9 @@ import ( /// input parameters for reading the pipeline type AxsStateCalcPipelineInputsT struct { - Axes []string - SyncMode SyncMode - Inputs []*AxsStateCalcPipelineSingleInputT + Axes []string `json:"axes"` + SyncMode SyncMode `json:"syncMode"` + Inputs []float64 `json:"inputs"` } func (t *AxsStateCalcPipelineInputsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -31,13 +31,9 @@ func (t *AxsStateCalcPipelineInputsT) Pack(builder *flatbuffers.Builder) flatbuf inputsOffset := flatbuffers.UOffsetT(0) if t.Inputs != nil { inputsLength := len(t.Inputs) - inputsOffsets := make([]flatbuffers.UOffsetT, inputsLength) - for j := 0; j < inputsLength; j++ { - inputsOffsets[j] = t.Inputs[j].Pack(builder) - } AxsStateCalcPipelineInputsStartInputsVector(builder, inputsLength) for j := inputsLength - 1; j >= 0; j-- { - builder.PrependUOffsetT(inputsOffsets[j]) + builder.PrependFloat64(t.Inputs[j]) } inputsOffset = builder.EndVector(inputsLength) } @@ -56,11 +52,9 @@ func (rcv *AxsStateCalcPipelineInputs) UnPackTo(t *AxsStateCalcPipelineInputsT) } t.SyncMode = rcv.SyncMode() inputsLength := rcv.InputsLength() - t.Inputs = make([]*AxsStateCalcPipelineSingleInputT, inputsLength) + t.Inputs = make([]float64, inputsLength) for j := 0; j < inputsLength; j++ { - x := AxsStateCalcPipelineSingleInput{} - rcv.Inputs(&x, j) - t.Inputs[j] = x.UnPack() + t.Inputs[j] = rcv.Inputs(j) } } @@ -132,16 +126,13 @@ func (rcv *AxsStateCalcPipelineInputs) MutateSyncMode(n SyncMode) bool { } /// id of the requested data -func (rcv *AxsStateCalcPipelineInputs) Inputs(obj *AxsStateCalcPipelineSingleInput, j int) bool { +func (rcv *AxsStateCalcPipelineInputs) Inputs(j int) float64 { o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) if o != 0 { - x := rcv._tab.Vector(o) - x += flatbuffers.UOffsetT(j) * 4 - x = rcv._tab.Indirect(x) - obj.Init(rcv._tab.Bytes, x) - return true + a := rcv._tab.Vector(o) + return rcv._tab.GetFloat64(a + flatbuffers.UOffsetT(j*8)) } - return false + return 0 } func (rcv *AxsStateCalcPipelineInputs) InputsLength() int { @@ -153,6 +144,15 @@ func (rcv *AxsStateCalcPipelineInputs) InputsLength() int { } /// id of the requested data +func (rcv *AxsStateCalcPipelineInputs) MutateInputs(j int, n float64) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateFloat64(a+flatbuffers.UOffsetT(j*8), n) + } + return false +} + func AxsStateCalcPipelineInputsStart(builder *flatbuffers.Builder) { builder.StartObject(3) } @@ -169,7 +169,7 @@ func AxsStateCalcPipelineInputsAddInputs(builder *flatbuffers.Builder, inputs fl builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(inputs), 0) } func AxsStateCalcPipelineInputsStartInputsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { - return builder.StartVector(4, numElems, 4) + return builder.StartVector(8, numElems, 8) } func AxsStateCalcPipelineInputsEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() diff --git a/pkg/fbs/motion/sync/fbtypes/AxsStateCalcPipelines.go b/pkg/fbs/motion/sync/fbtypes/AxsStateCalcPipelines.go index c07cf21..338f5a8 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsStateCalcPipelines.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsStateCalcPipelines.go @@ -8,7 +8,7 @@ import ( /// all configured calculation pipelines of a single axis type AxsStateCalcPipelinesT struct { - Pipeline []*AxsStateCalcSinglePipelineT + Pipeline []*AxsStateCalcSinglePipelineT `json:"pipeline"` } func (t *AxsStateCalcPipelinesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/sync/fbtypes/AxsStateCalcSinglePipeline.go b/pkg/fbs/motion/sync/fbtypes/AxsStateCalcSinglePipeline.go index 2f35d16..84d8759 100644 --- a/pkg/fbs/motion/sync/fbtypes/AxsStateCalcSinglePipeline.go +++ b/pkg/fbs/motion/sync/fbtypes/AxsStateCalcSinglePipeline.go @@ -8,27 +8,26 @@ import ( /// current state of a single calculation pipeline of a single axis type AxsStateCalcSinglePipelineT struct { - Name string - State PipelineState - Validation *PipelineValidationT - IsBuiltIn bool - DryRunResult string - Steps *AxsStateCalcStepsT + Name string `json:"name"` + State PipelineState `json:"state"` + Validation *PipelineValidationT `json:"validation"` + IsBuiltIn bool `json:"isBuiltIn"` + RunCalculationPipeline float64 `json:"runCalculationPipeline"` } func (t *AxsStateCalcSinglePipelineT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } validationOffset := t.Validation.Pack(builder) - dryRunResultOffset := builder.CreateString(t.DryRunResult) - stepsOffset := t.Steps.Pack(builder) AxsStateCalcSinglePipelineStart(builder) AxsStateCalcSinglePipelineAddName(builder, nameOffset) AxsStateCalcSinglePipelineAddState(builder, t.State) AxsStateCalcSinglePipelineAddValidation(builder, validationOffset) AxsStateCalcSinglePipelineAddIsBuiltIn(builder, t.IsBuiltIn) - AxsStateCalcSinglePipelineAddDryRunResult(builder, dryRunResultOffset) - AxsStateCalcSinglePipelineAddSteps(builder, stepsOffset) + AxsStateCalcSinglePipelineAddRunCalculationPipeline(builder, t.RunCalculationPipeline) return AxsStateCalcSinglePipelineEnd(builder) } @@ -37,8 +36,7 @@ func (rcv *AxsStateCalcSinglePipeline) UnPackTo(t *AxsStateCalcSinglePipelineT) t.State = rcv.State() t.Validation = rcv.Validation(nil).UnPack() t.IsBuiltIn = rcv.IsBuiltIn() - t.DryRunResult = string(rcv.DryRunResult()) - t.Steps = rcv.Steps(nil).UnPack() + t.RunCalculationPipeline = rcv.RunCalculationPipeline() } func (rcv *AxsStateCalcSinglePipeline) UnPack() *AxsStateCalcSinglePipelineT { @@ -128,33 +126,22 @@ func (rcv *AxsStateCalcSinglePipeline) MutateIsBuiltIn(n bool) bool { return rcv._tab.MutateBoolSlot(10, n) } -/// result obtained after running calculation pipeline -func (rcv *AxsStateCalcSinglePipeline) DryRunResult() []byte { +/// result obtained after running calculation pipeline +func (rcv *AxsStateCalcSinglePipeline) RunCalculationPipeline() float64 { o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) if o != 0 { - return rcv._tab.ByteVector(o + rcv._tab.Pos) + return rcv._tab.GetFloat64(o + rcv._tab.Pos) } - return nil + return 0.0 } -/// result obtained after running calculation pipeline -/// all calculation steps of the calculation pipeline -func (rcv *AxsStateCalcSinglePipeline) Steps(obj *AxsStateCalcSteps) *AxsStateCalcSteps { - o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) - if o != 0 { - x := rcv._tab.Indirect(o + rcv._tab.Pos) - if obj == nil { - obj = new(AxsStateCalcSteps) - } - obj.Init(rcv._tab.Bytes, x) - return obj - } - return nil +/// result obtained after running calculation pipeline +func (rcv *AxsStateCalcSinglePipeline) MutateRunCalculationPipeline(n float64) bool { + return rcv._tab.MutateFloat64Slot(12, n) } -/// all calculation steps of the calculation pipeline func AxsStateCalcSinglePipelineStart(builder *flatbuffers.Builder) { - builder.StartObject(6) + builder.StartObject(5) } func AxsStateCalcSinglePipelineAddName(builder *flatbuffers.Builder, name flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(name), 0) @@ -168,11 +155,8 @@ func AxsStateCalcSinglePipelineAddValidation(builder *flatbuffers.Builder, valid func AxsStateCalcSinglePipelineAddIsBuiltIn(builder *flatbuffers.Builder, isBuiltIn bool) { builder.PrependBoolSlot(3, isBuiltIn, false) } -func AxsStateCalcSinglePipelineAddDryRunResult(builder *flatbuffers.Builder, dryRunResult flatbuffers.UOffsetT) { - builder.PrependUOffsetTSlot(4, flatbuffers.UOffsetT(dryRunResult), 0) -} -func AxsStateCalcSinglePipelineAddSteps(builder *flatbuffers.Builder, steps flatbuffers.UOffsetT) { - builder.PrependUOffsetTSlot(5, flatbuffers.UOffsetT(steps), 0) +func AxsStateCalcSinglePipelineAddRunCalculationPipeline(builder *flatbuffers.Builder, runCalculationPipeline float64) { + builder.PrependFloat64Slot(4, runCalculationPipeline, 0.0) } func AxsStateCalcSinglePipelineEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() diff --git a/pkg/fbs/motion/sync/fbtypes/CalcPipelineCfg.go b/pkg/fbs/motion/sync/fbtypes/CalcPipelineCfg.go index 0e09f1e..29ddc9a 100644 --- a/pkg/fbs/motion/sync/fbtypes/CalcPipelineCfg.go +++ b/pkg/fbs/motion/sync/fbtypes/CalcPipelineCfg.go @@ -8,14 +8,17 @@ import ( /// configuration of a single calculation pipeline type CalcPipelineCfgT struct { - Name string - Generic bool - Steps []*CalcStepCfgT + Name string `json:"name"` + Generic bool `json:"generic"` + Steps []*CalcStepCfgT `json:"steps"` } func (t *CalcPipelineCfgT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } stepsOffset := flatbuffers.UOffsetT(0) if t.Steps != nil { stepsLength := len(t.Steps) diff --git a/pkg/fbs/motion/sync/fbtypes/CalcStepCfg.go b/pkg/fbs/motion/sync/fbtypes/CalcStepCfg.go index efe1b1f..3588f32 100644 --- a/pkg/fbs/motion/sync/fbtypes/CalcStepCfg.go +++ b/pkg/fbs/motion/sync/fbtypes/CalcStepCfg.go @@ -8,15 +8,18 @@ import ( /// configuration of a single calculation step type CalcStepCfgT struct { - StepID uint32 - Type string - Inputs []string - Parameter []*CalcStepCfgSingleParamT + StepId uint32 `json:"stepID"` + Type string `json:"type"` + Inputs []string `json:"inputs"` + Parameter []*CalcStepCfgSingleParamT `json:"parameter"` } func (t *CalcStepCfgT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - typeOffset := builder.CreateString(t.Type) + type_Offset := flatbuffers.UOffsetT(0) + if t.Type != "" { + type_Offset = builder.CreateString(t.Type) + } inputsOffset := flatbuffers.UOffsetT(0) if t.Inputs != nil { inputsLength := len(t.Inputs) @@ -44,15 +47,15 @@ func (t *CalcStepCfgT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { parameterOffset = builder.EndVector(parameterLength) } CalcStepCfgStart(builder) - CalcStepCfgAddStepID(builder, t.StepID) - CalcStepCfgAddType(builder, typeOffset) + CalcStepCfgAddStepId(builder, t.StepId) + CalcStepCfgAddType(builder, type_Offset) CalcStepCfgAddInputs(builder, inputsOffset) CalcStepCfgAddParameter(builder, parameterOffset) return CalcStepCfgEnd(builder) } func (rcv *CalcStepCfg) UnPackTo(t *CalcStepCfgT) { - t.StepID = rcv.StepID() + t.StepId = rcv.StepId() t.Type = string(rcv.Type()) inputsLength := rcv.InputsLength() t.Inputs = make([]string, inputsLength) @@ -103,7 +106,7 @@ func (rcv *CalcStepCfg) Table() flatbuffers.Table { } /// ID of the calculation step -func (rcv *CalcStepCfg) StepID() uint32 { +func (rcv *CalcStepCfg) StepId() uint32 { o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) if o != 0 { return rcv._tab.GetUint32(o + rcv._tab.Pos) @@ -112,7 +115,7 @@ func (rcv *CalcStepCfg) StepID() uint32 { } /// ID of the calculation step -func (rcv *CalcStepCfg) MutateStepID(n uint32) bool { +func (rcv *CalcStepCfg) MutateStepId(n uint32) bool { return rcv._tab.MutateUint32Slot(4, n) } @@ -170,8 +173,8 @@ func (rcv *CalcStepCfg) ParameterLength() int { func CalcStepCfgStart(builder *flatbuffers.Builder) { builder.StartObject(4) } -func CalcStepCfgAddStepID(builder *flatbuffers.Builder, stepID uint32) { - builder.PrependUint32Slot(0, stepID, 0) +func CalcStepCfgAddStepId(builder *flatbuffers.Builder, stepId uint32) { + builder.PrependUint32Slot(0, stepId, 0) } func CalcStepCfgAddType(builder *flatbuffers.Builder, type_ flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(type_), 0) diff --git a/pkg/fbs/motion/sync/fbtypes/CalcStepCfgSingleParam.go b/pkg/fbs/motion/sync/fbtypes/CalcStepCfgSingleParam.go index f9a2dbf..92916c9 100644 --- a/pkg/fbs/motion/sync/fbtypes/CalcStepCfgSingleParam.go +++ b/pkg/fbs/motion/sync/fbtypes/CalcStepCfgSingleParam.go @@ -8,16 +8,22 @@ import ( /// configuration of a single parameter of a calculation step type CalcStepCfgSingleParamT struct { - Name string - ValueDouble float64 - ValueInt int64 - ValueString string + Name string `json:"name"` + ValueDouble float64 `json:"valueDouble"` + ValueInt int64 `json:"valueInt"` + ValueString string `json:"valueString"` } func (t *CalcStepCfgSingleParamT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - valueStringOffset := builder.CreateString(t.ValueString) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + valueStringOffset := flatbuffers.UOffsetT(0) + if t.ValueString != "" { + valueStringOffset = builder.CreateString(t.ValueString) + } CalcStepCfgSingleParamStart(builder) CalcStepCfgSingleParamAddName(builder, nameOffset) CalcStepCfgSingleParamAddValueDouble(builder, t.ValueDouble) diff --git a/pkg/fbs/motion/sync/fbtypes/MutexGroupPart1.go b/pkg/fbs/motion/sync/fbtypes/MutexGroupPart1.go index abd70ab..9c9b819 100644 --- a/pkg/fbs/motion/sync/fbtypes/MutexGroupPart1.go +++ b/pkg/fbs/motion/sync/fbtypes/MutexGroupPart1.go @@ -8,7 +8,7 @@ import ( /// The first group of optional parameters, which mutually exclude each other type MutexGroupPart1T struct { - GroupPart1 []string + GroupPart1 []string `json:"groupPart1"` } func (t *MutexGroupPart1T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/sync/fbtypes/MutexGroupPart2.go b/pkg/fbs/motion/sync/fbtypes/MutexGroupPart2.go index 68d99de..9ed7488 100644 --- a/pkg/fbs/motion/sync/fbtypes/MutexGroupPart2.go +++ b/pkg/fbs/motion/sync/fbtypes/MutexGroupPart2.go @@ -8,7 +8,7 @@ import ( /// The second group of optional parameters, which mutually exclude each other type MutexGroupPart2T struct { - GroupPart2 []*MutexGroupPart1T + GroupPart2 []*MutexGroupPart1T `json:"groupPart2"` } func (t *MutexGroupPart2T) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/sync/fbtypes/PipelineValidation.go b/pkg/fbs/motion/sync/fbtypes/PipelineValidation.go index c736b2b..e01ca9d 100644 --- a/pkg/fbs/motion/sync/fbtypes/PipelineValidation.go +++ b/pkg/fbs/motion/sync/fbtypes/PipelineValidation.go @@ -8,7 +8,7 @@ import ( /// validation of a calculation pipeline type PipelineValidationT struct { - Validations []*SinglePipelineValidationT + Validations []*SinglePipelineValidationT `json:"validations"` } func (t *PipelineValidationT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/sync/fbtypes/SegmentLawType.go b/pkg/fbs/motion/sync/fbtypes/SegmentLawType.go index 12c43d3..e6f85e6 100644 --- a/pkg/fbs/motion/sync/fbtypes/SegmentLawType.go +++ b/pkg/fbs/motion/sync/fbtypes/SegmentLawType.go @@ -8,237 +8,172 @@ import "strconv" type SegmentLawType uint32 const ( - /// ctrlX, MLC, CamBuilder - Points-table with interpolation based on #points (0-100 Spline Interpolation, 101-... Linear Interpolation) - SegmentLawTypeSEG_LAW_TABLE_AUTO SegmentLawType = 0 - /// ctrlX, MLC, CamBuilder - Inclined sine curve - /// ctrlX, MLC, CamBuilder - Polynomial 5th order - SegmentLawTypeSEG_LAW_RR_POLY5 SegmentLawType = 256 - /// ctrlX, MLC, CamBuilder - Polynomial 5th order - SegmentLawTypeSEG_LAW_RG_POLY5 SegmentLawType = 512 - /// ctrlX, MLC, CamBuilder - Polynomial 7th order - SegmentLawTypeSEG_LAW_RG_POLY7 SegmentLawType = 768 - /// ctrlX, MLC, CamBuilder - Polynomial 5th order - SegmentLawTypeSEG_LAW_GR_POLY5 SegmentLawType = 1024 - /// ctrlX, MLC, CamBuilder - Polynomial 7th order - SegmentLawTypeSEG_LAW_GR_POLY7 SegmentLawType = 1280 - /// ctrlX, MLC, CamBuilder - Constant velocity - SegmentLawTypeSEG_LAW_GG_LINEAR SegmentLawType = 1536 - /// ctrlX, MLC, CamBuilder - Polynomial 5th order - SegmentLawTypeSEG_LAW_GG_POLY5 SegmentLawType = 1792 - /// ctrlX, MLC, CamBuilder - Standstill - SegmentLawTypeSEG_LAW_RR_LINEAR SegmentLawType = 2048 - /// ctrlX, MLC, CamBuilder - Polynomial 7th order - SegmentLawTypeSEG_LAW_RR_POLY7 SegmentLawType = 2304 - /// ctrlX, MLC, CamBuilder - Sine curve - SegmentLawTypeSEG_LAW_RR_SINUS SegmentLawType = 2560 - /// ctrlX, MLC, CamBuilder - Sinusoid of Gutman - SegmentLawTypeSEG_LAW_RR_SINUSGUTMAN SegmentLawType = 2816 - /// ctrlX, MLC, CamBuilder - Acceleration-optimal inclined sine curve - SegmentLawTypeSEG_LAW_RR_SINUSACC SegmentLawType = 3072 - /// ctrlX, MLC, CamBuilder - Torque-inclined sine curve - SegmentLawTypeSEG_LAW_RR_SINUSTOR SegmentLawType = 3328 - /// ctrlX, MLC, CamBuilder - Modified acceleration trapezoid - SegmentLawTypeSEG_LAW_RR_MOD_TRAPEZ SegmentLawType = 3584 - /// ctrlX, MLC, CamBuilder - Modified sine curve - SegmentLawTypeSEG_LAW_RR_MOD_SIN SegmentLawType = 3840 - /// ctrlX, MLC, CamBuilder - Polynomial 7th order - SegmentLawTypeSEG_LAW_GG_POLY7 SegmentLawType = 4096 - /// ctrlX, MLC, CamBuilder - Modified sine curve - SegmentLawTypeSEG_LAW_GG_MOD_SIN SegmentLawType = 4352 - /// ctrlX, MLC, CamBuilder - Velocity-limited polynomial 5th order - SegmentLawTypeSEG_LAW_RR_POLY5VLIM SegmentLawType = 4608 - /// ctrlX, MLC, CamBuilder - Quadratic parabola - SegmentLawTypeSEG_LAW_RR_PARABOLA SegmentLawType = 4864 - /// ctrlX, MLC, CamBuilder - Polynomial 8th order - SegmentLawTypeSEG_LAW_RR_POLY8 SegmentLawType = 5120 - /// ctrlX, MLC, CamBuilder - Polynomial 5th order - SegmentLawTypeSEG_LAW_BB_POLY5 SegmentLawType = 8192 - /// ctrlX, MLC, CamBuilder - Polynomial 7th order - SegmentLawTypeSEG_LAW_BB_POLY7 SegmentLawType = 8448 - /// RESERVED (not impl.) - Polynomial 8th order - SegmentLawTypeSEG_LAW_BB_POLY8 SegmentLawType = 8704 - /// EXPERIMENTAL (done) - Modified acceleration trapezoid - SegmentLawTypeSEG_LAW_RU_MOD_TRAPEZ SegmentLawType = 12288 - /// EXPERIMENTAL (in work) - Harmonic combination - SegmentLawTypeSEG_LAW_RU_HARMONIC SegmentLawType = 12544 - /// EXPERIMENTAL (done) - Modified acceleration trapezoid - SegmentLawTypeSEG_LAW_UR_MOD_TRAPEZ SegmentLawType = 12800 - /// EXPERIMENTAL (in work) - Harmonic combination - SegmentLawTypeSEG_LAW_UR_HARMONIC SegmentLawType = 13056 - /// EXPERIMENTAL (in work) - Harmonic combination - SegmentLawTypeSEG_LAW_GU_HARMONIC SegmentLawType = 13312 - /// EXPERIMENTAL (in work) - Harmonic combination - SegmentLawTypeSEG_LAW_UG_HARMONIC SegmentLawType = 13568 - /// EXPERIMENTAL (in work) - Sine - SegmentLawTypeSEG_LAW_UU_SIN SegmentLawType = 13824 - /// EXPERIMENTAL (in work) - Sine-linear-combination - SegmentLawTypeSEG_LAW_UU_SINLIN SegmentLawType = 14080 - /// ctrlX, MLC, CamBuilder - Polynomial 5th order - SegmentLawTypeSEG_LAW_POLY5 SegmentLawType = 16384 - /// ctrlX, MLC, CamBuilder - Polynomial 7th order - SegmentLawTypeSEG_LAW_POLY7 SegmentLawType = 16640 - /// ctrlX, MLC, CamBuilder - Polynomial 2nd order - SegmentLawTypeSEG_LAW_POLY2 SegmentLawType = 16896 - /// ctrlX, MLC, CamBuilder - Polynomial 3rd order - SegmentLawTypeSEG_LAW_POLY3 SegmentLawType = 17152 - /// ctrlX, MLC, CamBuilder - Polynomial 4th order - SegmentLawTypeSEG_LAW_POLY4 SegmentLawType = 17408 - /// ctrlX, MLC, CamBuilder - Polynomial 8th order - SegmentLawTypeSEG_LAW_POLY8 SegmentLawType = 17664 - /// IndraSize - SegmentLawTypeSEG_LAW_POLY4_TYPE2 SegmentLawType = 17920 - /// IndraSize - SegmentLawTypeSEG_LAW_POLY8_TYPE2 SegmentLawType = 18176 - /// ctrlX, MLC, CamBuilder - Acceleration-limited (trapezoid profile) - SegmentLawTypeSEG_LAW_GG_VELTRAPEZ_ACC SegmentLawType = 20480 - /// EXPERIMENTAL (in work) - Velocity-limited (trapezoid profile) - SegmentLawTypeSEG_LAW_GG_VELTRAPEZ_VEL SegmentLawType = 20736 - /// ctrlX, MLC, CamBuilder - Velocity-limited polynomial 5th order - SegmentLawTypeSEG_LAW_BB_POLY5VLIM SegmentLawType = 24576 - /// ctrlX, MLC, CamBuilder - Free of harmonics polynomial 5th order - SegmentLawTypeSEG_LAW_BB_POLY5OSC SegmentLawType = 24832 - /// ctrlX, MLC, CamBuilder - Acceleration-limited motion (trapezoid profile) - SegmentLawTypeSEG_LAW_INT_ACC SegmentLawType = 28672 - /// ctrlX, MLC, CamBuilder - Acceleration-limited motion (sinusoid profile) - SegmentLawTypeSEG_LAW_INT_SIN SegmentLawType = 28928 - /// ctrlX, MLC, CamBuilder - Jerk-limited motion - SegmentLawTypeSEG_LAW_INT_JRK SegmentLawType = 29184 - /// ctrlX, MLC, CamBuilder - Linear Acceleration - SegmentLawTypeSEG_LAW_ACAM SegmentLawType = 32768 - /// ctrlX, MLC, CamBuilder - Linear Velocity - SegmentLawTypeSEG_LAW_VCAM SegmentLawType = 33024 - /// ctrlX, MLC, CamBuilder - Velocity 2nd order (Start acceleration zero) - SegmentLawTypeSEG_LAW_VCAM2_A SegmentLawType = 33280 - /// ctrlX, MLC, CamBuilder - Velocity 2nd order (End acceleration zero) - SegmentLawTypeSEG_LAW_VCAM2_B SegmentLawType = 33536 - /// EXPERIMENTAL (in work) - Velocity and overshoot limited retract movement - SegmentLawTypeSEG_LAW_SCALEDCAM SegmentLawType = 33792 - /// CamBuilder - Points-table without interpolation - SegmentLawTypeSEG_LAW_TABLE SegmentLawType = 40960 - /// CamBuilder - Points-table with linear interpolation - SegmentLawTypeSEG_LAW_TABLE_LIN SegmentLawType = 41216 - /// CamBuilder - Points-table with spline interpolation - SegmentLawTypeSEG_LAW_TABLE_SPLINE SegmentLawType = 41472 - /// RESERVED (not impl.) - SegmentLawTypeSEG_LAW_TABLE_SCALED SegmentLawType = 41728 + /// Rest in rest, inclined sine curve + SegmentLawTypeREST_IN_REST_INCLINED_SINE SegmentLawType = 0 + /// Rest in rest, polynomial 5th order + SegmentLawTypeREST_IN_REST_POLYNOMIAL_5 SegmentLawType = 1 + /// Rest in velocity, polynomial 5th order + SegmentLawTypeREST_IN_VELOCITY_POLYNOMIAL_5 SegmentLawType = 2 + /// Rest in velocity, polynomial 7th order + SegmentLawTypeREST_IN_VELOCITY_POLYNOMIAL_7 SegmentLawType = 3 + /// Velocity in rest, polynomial 5th order + SegmentLawTypeVELOCITY_IN_REST_POLYNOMIAL_5 SegmentLawType = 4 + /// Velocity in rest, polynomial 7th order + SegmentLawTypeVELOCITY_IN_REST_POLYNOMIAL_7 SegmentLawType = 5 + /// Velocity in velocity, constant velocity + SegmentLawTypeVELOCITY_IN_VELOCITY_LINEAR SegmentLawType = 6 + /// Velocity in velocity, polynomial 5th order + SegmentLawTypeVELOCITY_IN_VELOCITY_POLYNOMIAL_5 SegmentLawType = 7 + /// Rest in rest, standstill + SegmentLawTypeREST_IN_REST_LINEAR SegmentLawType = 8 + /// Rest in rest, polynomial 7th order + SegmentLawTypeREST_IN_REST_POLYNOMIAL_7 SegmentLawType = 9 + /// Rest in rest, sine curve + SegmentLawTypeREST_IN_REST_SINE SegmentLawType = 10 + /// Rest in rest, sinusoid of Gutman + SegmentLawTypeREST_IN_REST_SINE_GUTMAN SegmentLawType = 11 + /// Rest in rest, acceleration-optimal inclined sine curve + SegmentLawTypeREST_IN_REST_SINE_ACC SegmentLawType = 12 + /// Rest in rest, torque-inclined sine curve + SegmentLawTypeREST_IN_REST_SINE_TORQUE SegmentLawType = 13 + /// Rest in rest, modified acceleration trapezoid + SegmentLawTypeREST_IN_REST_MOD_TRAPEZ SegmentLawType = 14 + /// Rest in rest, modified sine curve + SegmentLawTypeREST_IN_REST_MOD_SINE SegmentLawType = 15 + /// Velocity in velocity, polynomial 7th order + SegmentLawTypeVELOCITY_IN_VELOCITY_POLYNOMIAL_7 SegmentLawType = 16 + /// Velocity in velocity, modified sine curve + SegmentLawTypeVELOCITY_IN_VELOCITY_MOD_SINE SegmentLawType = 17 + /// Rest in rest, velocity-limited polynomial 5th order + SegmentLawTypeREST_IN_REST_POLYNOMIAL_5_VLIM SegmentLawType = 18 + /// Rest in rest, quadratic parabola + SegmentLawTypeREST_IN_REST_PARABOLA SegmentLawType = 19 + /// Rest in rest, polynomial 8th order + SegmentLawTypeREST_IN_REST_POLYNOMIAL_8 SegmentLawType = 20 + /// Motion in motion, polynomial 5th order + SegmentLawTypeMOTION_IN_MOTION_POLYNOMIAL_5 SegmentLawType = 21 + /// Motion in motion, polynomial 7th order + SegmentLawTypeMOTION_IN_MOTION_POLYNOMIAL_7 SegmentLawType = 22 + /// Polynomial 5th order + SegmentLawTypeCOMMON_POLYNOMIAL_5 SegmentLawType = 23 + /// Polynomial 7th order + SegmentLawTypeCOMMON_POLYNOMIAL_7 SegmentLawType = 24 + /// Polynomial 2nd order + SegmentLawTypeCOMMON_POLYNOMIAL_2 SegmentLawType = 25 + /// Polynomial 3rd order + SegmentLawTypeCOMMON_POLYNOMIAL_3 SegmentLawType = 26 + /// Polynomial 4th order + SegmentLawTypeCOMMON_POLYNOMIAL_4 SegmentLawType = 27 + /// Polynomial 8th order + SegmentLawTypeCOMMON_POLYNOMIAL_8 SegmentLawType = 28 + /// Velocity in velocity, Acceleration-limited (trapezoid profile) + SegmentLawTypeVELOCITY_IN_VELOCITY_TRAPEZ_ALIM SegmentLawType = 29 + /// Motion in motion, Velocity-limited polynomial 5th order + SegmentLawTypeMOTION_IN_MOTION_POLYNOMIAL_5_VLIM SegmentLawType = 30 + /// Motion in motion, Free of harmonics polynomial 5th order + SegmentLawTypeMOTION_IN_MOTION_POLYNOMIAL_5_SLIM SegmentLawType = 31 + /// Acceleration-limited motion (trapezoid profile) + SegmentLawTypeFIT_VEL_TRAPEZE_ALIM SegmentLawType = 32 + /// Acceleration-limited motion (sinusoid profile) + SegmentLawTypeFIT_SINE_TRAPEZE_ALIM SegmentLawType = 33 + /// Jerk-limited motion + SegmentLawTypeFIT_ACC_TRAPEZE_JLIM SegmentLawType = 34 + /// Linear Acceleration + SegmentLawTypeMOTION_IN_MOTION_ACAM SegmentLawType = 35 + /// Linear Velocity + SegmentLawTypeMOTION_IN_MOTION_VCAM SegmentLawType = 36 + /// Velocity 2nd order (Start acceleration zero) + SegmentLawTypeMOTION_IN_MOTION_VCAM2_A SegmentLawType = 37 + /// Velocity 2nd order (End acceleration zero) + SegmentLawTypeMOTION_IN_MOTION_VCAM2_B SegmentLawType = 38 + /// Points-table with interpolation + SegmentLawTypePOINTS_TABLE_AUTO SegmentLawType = 39 ) var EnumNamesSegmentLawType = map[SegmentLawType]string{ - SegmentLawTypeSEG_LAW_TABLE_AUTO: "SEG_LAW_TABLE_AUTO", - SegmentLawTypeSEG_LAW_RR_POLY5: "SEG_LAW_RR_POLY5", - SegmentLawTypeSEG_LAW_RG_POLY5: "SEG_LAW_RG_POLY5", - SegmentLawTypeSEG_LAW_RG_POLY7: "SEG_LAW_RG_POLY7", - SegmentLawTypeSEG_LAW_GR_POLY5: "SEG_LAW_GR_POLY5", - SegmentLawTypeSEG_LAW_GR_POLY7: "SEG_LAW_GR_POLY7", - SegmentLawTypeSEG_LAW_GG_LINEAR: "SEG_LAW_GG_LINEAR", - SegmentLawTypeSEG_LAW_GG_POLY5: "SEG_LAW_GG_POLY5", - SegmentLawTypeSEG_LAW_RR_LINEAR: "SEG_LAW_RR_LINEAR", - SegmentLawTypeSEG_LAW_RR_POLY7: "SEG_LAW_RR_POLY7", - SegmentLawTypeSEG_LAW_RR_SINUS: "SEG_LAW_RR_SINUS", - SegmentLawTypeSEG_LAW_RR_SINUSGUTMAN: "SEG_LAW_RR_SINUSGUTMAN", - SegmentLawTypeSEG_LAW_RR_SINUSACC: "SEG_LAW_RR_SINUSACC", - SegmentLawTypeSEG_LAW_RR_SINUSTOR: "SEG_LAW_RR_SINUSTOR", - SegmentLawTypeSEG_LAW_RR_MOD_TRAPEZ: "SEG_LAW_RR_MOD_TRAPEZ", - SegmentLawTypeSEG_LAW_RR_MOD_SIN: "SEG_LAW_RR_MOD_SIN", - SegmentLawTypeSEG_LAW_GG_POLY7: "SEG_LAW_GG_POLY7", - SegmentLawTypeSEG_LAW_GG_MOD_SIN: "SEG_LAW_GG_MOD_SIN", - SegmentLawTypeSEG_LAW_RR_POLY5VLIM: "SEG_LAW_RR_POLY5VLIM", - SegmentLawTypeSEG_LAW_RR_PARABOLA: "SEG_LAW_RR_PARABOLA", - SegmentLawTypeSEG_LAW_RR_POLY8: "SEG_LAW_RR_POLY8", - SegmentLawTypeSEG_LAW_BB_POLY5: "SEG_LAW_BB_POLY5", - SegmentLawTypeSEG_LAW_BB_POLY7: "SEG_LAW_BB_POLY7", - SegmentLawTypeSEG_LAW_BB_POLY8: "SEG_LAW_BB_POLY8", - SegmentLawTypeSEG_LAW_RU_MOD_TRAPEZ: "SEG_LAW_RU_MOD_TRAPEZ", - SegmentLawTypeSEG_LAW_RU_HARMONIC: "SEG_LAW_RU_HARMONIC", - SegmentLawTypeSEG_LAW_UR_MOD_TRAPEZ: "SEG_LAW_UR_MOD_TRAPEZ", - SegmentLawTypeSEG_LAW_UR_HARMONIC: "SEG_LAW_UR_HARMONIC", - SegmentLawTypeSEG_LAW_GU_HARMONIC: "SEG_LAW_GU_HARMONIC", - SegmentLawTypeSEG_LAW_UG_HARMONIC: "SEG_LAW_UG_HARMONIC", - SegmentLawTypeSEG_LAW_UU_SIN: "SEG_LAW_UU_SIN", - SegmentLawTypeSEG_LAW_UU_SINLIN: "SEG_LAW_UU_SINLIN", - SegmentLawTypeSEG_LAW_POLY5: "SEG_LAW_POLY5", - SegmentLawTypeSEG_LAW_POLY7: "SEG_LAW_POLY7", - SegmentLawTypeSEG_LAW_POLY2: "SEG_LAW_POLY2", - SegmentLawTypeSEG_LAW_POLY3: "SEG_LAW_POLY3", - SegmentLawTypeSEG_LAW_POLY4: "SEG_LAW_POLY4", - SegmentLawTypeSEG_LAW_POLY8: "SEG_LAW_POLY8", - SegmentLawTypeSEG_LAW_POLY4_TYPE2: "SEG_LAW_POLY4_TYPE2", - SegmentLawTypeSEG_LAW_POLY8_TYPE2: "SEG_LAW_POLY8_TYPE2", - SegmentLawTypeSEG_LAW_GG_VELTRAPEZ_ACC: "SEG_LAW_GG_VELTRAPEZ_ACC", - SegmentLawTypeSEG_LAW_GG_VELTRAPEZ_VEL: "SEG_LAW_GG_VELTRAPEZ_VEL", - SegmentLawTypeSEG_LAW_BB_POLY5VLIM: "SEG_LAW_BB_POLY5VLIM", - SegmentLawTypeSEG_LAW_BB_POLY5OSC: "SEG_LAW_BB_POLY5OSC", - SegmentLawTypeSEG_LAW_INT_ACC: "SEG_LAW_INT_ACC", - SegmentLawTypeSEG_LAW_INT_SIN: "SEG_LAW_INT_SIN", - SegmentLawTypeSEG_LAW_INT_JRK: "SEG_LAW_INT_JRK", - SegmentLawTypeSEG_LAW_ACAM: "SEG_LAW_ACAM", - SegmentLawTypeSEG_LAW_VCAM: "SEG_LAW_VCAM", - SegmentLawTypeSEG_LAW_VCAM2_A: "SEG_LAW_VCAM2_A", - SegmentLawTypeSEG_LAW_VCAM2_B: "SEG_LAW_VCAM2_B", - SegmentLawTypeSEG_LAW_SCALEDCAM: "SEG_LAW_SCALEDCAM", - SegmentLawTypeSEG_LAW_TABLE: "SEG_LAW_TABLE", - SegmentLawTypeSEG_LAW_TABLE_LIN: "SEG_LAW_TABLE_LIN", - SegmentLawTypeSEG_LAW_TABLE_SPLINE: "SEG_LAW_TABLE_SPLINE", - SegmentLawTypeSEG_LAW_TABLE_SCALED: "SEG_LAW_TABLE_SCALED", + SegmentLawTypeREST_IN_REST_INCLINED_SINE: "REST_IN_REST_INCLINED_SINE", + SegmentLawTypeREST_IN_REST_POLYNOMIAL_5: "REST_IN_REST_POLYNOMIAL_5", + SegmentLawTypeREST_IN_VELOCITY_POLYNOMIAL_5: "REST_IN_VELOCITY_POLYNOMIAL_5", + SegmentLawTypeREST_IN_VELOCITY_POLYNOMIAL_7: "REST_IN_VELOCITY_POLYNOMIAL_7", + SegmentLawTypeVELOCITY_IN_REST_POLYNOMIAL_5: "VELOCITY_IN_REST_POLYNOMIAL_5", + SegmentLawTypeVELOCITY_IN_REST_POLYNOMIAL_7: "VELOCITY_IN_REST_POLYNOMIAL_7", + SegmentLawTypeVELOCITY_IN_VELOCITY_LINEAR: "VELOCITY_IN_VELOCITY_LINEAR", + SegmentLawTypeVELOCITY_IN_VELOCITY_POLYNOMIAL_5: "VELOCITY_IN_VELOCITY_POLYNOMIAL_5", + SegmentLawTypeREST_IN_REST_LINEAR: "REST_IN_REST_LINEAR", + SegmentLawTypeREST_IN_REST_POLYNOMIAL_7: "REST_IN_REST_POLYNOMIAL_7", + SegmentLawTypeREST_IN_REST_SINE: "REST_IN_REST_SINE", + SegmentLawTypeREST_IN_REST_SINE_GUTMAN: "REST_IN_REST_SINE_GUTMAN", + SegmentLawTypeREST_IN_REST_SINE_ACC: "REST_IN_REST_SINE_ACC", + SegmentLawTypeREST_IN_REST_SINE_TORQUE: "REST_IN_REST_SINE_TORQUE", + SegmentLawTypeREST_IN_REST_MOD_TRAPEZ: "REST_IN_REST_MOD_TRAPEZ", + SegmentLawTypeREST_IN_REST_MOD_SINE: "REST_IN_REST_MOD_SINE", + SegmentLawTypeVELOCITY_IN_VELOCITY_POLYNOMIAL_7: "VELOCITY_IN_VELOCITY_POLYNOMIAL_7", + SegmentLawTypeVELOCITY_IN_VELOCITY_MOD_SINE: "VELOCITY_IN_VELOCITY_MOD_SINE", + SegmentLawTypeREST_IN_REST_POLYNOMIAL_5_VLIM: "REST_IN_REST_POLYNOMIAL_5_VLIM", + SegmentLawTypeREST_IN_REST_PARABOLA: "REST_IN_REST_PARABOLA", + SegmentLawTypeREST_IN_REST_POLYNOMIAL_8: "REST_IN_REST_POLYNOMIAL_8", + SegmentLawTypeMOTION_IN_MOTION_POLYNOMIAL_5: "MOTION_IN_MOTION_POLYNOMIAL_5", + SegmentLawTypeMOTION_IN_MOTION_POLYNOMIAL_7: "MOTION_IN_MOTION_POLYNOMIAL_7", + SegmentLawTypeCOMMON_POLYNOMIAL_5: "COMMON_POLYNOMIAL_5", + SegmentLawTypeCOMMON_POLYNOMIAL_7: "COMMON_POLYNOMIAL_7", + SegmentLawTypeCOMMON_POLYNOMIAL_2: "COMMON_POLYNOMIAL_2", + SegmentLawTypeCOMMON_POLYNOMIAL_3: "COMMON_POLYNOMIAL_3", + SegmentLawTypeCOMMON_POLYNOMIAL_4: "COMMON_POLYNOMIAL_4", + SegmentLawTypeCOMMON_POLYNOMIAL_8: "COMMON_POLYNOMIAL_8", + SegmentLawTypeVELOCITY_IN_VELOCITY_TRAPEZ_ALIM: "VELOCITY_IN_VELOCITY_TRAPEZ_ALIM", + SegmentLawTypeMOTION_IN_MOTION_POLYNOMIAL_5_VLIM: "MOTION_IN_MOTION_POLYNOMIAL_5_VLIM", + SegmentLawTypeMOTION_IN_MOTION_POLYNOMIAL_5_SLIM: "MOTION_IN_MOTION_POLYNOMIAL_5_SLIM", + SegmentLawTypeFIT_VEL_TRAPEZE_ALIM: "FIT_VEL_TRAPEZE_ALIM", + SegmentLawTypeFIT_SINE_TRAPEZE_ALIM: "FIT_SINE_TRAPEZE_ALIM", + SegmentLawTypeFIT_ACC_TRAPEZE_JLIM: "FIT_ACC_TRAPEZE_JLIM", + SegmentLawTypeMOTION_IN_MOTION_ACAM: "MOTION_IN_MOTION_ACAM", + SegmentLawTypeMOTION_IN_MOTION_VCAM: "MOTION_IN_MOTION_VCAM", + SegmentLawTypeMOTION_IN_MOTION_VCAM2_A: "MOTION_IN_MOTION_VCAM2_A", + SegmentLawTypeMOTION_IN_MOTION_VCAM2_B: "MOTION_IN_MOTION_VCAM2_B", + SegmentLawTypePOINTS_TABLE_AUTO: "POINTS_TABLE_AUTO", } var EnumValuesSegmentLawType = map[string]SegmentLawType{ - "SEG_LAW_TABLE_AUTO": SegmentLawTypeSEG_LAW_TABLE_AUTO, - "SEG_LAW_RR_POLY5": SegmentLawTypeSEG_LAW_RR_POLY5, - "SEG_LAW_RG_POLY5": SegmentLawTypeSEG_LAW_RG_POLY5, - "SEG_LAW_RG_POLY7": SegmentLawTypeSEG_LAW_RG_POLY7, - "SEG_LAW_GR_POLY5": SegmentLawTypeSEG_LAW_GR_POLY5, - "SEG_LAW_GR_POLY7": SegmentLawTypeSEG_LAW_GR_POLY7, - "SEG_LAW_GG_LINEAR": SegmentLawTypeSEG_LAW_GG_LINEAR, - "SEG_LAW_GG_POLY5": SegmentLawTypeSEG_LAW_GG_POLY5, - "SEG_LAW_RR_LINEAR": SegmentLawTypeSEG_LAW_RR_LINEAR, - "SEG_LAW_RR_POLY7": SegmentLawTypeSEG_LAW_RR_POLY7, - "SEG_LAW_RR_SINUS": SegmentLawTypeSEG_LAW_RR_SINUS, - "SEG_LAW_RR_SINUSGUTMAN": SegmentLawTypeSEG_LAW_RR_SINUSGUTMAN, - "SEG_LAW_RR_SINUSACC": SegmentLawTypeSEG_LAW_RR_SINUSACC, - "SEG_LAW_RR_SINUSTOR": SegmentLawTypeSEG_LAW_RR_SINUSTOR, - "SEG_LAW_RR_MOD_TRAPEZ": SegmentLawTypeSEG_LAW_RR_MOD_TRAPEZ, - "SEG_LAW_RR_MOD_SIN": SegmentLawTypeSEG_LAW_RR_MOD_SIN, - "SEG_LAW_GG_POLY7": SegmentLawTypeSEG_LAW_GG_POLY7, - "SEG_LAW_GG_MOD_SIN": SegmentLawTypeSEG_LAW_GG_MOD_SIN, - "SEG_LAW_RR_POLY5VLIM": SegmentLawTypeSEG_LAW_RR_POLY5VLIM, - "SEG_LAW_RR_PARABOLA": SegmentLawTypeSEG_LAW_RR_PARABOLA, - "SEG_LAW_RR_POLY8": SegmentLawTypeSEG_LAW_RR_POLY8, - "SEG_LAW_BB_POLY5": SegmentLawTypeSEG_LAW_BB_POLY5, - "SEG_LAW_BB_POLY7": SegmentLawTypeSEG_LAW_BB_POLY7, - "SEG_LAW_BB_POLY8": SegmentLawTypeSEG_LAW_BB_POLY8, - "SEG_LAW_RU_MOD_TRAPEZ": SegmentLawTypeSEG_LAW_RU_MOD_TRAPEZ, - "SEG_LAW_RU_HARMONIC": SegmentLawTypeSEG_LAW_RU_HARMONIC, - "SEG_LAW_UR_MOD_TRAPEZ": SegmentLawTypeSEG_LAW_UR_MOD_TRAPEZ, - "SEG_LAW_UR_HARMONIC": SegmentLawTypeSEG_LAW_UR_HARMONIC, - "SEG_LAW_GU_HARMONIC": SegmentLawTypeSEG_LAW_GU_HARMONIC, - "SEG_LAW_UG_HARMONIC": SegmentLawTypeSEG_LAW_UG_HARMONIC, - "SEG_LAW_UU_SIN": SegmentLawTypeSEG_LAW_UU_SIN, - "SEG_LAW_UU_SINLIN": SegmentLawTypeSEG_LAW_UU_SINLIN, - "SEG_LAW_POLY5": SegmentLawTypeSEG_LAW_POLY5, - "SEG_LAW_POLY7": SegmentLawTypeSEG_LAW_POLY7, - "SEG_LAW_POLY2": SegmentLawTypeSEG_LAW_POLY2, - "SEG_LAW_POLY3": SegmentLawTypeSEG_LAW_POLY3, - "SEG_LAW_POLY4": SegmentLawTypeSEG_LAW_POLY4, - "SEG_LAW_POLY8": SegmentLawTypeSEG_LAW_POLY8, - "SEG_LAW_POLY4_TYPE2": SegmentLawTypeSEG_LAW_POLY4_TYPE2, - "SEG_LAW_POLY8_TYPE2": SegmentLawTypeSEG_LAW_POLY8_TYPE2, - "SEG_LAW_GG_VELTRAPEZ_ACC": SegmentLawTypeSEG_LAW_GG_VELTRAPEZ_ACC, - "SEG_LAW_GG_VELTRAPEZ_VEL": SegmentLawTypeSEG_LAW_GG_VELTRAPEZ_VEL, - "SEG_LAW_BB_POLY5VLIM": SegmentLawTypeSEG_LAW_BB_POLY5VLIM, - "SEG_LAW_BB_POLY5OSC": SegmentLawTypeSEG_LAW_BB_POLY5OSC, - "SEG_LAW_INT_ACC": SegmentLawTypeSEG_LAW_INT_ACC, - "SEG_LAW_INT_SIN": SegmentLawTypeSEG_LAW_INT_SIN, - "SEG_LAW_INT_JRK": SegmentLawTypeSEG_LAW_INT_JRK, - "SEG_LAW_ACAM": SegmentLawTypeSEG_LAW_ACAM, - "SEG_LAW_VCAM": SegmentLawTypeSEG_LAW_VCAM, - "SEG_LAW_VCAM2_A": SegmentLawTypeSEG_LAW_VCAM2_A, - "SEG_LAW_VCAM2_B": SegmentLawTypeSEG_LAW_VCAM2_B, - "SEG_LAW_SCALEDCAM": SegmentLawTypeSEG_LAW_SCALEDCAM, - "SEG_LAW_TABLE": SegmentLawTypeSEG_LAW_TABLE, - "SEG_LAW_TABLE_LIN": SegmentLawTypeSEG_LAW_TABLE_LIN, - "SEG_LAW_TABLE_SPLINE": SegmentLawTypeSEG_LAW_TABLE_SPLINE, - "SEG_LAW_TABLE_SCALED": SegmentLawTypeSEG_LAW_TABLE_SCALED, + "REST_IN_REST_INCLINED_SINE": SegmentLawTypeREST_IN_REST_INCLINED_SINE, + "REST_IN_REST_POLYNOMIAL_5": SegmentLawTypeREST_IN_REST_POLYNOMIAL_5, + "REST_IN_VELOCITY_POLYNOMIAL_5": SegmentLawTypeREST_IN_VELOCITY_POLYNOMIAL_5, + "REST_IN_VELOCITY_POLYNOMIAL_7": SegmentLawTypeREST_IN_VELOCITY_POLYNOMIAL_7, + "VELOCITY_IN_REST_POLYNOMIAL_5": SegmentLawTypeVELOCITY_IN_REST_POLYNOMIAL_5, + "VELOCITY_IN_REST_POLYNOMIAL_7": SegmentLawTypeVELOCITY_IN_REST_POLYNOMIAL_7, + "VELOCITY_IN_VELOCITY_LINEAR": SegmentLawTypeVELOCITY_IN_VELOCITY_LINEAR, + "VELOCITY_IN_VELOCITY_POLYNOMIAL_5": SegmentLawTypeVELOCITY_IN_VELOCITY_POLYNOMIAL_5, + "REST_IN_REST_LINEAR": SegmentLawTypeREST_IN_REST_LINEAR, + "REST_IN_REST_POLYNOMIAL_7": SegmentLawTypeREST_IN_REST_POLYNOMIAL_7, + "REST_IN_REST_SINE": SegmentLawTypeREST_IN_REST_SINE, + "REST_IN_REST_SINE_GUTMAN": SegmentLawTypeREST_IN_REST_SINE_GUTMAN, + "REST_IN_REST_SINE_ACC": SegmentLawTypeREST_IN_REST_SINE_ACC, + "REST_IN_REST_SINE_TORQUE": SegmentLawTypeREST_IN_REST_SINE_TORQUE, + "REST_IN_REST_MOD_TRAPEZ": SegmentLawTypeREST_IN_REST_MOD_TRAPEZ, + "REST_IN_REST_MOD_SINE": SegmentLawTypeREST_IN_REST_MOD_SINE, + "VELOCITY_IN_VELOCITY_POLYNOMIAL_7": SegmentLawTypeVELOCITY_IN_VELOCITY_POLYNOMIAL_7, + "VELOCITY_IN_VELOCITY_MOD_SINE": SegmentLawTypeVELOCITY_IN_VELOCITY_MOD_SINE, + "REST_IN_REST_POLYNOMIAL_5_VLIM": SegmentLawTypeREST_IN_REST_POLYNOMIAL_5_VLIM, + "REST_IN_REST_PARABOLA": SegmentLawTypeREST_IN_REST_PARABOLA, + "REST_IN_REST_POLYNOMIAL_8": SegmentLawTypeREST_IN_REST_POLYNOMIAL_8, + "MOTION_IN_MOTION_POLYNOMIAL_5": SegmentLawTypeMOTION_IN_MOTION_POLYNOMIAL_5, + "MOTION_IN_MOTION_POLYNOMIAL_7": SegmentLawTypeMOTION_IN_MOTION_POLYNOMIAL_7, + "COMMON_POLYNOMIAL_5": SegmentLawTypeCOMMON_POLYNOMIAL_5, + "COMMON_POLYNOMIAL_7": SegmentLawTypeCOMMON_POLYNOMIAL_7, + "COMMON_POLYNOMIAL_2": SegmentLawTypeCOMMON_POLYNOMIAL_2, + "COMMON_POLYNOMIAL_3": SegmentLawTypeCOMMON_POLYNOMIAL_3, + "COMMON_POLYNOMIAL_4": SegmentLawTypeCOMMON_POLYNOMIAL_4, + "COMMON_POLYNOMIAL_8": SegmentLawTypeCOMMON_POLYNOMIAL_8, + "VELOCITY_IN_VELOCITY_TRAPEZ_ALIM": SegmentLawTypeVELOCITY_IN_VELOCITY_TRAPEZ_ALIM, + "MOTION_IN_MOTION_POLYNOMIAL_5_VLIM": SegmentLawTypeMOTION_IN_MOTION_POLYNOMIAL_5_VLIM, + "MOTION_IN_MOTION_POLYNOMIAL_5_SLIM": SegmentLawTypeMOTION_IN_MOTION_POLYNOMIAL_5_SLIM, + "FIT_VEL_TRAPEZE_ALIM": SegmentLawTypeFIT_VEL_TRAPEZE_ALIM, + "FIT_SINE_TRAPEZE_ALIM": SegmentLawTypeFIT_SINE_TRAPEZE_ALIM, + "FIT_ACC_TRAPEZE_JLIM": SegmentLawTypeFIT_ACC_TRAPEZE_JLIM, + "MOTION_IN_MOTION_ACAM": SegmentLawTypeMOTION_IN_MOTION_ACAM, + "MOTION_IN_MOTION_VCAM": SegmentLawTypeMOTION_IN_MOTION_VCAM, + "MOTION_IN_MOTION_VCAM2_A": SegmentLawTypeMOTION_IN_MOTION_VCAM2_A, + "MOTION_IN_MOTION_VCAM2_B": SegmentLawTypeMOTION_IN_MOTION_VCAM2_B, + "POINTS_TABLE_AUTO": SegmentLawTypePOINTS_TABLE_AUTO, } func (v SegmentLawType) String() string { diff --git a/pkg/fbs/motion/sync/fbtypes/SinglePipelineValidation.go b/pkg/fbs/motion/sync/fbtypes/SinglePipelineValidation.go index a3883f7..58b80d0 100644 --- a/pkg/fbs/motion/sync/fbtypes/SinglePipelineValidation.go +++ b/pkg/fbs/motion/sync/fbtypes/SinglePipelineValidation.go @@ -8,16 +8,22 @@ import ( /// single result of the validation of a calculation pipeline type SinglePipelineValidationT struct { - MainDiag uint32 - DetailDiag uint32 - Uri string - AddInfo string + MainDiag uint32 `json:"mainDiag"` + DetailDiag uint32 `json:"detailDiag"` + Uri string `json:"uri"` + AddInfo string `json:"addInfo"` } func (t *SinglePipelineValidationT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - uriOffset := builder.CreateString(t.Uri) - addInfoOffset := builder.CreateString(t.AddInfo) + uriOffset := flatbuffers.UOffsetT(0) + if t.Uri != "" { + uriOffset = builder.CreateString(t.Uri) + } + addInfoOffset := flatbuffers.UOffsetT(0) + if t.AddInfo != "" { + addInfoOffset = builder.CreateString(t.AddInfo) + } SinglePipelineValidationStart(builder) SinglePipelineValidationAddMainDiag(builder, t.MainDiag) SinglePipelineValidationAddDetailDiag(builder, t.DetailDiag) diff --git a/pkg/fbs/motion/sync/fbtypes/StateCalcSingleStep.go b/pkg/fbs/motion/sync/fbtypes/StateCalcSingleStep.go index fa32624..190857e 100644 --- a/pkg/fbs/motion/sync/fbtypes/StateCalcSingleStep.go +++ b/pkg/fbs/motion/sync/fbtypes/StateCalcSingleStep.go @@ -8,20 +8,29 @@ import ( /// a single supported calculation step type StateCalcSingleStepT struct { - Name string - Description string - DocuRef string - Inputs []DataID - Outputs []DataID - Parameter *StateCalcStepParamsT - MutexParameter *StateCalcStepMutexParamT + Name string `json:"name"` + Description string `json:"description"` + DocuRef string `json:"docuRef"` + Inputs []DataID `json:"inputs"` + Outputs []DataID `json:"outputs"` + Parameter *StateCalcStepParamsT `json:"parameter"` + MutexParameter *StateCalcStepMutexParamT `json:"mutexParameter"` } func (t *StateCalcSingleStepT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - descriptionOffset := builder.CreateString(t.Description) - docuRefOffset := builder.CreateString(t.DocuRef) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + descriptionOffset := flatbuffers.UOffsetT(0) + if t.Description != "" { + descriptionOffset = builder.CreateString(t.Description) + } + docuRefOffset := flatbuffers.UOffsetT(0) + if t.DocuRef != "" { + docuRefOffset = builder.CreateString(t.DocuRef) + } inputsOffset := flatbuffers.UOffsetT(0) if t.Inputs != nil { inputsLength := len(t.Inputs) diff --git a/pkg/fbs/motion/sync/fbtypes/StateCalcStepMutexParam.go b/pkg/fbs/motion/sync/fbtypes/StateCalcStepMutexParam.go index d20e612..ef1fecd 100644 --- a/pkg/fbs/motion/sync/fbtypes/StateCalcStepMutexParam.go +++ b/pkg/fbs/motion/sync/fbtypes/StateCalcStepMutexParam.go @@ -7,7 +7,7 @@ import ( ) type StateCalcStepMutexParamT struct { - MutexParam []*MutexGroupPart2T + MutexParam []*MutexGroupPart2T `json:"mutexParam"` } func (t *StateCalcStepMutexParamT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/sync/fbtypes/StateCalcStepParams.go b/pkg/fbs/motion/sync/fbtypes/StateCalcStepParams.go index 9fd5675..7ef46a3 100644 --- a/pkg/fbs/motion/sync/fbtypes/StateCalcStepParams.go +++ b/pkg/fbs/motion/sync/fbtypes/StateCalcStepParams.go @@ -8,7 +8,7 @@ import ( /// all supported calculation steps type StateCalcStepParamsT struct { - Params []*StateCalcStepSingleParamT + Params []*StateCalcStepSingleParamT `json:"params"` } func (t *StateCalcStepParamsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/sync/fbtypes/StateCalcStepSingleParam.go b/pkg/fbs/motion/sync/fbtypes/StateCalcStepSingleParam.go index 686aa86..119488d 100644 --- a/pkg/fbs/motion/sync/fbtypes/StateCalcStepSingleParam.go +++ b/pkg/fbs/motion/sync/fbtypes/StateCalcStepSingleParam.go @@ -8,17 +8,23 @@ import ( /// a single parameter of a calculation step type StateCalcStepSingleParamT struct { - Name string - Description string - Mandatory bool - Type ParameterType - Unit UnitValueType + Name string `json:"name"` + Description string `json:"description"` + Mandatory bool `json:"mandatory"` + Type ParameterType `json:"type"` + Unit UnitValueType `json:"unit"` } func (t *StateCalcStepSingleParamT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - descriptionOffset := builder.CreateString(t.Description) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + descriptionOffset := flatbuffers.UOffsetT(0) + if t.Description != "" { + descriptionOffset = builder.CreateString(t.Description) + } StateCalcStepSingleParamStart(builder) StateCalcStepSingleParamAddName(builder, nameOffset) StateCalcStepSingleParamAddDescription(builder, descriptionOffset) diff --git a/pkg/fbs/motion/sync/fbtypes/StateCalcSteps.go b/pkg/fbs/motion/sync/fbtypes/StateCalcSteps.go index 57b5a39..b2ed1ff 100644 --- a/pkg/fbs/motion/sync/fbtypes/StateCalcSteps.go +++ b/pkg/fbs/motion/sync/fbtypes/StateCalcSteps.go @@ -8,7 +8,7 @@ import ( /// all supported calculation steps type StateCalcStepsT struct { - Steps []*StateCalcSingleStepT + Steps []*StateCalcSingleStepT `json:"steps"` } func (t *StateCalcStepsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/motion/test/addbundle/fbtypes/KinCmdCircularData.go b/pkg/fbs/motion/test/addbundle/fbtypes/KinCmdCircularData.go index 566eea0..e017738 100644 --- a/pkg/fbs/motion/test/addbundle/fbtypes/KinCmdCircularData.go +++ b/pkg/fbs/motion/test/addbundle/fbtypes/KinCmdCircularData.go @@ -10,10 +10,10 @@ import ( /// just for test of additional bundle (motion extension API) type KinCmdCircularDataT struct { - CmdPos []float64 - CenterPos []float64 - Direction bool - Limits *motion__core__fbtypes.DynamicLimitsT + CmdPos []float64 `json:"cmdPos"` + CenterPos []float64 `json:"centerPos"` + Direction bool `json:"direction"` + Limits *motion__core__fbtypes.DynamicLimitsT `json:"limits"` } func (t *KinCmdCircularDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/AppDateAndTime.go b/pkg/fbs/plc/cmp/datalayer/fbs/AppDateAndTime.go index 60156d0..5ab9c5c 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/AppDateAndTime.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/AppDateAndTime.go @@ -3,16 +3,20 @@ package fbs import ( + "bytes" flatbuffers "github.com/google/flatbuffers/go" ) type AppDateAndTimeT struct { - DateAndTime string + DateAndTime string `json:"dateAndTime"` } func (t *AppDateAndTimeT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - dateAndTimeOffset := builder.CreateString(t.DateAndTime) + dateAndTimeOffset := flatbuffers.UOffsetT(0) + if t.DateAndTime != "" { + dateAndTimeOffset = builder.CreateString(t.DateAndTime) + } AppDateAndTimeStart(builder) AppDateAndTimeAddDateAndTime(builder, dateAndTimeOffset) return AppDateAndTimeEnd(builder) @@ -64,6 +68,38 @@ func (rcv *AppDateAndTime) DateAndTime() []byte { return nil } +func AppDateAndTimeKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &AppDateAndTime{} + obj2 := &AppDateAndTime{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.DateAndTime()) < string(obj2.DateAndTime()) +} + +func (rcv *AppDateAndTime) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &AppDateAndTime{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.DateAndTime(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + func AppDateAndTimeStart(builder *flatbuffers.Builder) { builder.StartObject(1) } diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/AppIdmUserInfo.go b/pkg/fbs/plc/cmp/datalayer/fbs/AppIdmUserInfo.go index 8185317..b5edd81 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/AppIdmUserInfo.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/AppIdmUserInfo.go @@ -7,13 +7,16 @@ import ( ) type AppIdmUserInfoT struct { - User string - Userhandles []uint64 + User string `json:"user"` + Userhandles []uint64 `json:"userhandles"` } func (t *AppIdmUserInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - userOffset := builder.CreateString(t.User) + userOffset := flatbuffers.UOffsetT(0) + if t.User != "" { + userOffset = builder.CreateString(t.User) + } userhandlesOffset := flatbuffers.UOffsetT(0) if t.Userhandles != nil { userhandlesLength := len(t.Userhandles) diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/AppIdmUserInfos.go b/pkg/fbs/plc/cmp/datalayer/fbs/AppIdmUserInfos.go index ab89d06..10d5b4d 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/AppIdmUserInfos.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/AppIdmUserInfos.go @@ -7,7 +7,7 @@ import ( ) type AppIdmUserInfosT struct { - Info []*AppIdmUserInfoT + Info []*AppIdmUserInfoT `json:"info"` } func (t *AppIdmUserInfosT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/AppIdmUserLogin.go b/pkg/fbs/plc/cmp/datalayer/fbs/AppIdmUserLogin.go index 58136ea..1247ec2 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/AppIdmUserLogin.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/AppIdmUserLogin.go @@ -7,14 +7,20 @@ import ( ) type AppIdmUserLoginT struct { - User string - Password string + User string `json:"user"` + Password string `json:"password"` } func (t *AppIdmUserLoginT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - userOffset := builder.CreateString(t.User) - passwordOffset := builder.CreateString(t.Password) + userOffset := flatbuffers.UOffsetT(0) + if t.User != "" { + userOffset = builder.CreateString(t.User) + } + passwordOffset := flatbuffers.UOffsetT(0) + if t.Password != "" { + passwordOffset = builder.CreateString(t.Password) + } AppIdmUserLoginStart(builder) AppIdmUserLoginAddUser(builder, userOffset) AppIdmUserLoginAddPassword(builder, passwordOffset) diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/AppInfo.go b/pkg/fbs/plc/cmp/datalayer/fbs/AppInfo.go index 500c0e1..28a724f 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/AppInfo.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/AppInfo.go @@ -3,27 +3,46 @@ package fbs import ( + "bytes" flatbuffers "github.com/google/flatbuffers/go" ) type AppInfoT struct { - Name string - Author string - Version string - Description string - Profile string - Compiler string - DateAndTime *AppDateAndTimeT + Name string `json:"name"` + Author string `json:"author"` + Version string `json:"version"` + Description string `json:"description"` + Profile string `json:"profile"` + Compiler string `json:"compiler"` + DateAndTime *AppDateAndTimeT `json:"dateAndTime"` } func (t *AppInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - authorOffset := builder.CreateString(t.Author) - versionOffset := builder.CreateString(t.Version) - descriptionOffset := builder.CreateString(t.Description) - profileOffset := builder.CreateString(t.Profile) - compilerOffset := builder.CreateString(t.Compiler) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + authorOffset := flatbuffers.UOffsetT(0) + if t.Author != "" { + authorOffset = builder.CreateString(t.Author) + } + versionOffset := flatbuffers.UOffsetT(0) + if t.Version != "" { + versionOffset = builder.CreateString(t.Version) + } + descriptionOffset := flatbuffers.UOffsetT(0) + if t.Description != "" { + descriptionOffset = builder.CreateString(t.Description) + } + profileOffset := flatbuffers.UOffsetT(0) + if t.Profile != "" { + profileOffset = builder.CreateString(t.Profile) + } + compilerOffset := flatbuffers.UOffsetT(0) + if t.Compiler != "" { + compilerOffset = builder.CreateString(t.Compiler) + } dateAndTimeOffset := t.DateAndTime.Pack(builder) AppInfoStart(builder) AppInfoAddName(builder, nameOffset) @@ -88,6 +107,38 @@ func (rcv *AppInfo) Name() []byte { return nil } +func AppInfoKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &AppInfo{} + obj2 := &AppInfo{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.Name()) < string(obj2.Name()) +} + +func (rcv *AppInfo) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &AppInfo{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.Name(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + func (rcv *AppInfo) Author() []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/AppLoadApplications.go b/pkg/fbs/plc/cmp/datalayer/fbs/AppLoadApplications.go index 8ee867d..4619fff 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/AppLoadApplications.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/AppLoadApplications.go @@ -7,13 +7,16 @@ import ( ) type AppLoadApplicationsT struct { - Path string - Files []string + Path string `json:"path"` + Files []string `json:"files"` } func (t *AppLoadApplicationsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - pathOffset := builder.CreateString(t.Path) + pathOffset := flatbuffers.UOffsetT(0) + if t.Path != "" { + pathOffset = builder.CreateString(t.Path) + } filesOffset := flatbuffers.UOffsetT(0) if t.Files != nil { filesLength := len(t.Files) diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/AppMemoryArea.go b/pkg/fbs/plc/cmp/datalayer/fbs/AppMemoryArea.go index 9168399..90ec50c 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/AppMemoryArea.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/AppMemoryArea.go @@ -7,7 +7,7 @@ import ( ) type AppMemoryAreaT struct { - Area Area + Area Area `json:"area"` } func (t *AppMemoryAreaT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/AppMemoryAreaAccess.go b/pkg/fbs/plc/cmp/datalayer/fbs/AppMemoryAreaAccess.go index bf971c7..26ebd04 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/AppMemoryAreaAccess.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/AppMemoryAreaAccess.go @@ -7,10 +7,10 @@ import ( ) type AppMemoryAreaAccessT struct { - Area *AppMemoryAreaT - Offset uint64 - Number uint64 - Value *ValueT + Area *AppMemoryAreaT `json:"area"` + Offset uint64 `json:"offset"` + Number uint64 `json:"number"` + Value *ValueT `json:"value"` } func (t *AppMemoryAreaAccessT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/AppOperationState.go b/pkg/fbs/plc/cmp/datalayer/fbs/AppOperationState.go index 8267ff8..de623a1 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/AppOperationState.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/AppOperationState.go @@ -7,28 +7,28 @@ import ( ) type AppOperationStateT struct { - ProgramLoaded bool - DownloadActive bool - OnlineChangeActive bool - StoreBootprojectActive bool - ForceVariablesActive bool - Exception bool - InitializeActive bool - StoreBootprojectOnlyActive bool - ExitActive bool - Deleted bool - ResetActive bool - RetainMismatch bool - BootprojectValid bool - LoadBootprojectActive bool - FlowControlActive bool - RunInFlash bool - ResetOutputs bool - CoreDumpLoaded bool - ExecutenPointsActive bool - CoreDumpCreating bool - SingelCycleActive bool - ResetDisabled bool + ProgramLoaded bool `json:"programLoaded"` + DownloadActive bool `json:"downloadActive"` + OnlineChangeActive bool `json:"onlineChangeActive"` + StoreBootprojectActive bool `json:"storeBootprojectActive"` + ForceVariablesActive bool `json:"forceVariablesActive"` + Exception bool `json:"exception"` + InitializeActive bool `json:"initializeActive"` + StoreBootprojectOnlyActive bool `json:"storeBootprojectOnlyActive"` + ExitActive bool `json:"exitActive"` + Deleted bool `json:"deleted"` + ResetActive bool `json:"resetActive"` + RetainMismatch bool `json:"retainMismatch"` + BootprojectValid bool `json:"bootprojectValid"` + LoadBootprojectActive bool `json:"loadBootprojectActive"` + FlowControlActive bool `json:"flowControlActive"` + RunInFlash bool `json:"runInFlash"` + ResetOutputs bool `json:"resetOutputs"` + CoreDumpLoaded bool `json:"coreDumpLoaded"` + ExecutenPointsActive bool `json:"executenPointsActive"` + CoreDumpCreating bool `json:"coreDumpCreating"` + SingelCycleActive bool `json:"singelCycleActive"` + ResetDisabled bool `json:"resetDisabled"` } func (t *AppOperationStateT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/AppProjectInfo.go b/pkg/fbs/plc/cmp/datalayer/fbs/AppProjectInfo.go index 7fc8c18..a71d6cd 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/AppProjectInfo.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/AppProjectInfo.go @@ -3,24 +3,40 @@ package fbs import ( + "bytes" flatbuffers "github.com/google/flatbuffers/go" ) type AppProjectInfoT struct { - Name string - Title string - Version string - Author string - Description string + Name string `json:"name"` + Title string `json:"title"` + Version string `json:"version"` + Author string `json:"author"` + Description string `json:"description"` } func (t *AppProjectInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - titleOffset := builder.CreateString(t.Title) - versionOffset := builder.CreateString(t.Version) - authorOffset := builder.CreateString(t.Author) - descriptionOffset := builder.CreateString(t.Description) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + titleOffset := flatbuffers.UOffsetT(0) + if t.Title != "" { + titleOffset = builder.CreateString(t.Title) + } + versionOffset := flatbuffers.UOffsetT(0) + if t.Version != "" { + versionOffset = builder.CreateString(t.Version) + } + authorOffset := flatbuffers.UOffsetT(0) + if t.Author != "" { + authorOffset = builder.CreateString(t.Author) + } + descriptionOffset := flatbuffers.UOffsetT(0) + if t.Description != "" { + descriptionOffset = builder.CreateString(t.Description) + } AppProjectInfoStart(builder) AppProjectInfoAddName(builder, nameOffset) AppProjectInfoAddTitle(builder, titleOffset) @@ -80,6 +96,38 @@ func (rcv *AppProjectInfo) Name() []byte { return nil } +func AppProjectInfoKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &AppProjectInfo{} + obj2 := &AppProjectInfo{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.Name()) < string(obj2.Name()) +} + +func (rcv *AppProjectInfo) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &AppProjectInfo{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.Name(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + func (rcv *AppProjectInfo) Title() []byte { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/AppReset.go b/pkg/fbs/plc/cmp/datalayer/fbs/AppReset.go index 710c1fd..4f8ff6a 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/AppReset.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/AppReset.go @@ -7,7 +7,7 @@ import ( ) type AppResetT struct { - Reset Reset + Reset Reset `json:"reset"` } func (t *AppResetT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/AppState.go b/pkg/fbs/plc/cmp/datalayer/fbs/AppState.go index e92d0a9..f5dfda5 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/AppState.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/AppState.go @@ -7,7 +7,7 @@ import ( ) type AppStateT struct { - State State + State State `json:"state"` } func (t *AppStateT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/AppTaskInfo.go b/pkg/fbs/plc/cmp/datalayer/fbs/AppTaskInfo.go index 97ca538..8cfd78b 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/AppTaskInfo.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/AppTaskInfo.go @@ -3,28 +3,32 @@ package fbs import ( + "bytes" flatbuffers "github.com/google/flatbuffers/go" ) type AppTaskInfoT struct { - Name string - Priority uint32 - Watchdog bool - WatchdogTime uint32 - CycleTime uint32 - AverageCycleTime uint32 - MaxCycleTime uint32 - MinCycleTime uint32 - CycleCount uint32 - WatchdogSensitivity uint32 - Interval uint32 - TaskType TaskType - OsHandle uint64 + Name string `json:"name"` + Priority uint32 `json:"priority"` + Watchdog bool `json:"watchdog"` + WatchdogTime uint32 `json:"watchdogTime"` + CycleTime uint32 `json:"cycleTime"` + AverageCycleTime uint32 `json:"averageCycleTime"` + MaxCycleTime uint32 `json:"maxCycleTime"` + MinCycleTime uint32 `json:"minCycleTime"` + CycleCount uint32 `json:"cycleCount"` + WatchdogSensitivity uint32 `json:"watchdogSensitivity"` + Interval uint32 `json:"interval"` + TaskType TaskType `json:"taskType"` + OsHandle uint64 `json:"osHandle"` } func (t *AppTaskInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } AppTaskInfoStart(builder) AppTaskInfoAddName(builder, nameOffset) AppTaskInfoAddPriority(builder, t.Priority) @@ -100,6 +104,38 @@ func (rcv *AppTaskInfo) Name() []byte { return nil } +func AppTaskInfoKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &AppTaskInfo{} + obj2 := &AppTaskInfo{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.Name()) < string(obj2.Name()) +} + +func (rcv *AppTaskInfo) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &AppTaskInfo{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.Name(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + func (rcv *AppTaskInfo) Priority() uint32 { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/AppTasksInfo.go b/pkg/fbs/plc/cmp/datalayer/fbs/AppTasksInfo.go index 639e55b..86a2bc3 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/AppTasksInfo.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/AppTasksInfo.go @@ -7,7 +7,7 @@ import ( ) type AppTasksInfoT struct { - Info []*AppTaskInfoT + Info []*AppTaskInfoT `json:"info"` } func (t *AppTasksInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -86,6 +86,15 @@ func (rcv *AppTasksInfo) Info(obj *AppTaskInfo, j int) bool { return false } +func (rcv *AppTasksInfo) InfoByKey(obj *AppTaskInfo, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + func (rcv *AppTasksInfo) InfoLength() int { o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) if o != 0 { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/ArrayBool_t.go b/pkg/fbs/plc/cmp/datalayer/fbs/ArrayBool_t.go index 534e8f8..20c7e5a 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/ArrayBool_t.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/ArrayBool_t.go @@ -7,7 +7,7 @@ import ( ) type ArrayBool_tT struct { - Data []bool + Data []bool `json:"data"` } func (t *ArrayBool_tT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/ArrayFloat32_t.go b/pkg/fbs/plc/cmp/datalayer/fbs/ArrayFloat32_t.go index f1e3a77..a027c92 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/ArrayFloat32_t.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/ArrayFloat32_t.go @@ -7,7 +7,7 @@ import ( ) type ArrayFloat32_tT struct { - Data []float32 + Data []float32 `json:"data"` } func (t *ArrayFloat32_tT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/ArrayFloat64_t.go b/pkg/fbs/plc/cmp/datalayer/fbs/ArrayFloat64_t.go index 2c167b5..900a712 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/ArrayFloat64_t.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/ArrayFloat64_t.go @@ -7,7 +7,7 @@ import ( ) type ArrayFloat64_tT struct { - Data []float64 + Data []float64 `json:"data"` } func (t *ArrayFloat64_tT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/ArrayInt16_t.go b/pkg/fbs/plc/cmp/datalayer/fbs/ArrayInt16_t.go index 9a30e37..c9808fa 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/ArrayInt16_t.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/ArrayInt16_t.go @@ -7,7 +7,7 @@ import ( ) type ArrayInt16_tT struct { - Data []int16 + Data []int16 `json:"data"` } func (t *ArrayInt16_tT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/ArrayInt32_t.go b/pkg/fbs/plc/cmp/datalayer/fbs/ArrayInt32_t.go index 2cdfaf1..7777a30 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/ArrayInt32_t.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/ArrayInt32_t.go @@ -7,7 +7,7 @@ import ( ) type ArrayInt32_tT struct { - Data []int32 + Data []int32 `json:"data"` } func (t *ArrayInt32_tT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/ArrayInt64_t.go b/pkg/fbs/plc/cmp/datalayer/fbs/ArrayInt64_t.go index ac60e16..ea614a5 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/ArrayInt64_t.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/ArrayInt64_t.go @@ -7,7 +7,7 @@ import ( ) type ArrayInt64_tT struct { - Data []int64 + Data []int64 `json:"data"` } func (t *ArrayInt64_tT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/ArrayInt8_t.go b/pkg/fbs/plc/cmp/datalayer/fbs/ArrayInt8_t.go index 1384f84..a21480a 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/ArrayInt8_t.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/ArrayInt8_t.go @@ -7,7 +7,7 @@ import ( ) type ArrayInt8_tT struct { - Data []int8 + Data []int8 `json:"data"` } func (t *ArrayInt8_tT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/ArrayUint16_t.go b/pkg/fbs/plc/cmp/datalayer/fbs/ArrayUint16_t.go index f036d45..abbc13c 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/ArrayUint16_t.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/ArrayUint16_t.go @@ -7,7 +7,7 @@ import ( ) type ArrayUint16_tT struct { - Data []uint16 + Data []uint16 `json:"data"` } func (t *ArrayUint16_tT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/ArrayUint32_t.go b/pkg/fbs/plc/cmp/datalayer/fbs/ArrayUint32_t.go index 2ce6bb8..70ac631 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/ArrayUint32_t.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/ArrayUint32_t.go @@ -7,7 +7,7 @@ import ( ) type ArrayUint32_tT struct { - Data []uint32 + Data []uint32 `json:"data"` } func (t *ArrayUint32_tT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/ArrayUint64_t.go b/pkg/fbs/plc/cmp/datalayer/fbs/ArrayUint64_t.go index 8f85454..58de934 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/ArrayUint64_t.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/ArrayUint64_t.go @@ -7,7 +7,7 @@ import ( ) type ArrayUint64_tT struct { - Data []uint64 + Data []uint64 `json:"data"` } func (t *ArrayUint64_tT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/ArrayUint8_t.go b/pkg/fbs/plc/cmp/datalayer/fbs/ArrayUint8_t.go index 8c0ab57..d968395 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/ArrayUint8_t.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/ArrayUint8_t.go @@ -7,7 +7,7 @@ import ( ) type ArrayUint8_tT struct { - Data []byte + Data []byte `json:"data"` } func (t *ArrayUint8_tT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/Bool_t.go b/pkg/fbs/plc/cmp/datalayer/fbs/Bool_t.go index 207f76c..4977200 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/Bool_t.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/Bool_t.go @@ -7,7 +7,7 @@ import ( ) type Bool_tT struct { - Data bool + Data bool `json:"data"` } func (t *Bool_tT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/Float32_t.go b/pkg/fbs/plc/cmp/datalayer/fbs/Float32_t.go index 082190e..0f5d35d 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/Float32_t.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/Float32_t.go @@ -7,7 +7,7 @@ import ( ) type Float32_tT struct { - Data float32 + Data float32 `json:"data"` } func (t *Float32_tT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/Float64_t.go b/pkg/fbs/plc/cmp/datalayer/fbs/Float64_t.go index f6e6bf7..1c3c702 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/Float64_t.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/Float64_t.go @@ -7,7 +7,7 @@ import ( ) type Float64_tT struct { - Data float64 + Data float64 `json:"data"` } func (t *Float64_tT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/Int16_t.go b/pkg/fbs/plc/cmp/datalayer/fbs/Int16_t.go index 580bc3a..44342f8 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/Int16_t.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/Int16_t.go @@ -7,7 +7,7 @@ import ( ) type Int16_tT struct { - Data int16 + Data int16 `json:"data"` } func (t *Int16_tT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/Int32_t.go b/pkg/fbs/plc/cmp/datalayer/fbs/Int32_t.go index 9bba646..954afa4 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/Int32_t.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/Int32_t.go @@ -7,7 +7,7 @@ import ( ) type Int32_tT struct { - Data int32 + Data int32 `json:"data"` } func (t *Int32_tT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/Int64_t.go b/pkg/fbs/plc/cmp/datalayer/fbs/Int64_t.go index 69ce532..45ca728 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/Int64_t.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/Int64_t.go @@ -7,7 +7,7 @@ import ( ) type Int64_tT struct { - Data int64 + Data int64 `json:"data"` } func (t *Int64_tT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/Int8_t.go b/pkg/fbs/plc/cmp/datalayer/fbs/Int8_t.go index 63f655e..2cd017f 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/Int8_t.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/Int8_t.go @@ -7,7 +7,7 @@ import ( ) type Int8_tT struct { - Data int8 + Data int8 `json:"data"` } func (t *Int8_tT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/Uint16_t.go b/pkg/fbs/plc/cmp/datalayer/fbs/Uint16_t.go index 754c75d..06aa37b 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/Uint16_t.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/Uint16_t.go @@ -7,7 +7,7 @@ import ( ) type Uint16_tT struct { - Data uint16 + Data uint16 `json:"data"` } func (t *Uint16_tT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/Uint32_t.go b/pkg/fbs/plc/cmp/datalayer/fbs/Uint32_t.go index 087d0d1..b8f6e97 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/Uint32_t.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/Uint32_t.go @@ -7,7 +7,7 @@ import ( ) type Uint32_tT struct { - Data uint32 + Data uint32 `json:"data"` } func (t *Uint32_tT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/Uint64_t.go b/pkg/fbs/plc/cmp/datalayer/fbs/Uint64_t.go index 46dd243..619b384 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/Uint64_t.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/Uint64_t.go @@ -7,7 +7,7 @@ import ( ) type Uint64_tT struct { - Data uint64 + Data uint64 `json:"data"` } func (t *Uint64_tT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/Uint8_t.go b/pkg/fbs/plc/cmp/datalayer/fbs/Uint8_t.go index f868370..5771fd6 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/Uint8_t.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/Uint8_t.go @@ -7,7 +7,7 @@ import ( ) type Uint8_tT struct { - Data byte + Data byte `json:"data"` } func (t *Uint8_tT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/plc/cmp/datalayer/fbs/Value.go b/pkg/fbs/plc/cmp/datalayer/fbs/Value.go index 817bc5c..f82481a 100644 --- a/pkg/fbs/plc/cmp/datalayer/fbs/Value.go +++ b/pkg/fbs/plc/cmp/datalayer/fbs/Value.go @@ -4,7 +4,6 @@ package fbs import ( "strconv" - flatbuffers "github.com/google/flatbuffers/go" ) @@ -156,70 +155,92 @@ func (t *ValueT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { func (rcv Value) UnPack(table flatbuffers.Table) *ValueT { switch rcv { case ValueBool_t: - x := Bool_t{_tab: table} + var x Bool_t + x.Init(table.Bytes, table.Pos) return &ValueT{ Type: ValueBool_t, Value: x.UnPack() } case ValueArrayBool_t: - x := ArrayBool_t{_tab: table} + var x ArrayBool_t + x.Init(table.Bytes, table.Pos) return &ValueT{ Type: ValueArrayBool_t, Value: x.UnPack() } case ValueInt8_t: - x := Int8_t{_tab: table} + var x Int8_t + x.Init(table.Bytes, table.Pos) return &ValueT{ Type: ValueInt8_t, Value: x.UnPack() } case ValueInt16_t: - x := Int16_t{_tab: table} + var x Int16_t + x.Init(table.Bytes, table.Pos) return &ValueT{ Type: ValueInt16_t, Value: x.UnPack() } case ValueInt32_t: - x := Int32_t{_tab: table} + var x Int32_t + x.Init(table.Bytes, table.Pos) return &ValueT{ Type: ValueInt32_t, Value: x.UnPack() } case ValueInt64_t: - x := Int64_t{_tab: table} + var x Int64_t + x.Init(table.Bytes, table.Pos) return &ValueT{ Type: ValueInt64_t, Value: x.UnPack() } case ValueUint8_t: - x := Uint8_t{_tab: table} + var x Uint8_t + x.Init(table.Bytes, table.Pos) return &ValueT{ Type: ValueUint8_t, Value: x.UnPack() } case ValueUint16_t: - x := Uint16_t{_tab: table} + var x Uint16_t + x.Init(table.Bytes, table.Pos) return &ValueT{ Type: ValueUint16_t, Value: x.UnPack() } case ValueUint32_t: - x := Uint32_t{_tab: table} + var x Uint32_t + x.Init(table.Bytes, table.Pos) return &ValueT{ Type: ValueUint32_t, Value: x.UnPack() } case ValueUint64_t: - x := Uint64_t{_tab: table} + var x Uint64_t + x.Init(table.Bytes, table.Pos) return &ValueT{ Type: ValueUint64_t, Value: x.UnPack() } case ValueFloat32_t: - x := Float32_t{_tab: table} + var x Float32_t + x.Init(table.Bytes, table.Pos) return &ValueT{ Type: ValueFloat32_t, Value: x.UnPack() } case ValueFloat64_t: - x := Float64_t{_tab: table} + var x Float64_t + x.Init(table.Bytes, table.Pos) return &ValueT{ Type: ValueFloat64_t, Value: x.UnPack() } case ValueArrayInt8_t: - x := ArrayInt8_t{_tab: table} + var x ArrayInt8_t + x.Init(table.Bytes, table.Pos) return &ValueT{ Type: ValueArrayInt8_t, Value: x.UnPack() } case ValueArrayInt16_t: - x := ArrayInt16_t{_tab: table} + var x ArrayInt16_t + x.Init(table.Bytes, table.Pos) return &ValueT{ Type: ValueArrayInt16_t, Value: x.UnPack() } case ValueArrayInt32_t: - x := ArrayInt32_t{_tab: table} + var x ArrayInt32_t + x.Init(table.Bytes, table.Pos) return &ValueT{ Type: ValueArrayInt32_t, Value: x.UnPack() } case ValueArrayUint64_t: - x := ArrayUint64_t{_tab: table} + var x ArrayUint64_t + x.Init(table.Bytes, table.Pos) return &ValueT{ Type: ValueArrayUint64_t, Value: x.UnPack() } case ValueArrayUint8_t: - x := ArrayUint8_t{_tab: table} + var x ArrayUint8_t + x.Init(table.Bytes, table.Pos) return &ValueT{ Type: ValueArrayUint8_t, Value: x.UnPack() } case ValueArrayUint16_t: - x := ArrayUint16_t{_tab: table} + var x ArrayUint16_t + x.Init(table.Bytes, table.Pos) return &ValueT{ Type: ValueArrayUint16_t, Value: x.UnPack() } case ValueArrayUint32_t: - x := ArrayUint32_t{_tab: table} + var x ArrayUint32_t + x.Init(table.Bytes, table.Pos) return &ValueT{ Type: ValueArrayUint32_t, Value: x.UnPack() } case ValueArrayInt64_t: - x := ArrayInt64_t{_tab: table} + var x ArrayInt64_t + x.Init(table.Bytes, table.Pos) return &ValueT{ Type: ValueArrayInt64_t, Value: x.UnPack() } case ValueArrayFloat32_t: - x := ArrayFloat32_t{_tab: table} + var x ArrayFloat32_t + x.Init(table.Bytes, table.Pos) return &ValueT{ Type: ValueArrayFloat32_t, Value: x.UnPack() } case ValueArrayFloat64_t: - x := ArrayFloat64_t{_tab: table} + var x ArrayFloat64_t + x.Init(table.Bytes, table.Pos) return &ValueT{ Type: ValueArrayFloat64_t, Value: x.UnPack() } } return nil diff --git a/pkg/fbs/script/manager/fbtypes/CfgGlobal.go b/pkg/fbs/script/manager/fbtypes/CfgGlobal.go index f1f30ae..c24cfa6 100644 --- a/pkg/fbs/script/manager/fbtypes/CfgGlobal.go +++ b/pkg/fbs/script/manager/fbtypes/CfgGlobal.go @@ -7,7 +7,7 @@ import ( ) type CfgGlobalT struct { - InitScript *CfgInitScriptT + InitScript *CfgInitScriptT `json:"initScript"` } func (t *CfgGlobalT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/script/manager/fbtypes/CfgInitScript.go b/pkg/fbs/script/manager/fbtypes/CfgInitScript.go index fd76872..5a52cca 100644 --- a/pkg/fbs/script/manager/fbtypes/CfgInitScript.go +++ b/pkg/fbs/script/manager/fbtypes/CfgInitScript.go @@ -7,15 +7,21 @@ import ( ) type CfgInitScriptT struct { - File string - Language string - Parameter []string + File string `json:"file"` + Language string `json:"language"` + Parameter []string `json:"parameter"` } func (t *CfgInitScriptT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - fileOffset := builder.CreateString(t.File) - languageOffset := builder.CreateString(t.Language) + fileOffset := flatbuffers.UOffsetT(0) + if t.File != "" { + fileOffset = builder.CreateString(t.File) + } + languageOffset := flatbuffers.UOffsetT(0) + if t.Language != "" { + languageOffset = builder.CreateString(t.Language) + } parameterOffset := flatbuffers.UOffsetT(0) if t.Parameter != nil { parameterLength := len(t.Parameter) diff --git a/pkg/fbs/script/manager/fbtypes/CfgProbeData.go b/pkg/fbs/script/manager/fbtypes/CfgProbeData.go index c99209b..71ee03e 100644 --- a/pkg/fbs/script/manager/fbtypes/CfgProbeData.go +++ b/pkg/fbs/script/manager/fbtypes/CfgProbeData.go @@ -8,28 +8,40 @@ import ( /// data of the axis probe type CfgProbeDataT struct { - MeasurSigSel string - MeasurType string - EvalEdgeType string - EvalDiffType string - ExpWindowEdgeEnable bool - ExpWindowStart float64 - ExpWindowEnd float64 - EnableMarkFailure bool - MaxNumOfMarkFailuer uint32 - TimeCompEnable bool - TimeCompPosEdge float64 - TimeCompNegEdge float64 - LvlMonitorActive bool - IsAutoActivated bool + MeasurSigSel string `json:"measurSigSel"` + MeasurType string `json:"measurType"` + EvalEdgeType string `json:"evalEdgeType"` + EvalDiffType string `json:"evalDiffType"` + ExpWindowEdgeEnable bool `json:"expWindowEdgeEnable"` + ExpWindowStart float64 `json:"expWindowStart"` + ExpWindowEnd float64 `json:"expWindowEnd"` + EnableMarkFailure bool `json:"enableMarkFailure"` + MaxNumOfMarkFailuer uint32 `json:"maxNumOfMarkFailuer"` + TimeCompEnable bool `json:"timeCompEnable"` + TimeCompPosEdge float64 `json:"timeCompPosEdge"` + TimeCompNegEdge float64 `json:"timeCompNegEdge"` + LvlMonitorActive bool `json:"lvlMonitorActive"` + IsAutoActivated bool `json:"isAutoActivated"` } func (t *CfgProbeDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - measurSigSelOffset := builder.CreateString(t.MeasurSigSel) - measurTypeOffset := builder.CreateString(t.MeasurType) - evalEdgeTypeOffset := builder.CreateString(t.EvalEdgeType) - evalDiffTypeOffset := builder.CreateString(t.EvalDiffType) + measurSigSelOffset := flatbuffers.UOffsetT(0) + if t.MeasurSigSel != "" { + measurSigSelOffset = builder.CreateString(t.MeasurSigSel) + } + measurTypeOffset := flatbuffers.UOffsetT(0) + if t.MeasurType != "" { + measurTypeOffset = builder.CreateString(t.MeasurType) + } + evalEdgeTypeOffset := flatbuffers.UOffsetT(0) + if t.EvalEdgeType != "" { + evalEdgeTypeOffset = builder.CreateString(t.EvalEdgeType) + } + evalDiffTypeOffset := flatbuffers.UOffsetT(0) + if t.EvalDiffType != "" { + evalDiffTypeOffset = builder.CreateString(t.EvalDiffType) + } CfgProbeDataStart(builder) CfgProbeDataAddMeasurSigSel(builder, measurSigSelOffset) CfgProbeDataAddMeasurType(builder, measurTypeOffset) diff --git a/pkg/fbs/script/manager/fbtypes/CmdOpt_Base.go b/pkg/fbs/script/manager/fbtypes/CmdOpt_Base.go index 9fe9737..c2a9d62 100644 --- a/pkg/fbs/script/manager/fbtypes/CmdOpt_Base.go +++ b/pkg/fbs/script/manager/fbtypes/CmdOpt_Base.go @@ -7,14 +7,17 @@ import ( ) type CmdOpt_BaseT struct { - Base *Cmd_BaseT - PermType string + Base *Cmd_BaseT `json:"base"` + PermType string `json:"permType"` } func (t *CmdOpt_BaseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } baseOffset := t.Base.Pack(builder) - permTypeOffset := builder.CreateString(t.PermType) + permTypeOffset := flatbuffers.UOffsetT(0) + if t.PermType != "" { + permTypeOffset = builder.CreateString(t.PermType) + } CmdOpt_BaseStart(builder) CmdOpt_BaseAddBase(builder, baseOffset) CmdOpt_BaseAddPermType(builder, permTypeOffset) diff --git a/pkg/fbs/script/manager/fbtypes/CmdOpt_KinAxsDynLim.go b/pkg/fbs/script/manager/fbtypes/CmdOpt_KinAxsDynLim.go index 7e2776a..97d2210 100644 --- a/pkg/fbs/script/manager/fbtypes/CmdOpt_KinAxsDynLim.go +++ b/pkg/fbs/script/manager/fbtypes/CmdOpt_KinAxsDynLim.go @@ -7,15 +7,18 @@ import ( ) type CmdOpt_KinAxsDynLimT struct { - Base *CmdOpt_BaseT - AxsName string - Lim *Cmd_DynLimitsT + Base *CmdOpt_BaseT `json:"base"` + AxsName string `json:"axsName"` + Lim *Cmd_DynLimitsT `json:"lim"` } func (t *CmdOpt_KinAxsDynLimT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } baseOffset := t.Base.Pack(builder) - axsNameOffset := builder.CreateString(t.AxsName) + axsNameOffset := flatbuffers.UOffsetT(0) + if t.AxsName != "" { + axsNameOffset = builder.CreateString(t.AxsName) + } limOffset := t.Lim.Pack(builder) CmdOpt_KinAxsDynLimStart(builder) CmdOpt_KinAxsDynLimAddBase(builder, baseOffset) diff --git a/pkg/fbs/script/manager/fbtypes/CmdOpt_KinBlend.go b/pkg/fbs/script/manager/fbtypes/CmdOpt_KinBlend.go index 33ed1f2..0b52807 100644 --- a/pkg/fbs/script/manager/fbtypes/CmdOpt_KinBlend.go +++ b/pkg/fbs/script/manager/fbtypes/CmdOpt_KinBlend.go @@ -7,9 +7,9 @@ import ( ) type CmdOpt_KinBlendT struct { - Base *CmdOpt_BaseT - Dist1 float64 - Dist2 float64 + Base *CmdOpt_BaseT `json:"base"` + Dist1 float64 `json:"dist1"` + Dist2 float64 `json:"dist2"` } func (t *CmdOpt_KinBlendT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/script/manager/fbtypes/CmdOpt_KinFeedGroup.go b/pkg/fbs/script/manager/fbtypes/CmdOpt_KinFeedGroup.go index 37e8f3a..ce001a2 100644 --- a/pkg/fbs/script/manager/fbtypes/CmdOpt_KinFeedGroup.go +++ b/pkg/fbs/script/manager/fbtypes/CmdOpt_KinFeedGroup.go @@ -7,8 +7,8 @@ import ( ) type CmdOpt_KinFeedGroupT struct { - Base *CmdOpt_BaseT - FeedGroup FeedGroup + Base *CmdOpt_BaseT `json:"base"` + FeedGroup FeedGroup `json:"feedGroup"` } func (t *CmdOpt_KinFeedGroupT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/script/manager/fbtypes/CmdOpt_KinPolyTrans.go b/pkg/fbs/script/manager/fbtypes/CmdOpt_KinPolyTrans.go index c832695..6c7fa60 100644 --- a/pkg/fbs/script/manager/fbtypes/CmdOpt_KinPolyTrans.go +++ b/pkg/fbs/script/manager/fbtypes/CmdOpt_KinPolyTrans.go @@ -7,10 +7,10 @@ import ( ) type CmdOpt_KinPolyTransT struct { - Base *CmdOpt_BaseT - Dist1 float64 - Dist2 float64 - Eps float64 + Base *CmdOpt_BaseT `json:"base"` + Dist1 float64 `json:"dist1"` + Dist2 float64 `json:"dist2"` + Eps float64 `json:"eps"` } func (t *CmdOpt_KinPolyTransT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/script/manager/fbtypes/CmdOpt_KinSetMCS.go b/pkg/fbs/script/manager/fbtypes/CmdOpt_KinSetMCS.go index 649e521..13caab0 100644 --- a/pkg/fbs/script/manager/fbtypes/CmdOpt_KinSetMCS.go +++ b/pkg/fbs/script/manager/fbtypes/CmdOpt_KinSetMCS.go @@ -7,14 +7,17 @@ import ( ) type CmdOpt_KinSetMCST struct { - Base *CmdOpt_BaseT - SetName string + Base *CmdOpt_BaseT `json:"base"` + SetName string `json:"setName"` } func (t *CmdOpt_KinSetMCST) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } baseOffset := t.Base.Pack(builder) - setNameOffset := builder.CreateString(t.SetName) + setNameOffset := flatbuffers.UOffsetT(0) + if t.SetName != "" { + setNameOffset = builder.CreateString(t.SetName) + } CmdOpt_KinSetMCSStart(builder) CmdOpt_KinSetMCSAddBase(builder, baseOffset) CmdOpt_KinSetMCSAddSetName(builder, setNameOffset) diff --git a/pkg/fbs/script/manager/fbtypes/CmdOpt_KinSetPCS.go b/pkg/fbs/script/manager/fbtypes/CmdOpt_KinSetPCS.go index 436ed8d..2a4a38d 100644 --- a/pkg/fbs/script/manager/fbtypes/CmdOpt_KinSetPCS.go +++ b/pkg/fbs/script/manager/fbtypes/CmdOpt_KinSetPCS.go @@ -7,14 +7,17 @@ import ( ) type CmdOpt_KinSetPCST struct { - Base *CmdOpt_BaseT - SetName string + Base *CmdOpt_BaseT `json:"base"` + SetName string `json:"setName"` } func (t *CmdOpt_KinSetPCST) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } baseOffset := t.Base.Pack(builder) - setNameOffset := builder.CreateString(t.SetName) + setNameOffset := flatbuffers.UOffsetT(0) + if t.SetName != "" { + setNameOffset = builder.CreateString(t.SetName) + } CmdOpt_KinSetPCSStart(builder) CmdOpt_KinSetPCSAddBase(builder, baseOffset) CmdOpt_KinSetPCSAddSetName(builder, setNameOffset) diff --git a/pkg/fbs/script/manager/fbtypes/CmdOpt_KinSetSafeArea.go b/pkg/fbs/script/manager/fbtypes/CmdOpt_KinSetSafeArea.go index c262a80..5c4a8df 100644 --- a/pkg/fbs/script/manager/fbtypes/CmdOpt_KinSetSafeArea.go +++ b/pkg/fbs/script/manager/fbtypes/CmdOpt_KinSetSafeArea.go @@ -7,14 +7,17 @@ import ( ) type CmdOpt_KinSetSafeAreaT struct { - Base *CmdOpt_BaseT - SafeArea string + Base *CmdOpt_BaseT `json:"base"` + SafeArea string `json:"safeArea"` } func (t *CmdOpt_KinSetSafeAreaT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } baseOffset := t.Base.Pack(builder) - safeAreaOffset := builder.CreateString(t.SafeArea) + safeAreaOffset := flatbuffers.UOffsetT(0) + if t.SafeArea != "" { + safeAreaOffset = builder.CreateString(t.SafeArea) + } CmdOpt_KinSetSafeAreaStart(builder) CmdOpt_KinSetSafeAreaAddBase(builder, baseOffset) CmdOpt_KinSetSafeAreaAddSafeArea(builder, safeAreaOffset) diff --git a/pkg/fbs/script/manager/fbtypes/CmdType_CmdOptionInfoReq.go b/pkg/fbs/script/manager/fbtypes/CmdType_CmdOptionInfoReq.go index d8a476b..ae1f4e5 100644 --- a/pkg/fbs/script/manager/fbtypes/CmdType_CmdOptionInfoReq.go +++ b/pkg/fbs/script/manager/fbtypes/CmdType_CmdOptionInfoReq.go @@ -4,27 +4,27 @@ package fbtypes import "strconv" -type CmdTypeCmdOptionInfoReq int8 +type CmdType_CmdOptionInfoReq int8 const ( - CmdType_CmdOptionInfoReqUNKNOWN CmdTypeCmdOptionInfoReq = 0 - CmdType_CmdOptionInfoReqCMD CmdTypeCmdOptionInfoReq = 1 - CmdType_CmdOptionInfoReqCMD_OPTION CmdTypeCmdOptionInfoReq = 2 + CmdType_CmdOptionInfoReqUNKNOWN CmdType_CmdOptionInfoReq = 0 + CmdType_CmdOptionInfoReqCMD CmdType_CmdOptionInfoReq = 1 + CmdType_CmdOptionInfoReqCMD_OPTION CmdType_CmdOptionInfoReq = 2 ) -var EnumNamesCmdType_CmdOptionInfoReq = map[CmdTypeCmdOptionInfoReq]string{ +var EnumNamesCmdType_CmdOptionInfoReq = map[CmdType_CmdOptionInfoReq]string{ CmdType_CmdOptionInfoReqUNKNOWN: "UNKNOWN", CmdType_CmdOptionInfoReqCMD: "CMD", CmdType_CmdOptionInfoReqCMD_OPTION: "CMD_OPTION", } -var EnumValuesCmdType_CmdOptionInfoReq = map[string]CmdTypeCmdOptionInfoReq{ +var EnumValuesCmdType_CmdOptionInfoReq = map[string]CmdType_CmdOptionInfoReq{ "UNKNOWN": CmdType_CmdOptionInfoReqUNKNOWN, "CMD": CmdType_CmdOptionInfoReqCMD, "CMD_OPTION": CmdType_CmdOptionInfoReqCMD_OPTION, } -func (v CmdTypeCmdOptionInfoReq) String() string { +func (v CmdType_CmdOptionInfoReq) String() string { if s, ok := EnumNamesCmdType_CmdOptionInfoReq[v]; ok { return s } diff --git a/pkg/fbs/script/manager/fbtypes/CmdType_ListRegisteredCmdsOptions.go b/pkg/fbs/script/manager/fbtypes/CmdType_ListRegisteredCmdsOptions.go index 07c9c32..7e98229 100644 --- a/pkg/fbs/script/manager/fbtypes/CmdType_ListRegisteredCmdsOptions.go +++ b/pkg/fbs/script/manager/fbtypes/CmdType_ListRegisteredCmdsOptions.go @@ -4,27 +4,27 @@ package fbtypes import "strconv" -type CmdTypeListRegisteredCmdsOptions int8 +type CmdType_ListRegisteredCmdsOptions int8 const ( - CmdType_ListRegisteredCmdsOptionsUNKNOWN CmdTypeListRegisteredCmdsOptions = 0 - CmdType_ListRegisteredCmdsOptionsCMD CmdTypeListRegisteredCmdsOptions = 1 - CmdType_ListRegisteredCmdsOptionsCMD_OPTION CmdTypeListRegisteredCmdsOptions = 2 + CmdType_ListRegisteredCmdsOptionsUNKNOWN CmdType_ListRegisteredCmdsOptions = 0 + CmdType_ListRegisteredCmdsOptionsCMD CmdType_ListRegisteredCmdsOptions = 1 + CmdType_ListRegisteredCmdsOptionsCMD_OPTION CmdType_ListRegisteredCmdsOptions = 2 ) -var EnumNamesCmdType_ListRegisteredCmdsOptions = map[CmdTypeListRegisteredCmdsOptions]string{ +var EnumNamesCmdType_ListRegisteredCmdsOptions = map[CmdType_ListRegisteredCmdsOptions]string{ CmdType_ListRegisteredCmdsOptionsUNKNOWN: "UNKNOWN", CmdType_ListRegisteredCmdsOptionsCMD: "CMD", CmdType_ListRegisteredCmdsOptionsCMD_OPTION: "CMD_OPTION", } -var EnumValuesCmdType_ListRegisteredCmdsOptions = map[string]CmdTypeListRegisteredCmdsOptions{ +var EnumValuesCmdType_ListRegisteredCmdsOptions = map[string]CmdType_ListRegisteredCmdsOptions{ "UNKNOWN": CmdType_ListRegisteredCmdsOptionsUNKNOWN, "CMD": CmdType_ListRegisteredCmdsOptionsCMD, "CMD_OPTION": CmdType_ListRegisteredCmdsOptionsCMD_OPTION, } -func (v CmdTypeListRegisteredCmdsOptions) String() string { +func (v CmdType_ListRegisteredCmdsOptions) String() string { if s, ok := EnumNamesCmdType_ListRegisteredCmdsOptions[v]; ok { return s } diff --git a/pkg/fbs/script/manager/fbtypes/Cmd_AxsAbort.go b/pkg/fbs/script/manager/fbtypes/Cmd_AxsAbort.go index 4dec089..2765541 100644 --- a/pkg/fbs/script/manager/fbtypes/Cmd_AxsAbort.go +++ b/pkg/fbs/script/manager/fbtypes/Cmd_AxsAbort.go @@ -7,9 +7,9 @@ import ( ) type Cmd_AxsAbortT struct { - Base *Cmd_BaseT - Dec float64 - JrkDec float64 + Base *Cmd_BaseT `json:"base"` + Dec float64 `json:"dec"` + JrkDec float64 `json:"jrkDec"` } func (t *Cmd_AxsAbortT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/script/manager/fbtypes/Cmd_AxsAddToGantry.go b/pkg/fbs/script/manager/fbtypes/Cmd_AxsAddToGantry.go index 32ac3a7..0120e77 100644 --- a/pkg/fbs/script/manager/fbtypes/Cmd_AxsAddToGantry.go +++ b/pkg/fbs/script/manager/fbtypes/Cmd_AxsAddToGantry.go @@ -7,15 +7,18 @@ import ( ) type Cmd_AxsAddToGantryT struct { - Base *Cmd_BaseT - MasterName string - Buffered bool + Base *Cmd_BaseT `json:"base"` + MasterName string `json:"masterName"` + Buffered bool `json:"buffered"` } func (t *Cmd_AxsAddToGantryT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } baseOffset := t.Base.Pack(builder) - masterNameOffset := builder.CreateString(t.MasterName) + masterNameOffset := flatbuffers.UOffsetT(0) + if t.MasterName != "" { + masterNameOffset = builder.CreateString(t.MasterName) + } Cmd_AxsAddToGantryStart(builder) Cmd_AxsAddToGantryAddBase(builder, baseOffset) Cmd_AxsAddToGantryAddMasterName(builder, masterNameOffset) diff --git a/pkg/fbs/script/manager/fbtypes/Cmd_AxsAddToKin.go b/pkg/fbs/script/manager/fbtypes/Cmd_AxsAddToKin.go index 9090238..f1e9d2c 100644 --- a/pkg/fbs/script/manager/fbtypes/Cmd_AxsAddToKin.go +++ b/pkg/fbs/script/manager/fbtypes/Cmd_AxsAddToKin.go @@ -7,15 +7,18 @@ import ( ) type Cmd_AxsAddToKinT struct { - Base *Cmd_BaseT - KinName string - Buffered bool + Base *Cmd_BaseT `json:"base"` + KinName string `json:"kinName"` + Buffered bool `json:"buffered"` } func (t *Cmd_AxsAddToKinT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } baseOffset := t.Base.Pack(builder) - kinNameOffset := builder.CreateString(t.KinName) + kinNameOffset := flatbuffers.UOffsetT(0) + if t.KinName != "" { + kinNameOffset = builder.CreateString(t.KinName) + } Cmd_AxsAddToKinStart(builder) Cmd_AxsAddToKinAddBase(builder, baseOffset) Cmd_AxsAddToKinAddKinName(builder, kinNameOffset) diff --git a/pkg/fbs/script/manager/fbtypes/Cmd_AxsJog.go b/pkg/fbs/script/manager/fbtypes/Cmd_AxsJog.go index e331deb..c94512a 100644 --- a/pkg/fbs/script/manager/fbtypes/Cmd_AxsJog.go +++ b/pkg/fbs/script/manager/fbtypes/Cmd_AxsJog.go @@ -7,16 +7,19 @@ import ( ) type Cmd_AxsJogT struct { - Base *Cmd_BaseT - Dir string - Incr float64 - Lim *Cmd_DynLimitsT + Base *Cmd_BaseT `json:"base"` + Dir string `json:"dir"` + Incr float64 `json:"incr"` + Lim *Cmd_DynLimitsT `json:"lim"` } func (t *Cmd_AxsJogT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } baseOffset := t.Base.Pack(builder) - dirOffset := builder.CreateString(t.Dir) + dirOffset := flatbuffers.UOffsetT(0) + if t.Dir != "" { + dirOffset = builder.CreateString(t.Dir) + } limOffset := t.Lim.Pack(builder) Cmd_AxsJogStart(builder) Cmd_AxsJogAddBase(builder, baseOffset) diff --git a/pkg/fbs/script/manager/fbtypes/Cmd_AxsPos.go b/pkg/fbs/script/manager/fbtypes/Cmd_AxsPos.go index 19f2a3d..ebcc691 100644 --- a/pkg/fbs/script/manager/fbtypes/Cmd_AxsPos.go +++ b/pkg/fbs/script/manager/fbtypes/Cmd_AxsPos.go @@ -7,10 +7,10 @@ import ( ) type Cmd_AxsPosT struct { - Base *Cmd_BaseT - Pos float64 - Buffered bool - Lim *Cmd_DynLimitsT + Base *Cmd_BaseT `json:"base"` + Pos float64 `json:"pos"` + Buffered bool `json:"buffered"` + Lim *Cmd_DynLimitsT `json:"lim"` } func (t *Cmd_AxsPosT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/script/manager/fbtypes/Cmd_AxsPower.go b/pkg/fbs/script/manager/fbtypes/Cmd_AxsPower.go index 60684d7..0d12d28 100644 --- a/pkg/fbs/script/manager/fbtypes/Cmd_AxsPower.go +++ b/pkg/fbs/script/manager/fbtypes/Cmd_AxsPower.go @@ -7,8 +7,8 @@ import ( ) type Cmd_AxsPowerT struct { - Base *Cmd_BaseT - SwitchOn bool + Base *Cmd_BaseT `json:"base"` + SwitchOn bool `json:"switchOn"` } func (t *Cmd_AxsPowerT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/script/manager/fbtypes/Cmd_AxsVelocity.go b/pkg/fbs/script/manager/fbtypes/Cmd_AxsVelocity.go index 046fb94..cc8e3b9 100644 --- a/pkg/fbs/script/manager/fbtypes/Cmd_AxsVelocity.go +++ b/pkg/fbs/script/manager/fbtypes/Cmd_AxsVelocity.go @@ -7,11 +7,11 @@ import ( ) type Cmd_AxsVelocityT struct { - Base *Cmd_BaseT - Vel float64 - DriveVelMode bool - Buffered bool - Lim *Cmd_DynLimitsT + Base *Cmd_BaseT `json:"base"` + Vel float64 `json:"vel"` + DriveVelMode bool `json:"driveVelMode"` + Buffered bool `json:"buffered"` + Lim *Cmd_DynLimitsT `json:"lim"` } func (t *Cmd_AxsVelocityT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/script/manager/fbtypes/Cmd_Base.go b/pkg/fbs/script/manager/fbtypes/Cmd_Base.go index fff7ef4..9b8fa1e 100644 --- a/pkg/fbs/script/manager/fbtypes/Cmd_Base.go +++ b/pkg/fbs/script/manager/fbtypes/Cmd_Base.go @@ -7,15 +7,21 @@ import ( ) type Cmd_BaseT struct { - Name string - Source string - Line uint64 + Name string `json:"name"` + Source string `json:"source"` + Line uint64 `json:"line"` } func (t *Cmd_BaseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - sourceOffset := builder.CreateString(t.Source) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + sourceOffset := flatbuffers.UOffsetT(0) + if t.Source != "" { + sourceOffset = builder.CreateString(t.Source) + } Cmd_BaseStart(builder) Cmd_BaseAddName(builder, nameOffset) Cmd_BaseAddSource(builder, sourceOffset) diff --git a/pkg/fbs/script/manager/fbtypes/Cmd_DynLimits.go b/pkg/fbs/script/manager/fbtypes/Cmd_DynLimits.go index 428f7f7..78ca7a4 100644 --- a/pkg/fbs/script/manager/fbtypes/Cmd_DynLimits.go +++ b/pkg/fbs/script/manager/fbtypes/Cmd_DynLimits.go @@ -7,11 +7,11 @@ import ( ) type Cmd_DynLimitsT struct { - Vel float64 - Acc float64 - Dec float64 - JrkAcc float64 - JrkDec float64 + Vel float64 `json:"vel"` + Acc float64 `json:"acc"` + Dec float64 `json:"dec"` + JrkAcc float64 `json:"jrkAcc"` + JrkDec float64 `json:"jrkDec"` } func (t *Cmd_DynLimitsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/script/manager/fbtypes/Cmd_GenCmdOption.go b/pkg/fbs/script/manager/fbtypes/Cmd_GenCmdOption.go index 8f2c765..5635fb9 100644 --- a/pkg/fbs/script/manager/fbtypes/Cmd_GenCmdOption.go +++ b/pkg/fbs/script/manager/fbtypes/Cmd_GenCmdOption.go @@ -7,16 +7,19 @@ import ( ) type Cmd_GenCmdOptionT struct { - Base *Cmd_BaseT - CmdName string - ObjType ObjectTypeGenCmdOption - Params []byte + Base *Cmd_BaseT `json:"base"` + CmdName string `json:"cmdName"` + ObjType ObjectType_GenCmdOption `json:"objType"` + Params []byte `json:"params"` } func (t *Cmd_GenCmdOptionT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } baseOffset := t.Base.Pack(builder) - cmdNameOffset := builder.CreateString(t.CmdName) + cmdNameOffset := flatbuffers.UOffsetT(0) + if t.CmdName != "" { + cmdNameOffset = builder.CreateString(t.CmdName) + } paramsOffset := flatbuffers.UOffsetT(0) if t.Params != nil { paramsOffset = builder.CreateByteString(t.Params) @@ -91,15 +94,15 @@ func (rcv *Cmd_GenCmdOption) CmdName() []byte { return nil } -func (rcv *Cmd_GenCmdOption) ObjType() ObjectTypeGenCmdOption { +func (rcv *Cmd_GenCmdOption) ObjType() ObjectType_GenCmdOption { o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) if o != 0 { - return ObjectTypeGenCmdOption(rcv._tab.GetInt8(o + rcv._tab.Pos)) + return ObjectType_GenCmdOption(rcv._tab.GetInt8(o + rcv._tab.Pos)) } return 0 } -func (rcv *Cmd_GenCmdOption) MutateObjType(n ObjectTypeGenCmdOption) bool { +func (rcv *Cmd_GenCmdOption) MutateObjType(n ObjectType_GenCmdOption) bool { return rcv._tab.MutateInt8Slot(8, int8(n)) } @@ -146,7 +149,7 @@ func Cmd_GenCmdOptionAddBase(builder *flatbuffers.Builder, base flatbuffers.UOff func Cmd_GenCmdOptionAddCmdName(builder *flatbuffers.Builder, cmdName flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(cmdName), 0) } -func Cmd_GenCmdOptionAddObjType(builder *flatbuffers.Builder, objType ObjectTypeGenCmdOption) { +func Cmd_GenCmdOptionAddObjType(builder *flatbuffers.Builder, objType ObjectType_GenCmdOption) { builder.PrependInt8Slot(2, int8(objType), 0) } func Cmd_GenCmdOptionAddParams(builder *flatbuffers.Builder, params flatbuffers.UOffsetT) { diff --git a/pkg/fbs/script/manager/fbtypes/Cmd_KinAbort.go b/pkg/fbs/script/manager/fbtypes/Cmd_KinAbort.go index 2b5d911..0b9174f 100644 --- a/pkg/fbs/script/manager/fbtypes/Cmd_KinAbort.go +++ b/pkg/fbs/script/manager/fbtypes/Cmd_KinAbort.go @@ -7,17 +7,20 @@ import ( ) type Cmd_KinAbortT struct { - Base *Cmd_BaseT - Type string + Base *Cmd_BaseT `json:"base"` + Type string `json:"type"` } func (t *Cmd_KinAbortT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } baseOffset := t.Base.Pack(builder) - typeOffset := builder.CreateString(t.Type) + type_Offset := flatbuffers.UOffsetT(0) + if t.Type != "" { + type_Offset = builder.CreateString(t.Type) + } Cmd_KinAbortStart(builder) Cmd_KinAbortAddBase(builder, baseOffset) - Cmd_KinAbortAddType(builder, typeOffset) + Cmd_KinAbortAddType(builder, type_Offset) return Cmd_KinAbortEnd(builder) } diff --git a/pkg/fbs/script/manager/fbtypes/Cmd_KinContour.go b/pkg/fbs/script/manager/fbtypes/Cmd_KinContour.go index 7304944..1263dce 100644 --- a/pkg/fbs/script/manager/fbtypes/Cmd_KinContour.go +++ b/pkg/fbs/script/manager/fbtypes/Cmd_KinContour.go @@ -7,9 +7,9 @@ import ( ) type Cmd_KinContourT struct { - Base *Cmd_BaseT - IsStart bool - PrepCmds uint32 + Base *Cmd_BaseT `json:"base"` + IsStart bool `json:"isStart"` + PrepCmds uint32 `json:"prepCmds"` } func (t *Cmd_KinContourT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/script/manager/fbtypes/Cmd_KinJog.go b/pkg/fbs/script/manager/fbtypes/Cmd_KinJog.go index 3dd6606..7c3979e 100644 --- a/pkg/fbs/script/manager/fbtypes/Cmd_KinJog.go +++ b/pkg/fbs/script/manager/fbtypes/Cmd_KinJog.go @@ -7,11 +7,11 @@ import ( ) type Cmd_KinJogT struct { - Base *Cmd_BaseT - Dir []float64 - CoordSys string - Incr float64 - Lim *Cmd_DynLimitsT + Base *Cmd_BaseT `json:"base"` + Dir []float64 `json:"dir"` + CoordSys string `json:"coordSys"` + Incr float64 `json:"incr"` + Lim *Cmd_DynLimitsT `json:"lim"` } func (t *Cmd_KinJogT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -26,7 +26,10 @@ func (t *Cmd_KinJogT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { } dirOffset = builder.EndVector(dirLength) } - coordSysOffset := builder.CreateString(t.CoordSys) + coordSysOffset := flatbuffers.UOffsetT(0) + if t.CoordSys != "" { + coordSysOffset = builder.CreateString(t.CoordSys) + } limOffset := t.Lim.Pack(builder) Cmd_KinJogStart(builder) Cmd_KinJogAddBase(builder, baseOffset) diff --git a/pkg/fbs/script/manager/fbtypes/Cmd_KinMoveDirect.go b/pkg/fbs/script/manager/fbtypes/Cmd_KinMoveDirect.go index ae3f176..32b14f7 100644 --- a/pkg/fbs/script/manager/fbtypes/Cmd_KinMoveDirect.go +++ b/pkg/fbs/script/manager/fbtypes/Cmd_KinMoveDirect.go @@ -7,10 +7,10 @@ import ( ) type Cmd_KinMoveDirectT struct { - Base *Cmd_BaseT - Pos []float64 - CoordSys string - Buffered bool + Base *Cmd_BaseT `json:"base"` + Pos []float64 `json:"pos"` + CoordSys string `json:"coordSys"` + Buffered bool `json:"buffered"` } func (t *Cmd_KinMoveDirectT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -25,7 +25,10 @@ func (t *Cmd_KinMoveDirectT) Pack(builder *flatbuffers.Builder) flatbuffers.UOff } posOffset = builder.EndVector(posLength) } - coordSysOffset := builder.CreateString(t.CoordSys) + coordSysOffset := flatbuffers.UOffsetT(0) + if t.CoordSys != "" { + coordSysOffset = builder.CreateString(t.CoordSys) + } Cmd_KinMoveDirectStart(builder) Cmd_KinMoveDirectAddBase(builder, baseOffset) Cmd_KinMoveDirectAddPos(builder, posOffset) diff --git a/pkg/fbs/script/manager/fbtypes/Cmd_KinMoveDirectAsync.go b/pkg/fbs/script/manager/fbtypes/Cmd_KinMoveDirectAsync.go index 5fc2103..a9a2db9 100644 --- a/pkg/fbs/script/manager/fbtypes/Cmd_KinMoveDirectAsync.go +++ b/pkg/fbs/script/manager/fbtypes/Cmd_KinMoveDirectAsync.go @@ -7,11 +7,11 @@ import ( ) type Cmd_KinMoveDirectAsyncT struct { - Base *Cmd_BaseT - Pos []float64 - CoordSys string - DynLimFactors *Cmd_DynLimitsT - Buffered bool + Base *Cmd_BaseT `json:"base"` + Pos []float64 `json:"pos"` + CoordSys string `json:"coordSys"` + DynLimFactors *Cmd_DynLimitsT `json:"dynLimFactors"` + Buffered bool `json:"buffered"` } func (t *Cmd_KinMoveDirectAsyncT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -26,7 +26,10 @@ func (t *Cmd_KinMoveDirectAsyncT) Pack(builder *flatbuffers.Builder) flatbuffers } posOffset = builder.EndVector(posLength) } - coordSysOffset := builder.CreateString(t.CoordSys) + coordSysOffset := flatbuffers.UOffsetT(0) + if t.CoordSys != "" { + coordSysOffset = builder.CreateString(t.CoordSys) + } dynLimFactorsOffset := t.DynLimFactors.Pack(builder) Cmd_KinMoveDirectAsyncStart(builder) Cmd_KinMoveDirectAsyncAddBase(builder, baseOffset) diff --git a/pkg/fbs/script/manager/fbtypes/Cmd_KinMoveLin.go b/pkg/fbs/script/manager/fbtypes/Cmd_KinMoveLin.go index 758529d..a20c5d0 100644 --- a/pkg/fbs/script/manager/fbtypes/Cmd_KinMoveLin.go +++ b/pkg/fbs/script/manager/fbtypes/Cmd_KinMoveLin.go @@ -7,11 +7,11 @@ import ( ) type Cmd_KinMoveLinT struct { - Base *Cmd_BaseT - Pos []float64 - CoordSys string - Lim *Cmd_DynLimitsT - Buffered bool + Base *Cmd_BaseT `json:"base"` + Pos []float64 `json:"pos"` + CoordSys string `json:"coordSys"` + Lim *Cmd_DynLimitsT `json:"lim"` + Buffered bool `json:"buffered"` } func (t *Cmd_KinMoveLinT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -26,7 +26,10 @@ func (t *Cmd_KinMoveLinT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffset } posOffset = builder.EndVector(posLength) } - coordSysOffset := builder.CreateString(t.CoordSys) + coordSysOffset := flatbuffers.UOffsetT(0) + if t.CoordSys != "" { + coordSysOffset = builder.CreateString(t.CoordSys) + } limOffset := t.Lim.Pack(builder) Cmd_KinMoveLinStart(builder) Cmd_KinMoveLinAddBase(builder, baseOffset) diff --git a/pkg/fbs/script/manager/fbtypes/DL_Write.go b/pkg/fbs/script/manager/fbtypes/DL_Write.go index 750f27a..dc53216 100644 --- a/pkg/fbs/script/manager/fbtypes/DL_Write.go +++ b/pkg/fbs/script/manager/fbtypes/DL_Write.go @@ -7,18 +7,24 @@ import ( ) type DL_WriteT struct { - Path string - Type int32 - S string - I int64 - B bool - D float64 + Path string `json:"path"` + Type int32 `json:"type"` + S string `json:"s"` + I int64 `json:"i"` + B bool `json:"b"` + D float64 `json:"d"` } func (t *DL_WriteT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - pathOffset := builder.CreateString(t.Path) - sOffset := builder.CreateString(t.S) + pathOffset := flatbuffers.UOffsetT(0) + if t.Path != "" { + pathOffset = builder.CreateString(t.Path) + } + sOffset := flatbuffers.UOffsetT(0) + if t.S != "" { + sOffset = builder.CreateString(t.S) + } DL_WriteStart(builder) DL_WriteAddPath(builder, pathOffset) DL_WriteAddType(builder, t.Type) diff --git a/pkg/fbs/script/manager/fbtypes/DiagInfo.go b/pkg/fbs/script/manager/fbtypes/DiagInfo.go index 9ac4a11..d0caf84 100644 --- a/pkg/fbs/script/manager/fbtypes/DiagInfo.go +++ b/pkg/fbs/script/manager/fbtypes/DiagInfo.go @@ -7,15 +7,18 @@ import ( ) type DiagInfoT struct { - LastMainDiag uint32 - LastDetailDiag uint32 - LastErrText string - LastErrTrace []string + LastMainDiag uint32 `json:"lastMainDiag"` + LastDetailDiag uint32 `json:"lastDetailDiag"` + LastErrText string `json:"lastErrText"` + LastErrTrace []string `json:"lastErrTrace"` } func (t *DiagInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - lastErrTextOffset := builder.CreateString(t.LastErrText) + lastErrTextOffset := flatbuffers.UOffsetT(0) + if t.LastErrText != "" { + lastErrTextOffset = builder.CreateString(t.LastErrText) + } lastErrTraceOffset := flatbuffers.UOffsetT(0) if t.LastErrTrace != nil { lastErrTraceLength := len(t.LastErrTrace) diff --git a/pkg/fbs/script/manager/fbtypes/GlobalCfg.go b/pkg/fbs/script/manager/fbtypes/GlobalCfg.go index 55234a8..c5e6128 100644 --- a/pkg/fbs/script/manager/fbtypes/GlobalCfg.go +++ b/pkg/fbs/script/manager/fbtypes/GlobalCfg.go @@ -7,13 +7,16 @@ import ( ) type GlobalCfgT struct { - InitScript string - InitScriptParam []string + InitScript string `json:"initScript"` + InitScriptParam []string `json:"initScriptParam"` } func (t *GlobalCfgT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - initScriptOffset := builder.CreateString(t.InitScript) + initScriptOffset := flatbuffers.UOffsetT(0) + if t.InitScript != "" { + initScriptOffset = builder.CreateString(t.InitScript) + } initScriptParamOffset := flatbuffers.UOffsetT(0) if t.InitScriptParam != nil { initScriptParamLength := len(t.InitScriptParam) diff --git a/pkg/fbs/script/manager/fbtypes/Misc_ActCmdData.go b/pkg/fbs/script/manager/fbtypes/Misc_ActCmdData.go index 2250159..d91e2f2 100644 --- a/pkg/fbs/script/manager/fbtypes/Misc_ActCmdData.go +++ b/pkg/fbs/script/manager/fbtypes/Misc_ActCmdData.go @@ -7,15 +7,21 @@ import ( ) type Misc_ActCmdDataT struct { - SrcName string - SrcType string - SrcLine uint64 + SrcName string `json:"srcName"` + SrcType string `json:"srcType"` + SrcLine uint64 `json:"srcLine"` } func (t *Misc_ActCmdDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - srcNameOffset := builder.CreateString(t.SrcName) - srcTypeOffset := builder.CreateString(t.SrcType) + srcNameOffset := flatbuffers.UOffsetT(0) + if t.SrcName != "" { + srcNameOffset = builder.CreateString(t.SrcName) + } + srcTypeOffset := flatbuffers.UOffsetT(0) + if t.SrcType != "" { + srcTypeOffset = builder.CreateString(t.SrcType) + } Misc_ActCmdDataStart(builder) Misc_ActCmdDataAddSrcName(builder, srcNameOffset) Misc_ActCmdDataAddSrcType(builder, srcTypeOffset) diff --git a/pkg/fbs/script/manager/fbtypes/Misc_CmdOptionInfoReq.go b/pkg/fbs/script/manager/fbtypes/Misc_CmdOptionInfoReq.go index d001fa1..44d5ac4 100644 --- a/pkg/fbs/script/manager/fbtypes/Misc_CmdOptionInfoReq.go +++ b/pkg/fbs/script/manager/fbtypes/Misc_CmdOptionInfoReq.go @@ -7,14 +7,17 @@ import ( ) type Misc_CmdOptionInfoReqT struct { - CmdName string - ObjType ObjectTypeCmdOptionInfoReq - CmdType CmdTypeCmdOptionInfoReq + CmdName string `json:"cmdName"` + ObjType ObjectType_CmdOptionInfoReq `json:"objType"` + CmdType CmdType_CmdOptionInfoReq `json:"cmdType"` } func (t *Misc_CmdOptionInfoReqT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - cmdNameOffset := builder.CreateString(t.CmdName) + cmdNameOffset := flatbuffers.UOffsetT(0) + if t.CmdName != "" { + cmdNameOffset = builder.CreateString(t.CmdName) + } Misc_CmdOptionInfoReqStart(builder) Misc_CmdOptionInfoReqAddCmdName(builder, cmdNameOffset) Misc_CmdOptionInfoReqAddObjType(builder, t.ObjType) @@ -70,27 +73,27 @@ func (rcv *Misc_CmdOptionInfoReq) CmdName() []byte { return nil } -func (rcv *Misc_CmdOptionInfoReq) ObjType() ObjectTypeCmdOptionInfoReq { +func (rcv *Misc_CmdOptionInfoReq) ObjType() ObjectType_CmdOptionInfoReq { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { - return ObjectTypeCmdOptionInfoReq(rcv._tab.GetInt8(o + rcv._tab.Pos)) + return ObjectType_CmdOptionInfoReq(rcv._tab.GetInt8(o + rcv._tab.Pos)) } return 0 } -func (rcv *Misc_CmdOptionInfoReq) MutateObjType(n ObjectTypeCmdOptionInfoReq) bool { +func (rcv *Misc_CmdOptionInfoReq) MutateObjType(n ObjectType_CmdOptionInfoReq) bool { return rcv._tab.MutateInt8Slot(6, int8(n)) } -func (rcv *Misc_CmdOptionInfoReq) CmdType() CmdTypeCmdOptionInfoReq { +func (rcv *Misc_CmdOptionInfoReq) CmdType() CmdType_CmdOptionInfoReq { o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) if o != 0 { - return CmdTypeCmdOptionInfoReq(rcv._tab.GetInt8(o + rcv._tab.Pos)) + return CmdType_CmdOptionInfoReq(rcv._tab.GetInt8(o + rcv._tab.Pos)) } return 0 } -func (rcv *Misc_CmdOptionInfoReq) MutateCmdType(n CmdTypeCmdOptionInfoReq) bool { +func (rcv *Misc_CmdOptionInfoReq) MutateCmdType(n CmdType_CmdOptionInfoReq) bool { return rcv._tab.MutateInt8Slot(8, int8(n)) } @@ -100,10 +103,10 @@ func Misc_CmdOptionInfoReqStart(builder *flatbuffers.Builder) { func Misc_CmdOptionInfoReqAddCmdName(builder *flatbuffers.Builder, cmdName flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(cmdName), 0) } -func Misc_CmdOptionInfoReqAddObjType(builder *flatbuffers.Builder, objType ObjectTypeCmdOptionInfoReq) { +func Misc_CmdOptionInfoReqAddObjType(builder *flatbuffers.Builder, objType ObjectType_CmdOptionInfoReq) { builder.PrependInt8Slot(1, int8(objType), 0) } -func Misc_CmdOptionInfoReqAddCmdType(builder *flatbuffers.Builder, cmdType CmdTypeCmdOptionInfoReq) { +func Misc_CmdOptionInfoReqAddCmdType(builder *flatbuffers.Builder, cmdType CmdType_CmdOptionInfoReq) { builder.PrependInt8Slot(2, int8(cmdType), 0) } func Misc_CmdOptionInfoReqEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/script/manager/fbtypes/Misc_CmdOptionInfoResp.go b/pkg/fbs/script/manager/fbtypes/Misc_CmdOptionInfoResp.go index d3146fe..921bcbe 100644 --- a/pkg/fbs/script/manager/fbtypes/Misc_CmdOptionInfoResp.go +++ b/pkg/fbs/script/manager/fbtypes/Misc_CmdOptionInfoResp.go @@ -7,14 +7,20 @@ import ( ) type Misc_CmdOptionInfoRespT struct { - Bfbs string - Description string + Bfbs string `json:"bfbs"` + Description string `json:"description"` } func (t *Misc_CmdOptionInfoRespT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - bfbsOffset := builder.CreateString(t.Bfbs) - descriptionOffset := builder.CreateString(t.Description) + bfbsOffset := flatbuffers.UOffsetT(0) + if t.Bfbs != "" { + bfbsOffset = builder.CreateString(t.Bfbs) + } + descriptionOffset := flatbuffers.UOffsetT(0) + if t.Description != "" { + descriptionOffset = builder.CreateString(t.Description) + } Misc_CmdOptionInfoRespStart(builder) Misc_CmdOptionInfoRespAddBfbs(builder, bfbsOffset) Misc_CmdOptionInfoRespAddDescription(builder, descriptionOffset) diff --git a/pkg/fbs/script/manager/fbtypes/Misc_ListRegisteredCmdsOptions.go b/pkg/fbs/script/manager/fbtypes/Misc_ListRegisteredCmdsOptions.go index c928956..9bbca59 100644 --- a/pkg/fbs/script/manager/fbtypes/Misc_ListRegisteredCmdsOptions.go +++ b/pkg/fbs/script/manager/fbtypes/Misc_ListRegisteredCmdsOptions.go @@ -7,8 +7,8 @@ import ( ) type Misc_ListRegisteredCmdsOptionsT struct { - ObjType ObjectTypeListRegisteredCmdsOptions - CmdType CmdTypeListRegisteredCmdsOptions + ObjType ObjectType_ListRegisteredCmdsOptions `json:"objType"` + CmdType CmdType_ListRegisteredCmdsOptions `json:"cmdType"` } func (t *Misc_ListRegisteredCmdsOptionsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { @@ -58,37 +58,37 @@ func (rcv *Misc_ListRegisteredCmdsOptions) Table() flatbuffers.Table { return rcv._tab } -func (rcv *Misc_ListRegisteredCmdsOptions) ObjType() ObjectTypeListRegisteredCmdsOptions { +func (rcv *Misc_ListRegisteredCmdsOptions) ObjType() ObjectType_ListRegisteredCmdsOptions { o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) if o != 0 { - return ObjectTypeListRegisteredCmdsOptions(rcv._tab.GetInt8(o + rcv._tab.Pos)) + return ObjectType_ListRegisteredCmdsOptions(rcv._tab.GetInt8(o + rcv._tab.Pos)) } return 0 } -func (rcv *Misc_ListRegisteredCmdsOptions) MutateObjType(n ObjectTypeListRegisteredCmdsOptions) bool { +func (rcv *Misc_ListRegisteredCmdsOptions) MutateObjType(n ObjectType_ListRegisteredCmdsOptions) bool { return rcv._tab.MutateInt8Slot(4, int8(n)) } -func (rcv *Misc_ListRegisteredCmdsOptions) CmdType() CmdTypeListRegisteredCmdsOptions { +func (rcv *Misc_ListRegisteredCmdsOptions) CmdType() CmdType_ListRegisteredCmdsOptions { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { - return CmdTypeListRegisteredCmdsOptions(rcv._tab.GetInt8(o + rcv._tab.Pos)) + return CmdType_ListRegisteredCmdsOptions(rcv._tab.GetInt8(o + rcv._tab.Pos)) } return 0 } -func (rcv *Misc_ListRegisteredCmdsOptions) MutateCmdType(n CmdTypeListRegisteredCmdsOptions) bool { +func (rcv *Misc_ListRegisteredCmdsOptions) MutateCmdType(n CmdType_ListRegisteredCmdsOptions) bool { return rcv._tab.MutateInt8Slot(6, int8(n)) } func Misc_ListRegisteredCmdsOptionsStart(builder *flatbuffers.Builder) { builder.StartObject(2) } -func Misc_ListRegisteredCmdsOptionsAddObjType(builder *flatbuffers.Builder, objType ObjectTypeListRegisteredCmdsOptions) { +func Misc_ListRegisteredCmdsOptionsAddObjType(builder *flatbuffers.Builder, objType ObjectType_ListRegisteredCmdsOptions) { builder.PrependInt8Slot(0, int8(objType), 0) } -func Misc_ListRegisteredCmdsOptionsAddCmdType(builder *flatbuffers.Builder, cmdType CmdTypeListRegisteredCmdsOptions) { +func Misc_ListRegisteredCmdsOptionsAddCmdType(builder *flatbuffers.Builder, cmdType CmdType_ListRegisteredCmdsOptions) { builder.PrependInt8Slot(1, int8(cmdType), 0) } func Misc_ListRegisteredCmdsOptionsEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/script/manager/fbtypes/Misc_SetErrLevel.go b/pkg/fbs/script/manager/fbtypes/Misc_SetErrLevel.go index 9b27cf2..22d4407 100644 --- a/pkg/fbs/script/manager/fbtypes/Misc_SetErrLevel.go +++ b/pkg/fbs/script/manager/fbtypes/Misc_SetErrLevel.go @@ -7,14 +7,17 @@ import ( ) type Misc_SetErrLevelT struct { - Base *Cmd_BaseT - ErrLvl string + Base *Cmd_BaseT `json:"base"` + ErrLvl string `json:"errLvl"` } func (t *Misc_SetErrLevelT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } baseOffset := t.Base.Pack(builder) - errLvlOffset := builder.CreateString(t.ErrLvl) + errLvlOffset := flatbuffers.UOffsetT(0) + if t.ErrLvl != "" { + errLvlOffset = builder.CreateString(t.ErrLvl) + } Misc_SetErrLevelStart(builder) Misc_SetErrLevelAddBase(builder, baseOffset) Misc_SetErrLevelAddErrLvl(builder, errLvlOffset) diff --git a/pkg/fbs/script/manager/fbtypes/Misc_SetOverride.go b/pkg/fbs/script/manager/fbtypes/Misc_SetOverride.go index 92b745e..50490a2 100644 --- a/pkg/fbs/script/manager/fbtypes/Misc_SetOverride.go +++ b/pkg/fbs/script/manager/fbtypes/Misc_SetOverride.go @@ -7,8 +7,8 @@ import ( ) type Misc_SetOverrideT struct { - Base *Cmd_BaseT - Value float64 + Base *Cmd_BaseT `json:"base"` + Value float64 `json:"value"` } func (t *Misc_SetOverrideT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/script/manager/fbtypes/ObjectType_CmdOptionInfoReq.go b/pkg/fbs/script/manager/fbtypes/ObjectType_CmdOptionInfoReq.go index 808f9e5..0b42cc2 100644 --- a/pkg/fbs/script/manager/fbtypes/ObjectType_CmdOptionInfoReq.go +++ b/pkg/fbs/script/manager/fbtypes/ObjectType_CmdOptionInfoReq.go @@ -4,27 +4,27 @@ package fbtypes import "strconv" -type ObjectTypeCmdOptionInfoReq int8 +type ObjectType_CmdOptionInfoReq int8 const ( - ObjectType_CmdOptionInfoReqUNKNOWN ObjectTypeCmdOptionInfoReq = 0 - ObjectType_CmdOptionInfoReqAXS ObjectTypeCmdOptionInfoReq = 1 - ObjectType_CmdOptionInfoReqKIN ObjectTypeCmdOptionInfoReq = 2 + ObjectType_CmdOptionInfoReqUNKNOWN ObjectType_CmdOptionInfoReq = 0 + ObjectType_CmdOptionInfoReqAXS ObjectType_CmdOptionInfoReq = 1 + ObjectType_CmdOptionInfoReqKIN ObjectType_CmdOptionInfoReq = 2 ) -var EnumNamesObjectType_CmdOptionInfoReq = map[ObjectTypeCmdOptionInfoReq]string{ +var EnumNamesObjectType_CmdOptionInfoReq = map[ObjectType_CmdOptionInfoReq]string{ ObjectType_CmdOptionInfoReqUNKNOWN: "UNKNOWN", ObjectType_CmdOptionInfoReqAXS: "AXS", ObjectType_CmdOptionInfoReqKIN: "KIN", } -var EnumValuesObjectType_CmdOptionInfoReq = map[string]ObjectTypeCmdOptionInfoReq{ +var EnumValuesObjectType_CmdOptionInfoReq = map[string]ObjectType_CmdOptionInfoReq{ "UNKNOWN": ObjectType_CmdOptionInfoReqUNKNOWN, "AXS": ObjectType_CmdOptionInfoReqAXS, "KIN": ObjectType_CmdOptionInfoReqKIN, } -func (v ObjectTypeCmdOptionInfoReq) String() string { +func (v ObjectType_CmdOptionInfoReq) String() string { if s, ok := EnumNamesObjectType_CmdOptionInfoReq[v]; ok { return s } diff --git a/pkg/fbs/script/manager/fbtypes/ObjectType_GenCmdOption.go b/pkg/fbs/script/manager/fbtypes/ObjectType_GenCmdOption.go index d3c16ef..89b3cd1 100644 --- a/pkg/fbs/script/manager/fbtypes/ObjectType_GenCmdOption.go +++ b/pkg/fbs/script/manager/fbtypes/ObjectType_GenCmdOption.go @@ -4,27 +4,27 @@ package fbtypes import "strconv" -type ObjectTypeGenCmdOption int8 +type ObjectType_GenCmdOption int8 const ( - ObjectType_GenCmdOptionUNKNOWN ObjectTypeGenCmdOption = 0 - ObjectType_GenCmdOptionAXS ObjectTypeGenCmdOption = 1 - ObjectType_GenCmdOptionKIN ObjectTypeGenCmdOption = 2 + ObjectType_GenCmdOptionUNKNOWN ObjectType_GenCmdOption = 0 + ObjectType_GenCmdOptionAXS ObjectType_GenCmdOption = 1 + ObjectType_GenCmdOptionKIN ObjectType_GenCmdOption = 2 ) -var EnumNamesObjectType_GenCmdOption = map[ObjectTypeGenCmdOption]string{ +var EnumNamesObjectType_GenCmdOption = map[ObjectType_GenCmdOption]string{ ObjectType_GenCmdOptionUNKNOWN: "UNKNOWN", ObjectType_GenCmdOptionAXS: "AXS", ObjectType_GenCmdOptionKIN: "KIN", } -var EnumValuesObjectType_GenCmdOption = map[string]ObjectTypeGenCmdOption{ +var EnumValuesObjectType_GenCmdOption = map[string]ObjectType_GenCmdOption{ "UNKNOWN": ObjectType_GenCmdOptionUNKNOWN, "AXS": ObjectType_GenCmdOptionAXS, "KIN": ObjectType_GenCmdOptionKIN, } -func (v ObjectTypeGenCmdOption) String() string { +func (v ObjectType_GenCmdOption) String() string { if s, ok := EnumNamesObjectType_GenCmdOption[v]; ok { return s } diff --git a/pkg/fbs/script/manager/fbtypes/ObjectType_ListRegisteredCmdsOptions.go b/pkg/fbs/script/manager/fbtypes/ObjectType_ListRegisteredCmdsOptions.go index b1c6354..a08f625 100644 --- a/pkg/fbs/script/manager/fbtypes/ObjectType_ListRegisteredCmdsOptions.go +++ b/pkg/fbs/script/manager/fbtypes/ObjectType_ListRegisteredCmdsOptions.go @@ -4,27 +4,27 @@ package fbtypes import "strconv" -type ObjectTypeListRegisteredCmdsOptions int8 +type ObjectType_ListRegisteredCmdsOptions int8 const ( - ObjectType_ListRegisteredCmdsOptionsUNKNOWN ObjectTypeListRegisteredCmdsOptions = 0 - ObjectType_ListRegisteredCmdsOptionsAXS ObjectTypeListRegisteredCmdsOptions = 1 - ObjectType_ListRegisteredCmdsOptionsKIN ObjectTypeListRegisteredCmdsOptions = 2 + ObjectType_ListRegisteredCmdsOptionsUNKNOWN ObjectType_ListRegisteredCmdsOptions = 0 + ObjectType_ListRegisteredCmdsOptionsAXS ObjectType_ListRegisteredCmdsOptions = 1 + ObjectType_ListRegisteredCmdsOptionsKIN ObjectType_ListRegisteredCmdsOptions = 2 ) -var EnumNamesObjectType_ListRegisteredCmdsOptions = map[ObjectTypeListRegisteredCmdsOptions]string{ +var EnumNamesObjectType_ListRegisteredCmdsOptions = map[ObjectType_ListRegisteredCmdsOptions]string{ ObjectType_ListRegisteredCmdsOptionsUNKNOWN: "UNKNOWN", ObjectType_ListRegisteredCmdsOptionsAXS: "AXS", ObjectType_ListRegisteredCmdsOptionsKIN: "KIN", } -var EnumValuesObjectType_ListRegisteredCmdsOptions = map[string]ObjectTypeListRegisteredCmdsOptions{ +var EnumValuesObjectType_ListRegisteredCmdsOptions = map[string]ObjectType_ListRegisteredCmdsOptions{ "UNKNOWN": ObjectType_ListRegisteredCmdsOptionsUNKNOWN, "AXS": ObjectType_ListRegisteredCmdsOptionsAXS, "KIN": ObjectType_ListRegisteredCmdsOptionsKIN, } -func (v ObjectTypeListRegisteredCmdsOptions) String() string { +func (v ObjectType_ListRegisteredCmdsOptions) String() string { if s, ok := EnumNamesObjectType_ListRegisteredCmdsOptions[v]; ok { return s } diff --git a/pkg/fbs/script/manager/fbtypes/Resp_Error.go b/pkg/fbs/script/manager/fbtypes/Resp_Error.go index 0bbe59d..d0debdb 100644 --- a/pkg/fbs/script/manager/fbtypes/Resp_Error.go +++ b/pkg/fbs/script/manager/fbtypes/Resp_Error.go @@ -7,15 +7,18 @@ import ( ) type Resp_ErrorT struct { - MainCode uint32 - DetailCode uint32 - Text string - Trace []string + MainCode uint32 `json:"mainCode"` + DetailCode uint32 `json:"detailCode"` + Text string `json:"text"` + Trace []string `json:"trace"` } func (t *Resp_ErrorT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - textOffset := builder.CreateString(t.Text) + textOffset := flatbuffers.UOffsetT(0) + if t.Text != "" { + textOffset = builder.CreateString(t.Text) + } traceOffset := flatbuffers.UOffsetT(0) if t.Trace != nil { traceLength := len(t.Trace) diff --git a/pkg/fbs/script/manager/fbtypes/ScriptDescription.go b/pkg/fbs/script/manager/fbtypes/ScriptDescription.go index e81c463..b2554a2 100644 --- a/pkg/fbs/script/manager/fbtypes/ScriptDescription.go +++ b/pkg/fbs/script/manager/fbtypes/ScriptDescription.go @@ -7,19 +7,28 @@ import ( ) type ScriptDescriptionT struct { - Language string - Version string - Executable string - FileEnding []string - License string - LicenseVersion string + Language string `json:"language"` + Version string `json:"version"` + Executable string `json:"executable"` + FileEnding []string `json:"fileEnding"` + License string `json:"license"` + LicenseVersion string `json:"licenseVersion"` } func (t *ScriptDescriptionT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - languageOffset := builder.CreateString(t.Language) - versionOffset := builder.CreateString(t.Version) - executableOffset := builder.CreateString(t.Executable) + languageOffset := flatbuffers.UOffsetT(0) + if t.Language != "" { + languageOffset = builder.CreateString(t.Language) + } + versionOffset := flatbuffers.UOffsetT(0) + if t.Version != "" { + versionOffset = builder.CreateString(t.Version) + } + executableOffset := flatbuffers.UOffsetT(0) + if t.Executable != "" { + executableOffset = builder.CreateString(t.Executable) + } fileEndingOffset := flatbuffers.UOffsetT(0) if t.FileEnding != nil { fileEndingLength := len(t.FileEnding) @@ -33,8 +42,14 @@ func (t *ScriptDescriptionT) Pack(builder *flatbuffers.Builder) flatbuffers.UOff } fileEndingOffset = builder.EndVector(fileEndingLength) } - licenseOffset := builder.CreateString(t.License) - licenseVersionOffset := builder.CreateString(t.LicenseVersion) + licenseOffset := flatbuffers.UOffsetT(0) + if t.License != "" { + licenseOffset = builder.CreateString(t.License) + } + licenseVersionOffset := flatbuffers.UOffsetT(0) + if t.LicenseVersion != "" { + licenseVersionOffset = builder.CreateString(t.LicenseVersion) + } ScriptDescriptionStart(builder) ScriptDescriptionAddLanguage(builder, languageOffset) ScriptDescriptionAddVersion(builder, versionOffset) diff --git a/pkg/fbs/script/manager/fbtypes/State_AxsActValues.go b/pkg/fbs/script/manager/fbtypes/State_AxsActValues.go index a37905e..4b5e772 100644 --- a/pkg/fbs/script/manager/fbtypes/State_AxsActValues.go +++ b/pkg/fbs/script/manager/fbtypes/State_AxsActValues.go @@ -7,11 +7,11 @@ import ( ) type State_AxsActValuesT struct { - Pos float64 - DistLeft float64 - Vel float64 - Acc float64 - Torque float64 + Pos float64 `json:"pos"` + DistLeft float64 `json:"distLeft"` + Vel float64 `json:"vel"` + Acc float64 `json:"acc"` + Torque float64 `json:"torque"` } func (t *State_AxsActValuesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/script/manager/fbtypes/State_AxsBrakingDistanceExReq.go b/pkg/fbs/script/manager/fbtypes/State_AxsBrakingDistanceExReq.go index 3996921..18977b4 100644 --- a/pkg/fbs/script/manager/fbtypes/State_AxsBrakingDistanceExReq.go +++ b/pkg/fbs/script/manager/fbtypes/State_AxsBrakingDistanceExReq.go @@ -7,13 +7,16 @@ import ( ) type State_AxsBrakingDistanceExReqT struct { - AxsName string - SelectedTypes []BrakingDistanceTypeReq + AxsName string `json:"axsName"` + SelectedTypes []BrakingDistanceTypeReq `json:"selectedTypes"` } func (t *State_AxsBrakingDistanceExReqT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - axsNameOffset := builder.CreateString(t.AxsName) + axsNameOffset := flatbuffers.UOffsetT(0) + if t.AxsName != "" { + axsNameOffset = builder.CreateString(t.AxsName) + } selectedTypesOffset := flatbuffers.UOffsetT(0) if t.SelectedTypes != nil { selectedTypesLength := len(t.SelectedTypes) diff --git a/pkg/fbs/script/manager/fbtypes/State_AxsBrakingDistanceExResp.go b/pkg/fbs/script/manager/fbtypes/State_AxsBrakingDistanceExResp.go index abcd1a4..7ffe244 100644 --- a/pkg/fbs/script/manager/fbtypes/State_AxsBrakingDistanceExResp.go +++ b/pkg/fbs/script/manager/fbtypes/State_AxsBrakingDistanceExResp.go @@ -7,8 +7,8 @@ import ( ) type State_AxsBrakingDistanceExRespT struct { - BrakingDistance float64 - DistanceType BrakingDistanceTypeResp + BrakingDistance float64 `json:"brakingDistance"` + DistanceType BrakingDistanceTypeResp `json:"distanceType"` } func (t *State_AxsBrakingDistanceExRespT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/script/manager/fbtypes/State_AxsIpoValues.go b/pkg/fbs/script/manager/fbtypes/State_AxsIpoValues.go index f801272..23fb153 100644 --- a/pkg/fbs/script/manager/fbtypes/State_AxsIpoValues.go +++ b/pkg/fbs/script/manager/fbtypes/State_AxsIpoValues.go @@ -7,10 +7,10 @@ import ( ) type State_AxsIpoValuesT struct { - Pos float64 - Vel float64 - Acc float64 - Jrk float64 + Pos float64 `json:"pos"` + Vel float64 `json:"vel"` + Acc float64 `json:"acc"` + Jrk float64 `json:"jrk"` } func (t *State_AxsIpoValuesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/script/manager/fbtypes/State_AxsRunCalculationPipelineData.go b/pkg/fbs/script/manager/fbtypes/State_AxsRunCalculationPipelineData.go index 51b4faf..6edd8ac 100644 --- a/pkg/fbs/script/manager/fbtypes/State_AxsRunCalculationPipelineData.go +++ b/pkg/fbs/script/manager/fbtypes/State_AxsRunCalculationPipelineData.go @@ -8,18 +8,27 @@ import ( /// Parameters of the runCalculationPipeline function type State_AxsRunCalculationPipelineDataT struct { - AxsName string - PipelineName string - SyncMode SyncMode - MasterName string - Inputs []float64 + AxsName string `json:"axsName"` + PipelineName string `json:"pipelineName"` + SyncMode SyncMode `json:"syncMode"` + MasterName string `json:"masterName"` + Inputs []float64 `json:"inputs"` } func (t *State_AxsRunCalculationPipelineDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - axsNameOffset := builder.CreateString(t.AxsName) - pipelineNameOffset := builder.CreateString(t.PipelineName) - masterNameOffset := builder.CreateString(t.MasterName) + axsNameOffset := flatbuffers.UOffsetT(0) + if t.AxsName != "" { + axsNameOffset = builder.CreateString(t.AxsName) + } + pipelineNameOffset := flatbuffers.UOffsetT(0) + if t.PipelineName != "" { + pipelineNameOffset = builder.CreateString(t.PipelineName) + } + masterNameOffset := flatbuffers.UOffsetT(0) + if t.MasterName != "" { + masterNameOffset = builder.CreateString(t.MasterName) + } inputsOffset := flatbuffers.UOffsetT(0) if t.Inputs != nil { inputsLength := len(t.Inputs) diff --git a/pkg/fbs/script/manager/fbtypes/State_CmdState.go b/pkg/fbs/script/manager/fbtypes/State_CmdState.go index cb64748..3255b4c 100644 --- a/pkg/fbs/script/manager/fbtypes/State_CmdState.go +++ b/pkg/fbs/script/manager/fbtypes/State_CmdState.go @@ -7,22 +7,25 @@ import ( ) type State_CmdStateT struct { - ObjName string - CmdID uint64 + ObjName string `json:"objName"` + CmdId uint64 `json:"cmdID"` } func (t *State_CmdStateT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - objNameOffset := builder.CreateString(t.ObjName) + objNameOffset := flatbuffers.UOffsetT(0) + if t.ObjName != "" { + objNameOffset = builder.CreateString(t.ObjName) + } State_CmdStateStart(builder) State_CmdStateAddObjName(builder, objNameOffset) - State_CmdStateAddCmdID(builder, t.CmdID) + State_CmdStateAddCmdId(builder, t.CmdId) return State_CmdStateEnd(builder) } func (rcv *State_CmdState) UnPackTo(t *State_CmdStateT) { t.ObjName = string(rcv.ObjName()) - t.CmdID = rcv.CmdID() + t.CmdId = rcv.CmdId() } func (rcv *State_CmdState) UnPack() *State_CmdStateT { @@ -67,7 +70,7 @@ func (rcv *State_CmdState) ObjName() []byte { return nil } -func (rcv *State_CmdState) CmdID() uint64 { +func (rcv *State_CmdState) CmdId() uint64 { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { return rcv._tab.GetUint64(o + rcv._tab.Pos) @@ -75,7 +78,7 @@ func (rcv *State_CmdState) CmdID() uint64 { return 0 } -func (rcv *State_CmdState) MutateCmdID(n uint64) bool { +func (rcv *State_CmdState) MutateCmdId(n uint64) bool { return rcv._tab.MutateUint64Slot(6, n) } @@ -85,8 +88,8 @@ func State_CmdStateStart(builder *flatbuffers.Builder) { func State_CmdStateAddObjName(builder *flatbuffers.Builder, objName flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(objName), 0) } -func State_CmdStateAddCmdID(builder *flatbuffers.Builder, cmdID uint64) { - builder.PrependUint64Slot(1, cmdID, 0) +func State_CmdStateAddCmdId(builder *flatbuffers.Builder, cmdId uint64) { + builder.PrependUint64Slot(1, cmdId, 0) } func State_CmdStateEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() diff --git a/pkg/fbs/script/manager/fbtypes/State_KinCoordTransform.go b/pkg/fbs/script/manager/fbtypes/State_KinCoordTransform.go index a2a86dd..2fee366 100644 --- a/pkg/fbs/script/manager/fbtypes/State_KinCoordTransform.go +++ b/pkg/fbs/script/manager/fbtypes/State_KinCoordTransform.go @@ -7,15 +7,18 @@ import ( ) type State_KinCoordTransformT struct { - ObjName string - PosIn []float64 - CoordSysIn string - CoordSysOut string + ObjName string `json:"objName"` + PosIn []float64 `json:"posIn"` + CoordSysIn string `json:"coordSysIn"` + CoordSysOut string `json:"coordSysOut"` } func (t *State_KinCoordTransformT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - objNameOffset := builder.CreateString(t.ObjName) + objNameOffset := flatbuffers.UOffsetT(0) + if t.ObjName != "" { + objNameOffset = builder.CreateString(t.ObjName) + } posInOffset := flatbuffers.UOffsetT(0) if t.PosIn != nil { posInLength := len(t.PosIn) @@ -25,8 +28,14 @@ func (t *State_KinCoordTransformT) Pack(builder *flatbuffers.Builder) flatbuffer } posInOffset = builder.EndVector(posInLength) } - coordSysInOffset := builder.CreateString(t.CoordSysIn) - coordSysOutOffset := builder.CreateString(t.CoordSysOut) + coordSysInOffset := flatbuffers.UOffsetT(0) + if t.CoordSysIn != "" { + coordSysInOffset = builder.CreateString(t.CoordSysIn) + } + coordSysOutOffset := flatbuffers.UOffsetT(0) + if t.CoordSysOut != "" { + coordSysOutOffset = builder.CreateString(t.CoordSysOut) + } State_KinCoordTransformStart(builder) State_KinCoordTransformAddObjName(builder, objNameOffset) State_KinCoordTransformAddPosIn(builder, posInOffset) diff --git a/pkg/fbs/script/manager/fbtypes/State_KinGetPos.go b/pkg/fbs/script/manager/fbtypes/State_KinGetPos.go index 75ca4aa..30206d4 100644 --- a/pkg/fbs/script/manager/fbtypes/State_KinGetPos.go +++ b/pkg/fbs/script/manager/fbtypes/State_KinGetPos.go @@ -7,14 +7,20 @@ import ( ) type State_KinGetPosT struct { - ObjName string - CoordSysOut string + ObjName string `json:"objName"` + CoordSysOut string `json:"coordSysOut"` } func (t *State_KinGetPosT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - objNameOffset := builder.CreateString(t.ObjName) - coordSysOutOffset := builder.CreateString(t.CoordSysOut) + objNameOffset := flatbuffers.UOffsetT(0) + if t.ObjName != "" { + objNameOffset = builder.CreateString(t.ObjName) + } + coordSysOutOffset := flatbuffers.UOffsetT(0) + if t.CoordSysOut != "" { + coordSysOutOffset = builder.CreateString(t.CoordSysOut) + } State_KinGetPosStart(builder) State_KinGetPosAddObjName(builder, objNameOffset) State_KinGetPosAddCoordSysOut(builder, coordSysOutOffset) diff --git a/pkg/fbs/script/manager/fbtypes/State_KinIpoValues.go b/pkg/fbs/script/manager/fbtypes/State_KinIpoValues.go index 3707695..28016d3 100644 --- a/pkg/fbs/script/manager/fbtypes/State_KinIpoValues.go +++ b/pkg/fbs/script/manager/fbtypes/State_KinIpoValues.go @@ -7,10 +7,10 @@ import ( ) type State_KinIpoValuesT struct { - Pos []float64 - Vel float64 - Acc float64 - Jrk float64 + Pos []float64 `json:"pos"` + Vel float64 `json:"vel"` + Acc float64 `json:"acc"` + Jrk float64 `json:"jrk"` } func (t *State_KinIpoValuesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/script/manager/fbtypes/Task_RunScript.go b/pkg/fbs/script/manager/fbtypes/Task_RunScript.go index fa98155..43c82a2 100644 --- a/pkg/fbs/script/manager/fbtypes/Task_RunScript.go +++ b/pkg/fbs/script/manager/fbtypes/Task_RunScript.go @@ -7,13 +7,16 @@ import ( ) type Task_RunScriptT struct { - Name string - Param []string + Name string `json:"name"` + Param []string `json:"param"` } func (t *Task_RunScriptT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } paramOffset := flatbuffers.UOffsetT(0) if t.Param != nil { paramLength := len(t.Param) diff --git a/pkg/fbs/script/manager/fbtypes/cmd_AxsProbe.go b/pkg/fbs/script/manager/fbtypes/cmd_AxsProbe.go index 0292f0b..739318b 100644 --- a/pkg/fbs/script/manager/fbtypes/cmd_AxsProbe.go +++ b/pkg/fbs/script/manager/fbtypes/cmd_AxsProbe.go @@ -8,9 +8,9 @@ import ( /// parameters of the axis probe command type cmd_AxsProbeT struct { - Base *Cmd_BaseT - BaseData *cmd_AxsProbeBaseT - CfgData *CfgProbeDataT + Base *Cmd_BaseT `json:"base"` + BaseData *cmd_AxsProbeBaseT `json:"baseData"` + CfgData *CfgProbeDataT `json:"cfgData"` } func (t *cmd_AxsProbeT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/script/manager/fbtypes/cmd_AxsProbeBase.go b/pkg/fbs/script/manager/fbtypes/cmd_AxsProbeBase.go index 94f8dc1..16bf5e2 100644 --- a/pkg/fbs/script/manager/fbtypes/cmd_AxsProbeBase.go +++ b/pkg/fbs/script/manager/fbtypes/cmd_AxsProbeBase.go @@ -8,16 +8,22 @@ import ( /// base parameters of the axis probe and axis probe abort command type cmd_AxsProbeBaseT struct { - Base *Cmd_BaseT - TriggerSrc string - ProbeIndex string + Base *Cmd_BaseT `json:"base"` + TriggerSrc string `json:"triggerSrc"` + ProbeIndex string `json:"probeIndex"` } func (t *cmd_AxsProbeBaseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } baseOffset := t.Base.Pack(builder) - triggerSrcOffset := builder.CreateString(t.TriggerSrc) - probeIndexOffset := builder.CreateString(t.ProbeIndex) + triggerSrcOffset := flatbuffers.UOffsetT(0) + if t.TriggerSrc != "" { + triggerSrcOffset = builder.CreateString(t.TriggerSrc) + } + probeIndexOffset := flatbuffers.UOffsetT(0) + if t.ProbeIndex != "" { + probeIndexOffset = builder.CreateString(t.ProbeIndex) + } cmd_AxsProbeBaseStart(builder) cmd_AxsProbeBaseAddBase(builder, baseOffset) cmd_AxsProbeBaseAddTriggerSrc(builder, triggerSrcOffset) diff --git a/pkg/fbs/script/manager/fbtypes/script_Instance.go b/pkg/fbs/script/manager/fbtypes/script_Instance.go index 7bf48ec..6283e82 100644 --- a/pkg/fbs/script/manager/fbtypes/script_Instance.go +++ b/pkg/fbs/script/manager/fbtypes/script_Instance.go @@ -7,14 +7,20 @@ import ( ) type script_InstanceT struct { - Name string - Language string + Name string `json:"name"` + Language string `json:"language"` } func (t *script_InstanceT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - nameOffset := builder.CreateString(t.Name) - languageOffset := builder.CreateString(t.Language) + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + languageOffset := flatbuffers.UOffsetT(0) + if t.Language != "" { + languageOffset = builder.CreateString(t.Language) + } script_InstanceStart(builder) script_InstanceAddName(builder, nameOffset) script_InstanceAddLanguage(builder, languageOffset) diff --git a/pkg/fbs/script/manager/fbtypes/state_AxsProbeActualValuesReq.go b/pkg/fbs/script/manager/fbtypes/state_AxsProbeActualValuesReq.go index 7926083..107094e 100644 --- a/pkg/fbs/script/manager/fbtypes/state_AxsProbeActualValuesReq.go +++ b/pkg/fbs/script/manager/fbtypes/state_AxsProbeActualValuesReq.go @@ -8,14 +8,20 @@ import ( /// currently the actual values of the probe type state_AxsProbeActualValuesReqT struct { - ObjName string - ProbeIndex string + ObjName string `json:"objName"` + ProbeIndex string `json:"probeIndex"` } func (t *state_AxsProbeActualValuesReqT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - objNameOffset := builder.CreateString(t.ObjName) - probeIndexOffset := builder.CreateString(t.ProbeIndex) + objNameOffset := flatbuffers.UOffsetT(0) + if t.ObjName != "" { + objNameOffset = builder.CreateString(t.ObjName) + } + probeIndexOffset := flatbuffers.UOffsetT(0) + if t.ProbeIndex != "" { + probeIndexOffset = builder.CreateString(t.ProbeIndex) + } state_AxsProbeActualValuesReqStart(builder) state_AxsProbeActualValuesReqAddObjName(builder, objNameOffset) state_AxsProbeActualValuesReqAddProbeIndex(builder, probeIndexOffset) diff --git a/pkg/fbs/script/manager/fbtypes/state_AxsProbeActualValuesResp.go b/pkg/fbs/script/manager/fbtypes/state_AxsProbeActualValuesResp.go index 3f2eef1..608cfe4 100644 --- a/pkg/fbs/script/manager/fbtypes/state_AxsProbeActualValuesResp.go +++ b/pkg/fbs/script/manager/fbtypes/state_AxsProbeActualValuesResp.go @@ -8,20 +8,23 @@ import ( /// currently the actual values of the probe type state_AxsProbeActualValuesRespT struct { - Valid bool - PosEdgeValue float64 - NegEdgeValue float64 - DifferValue float64 - DiffCount uint32 - PosEdgeCount uint32 - NegEdgeCount uint32 - MarksEdgeCount uint32 - Status string + Valid bool `json:"valid"` + PosEdgeValue float64 `json:"posEdgeValue"` + NegEdgeValue float64 `json:"negEdgeValue"` + DifferValue float64 `json:"differValue"` + DiffCount uint32 `json:"diffCount"` + PosEdgeCount uint32 `json:"posEdgeCount"` + NegEdgeCount uint32 `json:"negEdgeCount"` + MarksEdgeCount uint32 `json:"marksEdgeCount"` + Status string `json:"status"` } func (t *state_AxsProbeActualValuesRespT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } - statusOffset := builder.CreateString(t.Status) + statusOffset := flatbuffers.UOffsetT(0) + if t.Status != "" { + statusOffset = builder.CreateString(t.Status) + } state_AxsProbeActualValuesRespStart(builder) state_AxsProbeActualValuesRespAddValid(builder, t.Valid) state_AxsProbeActualValuesRespAddPosEdgeValue(builder, t.PosEdgeValue) diff --git a/pkg/fbs/web/automation/Settings.go b/pkg/fbs/web/automation/Settings.go index fa5d6d8..679e078 100644 --- a/pkg/fbs/web/automation/Settings.go +++ b/pkg/fbs/web/automation/Settings.go @@ -7,18 +7,21 @@ import ( ) type SettingsT struct { - Timeout uint32 + Timeout uint32 `json:"timeout"` + MaxJsonInput uint32 `json:"maxJsonInput"` } func (t *SettingsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } SettingsStart(builder) SettingsAddTimeout(builder, t.Timeout) + SettingsAddMaxJsonInput(builder, t.MaxJsonInput) return SettingsEnd(builder) } func (rcv *Settings) UnPackTo(t *SettingsT) { t.Timeout = rcv.Timeout() + t.MaxJsonInput = rcv.MaxJsonInput() } func (rcv *Settings) UnPack() *SettingsT { @@ -69,12 +72,29 @@ func (rcv *Settings) MutateTimeout(n uint32) bool { return rcv._tab.MutateUint32Slot(4, n) } +/// Maximum allowed size of JSON object for input data +func (rcv *Settings) MaxJsonInput() uint32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.GetUint32(o + rcv._tab.Pos) + } + return 1048576 +} + +/// Maximum allowed size of JSON object for input data +func (rcv *Settings) MutateMaxJsonInput(n uint32) bool { + return rcv._tab.MutateUint32Slot(6, n) +} + func SettingsStart(builder *flatbuffers.Builder) { - builder.StartObject(1) + builder.StartObject(2) } func SettingsAddTimeout(builder *flatbuffers.Builder, timeout uint32) { builder.PrependUint32Slot(0, timeout, 3000) } +func SettingsAddMaxJsonInput(builder *flatbuffers.Builder, maxJsonInput uint32) { + builder.PrependUint32Slot(1, maxJsonInput, 1048576) +} func SettingsEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() } diff --git a/pkg/fbs/web/automation/Stats.go b/pkg/fbs/web/automation/Stats.go index afea304..6f94758 100644 --- a/pkg/fbs/web/automation/Stats.go +++ b/pkg/fbs/web/automation/Stats.go @@ -7,11 +7,11 @@ import ( ) type StatsT struct { - Sse *StatsSSET - DlClient *StatsDlClientT - Restbed *StatsRestbedT - RequestsV1 uint32 - RequestsV2 uint32 + Sse *StatsSSET `json:"sse"` + DlClient *StatsDlClientT `json:"dlClient"` + Restbed *StatsRestbedT `json:"restbed"` + RequestsV1 uint32 `json:"requestsV1"` + RequestsV2 uint32 `json:"requestsV2"` } func (t *StatsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/web/automation/StatsDlClient.go b/pkg/fbs/web/automation/StatsDlClient.go index bab67c3..3ca8cc9 100644 --- a/pkg/fbs/web/automation/StatsDlClient.go +++ b/pkg/fbs/web/automation/StatsDlClient.go @@ -7,7 +7,7 @@ import ( ) type StatsDlClientT struct { - Converter uint32 + Converter uint32 `json:"converter"` } func (t *StatsDlClientT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/web/automation/StatsRestbed.go b/pkg/fbs/web/automation/StatsRestbed.go index 576d762..b2544a8 100644 --- a/pkg/fbs/web/automation/StatsRestbed.go +++ b/pkg/fbs/web/automation/StatsRestbed.go @@ -7,7 +7,7 @@ import ( ) type StatsRestbedT struct { - OpenSessions uint32 + OpenSessions uint32 `json:"openSessions"` } func (t *StatsRestbedT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { diff --git a/pkg/fbs/web/automation/StatsSSE.go b/pkg/fbs/web/automation/StatsSSE.go index 84f10d7..867cfed 100644 --- a/pkg/fbs/web/automation/StatsSSE.go +++ b/pkg/fbs/web/automation/StatsSSE.go @@ -7,24 +7,24 @@ import ( ) type StatsSSET struct { - OpenSubscriptions uint32 - OpenSSE uint32 - RequestsSSE uint32 + OpenSubscriptions uint32 `json:"openSubscriptions"` + OpenSse uint32 `json:"openSSE"` + RequestsSse uint32 `json:"requestsSSE"` } func (t *StatsSSET) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { if t == nil { return 0 } StatsSSEStart(builder) StatsSSEAddOpenSubscriptions(builder, t.OpenSubscriptions) - StatsSSEAddOpenSSE(builder, t.OpenSSE) - StatsSSEAddRequestsSSE(builder, t.RequestsSSE) + StatsSSEAddOpenSse(builder, t.OpenSse) + StatsSSEAddRequestsSse(builder, t.RequestsSse) return StatsSSEEnd(builder) } func (rcv *StatsSSE) UnPackTo(t *StatsSSET) { t.OpenSubscriptions = rcv.OpenSubscriptions() - t.OpenSSE = rcv.OpenSSE() - t.RequestsSSE = rcv.RequestsSSE() + t.OpenSse = rcv.OpenSse() + t.RequestsSse = rcv.RequestsSse() } func (rcv *StatsSSE) UnPack() *StatsSSET { @@ -73,7 +73,7 @@ func (rcv *StatsSSE) MutateOpenSubscriptions(n uint32) bool { return rcv._tab.MutateUint32Slot(4, n) } -func (rcv *StatsSSE) OpenSSE() uint32 { +func (rcv *StatsSSE) OpenSse() uint32 { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { return rcv._tab.GetUint32(o + rcv._tab.Pos) @@ -81,11 +81,11 @@ func (rcv *StatsSSE) OpenSSE() uint32 { return 0 } -func (rcv *StatsSSE) MutateOpenSSE(n uint32) bool { +func (rcv *StatsSSE) MutateOpenSse(n uint32) bool { return rcv._tab.MutateUint32Slot(6, n) } -func (rcv *StatsSSE) RequestsSSE() uint32 { +func (rcv *StatsSSE) RequestsSse() uint32 { o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) if o != 0 { return rcv._tab.GetUint32(o + rcv._tab.Pos) @@ -93,7 +93,7 @@ func (rcv *StatsSSE) RequestsSSE() uint32 { return 0 } -func (rcv *StatsSSE) MutateRequestsSSE(n uint32) bool { +func (rcv *StatsSSE) MutateRequestsSse(n uint32) bool { return rcv._tab.MutateUint32Slot(8, n) } @@ -103,11 +103,11 @@ func StatsSSEStart(builder *flatbuffers.Builder) { func StatsSSEAddOpenSubscriptions(builder *flatbuffers.Builder, openSubscriptions uint32) { builder.PrependUint32Slot(0, openSubscriptions, 0) } -func StatsSSEAddOpenSSE(builder *flatbuffers.Builder, openSSE uint32) { - builder.PrependUint32Slot(1, openSSE, 0) +func StatsSSEAddOpenSse(builder *flatbuffers.Builder, openSse uint32) { + builder.PrependUint32Slot(1, openSse, 0) } -func StatsSSEAddRequestsSSE(builder *flatbuffers.Builder, requestsSSE uint32) { - builder.PrependUint32Slot(2, requestsSSE, 0) +func StatsSSEAddRequestsSse(builder *flatbuffers.Builder, requestsSse uint32) { + builder.PrependUint32Slot(2, requestsSse, 0) } func StatsSSEEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() From 8d120ce2a7bbc41109c072ca3b62b3506b39eb0b Mon Sep 17 00:00:00 2001 From: guidfort Date: Fri, 11 Aug 2023 04:52:27 +0000 Subject: [PATCH 2/8] update fbs files --- pkg/fbs/comm/datalayer/ProgressData.go | 131 ++++++ pkg/fbs/comm/datalayer/RetainCorrupted.go | 66 +++ pkg/fbs/comm/datalayer/RetainDiagnosis.go | 106 +++++ pkg/fbs/comm/datalayer/Subscription.go | 127 +++++ pkg/fbs/comm/datalayer/TriggerOptions.go | 78 ++++ .../datalayer/remote/ReverseConnection.go | 153 ++++++ .../datalayer/remote/ReverseConnections.go | 117 +++++ .../master/fbs/SlaveToSlaveConfigInfo.go | 81 ++++ .../fbs/SlaveToSlaveConfigInfoResponse.go | 101 ++++ .../master/fbs/SlaveToSlaveCopyMode.go | 35 ++ .../master/fbs/SlaveToSlaveOnlineInfo.go | 81 ++++ .../fbs/SlaveToSlaveOnlineInfoResponse.go | 101 ++++ .../opcua/server/CompanionKeyValueType.go | 151 ++++++ pkg/fbs/comm/opcua/server/CompanionType.go | 151 ++++++ pkg/fbs/comm/opcua/server/Result.go | 46 ++ pkg/fbs/comm/osci/fbtypes/influxDB.go | 150 ++++++ pkg/fbs/common/health/Sensor.go | 162 +++++++ pkg/fbs/common/health/Threshold.go | 114 +++++ pkg/fbs/common/health/Thresholds.go | 108 +++++ pkg/fbs/common/systemhandler/fbs/Component.go | 127 +++++ pkg/fbs/motion/core/fbtypes/AxsCfgPosMode.go | 101 ++++ pkg/fbs/motion/core/fbtypes/CmdPosAbsDir.go | 41 ++ .../motion/core/fbtypes/KinCfgSingularity.go | 101 ++++ .../motion/core/fbtypes/KinStatePoseInfo.go | 166 +++++++ .../AxsCmdCtrlBasedHomingGantryData.go | 105 +++++ .../drivecmd/fbtypes/AxsCmdFixedstopData.go | 145 ++++++ .../drivecmd/fbtypes/AxsCmdHomingData.go | 101 ++++ .../drivecmd/fbtypes/AxsCmdSetAbsPosData.go | 101 ++++ .../motion/drivecmd/fbtypes/CmdBufferType.go | 81 ++++ .../motion/drivecmd/fbtypes/HomingParam.go | 207 ++++++++ .../drivecmd/fbtypes/HomingSlaveParamAll.go | 111 +++++ .../fbtypes/HomingSlaveParamSingle.go | 121 +++++ .../motion/drivecmd/fbtypes/RefMarkerSel.go | 29 ++ pkg/fbs/motion/drivecmd/fbtypes/RefMode.go | 33 ++ pkg/fbs/motion/drivecmd/fbtypes/RefType.go | 30 ++ .../sync/fbtypes/AxsCfgFlexProfileObj.go | 111 +++++ .../sync/fbtypes/AxsCfgSingleFlexProfile.go | 221 +++++++++ .../sync/fbtypes/AxsCmdFlexProfileData.go | 163 +++++++ .../sync/fbtypes/AxsCmdFlexProfileDlParams.go | 281 +++++++++++ .../sync/fbtypes/AxsCmdFlexProfileExData.go | 185 ++++++++ .../sync/fbtypes/AxsCmdFlexProfileParams.go | 281 +++++++++++ .../fbtypes/AxsStateFlexProfileAllEvents.go | 101 ++++ .../fbtypes/AxsStateFlexProfileExecution.go | 141 ++++++ .../sync/fbtypes/AxsStateFlexProfileObj.go | 155 ++++++ .../sync/fbtypes/AxsStateSingleFlexProfile.go | 101 ++++ .../sync/fbtypes/CfgFlexProfileEvent.go | 221 +++++++++ .../sync/fbtypes/CfgFlexProfileSegment.go | 441 ++++++++++++++++++ .../sync/fbtypes/PointTableInterpolation.go | 36 ++ pkg/fbs/motion/sync/fbtypes/ProfileEntry.go | 44 ++ .../sync/fbtypes/ProfileExecutionMode.go | 32 ++ .../motion/sync/fbtypes/SegmentActionMode.go | 35 ++ .../sync/fbtypes/SegmentTriggerCondition.go | 38 ++ .../sync/fbtypes/SysCfgAllPointTables.go | 111 +++++ .../sync/fbtypes/SysCfgSinglePointTable.go | 171 +++++++ .../fbtypes/AxsStateFlexProfileExecution.go | 141 ++++++ .../script/manager/fbtypes/CmdPosAbsDir.go | 41 ++ .../script/manager/fbtypes/Cmd_AxsPosEx.go | 156 +++++++ 57 files changed, 6866 insertions(+) create mode 100644 pkg/fbs/comm/datalayer/ProgressData.go create mode 100644 pkg/fbs/comm/datalayer/RetainCorrupted.go create mode 100644 pkg/fbs/comm/datalayer/RetainDiagnosis.go create mode 100644 pkg/fbs/comm/datalayer/Subscription.go create mode 100644 pkg/fbs/comm/datalayer/TriggerOptions.go create mode 100644 pkg/fbs/comm/datalayer/remote/ReverseConnection.go create mode 100644 pkg/fbs/comm/datalayer/remote/ReverseConnections.go create mode 100644 pkg/fbs/comm/ethercat/master/fbs/SlaveToSlaveConfigInfo.go create mode 100644 pkg/fbs/comm/ethercat/master/fbs/SlaveToSlaveConfigInfoResponse.go create mode 100644 pkg/fbs/comm/ethercat/master/fbs/SlaveToSlaveCopyMode.go create mode 100644 pkg/fbs/comm/ethercat/master/fbs/SlaveToSlaveOnlineInfo.go create mode 100644 pkg/fbs/comm/ethercat/master/fbs/SlaveToSlaveOnlineInfoResponse.go create mode 100644 pkg/fbs/comm/opcua/server/CompanionKeyValueType.go create mode 100644 pkg/fbs/comm/opcua/server/CompanionType.go create mode 100644 pkg/fbs/comm/opcua/server/Result.go create mode 100644 pkg/fbs/comm/osci/fbtypes/influxDB.go create mode 100644 pkg/fbs/common/health/Sensor.go create mode 100644 pkg/fbs/common/health/Threshold.go create mode 100644 pkg/fbs/common/health/Thresholds.go create mode 100644 pkg/fbs/common/systemhandler/fbs/Component.go create mode 100644 pkg/fbs/motion/core/fbtypes/AxsCfgPosMode.go create mode 100644 pkg/fbs/motion/core/fbtypes/CmdPosAbsDir.go create mode 100644 pkg/fbs/motion/core/fbtypes/KinCfgSingularity.go create mode 100644 pkg/fbs/motion/core/fbtypes/KinStatePoseInfo.go create mode 100644 pkg/fbs/motion/drivecmd/fbtypes/AxsCmdCtrlBasedHomingGantryData.go create mode 100644 pkg/fbs/motion/drivecmd/fbtypes/AxsCmdFixedstopData.go create mode 100644 pkg/fbs/motion/drivecmd/fbtypes/AxsCmdHomingData.go create mode 100644 pkg/fbs/motion/drivecmd/fbtypes/AxsCmdSetAbsPosData.go create mode 100644 pkg/fbs/motion/drivecmd/fbtypes/CmdBufferType.go create mode 100644 pkg/fbs/motion/drivecmd/fbtypes/HomingParam.go create mode 100644 pkg/fbs/motion/drivecmd/fbtypes/HomingSlaveParamAll.go create mode 100644 pkg/fbs/motion/drivecmd/fbtypes/HomingSlaveParamSingle.go create mode 100644 pkg/fbs/motion/drivecmd/fbtypes/RefMarkerSel.go create mode 100644 pkg/fbs/motion/drivecmd/fbtypes/RefMode.go create mode 100644 pkg/fbs/motion/drivecmd/fbtypes/RefType.go create mode 100644 pkg/fbs/motion/sync/fbtypes/AxsCfgFlexProfileObj.go create mode 100644 pkg/fbs/motion/sync/fbtypes/AxsCfgSingleFlexProfile.go create mode 100644 pkg/fbs/motion/sync/fbtypes/AxsCmdFlexProfileData.go create mode 100644 pkg/fbs/motion/sync/fbtypes/AxsCmdFlexProfileDlParams.go create mode 100644 pkg/fbs/motion/sync/fbtypes/AxsCmdFlexProfileExData.go create mode 100644 pkg/fbs/motion/sync/fbtypes/AxsCmdFlexProfileParams.go create mode 100644 pkg/fbs/motion/sync/fbtypes/AxsStateFlexProfileAllEvents.go create mode 100644 pkg/fbs/motion/sync/fbtypes/AxsStateFlexProfileExecution.go create mode 100644 pkg/fbs/motion/sync/fbtypes/AxsStateFlexProfileObj.go create mode 100644 pkg/fbs/motion/sync/fbtypes/AxsStateSingleFlexProfile.go create mode 100644 pkg/fbs/motion/sync/fbtypes/CfgFlexProfileEvent.go create mode 100644 pkg/fbs/motion/sync/fbtypes/CfgFlexProfileSegment.go create mode 100644 pkg/fbs/motion/sync/fbtypes/PointTableInterpolation.go create mode 100644 pkg/fbs/motion/sync/fbtypes/ProfileEntry.go create mode 100644 pkg/fbs/motion/sync/fbtypes/ProfileExecutionMode.go create mode 100644 pkg/fbs/motion/sync/fbtypes/SegmentActionMode.go create mode 100644 pkg/fbs/motion/sync/fbtypes/SegmentTriggerCondition.go create mode 100644 pkg/fbs/motion/sync/fbtypes/SysCfgAllPointTables.go create mode 100644 pkg/fbs/motion/sync/fbtypes/SysCfgSinglePointTable.go create mode 100644 pkg/fbs/script/manager/fbtypes/AxsStateFlexProfileExecution.go create mode 100644 pkg/fbs/script/manager/fbtypes/CmdPosAbsDir.go create mode 100644 pkg/fbs/script/manager/fbtypes/Cmd_AxsPosEx.go diff --git a/pkg/fbs/comm/datalayer/ProgressData.go b/pkg/fbs/comm/datalayer/ProgressData.go new file mode 100644 index 0000000..ec646fb --- /dev/null +++ b/pkg/fbs/comm/datalayer/ProgressData.go @@ -0,0 +1,131 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package datalayer + +import ( + "bytes" + flatbuffers "github.com/google/flatbuffers/go" +) + +type ProgressDataT struct { + Key string `json:"key"` + Value string `json:"value"` +} + +func (t *ProgressDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + keyOffset := flatbuffers.UOffsetT(0) + if t.Key != "" { + keyOffset = builder.CreateString(t.Key) + } + valueOffset := flatbuffers.UOffsetT(0) + if t.Value != "" { + valueOffset = builder.CreateString(t.Value) + } + ProgressDataStart(builder) + ProgressDataAddKey(builder, keyOffset) + ProgressDataAddValue(builder, valueOffset) + return ProgressDataEnd(builder) +} + +func (rcv *ProgressData) UnPackTo(t *ProgressDataT) { + t.Key = string(rcv.Key()) + t.Value = string(rcv.Value()) +} + +func (rcv *ProgressData) UnPack() *ProgressDataT { + if rcv == nil { return nil } + t := &ProgressDataT{} + rcv.UnPackTo(t) + return t +} + +type ProgressData struct { + _tab flatbuffers.Table +} + +func GetRootAsProgressData(buf []byte, offset flatbuffers.UOffsetT) *ProgressData { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &ProgressData{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsProgressData(buf []byte, offset flatbuffers.UOffsetT) *ProgressData { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &ProgressData{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *ProgressData) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *ProgressData) Table() flatbuffers.Table { + return rcv._tab +} + +func (rcv *ProgressData) Key() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func ProgressDataKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &ProgressData{} + obj2 := &ProgressData{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.Key()) < string(obj2.Key()) +} + +func (rcv *ProgressData) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &ProgressData{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.Key(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + +/// corresponding value +func (rcv *ProgressData) Value() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// corresponding value +func ProgressDataStart(builder *flatbuffers.Builder) { + builder.StartObject(2) +} +func ProgressDataAddKey(builder *flatbuffers.Builder, key flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(key), 0) +} +func ProgressDataAddValue(builder *flatbuffers.Builder, value flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(value), 0) +} +func ProgressDataEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/comm/datalayer/RetainCorrupted.go b/pkg/fbs/comm/datalayer/RetainCorrupted.go new file mode 100644 index 0000000..21ea461 --- /dev/null +++ b/pkg/fbs/comm/datalayer/RetainCorrupted.go @@ -0,0 +1,66 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package datalayer + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +type RetainCorruptedT struct { + Begin uint32 `json:"begin"` + End uint32 `json:"end"` +} + +func (t *RetainCorruptedT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + return CreateRetainCorrupted(builder, t.Begin, t.End) +} +func (rcv *RetainCorrupted) UnPackTo(t *RetainCorruptedT) { + t.Begin = rcv.Begin() + t.End = rcv.End() +} + +func (rcv *RetainCorrupted) UnPack() *RetainCorruptedT { + if rcv == nil { return nil } + t := &RetainCorruptedT{} + rcv.UnPackTo(t) + return t +} + +type RetainCorrupted struct { + _tab flatbuffers.Struct +} + +func (rcv *RetainCorrupted) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *RetainCorrupted) Table() flatbuffers.Table { + return rcv._tab.Table +} + +/// Start byte offset of corrupted nvram area +func (rcv *RetainCorrupted) Begin() uint32 { + return rcv._tab.GetUint32(rcv._tab.Pos + flatbuffers.UOffsetT(0)) +} +/// Start byte offset of corrupted nvram area +func (rcv *RetainCorrupted) MutateBegin(n uint32) bool { + return rcv._tab.MutateUint32(rcv._tab.Pos+flatbuffers.UOffsetT(0), n) +} + +/// End byte offset of corrupted nvram area +func (rcv *RetainCorrupted) End() uint32 { + return rcv._tab.GetUint32(rcv._tab.Pos + flatbuffers.UOffsetT(4)) +} +/// End byte offset of corrupted nvram area +func (rcv *RetainCorrupted) MutateEnd(n uint32) bool { + return rcv._tab.MutateUint32(rcv._tab.Pos+flatbuffers.UOffsetT(4), n) +} + +func CreateRetainCorrupted(builder *flatbuffers.Builder, begin uint32, end uint32) flatbuffers.UOffsetT { + builder.Prep(4, 8) + builder.PrependUint32(end) + builder.PrependUint32(begin) + return builder.Offset() +} diff --git a/pkg/fbs/comm/datalayer/RetainDiagnosis.go b/pkg/fbs/comm/datalayer/RetainDiagnosis.go new file mode 100644 index 0000000..da5b000 --- /dev/null +++ b/pkg/fbs/comm/datalayer/RetainDiagnosis.go @@ -0,0 +1,106 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package datalayer + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// Diagnosis of nvram +type RetainDiagnosisT struct { + Corrupted []*RetainCorruptedT `json:"corrupted"` +} + +func (t *RetainDiagnosisT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + corruptedOffset := flatbuffers.UOffsetT(0) + if t.Corrupted != nil { + corruptedLength := len(t.Corrupted) + RetainDiagnosisStartCorruptedVector(builder, corruptedLength) + for j := corruptedLength - 1; j >= 0; j-- { + t.Corrupted[j].Pack(builder) + } + corruptedOffset = builder.EndVector(corruptedLength) + } + RetainDiagnosisStart(builder) + RetainDiagnosisAddCorrupted(builder, corruptedOffset) + return RetainDiagnosisEnd(builder) +} + +func (rcv *RetainDiagnosis) UnPackTo(t *RetainDiagnosisT) { + corruptedLength := rcv.CorruptedLength() + t.Corrupted = make([]*RetainCorruptedT, corruptedLength) + for j := 0; j < corruptedLength; j++ { + x := RetainCorrupted{} + rcv.Corrupted(&x, j) + t.Corrupted[j] = x.UnPack() + } +} + +func (rcv *RetainDiagnosis) UnPack() *RetainDiagnosisT { + if rcv == nil { return nil } + t := &RetainDiagnosisT{} + rcv.UnPackTo(t) + return t +} + +type RetainDiagnosis struct { + _tab flatbuffers.Table +} + +func GetRootAsRetainDiagnosis(buf []byte, offset flatbuffers.UOffsetT) *RetainDiagnosis { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &RetainDiagnosis{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsRetainDiagnosis(buf []byte, offset flatbuffers.UOffsetT) *RetainDiagnosis { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &RetainDiagnosis{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *RetainDiagnosis) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *RetainDiagnosis) Table() flatbuffers.Table { + return rcv._tab +} + +/// List of corrupted memory areas in nvram +func (rcv *RetainDiagnosis) Corrupted(obj *RetainCorrupted, j int) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Vector(o) + x += flatbuffers.UOffsetT(j) * 8 + obj.Init(rcv._tab.Bytes, x) + return true + } + return false +} + +func (rcv *RetainDiagnosis) CorruptedLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +/// List of corrupted memory areas in nvram +func RetainDiagnosisStart(builder *flatbuffers.Builder) { + builder.StartObject(1) +} +func RetainDiagnosisAddCorrupted(builder *flatbuffers.Builder, corrupted flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(corrupted), 0) +} +func RetainDiagnosisStartCorruptedVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(8, numElems, 4) +} +func RetainDiagnosisEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/comm/datalayer/Subscription.go b/pkg/fbs/comm/datalayer/Subscription.go new file mode 100644 index 0000000..a07176e --- /dev/null +++ b/pkg/fbs/comm/datalayer/Subscription.go @@ -0,0 +1,127 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package datalayer + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +type SubscriptionT struct { + Properties *SubscriptionPropertiesT `json:"properties"` + Nodes []string `json:"nodes"` +} + +func (t *SubscriptionT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + propertiesOffset := t.Properties.Pack(builder) + nodesOffset := flatbuffers.UOffsetT(0) + if t.Nodes != nil { + nodesLength := len(t.Nodes) + nodesOffsets := make([]flatbuffers.UOffsetT, nodesLength) + for j := 0; j < nodesLength; j++ { + nodesOffsets[j] = builder.CreateString(t.Nodes[j]) + } + SubscriptionStartNodesVector(builder, nodesLength) + for j := nodesLength - 1; j >= 0; j-- { + builder.PrependUOffsetT(nodesOffsets[j]) + } + nodesOffset = builder.EndVector(nodesLength) + } + SubscriptionStart(builder) + SubscriptionAddProperties(builder, propertiesOffset) + SubscriptionAddNodes(builder, nodesOffset) + return SubscriptionEnd(builder) +} + +func (rcv *Subscription) UnPackTo(t *SubscriptionT) { + t.Properties = rcv.Properties(nil).UnPack() + nodesLength := rcv.NodesLength() + t.Nodes = make([]string, nodesLength) + for j := 0; j < nodesLength; j++ { + t.Nodes[j] = string(rcv.Nodes(j)) + } +} + +func (rcv *Subscription) UnPack() *SubscriptionT { + if rcv == nil { return nil } + t := &SubscriptionT{} + rcv.UnPackTo(t) + return t +} + +type Subscription struct { + _tab flatbuffers.Table +} + +func GetRootAsSubscription(buf []byte, offset flatbuffers.UOffsetT) *Subscription { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &Subscription{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsSubscription(buf []byte, offset flatbuffers.UOffsetT) *Subscription { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &Subscription{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *Subscription) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *Subscription) Table() flatbuffers.Table { + return rcv._tab +} + +/// properties of subscription +func (rcv *Subscription) Properties(obj *SubscriptionProperties) *SubscriptionProperties { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Indirect(o + rcv._tab.Pos) + if obj == nil { + obj = new(SubscriptionProperties) + } + obj.Init(rcv._tab.Bytes, x) + return obj + } + return nil +} + +/// properties of subscription +/// subscribed nodes +func (rcv *Subscription) Nodes(j int) []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.ByteVector(a + flatbuffers.UOffsetT(j*4)) + } + return nil +} + +func (rcv *Subscription) NodesLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +/// subscribed nodes +func SubscriptionStart(builder *flatbuffers.Builder) { + builder.StartObject(2) +} +func SubscriptionAddProperties(builder *flatbuffers.Builder, properties flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(properties), 0) +} +func SubscriptionAddNodes(builder *flatbuffers.Builder, nodes flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(nodes), 0) +} +func SubscriptionStartNodesVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} +func SubscriptionEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/comm/datalayer/TriggerOptions.go b/pkg/fbs/comm/datalayer/TriggerOptions.go new file mode 100644 index 0000000..6130d5f --- /dev/null +++ b/pkg/fbs/comm/datalayer/TriggerOptions.go @@ -0,0 +1,78 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package datalayer + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +type TriggerOptionsT struct { + QueueSize uint16 `json:"queueSize"` +} + +func (t *TriggerOptionsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + TriggerOptionsStart(builder) + TriggerOptionsAddQueueSize(builder, t.QueueSize) + return TriggerOptionsEnd(builder) +} + +func (rcv *TriggerOptions) UnPackTo(t *TriggerOptionsT) { + t.QueueSize = rcv.QueueSize() +} + +func (rcv *TriggerOptions) UnPack() *TriggerOptionsT { + if rcv == nil { return nil } + t := &TriggerOptionsT{} + rcv.UnPackTo(t) + return t +} + +type TriggerOptions struct { + _tab flatbuffers.Table +} + +func GetRootAsTriggerOptions(buf []byte, offset flatbuffers.UOffsetT) *TriggerOptions { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &TriggerOptions{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsTriggerOptions(buf []byte, offset flatbuffers.UOffsetT) *TriggerOptions { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &TriggerOptions{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *TriggerOptions) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *TriggerOptions) Table() flatbuffers.Table { + return rcv._tab +} + +func (rcv *TriggerOptions) QueueSize() uint16 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.GetUint16(o + rcv._tab.Pos) + } + return 1 +} + +func (rcv *TriggerOptions) MutateQueueSize(n uint16) bool { + return rcv._tab.MutateUint16Slot(4, n) +} + +func TriggerOptionsStart(builder *flatbuffers.Builder) { + builder.StartObject(1) +} +func TriggerOptionsAddQueueSize(builder *flatbuffers.Builder, queueSize uint16) { + builder.PrependUint16Slot(0, queueSize, 1) +} +func TriggerOptionsEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/comm/datalayer/remote/ReverseConnection.go b/pkg/fbs/comm/datalayer/remote/ReverseConnection.go new file mode 100644 index 0000000..e00fbc8 --- /dev/null +++ b/pkg/fbs/comm/datalayer/remote/ReverseConnection.go @@ -0,0 +1,153 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package remote + +import ( + "bytes" + flatbuffers "github.com/google/flatbuffers/go" +) + +type ReverseConnectionT struct { + ConnectionId string `json:"connectionId"` + ConnectionAddress string `json:"connectionAddress"` + Name string `json:"name"` +} + +func (t *ReverseConnectionT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + connectionIdOffset := flatbuffers.UOffsetT(0) + if t.ConnectionId != "" { + connectionIdOffset = builder.CreateString(t.ConnectionId) + } + connectionAddressOffset := flatbuffers.UOffsetT(0) + if t.ConnectionAddress != "" { + connectionAddressOffset = builder.CreateString(t.ConnectionAddress) + } + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + ReverseConnectionStart(builder) + ReverseConnectionAddConnectionId(builder, connectionIdOffset) + ReverseConnectionAddConnectionAddress(builder, connectionAddressOffset) + ReverseConnectionAddName(builder, nameOffset) + return ReverseConnectionEnd(builder) +} + +func (rcv *ReverseConnection) UnPackTo(t *ReverseConnectionT) { + t.ConnectionId = string(rcv.ConnectionId()) + t.ConnectionAddress = string(rcv.ConnectionAddress()) + t.Name = string(rcv.Name()) +} + +func (rcv *ReverseConnection) UnPack() *ReverseConnectionT { + if rcv == nil { return nil } + t := &ReverseConnectionT{} + rcv.UnPackTo(t) + return t +} + +type ReverseConnection struct { + _tab flatbuffers.Table +} + +func GetRootAsReverseConnection(buf []byte, offset flatbuffers.UOffsetT) *ReverseConnection { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &ReverseConnection{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsReverseConnection(buf []byte, offset flatbuffers.UOffsetT) *ReverseConnection { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &ReverseConnection{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *ReverseConnection) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *ReverseConnection) Table() flatbuffers.Table { + return rcv._tab +} + +/// local id of reverse connection +func (rcv *ReverseConnection) ConnectionId() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// local id of reverse connection +func ReverseConnectionKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool { + obj1 := &ReverseConnection{} + obj2 := &ReverseConnection{} + obj1.Init(buf, flatbuffers.UOffsetT(len(buf)) - o1) + obj2.Init(buf, flatbuffers.UOffsetT(len(buf)) - o2) + return string(obj1.ConnectionId()) < string(obj2.ConnectionId()) +} + +func (rcv *ReverseConnection) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool { + span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:]) + start := flatbuffers.UOffsetT(0) + bKey := []byte(key) + for span != 0 { + middle := span / 2 + tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle)) + obj := &ReverseConnection{} + obj.Init(buf, tableOffset) + comp := bytes.Compare(obj.ConnectionId(), bKey) + if comp > 0 { + span = middle + } else if comp < 0 { + middle += 1 + start += middle + span -= middle + } else { + rcv.Init(buf, tableOffset) + return true + } + } + return false +} + +/// address to remote control to connect to (connect string) +func (rcv *ReverseConnection) ConnectionAddress() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// address to remote control to connect to (connect string) +/// name the datalayer appears on remote server +func (rcv *ReverseConnection) Name() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// name the datalayer appears on remote server +func ReverseConnectionStart(builder *flatbuffers.Builder) { + builder.StartObject(3) +} +func ReverseConnectionAddConnectionId(builder *flatbuffers.Builder, connectionId flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(connectionId), 0) +} +func ReverseConnectionAddConnectionAddress(builder *flatbuffers.Builder, connectionAddress flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(connectionAddress), 0) +} +func ReverseConnectionAddName(builder *flatbuffers.Builder, name flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(name), 0) +} +func ReverseConnectionEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/comm/datalayer/remote/ReverseConnections.go b/pkg/fbs/comm/datalayer/remote/ReverseConnections.go new file mode 100644 index 0000000..9055038 --- /dev/null +++ b/pkg/fbs/comm/datalayer/remote/ReverseConnections.go @@ -0,0 +1,117 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package remote + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +type ReverseConnectionsT struct { + ReverseConnections []*ReverseConnectionT `json:"reverse_connections"` +} + +func (t *ReverseConnectionsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + reverseConnectionsOffset := flatbuffers.UOffsetT(0) + if t.ReverseConnections != nil { + reverseConnectionsLength := len(t.ReverseConnections) + reverseConnectionsOffsets := make([]flatbuffers.UOffsetT, reverseConnectionsLength) + for j := 0; j < reverseConnectionsLength; j++ { + reverseConnectionsOffsets[j] = t.ReverseConnections[j].Pack(builder) + } + ReverseConnectionsStartReverseConnectionsVector(builder, reverseConnectionsLength) + for j := reverseConnectionsLength - 1; j >= 0; j-- { + builder.PrependUOffsetT(reverseConnectionsOffsets[j]) + } + reverseConnectionsOffset = builder.EndVector(reverseConnectionsLength) + } + ReverseConnectionsStart(builder) + ReverseConnectionsAddReverseConnections(builder, reverseConnectionsOffset) + return ReverseConnectionsEnd(builder) +} + +func (rcv *ReverseConnections) UnPackTo(t *ReverseConnectionsT) { + reverseConnectionsLength := rcv.ReverseConnectionsLength() + t.ReverseConnections = make([]*ReverseConnectionT, reverseConnectionsLength) + for j := 0; j < reverseConnectionsLength; j++ { + x := ReverseConnection{} + rcv.ReverseConnections(&x, j) + t.ReverseConnections[j] = x.UnPack() + } +} + +func (rcv *ReverseConnections) UnPack() *ReverseConnectionsT { + if rcv == nil { return nil } + t := &ReverseConnectionsT{} + rcv.UnPackTo(t) + return t +} + +type ReverseConnections struct { + _tab flatbuffers.Table +} + +func GetRootAsReverseConnections(buf []byte, offset flatbuffers.UOffsetT) *ReverseConnections { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &ReverseConnections{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsReverseConnections(buf []byte, offset flatbuffers.UOffsetT) *ReverseConnections { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &ReverseConnections{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *ReverseConnections) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *ReverseConnections) Table() flatbuffers.Table { + return rcv._tab +} + +func (rcv *ReverseConnections) ReverseConnections(obj *ReverseConnection, j int) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Vector(o) + x += flatbuffers.UOffsetT(j) * 4 + x = rcv._tab.Indirect(x) + obj.Init(rcv._tab.Bytes, x) + return true + } + return false +} + +func (rcv *ReverseConnections) ReverseConnectionsByKey(obj *ReverseConnection, key string) bool{ + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Vector(o) + return obj.LookupByKey(key, x, rcv._tab.Bytes) + } + return false +} + +func (rcv *ReverseConnections) ReverseConnectionsLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func ReverseConnectionsStart(builder *flatbuffers.Builder) { + builder.StartObject(1) +} +func ReverseConnectionsAddReverseConnections(builder *flatbuffers.Builder, reverseConnections flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(reverseConnections), 0) +} +func ReverseConnectionsStartReverseConnectionsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} +func ReverseConnectionsEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveToSlaveConfigInfo.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveToSlaveConfigInfo.go new file mode 100644 index 0000000..5c3a3a6 --- /dev/null +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveToSlaveConfigInfo.go @@ -0,0 +1,81 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbs + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +///This node returns the slave to slave configuration information response +type SlaveToSlaveConfigInfoT struct { + Response *SlaveToSlaveConfigInfoResponseT `json:"response"` +} + +func (t *SlaveToSlaveConfigInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + responseOffset := t.Response.Pack(builder) + SlaveToSlaveConfigInfoStart(builder) + SlaveToSlaveConfigInfoAddResponse(builder, responseOffset) + return SlaveToSlaveConfigInfoEnd(builder) +} + +func (rcv *SlaveToSlaveConfigInfo) UnPackTo(t *SlaveToSlaveConfigInfoT) { + t.Response = rcv.Response(nil).UnPack() +} + +func (rcv *SlaveToSlaveConfigInfo) UnPack() *SlaveToSlaveConfigInfoT { + if rcv == nil { return nil } + t := &SlaveToSlaveConfigInfoT{} + rcv.UnPackTo(t) + return t +} + +type SlaveToSlaveConfigInfo struct { + _tab flatbuffers.Table +} + +func GetRootAsSlaveToSlaveConfigInfo(buf []byte, offset flatbuffers.UOffsetT) *SlaveToSlaveConfigInfo { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &SlaveToSlaveConfigInfo{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsSlaveToSlaveConfigInfo(buf []byte, offset flatbuffers.UOffsetT) *SlaveToSlaveConfigInfo { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &SlaveToSlaveConfigInfo{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *SlaveToSlaveConfigInfo) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *SlaveToSlaveConfigInfo) Table() flatbuffers.Table { + return rcv._tab +} + +func (rcv *SlaveToSlaveConfigInfo) Response(obj *SlaveToSlaveConfigInfoResponse) *SlaveToSlaveConfigInfoResponse { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Indirect(o + rcv._tab.Pos) + if obj == nil { + obj = new(SlaveToSlaveConfigInfoResponse) + } + obj.Init(rcv._tab.Bytes, x) + return obj + } + return nil +} + +func SlaveToSlaveConfigInfoStart(builder *flatbuffers.Builder) { + builder.StartObject(1) +} +func SlaveToSlaveConfigInfoAddResponse(builder *flatbuffers.Builder, response flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(response), 0) +} +func SlaveToSlaveConfigInfoEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveToSlaveConfigInfoResponse.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveToSlaveConfigInfoResponse.go new file mode 100644 index 0000000..b69f2c2 --- /dev/null +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveToSlaveConfigInfoResponse.go @@ -0,0 +1,101 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbs + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +///Slave to slave configuration information response +type SlaveToSlaveConfigInfoResponseT struct { + ProcessDataCopy bool `json:"processDataCopy"` + ProcessDataCopyMode SlaveToSlaveCopyMode `json:"processDataCopyMode"` +} + +func (t *SlaveToSlaveConfigInfoResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + SlaveToSlaveConfigInfoResponseStart(builder) + SlaveToSlaveConfigInfoResponseAddProcessDataCopy(builder, t.ProcessDataCopy) + SlaveToSlaveConfigInfoResponseAddProcessDataCopyMode(builder, t.ProcessDataCopyMode) + return SlaveToSlaveConfigInfoResponseEnd(builder) +} + +func (rcv *SlaveToSlaveConfigInfoResponse) UnPackTo(t *SlaveToSlaveConfigInfoResponseT) { + t.ProcessDataCopy = rcv.ProcessDataCopy() + t.ProcessDataCopyMode = rcv.ProcessDataCopyMode() +} + +func (rcv *SlaveToSlaveConfigInfoResponse) UnPack() *SlaveToSlaveConfigInfoResponseT { + if rcv == nil { return nil } + t := &SlaveToSlaveConfigInfoResponseT{} + rcv.UnPackTo(t) + return t +} + +type SlaveToSlaveConfigInfoResponse struct { + _tab flatbuffers.Table +} + +func GetRootAsSlaveToSlaveConfigInfoResponse(buf []byte, offset flatbuffers.UOffsetT) *SlaveToSlaveConfigInfoResponse { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &SlaveToSlaveConfigInfoResponse{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsSlaveToSlaveConfigInfoResponse(buf []byte, offset flatbuffers.UOffsetT) *SlaveToSlaveConfigInfoResponse { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &SlaveToSlaveConfigInfoResponse{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *SlaveToSlaveConfigInfoResponse) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *SlaveToSlaveConfigInfoResponse) Table() flatbuffers.Table { + return rcv._tab +} + +///Slave to slave copy configured +func (rcv *SlaveToSlaveConfigInfoResponse) ProcessDataCopy() bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.GetBool(o + rcv._tab.Pos) + } + return false +} + +///Slave to slave copy configured +func (rcv *SlaveToSlaveConfigInfoResponse) MutateProcessDataCopy(n bool) bool { + return rcv._tab.MutateBoolSlot(4, n) +} + +///Slave to slave copy mode for process data communication +func (rcv *SlaveToSlaveConfigInfoResponse) ProcessDataCopyMode() SlaveToSlaveCopyMode { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return SlaveToSlaveCopyMode(rcv._tab.GetUint32(o + rcv._tab.Pos)) + } + return 0 +} + +///Slave to slave copy mode for process data communication +func (rcv *SlaveToSlaveConfigInfoResponse) MutateProcessDataCopyMode(n SlaveToSlaveCopyMode) bool { + return rcv._tab.MutateUint32Slot(6, uint32(n)) +} + +func SlaveToSlaveConfigInfoResponseStart(builder *flatbuffers.Builder) { + builder.StartObject(2) +} +func SlaveToSlaveConfigInfoResponseAddProcessDataCopy(builder *flatbuffers.Builder, processDataCopy bool) { + builder.PrependBoolSlot(0, processDataCopy, false) +} +func SlaveToSlaveConfigInfoResponseAddProcessDataCopyMode(builder *flatbuffers.Builder, processDataCopyMode SlaveToSlaveCopyMode) { + builder.PrependUint32Slot(1, uint32(processDataCopyMode), 0) +} +func SlaveToSlaveConfigInfoResponseEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveToSlaveCopyMode.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveToSlaveCopyMode.go new file mode 100644 index 0000000..ee3a668 --- /dev/null +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveToSlaveCopyMode.go @@ -0,0 +1,35 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbs + +import "strconv" + +type SlaveToSlaveCopyMode uint32 + +const ( + SlaveToSlaveCopyModeauto SlaveToSlaveCopyMode = 0 + SlaveToSlaveCopyModeonTransmit SlaveToSlaveCopyMode = 1 + SlaveToSlaveCopyModeonReceive SlaveToSlaveCopyMode = 2 + SlaveToSlaveCopyModeundefined SlaveToSlaveCopyMode = 4294967295 +) + +var EnumNamesSlaveToSlaveCopyMode = map[SlaveToSlaveCopyMode]string{ + SlaveToSlaveCopyModeauto: "auto", + SlaveToSlaveCopyModeonTransmit: "onTransmit", + SlaveToSlaveCopyModeonReceive: "onReceive", + SlaveToSlaveCopyModeundefined: "undefined", +} + +var EnumValuesSlaveToSlaveCopyMode = map[string]SlaveToSlaveCopyMode{ + "auto": SlaveToSlaveCopyModeauto, + "onTransmit": SlaveToSlaveCopyModeonTransmit, + "onReceive": SlaveToSlaveCopyModeonReceive, + "undefined": SlaveToSlaveCopyModeundefined, +} + +func (v SlaveToSlaveCopyMode) String() string { + if s, ok := EnumNamesSlaveToSlaveCopyMode[v]; ok { + return s + } + return "SlaveToSlaveCopyMode(" + strconv.FormatInt(int64(v), 10) + ")" +} diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveToSlaveOnlineInfo.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveToSlaveOnlineInfo.go new file mode 100644 index 0000000..1dc4d0f --- /dev/null +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveToSlaveOnlineInfo.go @@ -0,0 +1,81 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbs + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +///This node returns the slave to slave online information response +type SlaveToSlaveOnlineInfoT struct { + Response *SlaveToSlaveOnlineInfoResponseT `json:"response"` +} + +func (t *SlaveToSlaveOnlineInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + responseOffset := t.Response.Pack(builder) + SlaveToSlaveOnlineInfoStart(builder) + SlaveToSlaveOnlineInfoAddResponse(builder, responseOffset) + return SlaveToSlaveOnlineInfoEnd(builder) +} + +func (rcv *SlaveToSlaveOnlineInfo) UnPackTo(t *SlaveToSlaveOnlineInfoT) { + t.Response = rcv.Response(nil).UnPack() +} + +func (rcv *SlaveToSlaveOnlineInfo) UnPack() *SlaveToSlaveOnlineInfoT { + if rcv == nil { return nil } + t := &SlaveToSlaveOnlineInfoT{} + rcv.UnPackTo(t) + return t +} + +type SlaveToSlaveOnlineInfo struct { + _tab flatbuffers.Table +} + +func GetRootAsSlaveToSlaveOnlineInfo(buf []byte, offset flatbuffers.UOffsetT) *SlaveToSlaveOnlineInfo { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &SlaveToSlaveOnlineInfo{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsSlaveToSlaveOnlineInfo(buf []byte, offset flatbuffers.UOffsetT) *SlaveToSlaveOnlineInfo { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &SlaveToSlaveOnlineInfo{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *SlaveToSlaveOnlineInfo) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *SlaveToSlaveOnlineInfo) Table() flatbuffers.Table { + return rcv._tab +} + +func (rcv *SlaveToSlaveOnlineInfo) Response(obj *SlaveToSlaveOnlineInfoResponse) *SlaveToSlaveOnlineInfoResponse { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Indirect(o + rcv._tab.Pos) + if obj == nil { + obj = new(SlaveToSlaveOnlineInfoResponse) + } + obj.Init(rcv._tab.Bytes, x) + return obj + } + return nil +} + +func SlaveToSlaveOnlineInfoStart(builder *flatbuffers.Builder) { + builder.StartObject(1) +} +func SlaveToSlaveOnlineInfoAddResponse(builder *flatbuffers.Builder, response flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(response), 0) +} +func SlaveToSlaveOnlineInfoEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/comm/ethercat/master/fbs/SlaveToSlaveOnlineInfoResponse.go b/pkg/fbs/comm/ethercat/master/fbs/SlaveToSlaveOnlineInfoResponse.go new file mode 100644 index 0000000..7dcd9d3 --- /dev/null +++ b/pkg/fbs/comm/ethercat/master/fbs/SlaveToSlaveOnlineInfoResponse.go @@ -0,0 +1,101 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbs + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +///Slave to slave online information response +type SlaveToSlaveOnlineInfoResponseT struct { + ProcessDataCopy bool `json:"processDataCopy"` + ProcessDataCopyMode SlaveToSlaveCopyMode `json:"processDataCopyMode"` +} + +func (t *SlaveToSlaveOnlineInfoResponseT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + SlaveToSlaveOnlineInfoResponseStart(builder) + SlaveToSlaveOnlineInfoResponseAddProcessDataCopy(builder, t.ProcessDataCopy) + SlaveToSlaveOnlineInfoResponseAddProcessDataCopyMode(builder, t.ProcessDataCopyMode) + return SlaveToSlaveOnlineInfoResponseEnd(builder) +} + +func (rcv *SlaveToSlaveOnlineInfoResponse) UnPackTo(t *SlaveToSlaveOnlineInfoResponseT) { + t.ProcessDataCopy = rcv.ProcessDataCopy() + t.ProcessDataCopyMode = rcv.ProcessDataCopyMode() +} + +func (rcv *SlaveToSlaveOnlineInfoResponse) UnPack() *SlaveToSlaveOnlineInfoResponseT { + if rcv == nil { return nil } + t := &SlaveToSlaveOnlineInfoResponseT{} + rcv.UnPackTo(t) + return t +} + +type SlaveToSlaveOnlineInfoResponse struct { + _tab flatbuffers.Table +} + +func GetRootAsSlaveToSlaveOnlineInfoResponse(buf []byte, offset flatbuffers.UOffsetT) *SlaveToSlaveOnlineInfoResponse { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &SlaveToSlaveOnlineInfoResponse{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsSlaveToSlaveOnlineInfoResponse(buf []byte, offset flatbuffers.UOffsetT) *SlaveToSlaveOnlineInfoResponse { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &SlaveToSlaveOnlineInfoResponse{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *SlaveToSlaveOnlineInfoResponse) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *SlaveToSlaveOnlineInfoResponse) Table() flatbuffers.Table { + return rcv._tab +} + +///Slave to slave copy active +func (rcv *SlaveToSlaveOnlineInfoResponse) ProcessDataCopy() bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.GetBool(o + rcv._tab.Pos) + } + return false +} + +///Slave to slave copy active +func (rcv *SlaveToSlaveOnlineInfoResponse) MutateProcessDataCopy(n bool) bool { + return rcv._tab.MutateBoolSlot(4, n) +} + +///Slave to slave copy mode for process data communication +func (rcv *SlaveToSlaveOnlineInfoResponse) ProcessDataCopyMode() SlaveToSlaveCopyMode { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return SlaveToSlaveCopyMode(rcv._tab.GetUint32(o + rcv._tab.Pos)) + } + return 0 +} + +///Slave to slave copy mode for process data communication +func (rcv *SlaveToSlaveOnlineInfoResponse) MutateProcessDataCopyMode(n SlaveToSlaveCopyMode) bool { + return rcv._tab.MutateUint32Slot(6, uint32(n)) +} + +func SlaveToSlaveOnlineInfoResponseStart(builder *flatbuffers.Builder) { + builder.StartObject(2) +} +func SlaveToSlaveOnlineInfoResponseAddProcessDataCopy(builder *flatbuffers.Builder, processDataCopy bool) { + builder.PrependBoolSlot(0, processDataCopy, false) +} +func SlaveToSlaveOnlineInfoResponseAddProcessDataCopyMode(builder *flatbuffers.Builder, processDataCopyMode SlaveToSlaveCopyMode) { + builder.PrependUint32Slot(1, uint32(processDataCopyMode), 0) +} +func SlaveToSlaveOnlineInfoResponseEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/comm/opcua/server/CompanionKeyValueType.go b/pkg/fbs/comm/opcua/server/CompanionKeyValueType.go new file mode 100644 index 0000000..fbdfffe --- /dev/null +++ b/pkg/fbs/comm/opcua/server/CompanionKeyValueType.go @@ -0,0 +1,151 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package server + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// Mapping of one source to target node +type CompanionKeyValueTypeT struct { + SourceUaNodeId string `json:"sourceUaNodeId"` + TargetUaNodeId string `json:"targetUaNodeId"` + Result []Result `json:"result"` +} + +func (t *CompanionKeyValueTypeT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + sourceUaNodeIdOffset := flatbuffers.UOffsetT(0) + if t.SourceUaNodeId != "" { + sourceUaNodeIdOffset = builder.CreateString(t.SourceUaNodeId) + } + targetUaNodeIdOffset := flatbuffers.UOffsetT(0) + if t.TargetUaNodeId != "" { + targetUaNodeIdOffset = builder.CreateString(t.TargetUaNodeId) + } + resultOffset := flatbuffers.UOffsetT(0) + if t.Result != nil { + resultLength := len(t.Result) + CompanionKeyValueTypeStartResultVector(builder, resultLength) + for j := resultLength - 1; j >= 0; j-- { + builder.PrependInt8(int8(t.Result[j])) + } + resultOffset = builder.EndVector(resultLength) + } + CompanionKeyValueTypeStart(builder) + CompanionKeyValueTypeAddSourceUaNodeId(builder, sourceUaNodeIdOffset) + CompanionKeyValueTypeAddTargetUaNodeId(builder, targetUaNodeIdOffset) + CompanionKeyValueTypeAddResult(builder, resultOffset) + return CompanionKeyValueTypeEnd(builder) +} + +func (rcv *CompanionKeyValueType) UnPackTo(t *CompanionKeyValueTypeT) { + t.SourceUaNodeId = string(rcv.SourceUaNodeId()) + t.TargetUaNodeId = string(rcv.TargetUaNodeId()) + resultLength := rcv.ResultLength() + t.Result = make([]Result, resultLength) + for j := 0; j < resultLength; j++ { + t.Result[j] = rcv.Result(j) + } +} + +func (rcv *CompanionKeyValueType) UnPack() *CompanionKeyValueTypeT { + if rcv == nil { return nil } + t := &CompanionKeyValueTypeT{} + rcv.UnPackTo(t) + return t +} + +type CompanionKeyValueType struct { + _tab flatbuffers.Table +} + +func GetRootAsCompanionKeyValueType(buf []byte, offset flatbuffers.UOffsetT) *CompanionKeyValueType { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &CompanionKeyValueType{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsCompanionKeyValueType(buf []byte, offset flatbuffers.UOffsetT) *CompanionKeyValueType { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &CompanionKeyValueType{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *CompanionKeyValueType) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *CompanionKeyValueType) Table() flatbuffers.Table { + return rcv._tab +} + +/// The original opc ua node id which will be mapped into the opc ua companion model, e.g. ns=2;s=plc/app/Appl/... +func (rcv *CompanionKeyValueType) SourceUaNodeId() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// The original opc ua node id which will be mapped into the opc ua companion model, e.g. ns=2;s=plc/app/Appl/... +/// The target opc ua node id in the companion model, e.g. ns=5;s=myModel.myPlcNode +func (rcv *CompanionKeyValueType) TargetUaNodeId() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// The target opc ua node id in the companion model, e.g. ns=5;s=myModel.myPlcNode +/// Verification of the mapping, used as output parameter +func (rcv *CompanionKeyValueType) Result(j int) Result { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + a := rcv._tab.Vector(o) + return Result(rcv._tab.GetInt8(a + flatbuffers.UOffsetT(j*1))) + } + return 0 +} + +func (rcv *CompanionKeyValueType) ResultLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +/// Verification of the mapping, used as output parameter +func (rcv *CompanionKeyValueType) MutateResult(j int, n Result) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateInt8(a+flatbuffers.UOffsetT(j*1), int8(n)) + } + return false +} + +func CompanionKeyValueTypeStart(builder *flatbuffers.Builder) { + builder.StartObject(3) +} +func CompanionKeyValueTypeAddSourceUaNodeId(builder *flatbuffers.Builder, sourceUaNodeId flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(sourceUaNodeId), 0) +} +func CompanionKeyValueTypeAddTargetUaNodeId(builder *flatbuffers.Builder, targetUaNodeId flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(targetUaNodeId), 0) +} +func CompanionKeyValueTypeAddResult(builder *flatbuffers.Builder, result flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(result), 0) +} +func CompanionKeyValueTypeStartResultVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(1, numElems, 1) +} +func CompanionKeyValueTypeEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/comm/opcua/server/CompanionType.go b/pkg/fbs/comm/opcua/server/CompanionType.go new file mode 100644 index 0000000..c7993a6 --- /dev/null +++ b/pkg/fbs/comm/opcua/server/CompanionType.go @@ -0,0 +1,151 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package server + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// Companion model mapping description +type CompanionTypeT struct { + Name string `json:"name"` + TypeSafety bool `json:"typeSafety"` + Mapping []*CompanionKeyValueTypeT `json:"mapping"` +} + +func (t *CompanionTypeT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + mappingOffset := flatbuffers.UOffsetT(0) + if t.Mapping != nil { + mappingLength := len(t.Mapping) + mappingOffsets := make([]flatbuffers.UOffsetT, mappingLength) + for j := 0; j < mappingLength; j++ { + mappingOffsets[j] = t.Mapping[j].Pack(builder) + } + CompanionTypeStartMappingVector(builder, mappingLength) + for j := mappingLength - 1; j >= 0; j-- { + builder.PrependUOffsetT(mappingOffsets[j]) + } + mappingOffset = builder.EndVector(mappingLength) + } + CompanionTypeStart(builder) + CompanionTypeAddName(builder, nameOffset) + CompanionTypeAddTypeSafety(builder, t.TypeSafety) + CompanionTypeAddMapping(builder, mappingOffset) + return CompanionTypeEnd(builder) +} + +func (rcv *CompanionType) UnPackTo(t *CompanionTypeT) { + t.Name = string(rcv.Name()) + t.TypeSafety = rcv.TypeSafety() + mappingLength := rcv.MappingLength() + t.Mapping = make([]*CompanionKeyValueTypeT, mappingLength) + for j := 0; j < mappingLength; j++ { + x := CompanionKeyValueType{} + rcv.Mapping(&x, j) + t.Mapping[j] = x.UnPack() + } +} + +func (rcv *CompanionType) UnPack() *CompanionTypeT { + if rcv == nil { return nil } + t := &CompanionTypeT{} + rcv.UnPackTo(t) + return t +} + +type CompanionType struct { + _tab flatbuffers.Table +} + +func GetRootAsCompanionType(buf []byte, offset flatbuffers.UOffsetT) *CompanionType { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &CompanionType{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsCompanionType(buf []byte, offset flatbuffers.UOffsetT) *CompanionType { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &CompanionType{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *CompanionType) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *CompanionType) Table() flatbuffers.Table { + return rcv._tab +} + +/// Name of the companion model +func (rcv *CompanionType) Name() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// Name of the companion model +/// Check if source and target have same datatype +func (rcv *CompanionType) TypeSafety() bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.GetBool(o + rcv._tab.Pos) + } + return true +} + +/// Check if source and target have same datatype +func (rcv *CompanionType) MutateTypeSafety(n bool) bool { + return rcv._tab.MutateBoolSlot(6, n) +} + +/// Mapping of the nodes +func (rcv *CompanionType) Mapping(obj *CompanionKeyValueType, j int) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + x := rcv._tab.Vector(o) + x += flatbuffers.UOffsetT(j) * 4 + x = rcv._tab.Indirect(x) + obj.Init(rcv._tab.Bytes, x) + return true + } + return false +} + +func (rcv *CompanionType) MappingLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +/// Mapping of the nodes +func CompanionTypeStart(builder *flatbuffers.Builder) { + builder.StartObject(3) +} +func CompanionTypeAddName(builder *flatbuffers.Builder, name flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(name), 0) +} +func CompanionTypeAddTypeSafety(builder *flatbuffers.Builder, typeSafety bool) { + builder.PrependBoolSlot(1, typeSafety, true) +} +func CompanionTypeAddMapping(builder *flatbuffers.Builder, mapping flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(mapping), 0) +} +func CompanionTypeStartMappingVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} +func CompanionTypeEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/comm/opcua/server/Result.go b/pkg/fbs/comm/opcua/server/Result.go new file mode 100644 index 0000000..27c74c8 --- /dev/null +++ b/pkg/fbs/comm/opcua/server/Result.go @@ -0,0 +1,46 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package server + +import "strconv" + +type Result int8 + +const ( + ResultGood Result = 0 + /// sourceNodeId from datalayer is not valid + ResultInvalidSource Result = 1 + /// targetNodeId is not present in server addressspace + ResultInvalidTarget Result = 2 + /// targetNodeId is used multiple times in the mapping tables + ResultTargetAlreadyUsed Result = 3 + /// Coultn't load the type definition of the targetNodeId from companion model + ResultTypeInvalid Result = 4 + /// sourceNodeId and targetNodeId have different datatypes, only checked if 'typeSafety' is true + ResultTypeMismatch Result = 5 +) + +var EnumNamesResult = map[Result]string{ + ResultGood: "Good", + ResultInvalidSource: "InvalidSource", + ResultInvalidTarget: "InvalidTarget", + ResultTargetAlreadyUsed: "TargetAlreadyUsed", + ResultTypeInvalid: "TypeInvalid", + ResultTypeMismatch: "TypeMismatch", +} + +var EnumValuesResult = map[string]Result{ + "Good": ResultGood, + "InvalidSource": ResultInvalidSource, + "InvalidTarget": ResultInvalidTarget, + "TargetAlreadyUsed": ResultTargetAlreadyUsed, + "TypeInvalid": ResultTypeInvalid, + "TypeMismatch": ResultTypeMismatch, +} + +func (v Result) String() string { + if s, ok := EnumNamesResult[v]; ok { + return s + } + return "Result(" + strconv.FormatInt(int64(v), 10) + ")" +} diff --git a/pkg/fbs/comm/osci/fbtypes/influxDB.go b/pkg/fbs/comm/osci/fbtypes/influxDB.go new file mode 100644 index 0000000..1cd21ed --- /dev/null +++ b/pkg/fbs/comm/osci/fbtypes/influxDB.go @@ -0,0 +1,150 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +type influxDBT struct { + Enable bool `json:"enable"` + Host string `json:"host"` + Organization string `json:"organization"` + Token string `json:"token"` + Bucket string `json:"bucket"` +} + +func (t *influxDBT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + hostOffset := flatbuffers.UOffsetT(0) + if t.Host != "" { + hostOffset = builder.CreateString(t.Host) + } + organizationOffset := flatbuffers.UOffsetT(0) + if t.Organization != "" { + organizationOffset = builder.CreateString(t.Organization) + } + tokenOffset := flatbuffers.UOffsetT(0) + if t.Token != "" { + tokenOffset = builder.CreateString(t.Token) + } + bucketOffset := flatbuffers.UOffsetT(0) + if t.Bucket != "" { + bucketOffset = builder.CreateString(t.Bucket) + } + influxDBStart(builder) + influxDBAddEnable(builder, t.Enable) + influxDBAddHost(builder, hostOffset) + influxDBAddOrganization(builder, organizationOffset) + influxDBAddToken(builder, tokenOffset) + influxDBAddBucket(builder, bucketOffset) + return influxDBEnd(builder) +} + +func (rcv *influxDB) UnPackTo(t *influxDBT) { + t.Enable = rcv.Enable() + t.Host = string(rcv.Host()) + t.Organization = string(rcv.Organization()) + t.Token = string(rcv.Token()) + t.Bucket = string(rcv.Bucket()) +} + +func (rcv *influxDB) UnPack() *influxDBT { + if rcv == nil { return nil } + t := &influxDBT{} + rcv.UnPackTo(t) + return t +} + +type influxDB struct { + _tab flatbuffers.Table +} + +func GetRootAsinfluxDB(buf []byte, offset flatbuffers.UOffsetT) *influxDB { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &influxDB{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsinfluxDB(buf []byte, offset flatbuffers.UOffsetT) *influxDB { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &influxDB{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *influxDB) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *influxDB) Table() flatbuffers.Table { + return rcv._tab +} + +func (rcv *influxDB) Enable() bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.GetBool(o + rcv._tab.Pos) + } + return false +} + +func (rcv *influxDB) MutateEnable(n bool) bool { + return rcv._tab.MutateBoolSlot(4, n) +} + +func (rcv *influxDB) Host() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func (rcv *influxDB) Organization() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func (rcv *influxDB) Token() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func (rcv *influxDB) Bucket() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func influxDBStart(builder *flatbuffers.Builder) { + builder.StartObject(5) +} +func influxDBAddEnable(builder *flatbuffers.Builder, enable bool) { + builder.PrependBoolSlot(0, enable, false) +} +func influxDBAddHost(builder *flatbuffers.Builder, host flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(host), 0) +} +func influxDBAddOrganization(builder *flatbuffers.Builder, organization flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(organization), 0) +} +func influxDBAddToken(builder *flatbuffers.Builder, token flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(token), 0) +} +func influxDBAddBucket(builder *flatbuffers.Builder, bucket flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(4, flatbuffers.UOffsetT(bucket), 0) +} +func influxDBEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/common/health/Sensor.go b/pkg/fbs/common/health/Sensor.go new file mode 100644 index 0000000..d35aa18 --- /dev/null +++ b/pkg/fbs/common/health/Sensor.go @@ -0,0 +1,162 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package health + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +type SensorT struct { + Name string `json:"name"` + Thresholds []*ThresholdT `json:"thresholds"` + CheckInterval int64 `json:"checkInterval"` + MddbPath string `json:"mddbPath"` +} + +func (t *SensorT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + thresholdsOffset := flatbuffers.UOffsetT(0) + if t.Thresholds != nil { + thresholdsLength := len(t.Thresholds) + thresholdsOffsets := make([]flatbuffers.UOffsetT, thresholdsLength) + for j := 0; j < thresholdsLength; j++ { + thresholdsOffsets[j] = t.Thresholds[j].Pack(builder) + } + SensorStartThresholdsVector(builder, thresholdsLength) + for j := thresholdsLength - 1; j >= 0; j-- { + builder.PrependUOffsetT(thresholdsOffsets[j]) + } + thresholdsOffset = builder.EndVector(thresholdsLength) + } + mddbPathOffset := flatbuffers.UOffsetT(0) + if t.MddbPath != "" { + mddbPathOffset = builder.CreateString(t.MddbPath) + } + SensorStart(builder) + SensorAddName(builder, nameOffset) + SensorAddThresholds(builder, thresholdsOffset) + SensorAddCheckInterval(builder, t.CheckInterval) + SensorAddMddbPath(builder, mddbPathOffset) + return SensorEnd(builder) +} + +func (rcv *Sensor) UnPackTo(t *SensorT) { + t.Name = string(rcv.Name()) + thresholdsLength := rcv.ThresholdsLength() + t.Thresholds = make([]*ThresholdT, thresholdsLength) + for j := 0; j < thresholdsLength; j++ { + x := Threshold{} + rcv.Thresholds(&x, j) + t.Thresholds[j] = x.UnPack() + } + t.CheckInterval = rcv.CheckInterval() + t.MddbPath = string(rcv.MddbPath()) +} + +func (rcv *Sensor) UnPack() *SensorT { + if rcv == nil { return nil } + t := &SensorT{} + rcv.UnPackTo(t) + return t +} + +type Sensor struct { + _tab flatbuffers.Table +} + +func GetRootAsSensor(buf []byte, offset flatbuffers.UOffsetT) *Sensor { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &Sensor{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsSensor(buf []byte, offset flatbuffers.UOffsetT) *Sensor { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &Sensor{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *Sensor) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *Sensor) Table() flatbuffers.Table { + return rcv._tab +} + +func (rcv *Sensor) Name() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func (rcv *Sensor) Thresholds(obj *Threshold, j int) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + x := rcv._tab.Vector(o) + x += flatbuffers.UOffsetT(j) * 4 + x = rcv._tab.Indirect(x) + obj.Init(rcv._tab.Bytes, x) + return true + } + return false +} + +func (rcv *Sensor) ThresholdsLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func (rcv *Sensor) CheckInterval() int64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return rcv._tab.GetInt64(o + rcv._tab.Pos) + } + return 0 +} + +func (rcv *Sensor) MutateCheckInterval(n int64) bool { + return rcv._tab.MutateInt64Slot(8, n) +} + +func (rcv *Sensor) MddbPath() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func SensorStart(builder *flatbuffers.Builder) { + builder.StartObject(4) +} +func SensorAddName(builder *flatbuffers.Builder, name flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(name), 0) +} +func SensorAddThresholds(builder *flatbuffers.Builder, thresholds flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(thresholds), 0) +} +func SensorStartThresholdsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} +func SensorAddCheckInterval(builder *flatbuffers.Builder, checkInterval int64) { + builder.PrependInt64Slot(2, checkInterval, 0) +} +func SensorAddMddbPath(builder *flatbuffers.Builder, mddbPath flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(mddbPath), 0) +} +func SensorEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/common/health/Threshold.go b/pkg/fbs/common/health/Threshold.go new file mode 100644 index 0000000..d699ca2 --- /dev/null +++ b/pkg/fbs/common/health/Threshold.go @@ -0,0 +1,114 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package health + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +type ThresholdT struct { + Value string `json:"value"` + MainDiagnosisCode string `json:"mainDiagnosisCode"` + DetailedDiagnosisCode string `json:"detailedDiagnosisCode"` +} + +func (t *ThresholdT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + valueOffset := flatbuffers.UOffsetT(0) + if t.Value != "" { + valueOffset = builder.CreateString(t.Value) + } + mainDiagnosisCodeOffset := flatbuffers.UOffsetT(0) + if t.MainDiagnosisCode != "" { + mainDiagnosisCodeOffset = builder.CreateString(t.MainDiagnosisCode) + } + detailedDiagnosisCodeOffset := flatbuffers.UOffsetT(0) + if t.DetailedDiagnosisCode != "" { + detailedDiagnosisCodeOffset = builder.CreateString(t.DetailedDiagnosisCode) + } + ThresholdStart(builder) + ThresholdAddValue(builder, valueOffset) + ThresholdAddMainDiagnosisCode(builder, mainDiagnosisCodeOffset) + ThresholdAddDetailedDiagnosisCode(builder, detailedDiagnosisCodeOffset) + return ThresholdEnd(builder) +} + +func (rcv *Threshold) UnPackTo(t *ThresholdT) { + t.Value = string(rcv.Value()) + t.MainDiagnosisCode = string(rcv.MainDiagnosisCode()) + t.DetailedDiagnosisCode = string(rcv.DetailedDiagnosisCode()) +} + +func (rcv *Threshold) UnPack() *ThresholdT { + if rcv == nil { return nil } + t := &ThresholdT{} + rcv.UnPackTo(t) + return t +} + +type Threshold struct { + _tab flatbuffers.Table +} + +func GetRootAsThreshold(buf []byte, offset flatbuffers.UOffsetT) *Threshold { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &Threshold{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsThreshold(buf []byte, offset flatbuffers.UOffsetT) *Threshold { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &Threshold{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *Threshold) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *Threshold) Table() flatbuffers.Table { + return rcv._tab +} + +func (rcv *Threshold) Value() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func (rcv *Threshold) MainDiagnosisCode() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func (rcv *Threshold) DetailedDiagnosisCode() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func ThresholdStart(builder *flatbuffers.Builder) { + builder.StartObject(3) +} +func ThresholdAddValue(builder *flatbuffers.Builder, value flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(value), 0) +} +func ThresholdAddMainDiagnosisCode(builder *flatbuffers.Builder, mainDiagnosisCode flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(mainDiagnosisCode), 0) +} +func ThresholdAddDetailedDiagnosisCode(builder *flatbuffers.Builder, detailedDiagnosisCode flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(detailedDiagnosisCode), 0) +} +func ThresholdEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/common/health/Thresholds.go b/pkg/fbs/common/health/Thresholds.go new file mode 100644 index 0000000..abd3979 --- /dev/null +++ b/pkg/fbs/common/health/Thresholds.go @@ -0,0 +1,108 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package health + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +type ThresholdsT struct { + Thresholds []*ThresholdT `json:"thresholds"` +} + +func (t *ThresholdsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + thresholdsOffset := flatbuffers.UOffsetT(0) + if t.Thresholds != nil { + thresholdsLength := len(t.Thresholds) + thresholdsOffsets := make([]flatbuffers.UOffsetT, thresholdsLength) + for j := 0; j < thresholdsLength; j++ { + thresholdsOffsets[j] = t.Thresholds[j].Pack(builder) + } + ThresholdsStartThresholdsVector(builder, thresholdsLength) + for j := thresholdsLength - 1; j >= 0; j-- { + builder.PrependUOffsetT(thresholdsOffsets[j]) + } + thresholdsOffset = builder.EndVector(thresholdsLength) + } + ThresholdsStart(builder) + ThresholdsAddThresholds(builder, thresholdsOffset) + return ThresholdsEnd(builder) +} + +func (rcv *Thresholds) UnPackTo(t *ThresholdsT) { + thresholdsLength := rcv.ThresholdsLength() + t.Thresholds = make([]*ThresholdT, thresholdsLength) + for j := 0; j < thresholdsLength; j++ { + x := Threshold{} + rcv.Thresholds(&x, j) + t.Thresholds[j] = x.UnPack() + } +} + +func (rcv *Thresholds) UnPack() *ThresholdsT { + if rcv == nil { return nil } + t := &ThresholdsT{} + rcv.UnPackTo(t) + return t +} + +type Thresholds struct { + _tab flatbuffers.Table +} + +func GetRootAsThresholds(buf []byte, offset flatbuffers.UOffsetT) *Thresholds { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &Thresholds{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsThresholds(buf []byte, offset flatbuffers.UOffsetT) *Thresholds { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &Thresholds{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *Thresholds) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *Thresholds) Table() flatbuffers.Table { + return rcv._tab +} + +func (rcv *Thresholds) Thresholds(obj *Threshold, j int) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Vector(o) + x += flatbuffers.UOffsetT(j) * 4 + x = rcv._tab.Indirect(x) + obj.Init(rcv._tab.Bytes, x) + return true + } + return false +} + +func (rcv *Thresholds) ThresholdsLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func ThresholdsStart(builder *flatbuffers.Builder) { + builder.StartObject(1) +} +func ThresholdsAddThresholds(builder *flatbuffers.Builder, thresholds flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(thresholds), 0) +} +func ThresholdsStartThresholdsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} +func ThresholdsEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/common/systemhandler/fbs/Component.go b/pkg/fbs/common/systemhandler/fbs/Component.go new file mode 100644 index 0000000..ffee5f5 --- /dev/null +++ b/pkg/fbs/common/systemhandler/fbs/Component.go @@ -0,0 +1,127 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbs + +import ( + flatbuffers "github.com/google/flatbuffers/go" + + comm__datalayer "github.com/boschrexroth/ctrlx-datalayer-golang/pkg/fbs/comm/datalayer" +) + +/// Information about the component +type ComponentT struct { + Name string `json:"name"` + State *StateT `json:"state"` + Metadata *comm__datalayer.MetadataT `json:"metadata"` +} + +func (t *ComponentT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + stateOffset := t.State.Pack(builder) + metadataOffset := t.Metadata.Pack(builder) + ComponentStart(builder) + ComponentAddName(builder, nameOffset) + ComponentAddState(builder, stateOffset) + ComponentAddMetadata(builder, metadataOffset) + return ComponentEnd(builder) +} + +func (rcv *Component) UnPackTo(t *ComponentT) { + t.Name = string(rcv.Name()) + t.State = rcv.State(nil).UnPack() + t.Metadata = rcv.Metadata(nil).UnPack() +} + +func (rcv *Component) UnPack() *ComponentT { + if rcv == nil { return nil } + t := &ComponentT{} + rcv.UnPackTo(t) + return t +} + +type Component struct { + _tab flatbuffers.Table +} + +func GetRootAsComponent(buf []byte, offset flatbuffers.UOffsetT) *Component { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &Component{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsComponent(buf []byte, offset flatbuffers.UOffsetT) *Component { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &Component{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *Component) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *Component) Table() flatbuffers.Table { + return rcv._tab +} + +/// Name of component, must be unique +func (rcv *Component) Name() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// Name of component, must be unique +/// Current state of component +func (rcv *Component) State(obj *State) *State { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + x := rcv._tab.Indirect(o + rcv._tab.Pos) + if obj == nil { + obj = new(State) + } + obj.Init(rcv._tab.Bytes, x) + return obj + } + return nil +} + +/// Current state of component +/// Metadata information about the Data Layer child node which will be created for the component +func (rcv *Component) Metadata(obj *comm__datalayer.Metadata) *comm__datalayer.Metadata { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + x := rcv._tab.Indirect(o + rcv._tab.Pos) + if obj == nil { + obj = new(comm__datalayer.Metadata) + } + obj.Init(rcv._tab.Bytes, x) + return obj + } + return nil +} + +/// Metadata information about the Data Layer child node which will be created for the component +func ComponentStart(builder *flatbuffers.Builder) { + builder.StartObject(3) +} +func ComponentAddName(builder *flatbuffers.Builder, name flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(name), 0) +} +func ComponentAddState(builder *flatbuffers.Builder, state flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(state), 0) +} +func ComponentAddMetadata(builder *flatbuffers.Builder, metadata flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(metadata), 0) +} +func ComponentEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/core/fbtypes/AxsCfgPosMode.go b/pkg/fbs/motion/core/fbtypes/AxsCfgPosMode.go new file mode 100644 index 0000000..abbb98f --- /dev/null +++ b/pkg/fbs/motion/core/fbtypes/AxsCfgPosMode.go @@ -0,0 +1,101 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// configuration for position mode function parameters for a single axis +type AxsCfgPosModeT struct { + TargetPosWindowModulo float64 `json:"targetPosWindowModulo"` + TargetPosWindowModuloUnit string `json:"targetPosWindowModuloUnit"` +} + +func (t *AxsCfgPosModeT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + targetPosWindowModuloUnitOffset := flatbuffers.UOffsetT(0) + if t.TargetPosWindowModuloUnit != "" { + targetPosWindowModuloUnitOffset = builder.CreateString(t.TargetPosWindowModuloUnit) + } + AxsCfgPosModeStart(builder) + AxsCfgPosModeAddTargetPosWindowModulo(builder, t.TargetPosWindowModulo) + AxsCfgPosModeAddTargetPosWindowModuloUnit(builder, targetPosWindowModuloUnitOffset) + return AxsCfgPosModeEnd(builder) +} + +func (rcv *AxsCfgPosMode) UnPackTo(t *AxsCfgPosModeT) { + t.TargetPosWindowModulo = rcv.TargetPosWindowModulo() + t.TargetPosWindowModuloUnit = string(rcv.TargetPosWindowModuloUnit()) +} + +func (rcv *AxsCfgPosMode) UnPack() *AxsCfgPosModeT { + if rcv == nil { return nil } + t := &AxsCfgPosModeT{} + rcv.UnPackTo(t) + return t +} + +type AxsCfgPosMode struct { + _tab flatbuffers.Table +} + +func GetRootAsAxsCfgPosMode(buf []byte, offset flatbuffers.UOffsetT) *AxsCfgPosMode { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &AxsCfgPosMode{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsAxsCfgPosMode(buf []byte, offset flatbuffers.UOffsetT) *AxsCfgPosMode { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &AxsCfgPosMode{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *AxsCfgPosMode) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *AxsCfgPosMode) Table() flatbuffers.Table { + return rcv._tab +} + +/// the target position window for modulo axes (modulo axes always use shortest way, when inside this window) +func (rcv *AxsCfgPosMode) TargetPosWindowModulo() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// the target position window for modulo axes (modulo axes always use shortest way, when inside this window) +func (rcv *AxsCfgPosMode) MutateTargetPosWindowModulo(n float64) bool { + return rcv._tab.MutateFloat64Slot(4, n) +} + +/// unit of the target position window for modulo axes +func (rcv *AxsCfgPosMode) TargetPosWindowModuloUnit() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// unit of the target position window for modulo axes +func AxsCfgPosModeStart(builder *flatbuffers.Builder) { + builder.StartObject(2) +} +func AxsCfgPosModeAddTargetPosWindowModulo(builder *flatbuffers.Builder, targetPosWindowModulo float64) { + builder.PrependFloat64Slot(0, targetPosWindowModulo, 0.0) +} +func AxsCfgPosModeAddTargetPosWindowModuloUnit(builder *flatbuffers.Builder, targetPosWindowModuloUnit flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(targetPosWindowModuloUnit), 0) +} +func AxsCfgPosModeEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/core/fbtypes/CmdPosAbsDir.go b/pkg/fbs/motion/core/fbtypes/CmdPosAbsDir.go new file mode 100644 index 0000000..65f9f16 --- /dev/null +++ b/pkg/fbs/motion/core/fbtypes/CmdPosAbsDir.go @@ -0,0 +1,41 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import "strconv" + +/// Selected direction for PosAbs with modulo axis +type CmdPosAbsDir int8 + +const ( + /// use shortest way to reach target position + CmdPosAbsDirSHORTEST_WAY CmdPosAbsDir = 0 + /// move only in positive direction to reach target position + CmdPosAbsDirPOSITIVE_DIR CmdPosAbsDir = 1 + /// move only in negative direction to reach target position + CmdPosAbsDirNEGATIVE_DIR CmdPosAbsDir = 2 + /// when currently moving: continue to move in this direction to reach target position; + /// when in stand still: use SHORTEST_WAY + CmdPosAbsDirCURRENT_DIR CmdPosAbsDir = 3 +) + +var EnumNamesCmdPosAbsDir = map[CmdPosAbsDir]string{ + CmdPosAbsDirSHORTEST_WAY: "SHORTEST_WAY", + CmdPosAbsDirPOSITIVE_DIR: "POSITIVE_DIR", + CmdPosAbsDirNEGATIVE_DIR: "NEGATIVE_DIR", + CmdPosAbsDirCURRENT_DIR: "CURRENT_DIR", +} + +var EnumValuesCmdPosAbsDir = map[string]CmdPosAbsDir{ + "SHORTEST_WAY": CmdPosAbsDirSHORTEST_WAY, + "POSITIVE_DIR": CmdPosAbsDirPOSITIVE_DIR, + "NEGATIVE_DIR": CmdPosAbsDirNEGATIVE_DIR, + "CURRENT_DIR": CmdPosAbsDirCURRENT_DIR, +} + +func (v CmdPosAbsDir) String() string { + if s, ok := EnumNamesCmdPosAbsDir[v]; ok { + return s + } + return "CmdPosAbsDir(" + strconv.FormatInt(int64(v), 10) + ")" +} diff --git a/pkg/fbs/motion/core/fbtypes/KinCfgSingularity.go b/pkg/fbs/motion/core/fbtypes/KinCfgSingularity.go new file mode 100644 index 0000000..a57a461 --- /dev/null +++ b/pkg/fbs/motion/core/fbtypes/KinCfgSingularity.go @@ -0,0 +1,101 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// configuration for singularity handling +type KinCfgSingularityT struct { + Epsilon float64 `json:"epsilon"` + EpsilonUnit string `json:"epsilonUnit"` +} + +func (t *KinCfgSingularityT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + epsilonUnitOffset := flatbuffers.UOffsetT(0) + if t.EpsilonUnit != "" { + epsilonUnitOffset = builder.CreateString(t.EpsilonUnit) + } + KinCfgSingularityStart(builder) + KinCfgSingularityAddEpsilon(builder, t.Epsilon) + KinCfgSingularityAddEpsilonUnit(builder, epsilonUnitOffset) + return KinCfgSingularityEnd(builder) +} + +func (rcv *KinCfgSingularity) UnPackTo(t *KinCfgSingularityT) { + t.Epsilon = rcv.Epsilon() + t.EpsilonUnit = string(rcv.EpsilonUnit()) +} + +func (rcv *KinCfgSingularity) UnPack() *KinCfgSingularityT { + if rcv == nil { return nil } + t := &KinCfgSingularityT{} + rcv.UnPackTo(t) + return t +} + +type KinCfgSingularity struct { + _tab flatbuffers.Table +} + +func GetRootAsKinCfgSingularity(buf []byte, offset flatbuffers.UOffsetT) *KinCfgSingularity { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &KinCfgSingularity{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsKinCfgSingularity(buf []byte, offset flatbuffers.UOffsetT) *KinCfgSingularity { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &KinCfgSingularity{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *KinCfgSingularity) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *KinCfgSingularity) Table() flatbuffers.Table { + return rcv._tab +} + +/// epsilon for singularity handling +func (rcv *KinCfgSingularity) Epsilon() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 10.0 +} + +/// epsilon for singularity handling +func (rcv *KinCfgSingularity) MutateEpsilon(n float64) bool { + return rcv._tab.MutateFloat64Slot(4, n) +} + +/// unit of the epsilon for singularity handling +func (rcv *KinCfgSingularity) EpsilonUnit() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// unit of the epsilon for singularity handling +func KinCfgSingularityStart(builder *flatbuffers.Builder) { + builder.StartObject(2) +} +func KinCfgSingularityAddEpsilon(builder *flatbuffers.Builder, epsilon float64) { + builder.PrependFloat64Slot(0, epsilon, 10.0) +} +func KinCfgSingularityAddEpsilonUnit(builder *flatbuffers.Builder, epsilonUnit flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(epsilonUnit), 0) +} +func KinCfgSingularityEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/core/fbtypes/KinStatePoseInfo.go b/pkg/fbs/motion/core/fbtypes/KinStatePoseInfo.go new file mode 100644 index 0000000..7fa1af7 --- /dev/null +++ b/pkg/fbs/motion/core/fbtypes/KinStatePoseInfo.go @@ -0,0 +1,166 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// Kinematics position information of the currently active command +type KinStatePoseInfoT struct { + AxisInfo []string `json:"axisInfo"` + PosCap string `json:"posCap"` + OriCap string `json:"oriCap"` + Cos string `json:"cos"` +} + +func (t *KinStatePoseInfoT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + axisInfoOffset := flatbuffers.UOffsetT(0) + if t.AxisInfo != nil { + axisInfoLength := len(t.AxisInfo) + axisInfoOffsets := make([]flatbuffers.UOffsetT, axisInfoLength) + for j := 0; j < axisInfoLength; j++ { + axisInfoOffsets[j] = builder.CreateString(t.AxisInfo[j]) + } + KinStatePoseInfoStartAxisInfoVector(builder, axisInfoLength) + for j := axisInfoLength - 1; j >= 0; j-- { + builder.PrependUOffsetT(axisInfoOffsets[j]) + } + axisInfoOffset = builder.EndVector(axisInfoLength) + } + posCapOffset := flatbuffers.UOffsetT(0) + if t.PosCap != "" { + posCapOffset = builder.CreateString(t.PosCap) + } + oriCapOffset := flatbuffers.UOffsetT(0) + if t.OriCap != "" { + oriCapOffset = builder.CreateString(t.OriCap) + } + cosOffset := flatbuffers.UOffsetT(0) + if t.Cos != "" { + cosOffset = builder.CreateString(t.Cos) + } + KinStatePoseInfoStart(builder) + KinStatePoseInfoAddAxisInfo(builder, axisInfoOffset) + KinStatePoseInfoAddPosCap(builder, posCapOffset) + KinStatePoseInfoAddOriCap(builder, oriCapOffset) + KinStatePoseInfoAddCos(builder, cosOffset) + return KinStatePoseInfoEnd(builder) +} + +func (rcv *KinStatePoseInfo) UnPackTo(t *KinStatePoseInfoT) { + axisInfoLength := rcv.AxisInfoLength() + t.AxisInfo = make([]string, axisInfoLength) + for j := 0; j < axisInfoLength; j++ { + t.AxisInfo[j] = string(rcv.AxisInfo(j)) + } + t.PosCap = string(rcv.PosCap()) + t.OriCap = string(rcv.OriCap()) + t.Cos = string(rcv.Cos()) +} + +func (rcv *KinStatePoseInfo) UnPack() *KinStatePoseInfoT { + if rcv == nil { return nil } + t := &KinStatePoseInfoT{} + rcv.UnPackTo(t) + return t +} + +type KinStatePoseInfo struct { + _tab flatbuffers.Table +} + +func GetRootAsKinStatePoseInfo(buf []byte, offset flatbuffers.UOffsetT) *KinStatePoseInfo { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &KinStatePoseInfo{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsKinStatePoseInfo(buf []byte, offset flatbuffers.UOffsetT) *KinStatePoseInfo { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &KinStatePoseInfo{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *KinStatePoseInfo) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *KinStatePoseInfo) Table() flatbuffers.Table { + return rcv._tab +} + +/// Type of the axis in the current position calculation of the kinematics, e.g. TRAFO_MEMBER +func (rcv *KinStatePoseInfo) AxisInfo(j int) []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.ByteVector(a + flatbuffers.UOffsetT(j*4)) + } + return nil +} + +func (rcv *KinStatePoseInfo) AxisInfoLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +/// Type of the axis in the current position calculation of the kinematics, e.g. TRAFO_MEMBER +/// Position capability of the active joint transformations, e.g. POS_3D +func (rcv *KinStatePoseInfo) PosCap() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// Position capability of the active joint transformations, e.g. POS_3D +/// Orientation capability of the active joint transformations, e.g. ORI_3D +func (rcv *KinStatePoseInfo) OriCap() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// Orientation capability of the active joint transformations, e.g. ORI_3D +/// Referring coordinate system, e.g. PCS +func (rcv *KinStatePoseInfo) Cos() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// Referring coordinate system, e.g. PCS +func KinStatePoseInfoStart(builder *flatbuffers.Builder) { + builder.StartObject(4) +} +func KinStatePoseInfoAddAxisInfo(builder *flatbuffers.Builder, axisInfo flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(axisInfo), 0) +} +func KinStatePoseInfoStartAxisInfoVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} +func KinStatePoseInfoAddPosCap(builder *flatbuffers.Builder, posCap flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(posCap), 0) +} +func KinStatePoseInfoAddOriCap(builder *flatbuffers.Builder, oriCap flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(oriCap), 0) +} +func KinStatePoseInfoAddCos(builder *flatbuffers.Builder, cos flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(cos), 0) +} +func KinStatePoseInfoEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/drivecmd/fbtypes/AxsCmdCtrlBasedHomingGantryData.go b/pkg/fbs/motion/drivecmd/fbtypes/AxsCmdCtrlBasedHomingGantryData.go new file mode 100644 index 0000000..4c6fd6d --- /dev/null +++ b/pkg/fbs/motion/drivecmd/fbtypes/AxsCmdCtrlBasedHomingGantryData.go @@ -0,0 +1,105 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// parameters of control based gantry homing +type AxsCmdCtrlBasedHomingGantryDataT struct { + HomingParam *HomingParamT `json:"homingParam"` + HomingSlaveParam *HomingSlaveParamAllT `json:"homingSlaveParam"` +} + +func (t *AxsCmdCtrlBasedHomingGantryDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + homingParamOffset := t.HomingParam.Pack(builder) + homingSlaveParamOffset := t.HomingSlaveParam.Pack(builder) + AxsCmdCtrlBasedHomingGantryDataStart(builder) + AxsCmdCtrlBasedHomingGantryDataAddHomingParam(builder, homingParamOffset) + AxsCmdCtrlBasedHomingGantryDataAddHomingSlaveParam(builder, homingSlaveParamOffset) + return AxsCmdCtrlBasedHomingGantryDataEnd(builder) +} + +func (rcv *AxsCmdCtrlBasedHomingGantryData) UnPackTo(t *AxsCmdCtrlBasedHomingGantryDataT) { + t.HomingParam = rcv.HomingParam(nil).UnPack() + t.HomingSlaveParam = rcv.HomingSlaveParam(nil).UnPack() +} + +func (rcv *AxsCmdCtrlBasedHomingGantryData) UnPack() *AxsCmdCtrlBasedHomingGantryDataT { + if rcv == nil { return nil } + t := &AxsCmdCtrlBasedHomingGantryDataT{} + rcv.UnPackTo(t) + return t +} + +type AxsCmdCtrlBasedHomingGantryData struct { + _tab flatbuffers.Table +} + +func GetRootAsAxsCmdCtrlBasedHomingGantryData(buf []byte, offset flatbuffers.UOffsetT) *AxsCmdCtrlBasedHomingGantryData { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &AxsCmdCtrlBasedHomingGantryData{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsAxsCmdCtrlBasedHomingGantryData(buf []byte, offset flatbuffers.UOffsetT) *AxsCmdCtrlBasedHomingGantryData { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &AxsCmdCtrlBasedHomingGantryData{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *AxsCmdCtrlBasedHomingGantryData) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *AxsCmdCtrlBasedHomingGantryData) Table() flatbuffers.Table { + return rcv._tab +} + +/// homing basic parameters +func (rcv *AxsCmdCtrlBasedHomingGantryData) HomingParam(obj *HomingParam) *HomingParam { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Indirect(o + rcv._tab.Pos) + if obj == nil { + obj = new(HomingParam) + } + obj.Init(rcv._tab.Bytes, x) + return obj + } + return nil +} + +/// homing basic parameters +/// slave axes parameters +func (rcv *AxsCmdCtrlBasedHomingGantryData) HomingSlaveParam(obj *HomingSlaveParamAll) *HomingSlaveParamAll { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + x := rcv._tab.Indirect(o + rcv._tab.Pos) + if obj == nil { + obj = new(HomingSlaveParamAll) + } + obj.Init(rcv._tab.Bytes, x) + return obj + } + return nil +} + +/// slave axes parameters +func AxsCmdCtrlBasedHomingGantryDataStart(builder *flatbuffers.Builder) { + builder.StartObject(2) +} +func AxsCmdCtrlBasedHomingGantryDataAddHomingParam(builder *flatbuffers.Builder, homingParam flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(homingParam), 0) +} +func AxsCmdCtrlBasedHomingGantryDataAddHomingSlaveParam(builder *flatbuffers.Builder, homingSlaveParam flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(homingSlaveParam), 0) +} +func AxsCmdCtrlBasedHomingGantryDataEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/drivecmd/fbtypes/AxsCmdFixedstopData.go b/pkg/fbs/motion/drivecmd/fbtypes/AxsCmdFixedstopData.go new file mode 100644 index 0000000..73b886a --- /dev/null +++ b/pkg/fbs/motion/drivecmd/fbtypes/AxsCmdFixedstopData.go @@ -0,0 +1,145 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" + + motion__core__fbtypes "github.com/boschrexroth/ctrlx-datalayer-golang/pkg/fbs/motion/core/fbtypes" +) + +/// parameters of the axis position commands +type AxsCmdFixedstopDataT struct { + Buffered bool `json:"buffered"` + AxsPos float64 `json:"axsPos"` + MaxTrq float64 `json:"maxTrq"` + Lim *motion__core__fbtypes.DynamicLimitsT `json:"lim"` +} + +func (t *AxsCmdFixedstopDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + limOffset := t.Lim.Pack(builder) + AxsCmdFixedstopDataStart(builder) + AxsCmdFixedstopDataAddBuffered(builder, t.Buffered) + AxsCmdFixedstopDataAddAxsPos(builder, t.AxsPos) + AxsCmdFixedstopDataAddMaxTrq(builder, t.MaxTrq) + AxsCmdFixedstopDataAddLim(builder, limOffset) + return AxsCmdFixedstopDataEnd(builder) +} + +func (rcv *AxsCmdFixedstopData) UnPackTo(t *AxsCmdFixedstopDataT) { + t.Buffered = rcv.Buffered() + t.AxsPos = rcv.AxsPos() + t.MaxTrq = rcv.MaxTrq() + t.Lim = rcv.Lim(nil).UnPack() +} + +func (rcv *AxsCmdFixedstopData) UnPack() *AxsCmdFixedstopDataT { + if rcv == nil { return nil } + t := &AxsCmdFixedstopDataT{} + rcv.UnPackTo(t) + return t +} + +type AxsCmdFixedstopData struct { + _tab flatbuffers.Table +} + +func GetRootAsAxsCmdFixedstopData(buf []byte, offset flatbuffers.UOffsetT) *AxsCmdFixedstopData { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &AxsCmdFixedstopData{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsAxsCmdFixedstopData(buf []byte, offset flatbuffers.UOffsetT) *AxsCmdFixedstopData { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &AxsCmdFixedstopData{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *AxsCmdFixedstopData) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *AxsCmdFixedstopData) Table() flatbuffers.Table { + return rcv._tab +} + +/// buffered type for generic command +func (rcv *AxsCmdFixedstopData) Buffered() bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.GetBool(o + rcv._tab.Pos) + } + return false +} + +/// buffered type for generic command +func (rcv *AxsCmdFixedstopData) MutateBuffered(n bool) bool { + return rcv._tab.MutateBoolSlot(4, n) +} + +/// commanded target position (or increment for relative position command) +func (rcv *AxsCmdFixedstopData) AxsPos() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// commanded target position (or increment for relative position command) +func (rcv *AxsCmdFixedstopData) MutateAxsPos(n float64) bool { + return rcv._tab.MutateFloat64Slot(6, n) +} + +/// commanded force / torque limitation +func (rcv *AxsCmdFixedstopData) MaxTrq() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// commanded force / torque limitation +func (rcv *AxsCmdFixedstopData) MutateMaxTrq(n float64) bool { + return rcv._tab.MutateFloat64Slot(8, n) +} + +/// dynamic limits for the motion of this command +func (rcv *AxsCmdFixedstopData) Lim(obj *motion__core__fbtypes.DynamicLimits) *motion__core__fbtypes.DynamicLimits { + o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) + if o != 0 { + x := rcv._tab.Indirect(o + rcv._tab.Pos) + if obj == nil { + obj = new(motion__core__fbtypes.DynamicLimits) + } + obj.Init(rcv._tab.Bytes, x) + return obj + } + return nil +} + +/// dynamic limits for the motion of this command +func AxsCmdFixedstopDataStart(builder *flatbuffers.Builder) { + builder.StartObject(4) +} +func AxsCmdFixedstopDataAddBuffered(builder *flatbuffers.Builder, buffered bool) { + builder.PrependBoolSlot(0, buffered, false) +} +func AxsCmdFixedstopDataAddAxsPos(builder *flatbuffers.Builder, axsPos float64) { + builder.PrependFloat64Slot(1, axsPos, 0.0) +} +func AxsCmdFixedstopDataAddMaxTrq(builder *flatbuffers.Builder, maxTrq float64) { + builder.PrependFloat64Slot(2, maxTrq, 0.0) +} +func AxsCmdFixedstopDataAddLim(builder *flatbuffers.Builder, lim flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(lim), 0) +} +func AxsCmdFixedstopDataEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/drivecmd/fbtypes/AxsCmdHomingData.go b/pkg/fbs/motion/drivecmd/fbtypes/AxsCmdHomingData.go new file mode 100644 index 0000000..ae230a6 --- /dev/null +++ b/pkg/fbs/motion/drivecmd/fbtypes/AxsCmdHomingData.go @@ -0,0 +1,101 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// parameters of the axis position commands +type AxsCmdHomingDataT struct { + Buffered bool `json:"buffered"` + NewRefPos float64 `json:"newRefPos"` +} + +func (t *AxsCmdHomingDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + AxsCmdHomingDataStart(builder) + AxsCmdHomingDataAddBuffered(builder, t.Buffered) + AxsCmdHomingDataAddNewRefPos(builder, t.NewRefPos) + return AxsCmdHomingDataEnd(builder) +} + +func (rcv *AxsCmdHomingData) UnPackTo(t *AxsCmdHomingDataT) { + t.Buffered = rcv.Buffered() + t.NewRefPos = rcv.NewRefPos() +} + +func (rcv *AxsCmdHomingData) UnPack() *AxsCmdHomingDataT { + if rcv == nil { return nil } + t := &AxsCmdHomingDataT{} + rcv.UnPackTo(t) + return t +} + +type AxsCmdHomingData struct { + _tab flatbuffers.Table +} + +func GetRootAsAxsCmdHomingData(buf []byte, offset flatbuffers.UOffsetT) *AxsCmdHomingData { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &AxsCmdHomingData{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsAxsCmdHomingData(buf []byte, offset flatbuffers.UOffsetT) *AxsCmdHomingData { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &AxsCmdHomingData{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *AxsCmdHomingData) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *AxsCmdHomingData) Table() flatbuffers.Table { + return rcv._tab +} + +/// buffered type for generic command +func (rcv *AxsCmdHomingData) Buffered() bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.GetBool(o + rcv._tab.Pos) + } + return false +} + +/// buffered type for generic command +func (rcv *AxsCmdHomingData) MutateBuffered(n bool) bool { + return rcv._tab.MutateBoolSlot(4, n) +} + +/// commanded target position (or increment for relative position command) +func (rcv *AxsCmdHomingData) NewRefPos() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// commanded target position (or increment for relative position command) +func (rcv *AxsCmdHomingData) MutateNewRefPos(n float64) bool { + return rcv._tab.MutateFloat64Slot(6, n) +} + +func AxsCmdHomingDataStart(builder *flatbuffers.Builder) { + builder.StartObject(2) +} +func AxsCmdHomingDataAddBuffered(builder *flatbuffers.Builder, buffered bool) { + builder.PrependBoolSlot(0, buffered, false) +} +func AxsCmdHomingDataAddNewRefPos(builder *flatbuffers.Builder, newRefPos float64) { + builder.PrependFloat64Slot(1, newRefPos, 0.0) +} +func AxsCmdHomingDataEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/drivecmd/fbtypes/AxsCmdSetAbsPosData.go b/pkg/fbs/motion/drivecmd/fbtypes/AxsCmdSetAbsPosData.go new file mode 100644 index 0000000..db03f27 --- /dev/null +++ b/pkg/fbs/motion/drivecmd/fbtypes/AxsCmdSetAbsPosData.go @@ -0,0 +1,101 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// parameters of the axis position commands +type AxsCmdSetAbsPosDataT struct { + Buffered bool `json:"buffered"` + AxsPos float64 `json:"axsPos"` +} + +func (t *AxsCmdSetAbsPosDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + AxsCmdSetAbsPosDataStart(builder) + AxsCmdSetAbsPosDataAddBuffered(builder, t.Buffered) + AxsCmdSetAbsPosDataAddAxsPos(builder, t.AxsPos) + return AxsCmdSetAbsPosDataEnd(builder) +} + +func (rcv *AxsCmdSetAbsPosData) UnPackTo(t *AxsCmdSetAbsPosDataT) { + t.Buffered = rcv.Buffered() + t.AxsPos = rcv.AxsPos() +} + +func (rcv *AxsCmdSetAbsPosData) UnPack() *AxsCmdSetAbsPosDataT { + if rcv == nil { return nil } + t := &AxsCmdSetAbsPosDataT{} + rcv.UnPackTo(t) + return t +} + +type AxsCmdSetAbsPosData struct { + _tab flatbuffers.Table +} + +func GetRootAsAxsCmdSetAbsPosData(buf []byte, offset flatbuffers.UOffsetT) *AxsCmdSetAbsPosData { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &AxsCmdSetAbsPosData{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsAxsCmdSetAbsPosData(buf []byte, offset flatbuffers.UOffsetT) *AxsCmdSetAbsPosData { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &AxsCmdSetAbsPosData{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *AxsCmdSetAbsPosData) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *AxsCmdSetAbsPosData) Table() flatbuffers.Table { + return rcv._tab +} + +/// buffered type for generic command +func (rcv *AxsCmdSetAbsPosData) Buffered() bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.GetBool(o + rcv._tab.Pos) + } + return false +} + +/// buffered type for generic command +func (rcv *AxsCmdSetAbsPosData) MutateBuffered(n bool) bool { + return rcv._tab.MutateBoolSlot(4, n) +} + +/// commanded target position (or increment for relative position command) +func (rcv *AxsCmdSetAbsPosData) AxsPos() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// commanded target position (or increment for relative position command) +func (rcv *AxsCmdSetAbsPosData) MutateAxsPos(n float64) bool { + return rcv._tab.MutateFloat64Slot(6, n) +} + +func AxsCmdSetAbsPosDataStart(builder *flatbuffers.Builder) { + builder.StartObject(2) +} +func AxsCmdSetAbsPosDataAddBuffered(builder *flatbuffers.Builder, buffered bool) { + builder.PrependBoolSlot(0, buffered, false) +} +func AxsCmdSetAbsPosDataAddAxsPos(builder *flatbuffers.Builder, axsPos float64) { + builder.PrependFloat64Slot(1, axsPos, 0.0) +} +func AxsCmdSetAbsPosDataEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/drivecmd/fbtypes/CmdBufferType.go b/pkg/fbs/motion/drivecmd/fbtypes/CmdBufferType.go new file mode 100644 index 0000000..d1a97b2 --- /dev/null +++ b/pkg/fbs/motion/drivecmd/fbtypes/CmdBufferType.go @@ -0,0 +1,81 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// parameter defines the buffer type of generic command +type CmdBufferTypeT struct { + Buffered bool `json:"buffered"` +} + +func (t *CmdBufferTypeT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + CmdBufferTypeStart(builder) + CmdBufferTypeAddBuffered(builder, t.Buffered) + return CmdBufferTypeEnd(builder) +} + +func (rcv *CmdBufferType) UnPackTo(t *CmdBufferTypeT) { + t.Buffered = rcv.Buffered() +} + +func (rcv *CmdBufferType) UnPack() *CmdBufferTypeT { + if rcv == nil { return nil } + t := &CmdBufferTypeT{} + rcv.UnPackTo(t) + return t +} + +type CmdBufferType struct { + _tab flatbuffers.Table +} + +func GetRootAsCmdBufferType(buf []byte, offset flatbuffers.UOffsetT) *CmdBufferType { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &CmdBufferType{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsCmdBufferType(buf []byte, offset flatbuffers.UOffsetT) *CmdBufferType { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &CmdBufferType{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *CmdBufferType) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *CmdBufferType) Table() flatbuffers.Table { + return rcv._tab +} + +/// buffered type for generic command +func (rcv *CmdBufferType) Buffered() bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.GetBool(o + rcv._tab.Pos) + } + return false +} + +/// buffered type for generic command +func (rcv *CmdBufferType) MutateBuffered(n bool) bool { + return rcv._tab.MutateBoolSlot(4, n) +} + +func CmdBufferTypeStart(builder *flatbuffers.Builder) { + builder.StartObject(1) +} +func CmdBufferTypeAddBuffered(builder *flatbuffers.Builder, buffered bool) { + builder.PrependBoolSlot(0, buffered, false) +} +func CmdBufferTypeEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/drivecmd/fbtypes/HomingParam.go b/pkg/fbs/motion/drivecmd/fbtypes/HomingParam.go new file mode 100644 index 0000000..2776104 --- /dev/null +++ b/pkg/fbs/motion/drivecmd/fbtypes/HomingParam.go @@ -0,0 +1,207 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" + + motion__core__fbtypes "github.com/boschrexroth/ctrlx-datalayer-golang/pkg/fbs/motion/core/fbtypes" +) + +/// set of homing parameters +type HomingParamT struct { + NewRefPos float64 `json:"newRefPos"` + TravelDisLim float64 `json:"travelDisLim"` + HomingDir string `json:"homingDir"` + RefType RefType `json:"refType"` + DynForward *motion__core__fbtypes.DynamicLimitsT `json:"dynForward"` + DynBackward *motion__core__fbtypes.DynamicLimitsT `json:"dynBackward"` + RefMode RefMode `json:"refMode"` +} + +func (t *HomingParamT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + homingDirOffset := flatbuffers.UOffsetT(0) + if t.HomingDir != "" { + homingDirOffset = builder.CreateString(t.HomingDir) + } + dynForwardOffset := t.DynForward.Pack(builder) + dynBackwardOffset := t.DynBackward.Pack(builder) + HomingParamStart(builder) + HomingParamAddNewRefPos(builder, t.NewRefPos) + HomingParamAddTravelDisLim(builder, t.TravelDisLim) + HomingParamAddHomingDir(builder, homingDirOffset) + HomingParamAddRefType(builder, t.RefType) + HomingParamAddDynForward(builder, dynForwardOffset) + HomingParamAddDynBackward(builder, dynBackwardOffset) + HomingParamAddRefMode(builder, t.RefMode) + return HomingParamEnd(builder) +} + +func (rcv *HomingParam) UnPackTo(t *HomingParamT) { + t.NewRefPos = rcv.NewRefPos() + t.TravelDisLim = rcv.TravelDisLim() + t.HomingDir = string(rcv.HomingDir()) + t.RefType = rcv.RefType() + t.DynForward = rcv.DynForward(nil).UnPack() + t.DynBackward = rcv.DynBackward(nil).UnPack() + t.RefMode = rcv.RefMode() +} + +func (rcv *HomingParam) UnPack() *HomingParamT { + if rcv == nil { return nil } + t := &HomingParamT{} + rcv.UnPackTo(t) + return t +} + +type HomingParam struct { + _tab flatbuffers.Table +} + +func GetRootAsHomingParam(buf []byte, offset flatbuffers.UOffsetT) *HomingParam { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &HomingParam{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsHomingParam(buf []byte, offset flatbuffers.UOffsetT) *HomingParam { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &HomingParam{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *HomingParam) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *HomingParam) Table() flatbuffers.Table { + return rcv._tab +} + +/// commanded target position (or increment for relative position command +func (rcv *HomingParam) NewRefPos() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// commanded target position (or increment for relative position command +func (rcv *HomingParam) MutateNewRefPos(n float64) bool { + return rcv._tab.MutateFloat64Slot(4, n) +} + +/// max travel distance to search the reference switch +func (rcv *HomingParam) TravelDisLim() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// max travel distance to search the reference switch +func (rcv *HomingParam) MutateTravelDisLim(n float64) bool { + return rcv._tab.MutateFloat64Slot(6, n) +} + +/// homing direction +func (rcv *HomingParam) HomingDir() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// homing direction +/// reference type to indicates set which position as the reference position +func (rcv *HomingParam) RefType() RefType { + o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) + if o != 0 { + return RefType(rcv._tab.GetInt8(o + rcv._tab.Pos)) + } + return 0 +} + +/// reference type to indicates set which position as the reference position +func (rcv *HomingParam) MutateRefType(n RefType) bool { + return rcv._tab.MutateInt8Slot(10, int8(n)) +} + +/// dynamic limit to search the reference switch(fast velocity) +func (rcv *HomingParam) DynForward(obj *motion__core__fbtypes.DynamicLimits) *motion__core__fbtypes.DynamicLimits { + o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) + if o != 0 { + x := rcv._tab.Indirect(o + rcv._tab.Pos) + if obj == nil { + obj = new(motion__core__fbtypes.DynamicLimits) + } + obj.Init(rcv._tab.Bytes, x) + return obj + } + return nil +} + +/// dynamic limit to search the reference switch(fast velocity) +/// dynamic limit to move to reference switch(slow velocity) +func (rcv *HomingParam) DynBackward(obj *motion__core__fbtypes.DynamicLimits) *motion__core__fbtypes.DynamicLimits { + o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) + if o != 0 { + x := rcv._tab.Indirect(o + rcv._tab.Pos) + if obj == nil { + obj = new(motion__core__fbtypes.DynamicLimits) + } + obj.Init(rcv._tab.Bytes, x) + return obj + } + return nil +} + +/// dynamic limit to move to reference switch(slow velocity) +/// method of set new position +func (rcv *HomingParam) RefMode() RefMode { + o := flatbuffers.UOffsetT(rcv._tab.Offset(16)) + if o != 0 { + return RefMode(rcv._tab.GetInt8(o + rcv._tab.Pos)) + } + return 0 +} + +/// method of set new position +func (rcv *HomingParam) MutateRefMode(n RefMode) bool { + return rcv._tab.MutateInt8Slot(16, int8(n)) +} + +func HomingParamStart(builder *flatbuffers.Builder) { + builder.StartObject(7) +} +func HomingParamAddNewRefPos(builder *flatbuffers.Builder, newRefPos float64) { + builder.PrependFloat64Slot(0, newRefPos, 0.0) +} +func HomingParamAddTravelDisLim(builder *flatbuffers.Builder, travelDisLim float64) { + builder.PrependFloat64Slot(1, travelDisLim, 0.0) +} +func HomingParamAddHomingDir(builder *flatbuffers.Builder, homingDir flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(homingDir), 0) +} +func HomingParamAddRefType(builder *flatbuffers.Builder, refType RefType) { + builder.PrependInt8Slot(3, int8(refType), 0) +} +func HomingParamAddDynForward(builder *flatbuffers.Builder, dynForward flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(4, flatbuffers.UOffsetT(dynForward), 0) +} +func HomingParamAddDynBackward(builder *flatbuffers.Builder, dynBackward flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(5, flatbuffers.UOffsetT(dynBackward), 0) +} +func HomingParamAddRefMode(builder *flatbuffers.Builder, refMode RefMode) { + builder.PrependInt8Slot(6, int8(refMode), 0) +} +func HomingParamEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/drivecmd/fbtypes/HomingSlaveParamAll.go b/pkg/fbs/motion/drivecmd/fbtypes/HomingSlaveParamAll.go new file mode 100644 index 0000000..9499589 --- /dev/null +++ b/pkg/fbs/motion/drivecmd/fbtypes/HomingSlaveParamAll.go @@ -0,0 +1,111 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// configuration of all slave axes parameters +type HomingSlaveParamAllT struct { + HomingSlaveParamAll []*HomingSlaveParamSingleT `json:"homingSlaveParamAll"` +} + +func (t *HomingSlaveParamAllT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + homingSlaveParamAllOffset := flatbuffers.UOffsetT(0) + if t.HomingSlaveParamAll != nil { + homingSlaveParamAllLength := len(t.HomingSlaveParamAll) + homingSlaveParamAllOffsets := make([]flatbuffers.UOffsetT, homingSlaveParamAllLength) + for j := 0; j < homingSlaveParamAllLength; j++ { + homingSlaveParamAllOffsets[j] = t.HomingSlaveParamAll[j].Pack(builder) + } + HomingSlaveParamAllStartHomingSlaveParamAllVector(builder, homingSlaveParamAllLength) + for j := homingSlaveParamAllLength - 1; j >= 0; j-- { + builder.PrependUOffsetT(homingSlaveParamAllOffsets[j]) + } + homingSlaveParamAllOffset = builder.EndVector(homingSlaveParamAllLength) + } + HomingSlaveParamAllStart(builder) + HomingSlaveParamAllAddHomingSlaveParamAll(builder, homingSlaveParamAllOffset) + return HomingSlaveParamAllEnd(builder) +} + +func (rcv *HomingSlaveParamAll) UnPackTo(t *HomingSlaveParamAllT) { + homingSlaveParamAllLength := rcv.HomingSlaveParamAllLength() + t.HomingSlaveParamAll = make([]*HomingSlaveParamSingleT, homingSlaveParamAllLength) + for j := 0; j < homingSlaveParamAllLength; j++ { + x := HomingSlaveParamSingle{} + rcv.HomingSlaveParamAll(&x, j) + t.HomingSlaveParamAll[j] = x.UnPack() + } +} + +func (rcv *HomingSlaveParamAll) UnPack() *HomingSlaveParamAllT { + if rcv == nil { return nil } + t := &HomingSlaveParamAllT{} + rcv.UnPackTo(t) + return t +} + +type HomingSlaveParamAll struct { + _tab flatbuffers.Table +} + +func GetRootAsHomingSlaveParamAll(buf []byte, offset flatbuffers.UOffsetT) *HomingSlaveParamAll { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &HomingSlaveParamAll{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsHomingSlaveParamAll(buf []byte, offset flatbuffers.UOffsetT) *HomingSlaveParamAll { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &HomingSlaveParamAll{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *HomingSlaveParamAll) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *HomingSlaveParamAll) Table() flatbuffers.Table { + return rcv._tab +} + +/// vector of all slave parameters +func (rcv *HomingSlaveParamAll) HomingSlaveParamAll(obj *HomingSlaveParamSingle, j int) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Vector(o) + x += flatbuffers.UOffsetT(j) * 4 + x = rcv._tab.Indirect(x) + obj.Init(rcv._tab.Bytes, x) + return true + } + return false +} + +func (rcv *HomingSlaveParamAll) HomingSlaveParamAllLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +/// vector of all slave parameters +func HomingSlaveParamAllStart(builder *flatbuffers.Builder) { + builder.StartObject(1) +} +func HomingSlaveParamAllAddHomingSlaveParamAll(builder *flatbuffers.Builder, homingSlaveParamAll flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(homingSlaveParamAll), 0) +} +func HomingSlaveParamAllStartHomingSlaveParamAllVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} +func HomingSlaveParamAllEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/drivecmd/fbtypes/HomingSlaveParamSingle.go b/pkg/fbs/motion/drivecmd/fbtypes/HomingSlaveParamSingle.go new file mode 100644 index 0000000..7a0ee4d --- /dev/null +++ b/pkg/fbs/motion/drivecmd/fbtypes/HomingSlaveParamSingle.go @@ -0,0 +1,121 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +///slave axes parameter of control based gantry homing +type HomingSlaveParamSingleT struct { + SlaveId uint16 `json:"slaveId"` + NewRefPos float64 `json:"newRefPos"` + MarkerSel RefMarkerSel `json:"markerSel"` +} + +func (t *HomingSlaveParamSingleT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + HomingSlaveParamSingleStart(builder) + HomingSlaveParamSingleAddSlaveId(builder, t.SlaveId) + HomingSlaveParamSingleAddNewRefPos(builder, t.NewRefPos) + HomingSlaveParamSingleAddMarkerSel(builder, t.MarkerSel) + return HomingSlaveParamSingleEnd(builder) +} + +func (rcv *HomingSlaveParamSingle) UnPackTo(t *HomingSlaveParamSingleT) { + t.SlaveId = rcv.SlaveId() + t.NewRefPos = rcv.NewRefPos() + t.MarkerSel = rcv.MarkerSel() +} + +func (rcv *HomingSlaveParamSingle) UnPack() *HomingSlaveParamSingleT { + if rcv == nil { return nil } + t := &HomingSlaveParamSingleT{} + rcv.UnPackTo(t) + return t +} + +type HomingSlaveParamSingle struct { + _tab flatbuffers.Table +} + +func GetRootAsHomingSlaveParamSingle(buf []byte, offset flatbuffers.UOffsetT) *HomingSlaveParamSingle { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &HomingSlaveParamSingle{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsHomingSlaveParamSingle(buf []byte, offset flatbuffers.UOffsetT) *HomingSlaveParamSingle { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &HomingSlaveParamSingle{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *HomingSlaveParamSingle) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *HomingSlaveParamSingle) Table() flatbuffers.Table { + return rcv._tab +} + +///the id of slave axis +func (rcv *HomingSlaveParamSingle) SlaveId() uint16 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.GetUint16(o + rcv._tab.Pos) + } + return 0 +} + +///the id of slave axis +func (rcv *HomingSlaveParamSingle) MutateSlaveId(n uint16) bool { + return rcv._tab.MutateUint16Slot(4, n) +} + +///commanded reference position of slave axis +func (rcv *HomingSlaveParamSingle) NewRefPos() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +///commanded reference position of slave axis +func (rcv *HomingSlaveParamSingle) MutateNewRefPos(n float64) bool { + return rcv._tab.MutateFloat64Slot(6, n) +} + +///select which reference mark to set the reference position +func (rcv *HomingSlaveParamSingle) MarkerSel() RefMarkerSel { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return RefMarkerSel(rcv._tab.GetInt8(o + rcv._tab.Pos)) + } + return 0 +} + +///select which reference mark to set the reference position +func (rcv *HomingSlaveParamSingle) MutateMarkerSel(n RefMarkerSel) bool { + return rcv._tab.MutateInt8Slot(8, int8(n)) +} + +func HomingSlaveParamSingleStart(builder *flatbuffers.Builder) { + builder.StartObject(3) +} +func HomingSlaveParamSingleAddSlaveId(builder *flatbuffers.Builder, slaveId uint16) { + builder.PrependUint16Slot(0, slaveId, 0) +} +func HomingSlaveParamSingleAddNewRefPos(builder *flatbuffers.Builder, newRefPos float64) { + builder.PrependFloat64Slot(1, newRefPos, 0.0) +} +func HomingSlaveParamSingleAddMarkerSel(builder *flatbuffers.Builder, markerSel RefMarkerSel) { + builder.PrependInt8Slot(2, int8(markerSel), 0) +} +func HomingSlaveParamSingleEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/drivecmd/fbtypes/RefMarkerSel.go b/pkg/fbs/motion/drivecmd/fbtypes/RefMarkerSel.go new file mode 100644 index 0000000..1741ec8 --- /dev/null +++ b/pkg/fbs/motion/drivecmd/fbtypes/RefMarkerSel.go @@ -0,0 +1,29 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import "strconv" + +type RefMarkerSel int8 + +const ( + RefMarkerSelMASTER_SWITCH RefMarkerSel = 0 + RefMarkerSelSELF_SWITCH RefMarkerSel = 1 +) + +var EnumNamesRefMarkerSel = map[RefMarkerSel]string{ + RefMarkerSelMASTER_SWITCH: "MASTER_SWITCH", + RefMarkerSelSELF_SWITCH: "SELF_SWITCH", +} + +var EnumValuesRefMarkerSel = map[string]RefMarkerSel{ + "MASTER_SWITCH": RefMarkerSelMASTER_SWITCH, + "SELF_SWITCH": RefMarkerSelSELF_SWITCH, +} + +func (v RefMarkerSel) String() string { + if s, ok := EnumNamesRefMarkerSel[v]; ok { + return s + } + return "RefMarkerSel(" + strconv.FormatInt(int64(v), 10) + ")" +} diff --git a/pkg/fbs/motion/drivecmd/fbtypes/RefMode.go b/pkg/fbs/motion/drivecmd/fbtypes/RefMode.go new file mode 100644 index 0000000..de64094 --- /dev/null +++ b/pkg/fbs/motion/drivecmd/fbtypes/RefMode.go @@ -0,0 +1,33 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import "strconv" + +/// set new reference in driver or control or don't set new reference +type RefMode int8 + +const ( + RefModeSET_POS_DEVICE RefMode = 0 + RefModeSET_POS_PROFILE RefMode = 1 + RefModeSET_NONE RefMode = 2 +) + +var EnumNamesRefMode = map[RefMode]string{ + RefModeSET_POS_DEVICE: "SET_POS_DEVICE", + RefModeSET_POS_PROFILE: "SET_POS_PROFILE", + RefModeSET_NONE: "SET_NONE", +} + +var EnumValuesRefMode = map[string]RefMode{ + "SET_POS_DEVICE": RefModeSET_POS_DEVICE, + "SET_POS_PROFILE": RefModeSET_POS_PROFILE, + "SET_NONE": RefModeSET_NONE, +} + +func (v RefMode) String() string { + if s, ok := EnumNamesRefMode[v]; ok { + return s + } + return "RefMode(" + strconv.FormatInt(int64(v), 10) + ")" +} diff --git a/pkg/fbs/motion/drivecmd/fbtypes/RefType.go b/pkg/fbs/motion/drivecmd/fbtypes/RefType.go new file mode 100644 index 0000000..df7eb34 --- /dev/null +++ b/pkg/fbs/motion/drivecmd/fbtypes/RefType.go @@ -0,0 +1,30 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import "strconv" + +/// stop at stoped position or reference mark when reference end +type RefType int8 + +const ( + RefTypeSTOPPED_POS RefType = 0 + RefTypeMARKER_POS RefType = 1 +) + +var EnumNamesRefType = map[RefType]string{ + RefTypeSTOPPED_POS: "STOPPED_POS", + RefTypeMARKER_POS: "MARKER_POS", +} + +var EnumValuesRefType = map[string]RefType{ + "STOPPED_POS": RefTypeSTOPPED_POS, + "MARKER_POS": RefTypeMARKER_POS, +} + +func (v RefType) String() string { + if s, ok := EnumNamesRefType[v]; ok { + return s + } + return "RefType(" + strconv.FormatInt(int64(v), 10) + ")" +} diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCfgFlexProfileObj.go b/pkg/fbs/motion/sync/fbtypes/AxsCfgFlexProfileObj.go new file mode 100644 index 0000000..d9a3ce5 --- /dev/null +++ b/pkg/fbs/motion/sync/fbtypes/AxsCfgFlexProfileObj.go @@ -0,0 +1,111 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// configuration of a FlexProfile object +type AxsCfgFlexProfileObjT struct { + Profiles []*AxsCfgSingleFlexProfileT `json:"profiles"` +} + +func (t *AxsCfgFlexProfileObjT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + profilesOffset := flatbuffers.UOffsetT(0) + if t.Profiles != nil { + profilesLength := len(t.Profiles) + profilesOffsets := make([]flatbuffers.UOffsetT, profilesLength) + for j := 0; j < profilesLength; j++ { + profilesOffsets[j] = t.Profiles[j].Pack(builder) + } + AxsCfgFlexProfileObjStartProfilesVector(builder, profilesLength) + for j := profilesLength - 1; j >= 0; j-- { + builder.PrependUOffsetT(profilesOffsets[j]) + } + profilesOffset = builder.EndVector(profilesLength) + } + AxsCfgFlexProfileObjStart(builder) + AxsCfgFlexProfileObjAddProfiles(builder, profilesOffset) + return AxsCfgFlexProfileObjEnd(builder) +} + +func (rcv *AxsCfgFlexProfileObj) UnPackTo(t *AxsCfgFlexProfileObjT) { + profilesLength := rcv.ProfilesLength() + t.Profiles = make([]*AxsCfgSingleFlexProfileT, profilesLength) + for j := 0; j < profilesLength; j++ { + x := AxsCfgSingleFlexProfile{} + rcv.Profiles(&x, j) + t.Profiles[j] = x.UnPack() + } +} + +func (rcv *AxsCfgFlexProfileObj) UnPack() *AxsCfgFlexProfileObjT { + if rcv == nil { return nil } + t := &AxsCfgFlexProfileObjT{} + rcv.UnPackTo(t) + return t +} + +type AxsCfgFlexProfileObj struct { + _tab flatbuffers.Table +} + +func GetRootAsAxsCfgFlexProfileObj(buf []byte, offset flatbuffers.UOffsetT) *AxsCfgFlexProfileObj { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &AxsCfgFlexProfileObj{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsAxsCfgFlexProfileObj(buf []byte, offset flatbuffers.UOffsetT) *AxsCfgFlexProfileObj { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &AxsCfgFlexProfileObj{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *AxsCfgFlexProfileObj) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *AxsCfgFlexProfileObj) Table() flatbuffers.Table { + return rcv._tab +} + +/// configuration of single FlexProfiles +func (rcv *AxsCfgFlexProfileObj) Profiles(obj *AxsCfgSingleFlexProfile, j int) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Vector(o) + x += flatbuffers.UOffsetT(j) * 4 + x = rcv._tab.Indirect(x) + obj.Init(rcv._tab.Bytes, x) + return true + } + return false +} + +func (rcv *AxsCfgFlexProfileObj) ProfilesLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +/// configuration of single FlexProfiles +func AxsCfgFlexProfileObjStart(builder *flatbuffers.Builder) { + builder.StartObject(1) +} +func AxsCfgFlexProfileObjAddProfiles(builder *flatbuffers.Builder, profiles flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(profiles), 0) +} +func AxsCfgFlexProfileObjStartProfilesVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} +func AxsCfgFlexProfileObjEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCfgSingleFlexProfile.go b/pkg/fbs/motion/sync/fbtypes/AxsCfgSingleFlexProfile.go new file mode 100644 index 0000000..bf20178 --- /dev/null +++ b/pkg/fbs/motion/sync/fbtypes/AxsCfgSingleFlexProfile.go @@ -0,0 +1,221 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// configuration of a single FlexProfile +type AxsCfgSingleFlexProfileT struct { + Name string `json:"name"` + Segments []*CfgFlexProfileSegmentT `json:"segments"` + Events []*CfgFlexProfileEventT `json:"events"` + MasterAxsRefVel float64 `json:"masterAxsRefVel"` + CamBuilderProfileData string `json:"camBuilderProfileData"` +} + +func (t *AxsCfgSingleFlexProfileT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + segmentsOffset := flatbuffers.UOffsetT(0) + if t.Segments != nil { + segmentsLength := len(t.Segments) + segmentsOffsets := make([]flatbuffers.UOffsetT, segmentsLength) + for j := 0; j < segmentsLength; j++ { + segmentsOffsets[j] = t.Segments[j].Pack(builder) + } + AxsCfgSingleFlexProfileStartSegmentsVector(builder, segmentsLength) + for j := segmentsLength - 1; j >= 0; j-- { + builder.PrependUOffsetT(segmentsOffsets[j]) + } + segmentsOffset = builder.EndVector(segmentsLength) + } + eventsOffset := flatbuffers.UOffsetT(0) + if t.Events != nil { + eventsLength := len(t.Events) + eventsOffsets := make([]flatbuffers.UOffsetT, eventsLength) + for j := 0; j < eventsLength; j++ { + eventsOffsets[j] = t.Events[j].Pack(builder) + } + AxsCfgSingleFlexProfileStartEventsVector(builder, eventsLength) + for j := eventsLength - 1; j >= 0; j-- { + builder.PrependUOffsetT(eventsOffsets[j]) + } + eventsOffset = builder.EndVector(eventsLength) + } + camBuilderProfileDataOffset := flatbuffers.UOffsetT(0) + if t.CamBuilderProfileData != "" { + camBuilderProfileDataOffset = builder.CreateString(t.CamBuilderProfileData) + } + AxsCfgSingleFlexProfileStart(builder) + AxsCfgSingleFlexProfileAddName(builder, nameOffset) + AxsCfgSingleFlexProfileAddSegments(builder, segmentsOffset) + AxsCfgSingleFlexProfileAddEvents(builder, eventsOffset) + AxsCfgSingleFlexProfileAddMasterAxsRefVel(builder, t.MasterAxsRefVel) + AxsCfgSingleFlexProfileAddCamBuilderProfileData(builder, camBuilderProfileDataOffset) + return AxsCfgSingleFlexProfileEnd(builder) +} + +func (rcv *AxsCfgSingleFlexProfile) UnPackTo(t *AxsCfgSingleFlexProfileT) { + t.Name = string(rcv.Name()) + segmentsLength := rcv.SegmentsLength() + t.Segments = make([]*CfgFlexProfileSegmentT, segmentsLength) + for j := 0; j < segmentsLength; j++ { + x := CfgFlexProfileSegment{} + rcv.Segments(&x, j) + t.Segments[j] = x.UnPack() + } + eventsLength := rcv.EventsLength() + t.Events = make([]*CfgFlexProfileEventT, eventsLength) + for j := 0; j < eventsLength; j++ { + x := CfgFlexProfileEvent{} + rcv.Events(&x, j) + t.Events[j] = x.UnPack() + } + t.MasterAxsRefVel = rcv.MasterAxsRefVel() + t.CamBuilderProfileData = string(rcv.CamBuilderProfileData()) +} + +func (rcv *AxsCfgSingleFlexProfile) UnPack() *AxsCfgSingleFlexProfileT { + if rcv == nil { return nil } + t := &AxsCfgSingleFlexProfileT{} + rcv.UnPackTo(t) + return t +} + +type AxsCfgSingleFlexProfile struct { + _tab flatbuffers.Table +} + +func GetRootAsAxsCfgSingleFlexProfile(buf []byte, offset flatbuffers.UOffsetT) *AxsCfgSingleFlexProfile { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &AxsCfgSingleFlexProfile{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsAxsCfgSingleFlexProfile(buf []byte, offset flatbuffers.UOffsetT) *AxsCfgSingleFlexProfile { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &AxsCfgSingleFlexProfile{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *AxsCfgSingleFlexProfile) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *AxsCfgSingleFlexProfile) Table() flatbuffers.Table { + return rcv._tab +} + +/// name of the single FlexProfile +func (rcv *AxsCfgSingleFlexProfile) Name() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// name of the single FlexProfile +/// FlexProfile segment description +func (rcv *AxsCfgSingleFlexProfile) Segments(obj *CfgFlexProfileSegment, j int) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + x := rcv._tab.Vector(o) + x += flatbuffers.UOffsetT(j) * 4 + x = rcv._tab.Indirect(x) + obj.Init(rcv._tab.Bytes, x) + return true + } + return false +} + +func (rcv *AxsCfgSingleFlexProfile) SegmentsLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +/// FlexProfile segment description +/// FlexProfile event description +func (rcv *AxsCfgSingleFlexProfile) Events(obj *CfgFlexProfileEvent, j int) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + x := rcv._tab.Vector(o) + x += flatbuffers.UOffsetT(j) * 4 + x = rcv._tab.Indirect(x) + obj.Init(rcv._tab.Bytes, x) + return true + } + return false +} + +func (rcv *AxsCfgSingleFlexProfile) EventsLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +/// FlexProfile event description +/// master axis reference velocity. This value is mandatory when segments are written. +func (rcv *AxsCfgSingleFlexProfile) MasterAxsRefVel() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// master axis reference velocity. This value is mandatory when segments are written. +func (rcv *AxsCfgSingleFlexProfile) MutateMasterAxsRefVel(n float64) bool { + return rcv._tab.MutateFloat64Slot(10, n) +} + +/// cam builder data (profile specific) +func (rcv *AxsCfgSingleFlexProfile) CamBuilderProfileData() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// cam builder data (profile specific) +func AxsCfgSingleFlexProfileStart(builder *flatbuffers.Builder) { + builder.StartObject(5) +} +func AxsCfgSingleFlexProfileAddName(builder *flatbuffers.Builder, name flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(name), 0) +} +func AxsCfgSingleFlexProfileAddSegments(builder *flatbuffers.Builder, segments flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(segments), 0) +} +func AxsCfgSingleFlexProfileStartSegmentsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} +func AxsCfgSingleFlexProfileAddEvents(builder *flatbuffers.Builder, events flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(events), 0) +} +func AxsCfgSingleFlexProfileStartEventsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} +func AxsCfgSingleFlexProfileAddMasterAxsRefVel(builder *flatbuffers.Builder, masterAxsRefVel float64) { + builder.PrependFloat64Slot(3, masterAxsRefVel, 0.0) +} +func AxsCfgSingleFlexProfileAddCamBuilderProfileData(builder *flatbuffers.Builder, camBuilderProfileData flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(4, flatbuffers.UOffsetT(camBuilderProfileData), 0) +} +func AxsCfgSingleFlexProfileEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCmdFlexProfileData.go b/pkg/fbs/motion/sync/fbtypes/AxsCmdFlexProfileData.go new file mode 100644 index 0000000..e92720c --- /dev/null +++ b/pkg/fbs/motion/sync/fbtypes/AxsCmdFlexProfileData.go @@ -0,0 +1,163 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// parameters of the axis FlexProfile command +type AxsCmdFlexProfileDataT struct { + Master string `json:"master"` + SyncSource SyncSource `json:"syncSource"` + SyncDirection SyncDirection `json:"syncDirection"` + Parameters *AxsCmdFlexProfileParamsT `json:"parameters"` + Buffered bool `json:"buffered"` +} + +func (t *AxsCmdFlexProfileDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + masterOffset := flatbuffers.UOffsetT(0) + if t.Master != "" { + masterOffset = builder.CreateString(t.Master) + } + parametersOffset := t.Parameters.Pack(builder) + AxsCmdFlexProfileDataStart(builder) + AxsCmdFlexProfileDataAddMaster(builder, masterOffset) + AxsCmdFlexProfileDataAddSyncSource(builder, t.SyncSource) + AxsCmdFlexProfileDataAddSyncDirection(builder, t.SyncDirection) + AxsCmdFlexProfileDataAddParameters(builder, parametersOffset) + AxsCmdFlexProfileDataAddBuffered(builder, t.Buffered) + return AxsCmdFlexProfileDataEnd(builder) +} + +func (rcv *AxsCmdFlexProfileData) UnPackTo(t *AxsCmdFlexProfileDataT) { + t.Master = string(rcv.Master()) + t.SyncSource = rcv.SyncSource() + t.SyncDirection = rcv.SyncDirection() + t.Parameters = rcv.Parameters(nil).UnPack() + t.Buffered = rcv.Buffered() +} + +func (rcv *AxsCmdFlexProfileData) UnPack() *AxsCmdFlexProfileDataT { + if rcv == nil { return nil } + t := &AxsCmdFlexProfileDataT{} + rcv.UnPackTo(t) + return t +} + +type AxsCmdFlexProfileData struct { + _tab flatbuffers.Table +} + +func GetRootAsAxsCmdFlexProfileData(buf []byte, offset flatbuffers.UOffsetT) *AxsCmdFlexProfileData { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &AxsCmdFlexProfileData{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsAxsCmdFlexProfileData(buf []byte, offset flatbuffers.UOffsetT) *AxsCmdFlexProfileData { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &AxsCmdFlexProfileData{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *AxsCmdFlexProfileData) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *AxsCmdFlexProfileData) Table() flatbuffers.Table { + return rcv._tab +} + +/// name of the master axis +func (rcv *AxsCmdFlexProfileData) Master() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// name of the master axis +/// sync source (Setpoint) +func (rcv *AxsCmdFlexProfileData) SyncSource() SyncSource { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return SyncSource(rcv._tab.GetInt8(o + rcv._tab.Pos)) + } + return 0 +} + +/// sync source (Setpoint) +func (rcv *AxsCmdFlexProfileData) MutateSyncSource(n SyncSource) bool { + return rcv._tab.MutateInt8Slot(6, int8(n)) +} + +/// sync direction (ShortestPath) +func (rcv *AxsCmdFlexProfileData) SyncDirection() SyncDirection { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return SyncDirection(rcv._tab.GetInt8(o + rcv._tab.Pos)) + } + return 0 +} + +/// sync direction (ShortestPath) +func (rcv *AxsCmdFlexProfileData) MutateSyncDirection(n SyncDirection) bool { + return rcv._tab.MutateInt8Slot(8, int8(n)) +} + +/// FlexProfile parameters (master offset, slave offset, ratio numerator, ratio denominator, fine adjust, profileEntry, setSelection) +func (rcv *AxsCmdFlexProfileData) Parameters(obj *AxsCmdFlexProfileParams) *AxsCmdFlexProfileParams { + o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) + if o != 0 { + x := rcv._tab.Indirect(o + rcv._tab.Pos) + if obj == nil { + obj = new(AxsCmdFlexProfileParams) + } + obj.Init(rcv._tab.Bytes, x) + return obj + } + return nil +} + +/// FlexProfile parameters (master offset, slave offset, ratio numerator, ratio denominator, fine adjust, profileEntry, setSelection) +/// should this be a buffered command? +func (rcv *AxsCmdFlexProfileData) Buffered() bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) + if o != 0 { + return rcv._tab.GetBool(o + rcv._tab.Pos) + } + return false +} + +/// should this be a buffered command? +func (rcv *AxsCmdFlexProfileData) MutateBuffered(n bool) bool { + return rcv._tab.MutateBoolSlot(12, n) +} + +func AxsCmdFlexProfileDataStart(builder *flatbuffers.Builder) { + builder.StartObject(5) +} +func AxsCmdFlexProfileDataAddMaster(builder *flatbuffers.Builder, master flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(master), 0) +} +func AxsCmdFlexProfileDataAddSyncSource(builder *flatbuffers.Builder, syncSource SyncSource) { + builder.PrependInt8Slot(1, int8(syncSource), 0) +} +func AxsCmdFlexProfileDataAddSyncDirection(builder *flatbuffers.Builder, syncDirection SyncDirection) { + builder.PrependInt8Slot(2, int8(syncDirection), 0) +} +func AxsCmdFlexProfileDataAddParameters(builder *flatbuffers.Builder, parameters flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(parameters), 0) +} +func AxsCmdFlexProfileDataAddBuffered(builder *flatbuffers.Builder, buffered bool) { + builder.PrependBoolSlot(4, buffered, false) +} +func AxsCmdFlexProfileDataEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCmdFlexProfileDlParams.go b/pkg/fbs/motion/sync/fbtypes/AxsCmdFlexProfileDlParams.go new file mode 100644 index 0000000..b7a8da5 --- /dev/null +++ b/pkg/fbs/motion/sync/fbtypes/AxsCmdFlexProfileDlParams.go @@ -0,0 +1,281 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// FlexProfile calculation pipeline parameters, that are stored in the Datalayer RT, for the axis FlexProfileEx command +type AxsCmdFlexProfileDlParamsT struct { + SoiMasterOffsetDlIdx int32 `json:"soiMasterOffsetDlIdx"` + SoiMasterOffsetVelDlIdx int32 `json:"soiMasterOffsetVelDlIdx"` + SoiMasterOffsetAccDlIdx int32 `json:"soiMasterOffsetAccDlIdx"` + SoiSlaveOffsetDlIdx int32 `json:"soiSlaveOffsetDlIdx"` + SoiSlaveOffsetVelDlIdx int32 `json:"soiSlaveOffsetVelDlIdx"` + SoiSlaveOffsetAccDlIdx int32 `json:"soiSlaveOffsetAccDlIdx"` + FofMasterOffsetDlIdx int32 `json:"fofMasterOffsetDlIdx"` + FofMasterOffsetTimeConstantDlIdx int32 `json:"fofMasterOffsetTimeConstantDlIdx"` + FofSlaveOffsetDlIdx int32 `json:"fofSlaveOffsetDlIdx"` + FofSlaveOffsetTimeConstantDlIdx int32 `json:"fofSlaveOffsetTimeConstantDlIdx"` + FineAdjustDlIdx int32 `json:"fineAdjustDlIdx"` +} + +func (t *AxsCmdFlexProfileDlParamsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + AxsCmdFlexProfileDlParamsStart(builder) + AxsCmdFlexProfileDlParamsAddSoiMasterOffsetDlIdx(builder, t.SoiMasterOffsetDlIdx) + AxsCmdFlexProfileDlParamsAddSoiMasterOffsetVelDlIdx(builder, t.SoiMasterOffsetVelDlIdx) + AxsCmdFlexProfileDlParamsAddSoiMasterOffsetAccDlIdx(builder, t.SoiMasterOffsetAccDlIdx) + AxsCmdFlexProfileDlParamsAddSoiSlaveOffsetDlIdx(builder, t.SoiSlaveOffsetDlIdx) + AxsCmdFlexProfileDlParamsAddSoiSlaveOffsetVelDlIdx(builder, t.SoiSlaveOffsetVelDlIdx) + AxsCmdFlexProfileDlParamsAddSoiSlaveOffsetAccDlIdx(builder, t.SoiSlaveOffsetAccDlIdx) + AxsCmdFlexProfileDlParamsAddFofMasterOffsetDlIdx(builder, t.FofMasterOffsetDlIdx) + AxsCmdFlexProfileDlParamsAddFofMasterOffsetTimeConstantDlIdx(builder, t.FofMasterOffsetTimeConstantDlIdx) + AxsCmdFlexProfileDlParamsAddFofSlaveOffsetDlIdx(builder, t.FofSlaveOffsetDlIdx) + AxsCmdFlexProfileDlParamsAddFofSlaveOffsetTimeConstantDlIdx(builder, t.FofSlaveOffsetTimeConstantDlIdx) + AxsCmdFlexProfileDlParamsAddFineAdjustDlIdx(builder, t.FineAdjustDlIdx) + return AxsCmdFlexProfileDlParamsEnd(builder) +} + +func (rcv *AxsCmdFlexProfileDlParams) UnPackTo(t *AxsCmdFlexProfileDlParamsT) { + t.SoiMasterOffsetDlIdx = rcv.SoiMasterOffsetDlIdx() + t.SoiMasterOffsetVelDlIdx = rcv.SoiMasterOffsetVelDlIdx() + t.SoiMasterOffsetAccDlIdx = rcv.SoiMasterOffsetAccDlIdx() + t.SoiSlaveOffsetDlIdx = rcv.SoiSlaveOffsetDlIdx() + t.SoiSlaveOffsetVelDlIdx = rcv.SoiSlaveOffsetVelDlIdx() + t.SoiSlaveOffsetAccDlIdx = rcv.SoiSlaveOffsetAccDlIdx() + t.FofMasterOffsetDlIdx = rcv.FofMasterOffsetDlIdx() + t.FofMasterOffsetTimeConstantDlIdx = rcv.FofMasterOffsetTimeConstantDlIdx() + t.FofSlaveOffsetDlIdx = rcv.FofSlaveOffsetDlIdx() + t.FofSlaveOffsetTimeConstantDlIdx = rcv.FofSlaveOffsetTimeConstantDlIdx() + t.FineAdjustDlIdx = rcv.FineAdjustDlIdx() +} + +func (rcv *AxsCmdFlexProfileDlParams) UnPack() *AxsCmdFlexProfileDlParamsT { + if rcv == nil { return nil } + t := &AxsCmdFlexProfileDlParamsT{} + rcv.UnPackTo(t) + return t +} + +type AxsCmdFlexProfileDlParams struct { + _tab flatbuffers.Table +} + +func GetRootAsAxsCmdFlexProfileDlParams(buf []byte, offset flatbuffers.UOffsetT) *AxsCmdFlexProfileDlParams { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &AxsCmdFlexProfileDlParams{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsAxsCmdFlexProfileDlParams(buf []byte, offset flatbuffers.UOffsetT) *AxsCmdFlexProfileDlParams { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &AxsCmdFlexProfileDlParams{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *AxsCmdFlexProfileDlParams) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *AxsCmdFlexProfileDlParams) Table() flatbuffers.Table { + return rcv._tab +} + +/// data layer index of master offset target value, second order interpolated +func (rcv *AxsCmdFlexProfileDlParams) SoiMasterOffsetDlIdx() int32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.GetInt32(o + rcv._tab.Pos) + } + return -1 +} + +/// data layer index of master offset target value, second order interpolated +func (rcv *AxsCmdFlexProfileDlParams) MutateSoiMasterOffsetDlIdx(n int32) bool { + return rcv._tab.MutateInt32Slot(4, n) +} + +/// data layer index of master offset velocity constraint for second order interpolation +func (rcv *AxsCmdFlexProfileDlParams) SoiMasterOffsetVelDlIdx() int32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.GetInt32(o + rcv._tab.Pos) + } + return -1 +} + +/// data layer index of master offset velocity constraint for second order interpolation +func (rcv *AxsCmdFlexProfileDlParams) MutateSoiMasterOffsetVelDlIdx(n int32) bool { + return rcv._tab.MutateInt32Slot(6, n) +} + +/// data layer index of master offset acceleration constraint for second order interpolation +func (rcv *AxsCmdFlexProfileDlParams) SoiMasterOffsetAccDlIdx() int32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return rcv._tab.GetInt32(o + rcv._tab.Pos) + } + return -1 +} + +/// data layer index of master offset acceleration constraint for second order interpolation +func (rcv *AxsCmdFlexProfileDlParams) MutateSoiMasterOffsetAccDlIdx(n int32) bool { + return rcv._tab.MutateInt32Slot(8, n) +} + +/// data layer index of slave offset target value, second order interpolated +func (rcv *AxsCmdFlexProfileDlParams) SoiSlaveOffsetDlIdx() int32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) + if o != 0 { + return rcv._tab.GetInt32(o + rcv._tab.Pos) + } + return -1 +} + +/// data layer index of slave offset target value, second order interpolated +func (rcv *AxsCmdFlexProfileDlParams) MutateSoiSlaveOffsetDlIdx(n int32) bool { + return rcv._tab.MutateInt32Slot(10, n) +} + +/// data layer index of slave offset velocity constraint for second order interpolation +func (rcv *AxsCmdFlexProfileDlParams) SoiSlaveOffsetVelDlIdx() int32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) + if o != 0 { + return rcv._tab.GetInt32(o + rcv._tab.Pos) + } + return -1 +} + +/// data layer index of slave offset velocity constraint for second order interpolation +func (rcv *AxsCmdFlexProfileDlParams) MutateSoiSlaveOffsetVelDlIdx(n int32) bool { + return rcv._tab.MutateInt32Slot(12, n) +} + +/// data layer index of slave offset acceleration constraint for second order interpolation +func (rcv *AxsCmdFlexProfileDlParams) SoiSlaveOffsetAccDlIdx() int32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) + if o != 0 { + return rcv._tab.GetInt32(o + rcv._tab.Pos) + } + return -1 +} + +/// data layer index of slave offset acceleration constraint for second order interpolation +func (rcv *AxsCmdFlexProfileDlParams) MutateSoiSlaveOffsetAccDlIdx(n int32) bool { + return rcv._tab.MutateInt32Slot(14, n) +} + +/// data layer index of second master offset, first order filtered +func (rcv *AxsCmdFlexProfileDlParams) FofMasterOffsetDlIdx() int32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(16)) + if o != 0 { + return rcv._tab.GetInt32(o + rcv._tab.Pos) + } + return -1 +} + +/// data layer index of second master offset, first order filtered +func (rcv *AxsCmdFlexProfileDlParams) MutateFofMasterOffsetDlIdx(n int32) bool { + return rcv._tab.MutateInt32Slot(16, n) +} + +/// data layer index of time constant for change rate of fofMasterOffset +func (rcv *AxsCmdFlexProfileDlParams) FofMasterOffsetTimeConstantDlIdx() int32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(18)) + if o != 0 { + return rcv._tab.GetInt32(o + rcv._tab.Pos) + } + return -1 +} + +/// data layer index of time constant for change rate of fofMasterOffset +func (rcv *AxsCmdFlexProfileDlParams) MutateFofMasterOffsetTimeConstantDlIdx(n int32) bool { + return rcv._tab.MutateInt32Slot(18, n) +} + +/// data layer index of second slave offset, first order filtered +func (rcv *AxsCmdFlexProfileDlParams) FofSlaveOffsetDlIdx() int32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(20)) + if o != 0 { + return rcv._tab.GetInt32(o + rcv._tab.Pos) + } + return -1 +} + +/// data layer index of second slave offset, first order filtered +func (rcv *AxsCmdFlexProfileDlParams) MutateFofSlaveOffsetDlIdx(n int32) bool { + return rcv._tab.MutateInt32Slot(20, n) +} + +/// data layer index of time constant for change rate of fofSlaveOffset +func (rcv *AxsCmdFlexProfileDlParams) FofSlaveOffsetTimeConstantDlIdx() int32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(22)) + if o != 0 { + return rcv._tab.GetInt32(o + rcv._tab.Pos) + } + return -1 +} + +/// data layer index of time constant for change rate of fofSlaveOffset +func (rcv *AxsCmdFlexProfileDlParams) MutateFofSlaveOffsetTimeConstantDlIdx(n int32) bool { + return rcv._tab.MutateInt32Slot(22, n) +} + +/// data layer index of fine adjust percentage in addition to the commanded fine adjust +func (rcv *AxsCmdFlexProfileDlParams) FineAdjustDlIdx() int32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(24)) + if o != 0 { + return rcv._tab.GetInt32(o + rcv._tab.Pos) + } + return -1 +} + +/// data layer index of fine adjust percentage in addition to the commanded fine adjust +func (rcv *AxsCmdFlexProfileDlParams) MutateFineAdjustDlIdx(n int32) bool { + return rcv._tab.MutateInt32Slot(24, n) +} + +func AxsCmdFlexProfileDlParamsStart(builder *flatbuffers.Builder) { + builder.StartObject(11) +} +func AxsCmdFlexProfileDlParamsAddSoiMasterOffsetDlIdx(builder *flatbuffers.Builder, soiMasterOffsetDlIdx int32) { + builder.PrependInt32Slot(0, soiMasterOffsetDlIdx, -1) +} +func AxsCmdFlexProfileDlParamsAddSoiMasterOffsetVelDlIdx(builder *flatbuffers.Builder, soiMasterOffsetVelDlIdx int32) { + builder.PrependInt32Slot(1, soiMasterOffsetVelDlIdx, -1) +} +func AxsCmdFlexProfileDlParamsAddSoiMasterOffsetAccDlIdx(builder *flatbuffers.Builder, soiMasterOffsetAccDlIdx int32) { + builder.PrependInt32Slot(2, soiMasterOffsetAccDlIdx, -1) +} +func AxsCmdFlexProfileDlParamsAddSoiSlaveOffsetDlIdx(builder *flatbuffers.Builder, soiSlaveOffsetDlIdx int32) { + builder.PrependInt32Slot(3, soiSlaveOffsetDlIdx, -1) +} +func AxsCmdFlexProfileDlParamsAddSoiSlaveOffsetVelDlIdx(builder *flatbuffers.Builder, soiSlaveOffsetVelDlIdx int32) { + builder.PrependInt32Slot(4, soiSlaveOffsetVelDlIdx, -1) +} +func AxsCmdFlexProfileDlParamsAddSoiSlaveOffsetAccDlIdx(builder *flatbuffers.Builder, soiSlaveOffsetAccDlIdx int32) { + builder.PrependInt32Slot(5, soiSlaveOffsetAccDlIdx, -1) +} +func AxsCmdFlexProfileDlParamsAddFofMasterOffsetDlIdx(builder *flatbuffers.Builder, fofMasterOffsetDlIdx int32) { + builder.PrependInt32Slot(6, fofMasterOffsetDlIdx, -1) +} +func AxsCmdFlexProfileDlParamsAddFofMasterOffsetTimeConstantDlIdx(builder *flatbuffers.Builder, fofMasterOffsetTimeConstantDlIdx int32) { + builder.PrependInt32Slot(7, fofMasterOffsetTimeConstantDlIdx, -1) +} +func AxsCmdFlexProfileDlParamsAddFofSlaveOffsetDlIdx(builder *flatbuffers.Builder, fofSlaveOffsetDlIdx int32) { + builder.PrependInt32Slot(8, fofSlaveOffsetDlIdx, -1) +} +func AxsCmdFlexProfileDlParamsAddFofSlaveOffsetTimeConstantDlIdx(builder *flatbuffers.Builder, fofSlaveOffsetTimeConstantDlIdx int32) { + builder.PrependInt32Slot(9, fofSlaveOffsetTimeConstantDlIdx, -1) +} +func AxsCmdFlexProfileDlParamsAddFineAdjustDlIdx(builder *flatbuffers.Builder, fineAdjustDlIdx int32) { + builder.PrependInt32Slot(10, fineAdjustDlIdx, -1) +} +func AxsCmdFlexProfileDlParamsEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCmdFlexProfileExData.go b/pkg/fbs/motion/sync/fbtypes/AxsCmdFlexProfileExData.go new file mode 100644 index 0000000..5a34739 --- /dev/null +++ b/pkg/fbs/motion/sync/fbtypes/AxsCmdFlexProfileExData.go @@ -0,0 +1,185 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// parameters of the axis FlexProfileEx command +type AxsCmdFlexProfileExDataT struct { + Master string `json:"master"` + SyncSource SyncSource `json:"syncSource"` + SyncDirection SyncDirection `json:"syncDirection"` + Parameters *AxsCmdFlexProfileParamsT `json:"parameters"` + DlParameters *AxsCmdFlexProfileDlParamsT `json:"dlParameters"` + Buffered bool `json:"buffered"` +} + +func (t *AxsCmdFlexProfileExDataT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + masterOffset := flatbuffers.UOffsetT(0) + if t.Master != "" { + masterOffset = builder.CreateString(t.Master) + } + parametersOffset := t.Parameters.Pack(builder) + dlParametersOffset := t.DlParameters.Pack(builder) + AxsCmdFlexProfileExDataStart(builder) + AxsCmdFlexProfileExDataAddMaster(builder, masterOffset) + AxsCmdFlexProfileExDataAddSyncSource(builder, t.SyncSource) + AxsCmdFlexProfileExDataAddSyncDirection(builder, t.SyncDirection) + AxsCmdFlexProfileExDataAddParameters(builder, parametersOffset) + AxsCmdFlexProfileExDataAddDlParameters(builder, dlParametersOffset) + AxsCmdFlexProfileExDataAddBuffered(builder, t.Buffered) + return AxsCmdFlexProfileExDataEnd(builder) +} + +func (rcv *AxsCmdFlexProfileExData) UnPackTo(t *AxsCmdFlexProfileExDataT) { + t.Master = string(rcv.Master()) + t.SyncSource = rcv.SyncSource() + t.SyncDirection = rcv.SyncDirection() + t.Parameters = rcv.Parameters(nil).UnPack() + t.DlParameters = rcv.DlParameters(nil).UnPack() + t.Buffered = rcv.Buffered() +} + +func (rcv *AxsCmdFlexProfileExData) UnPack() *AxsCmdFlexProfileExDataT { + if rcv == nil { return nil } + t := &AxsCmdFlexProfileExDataT{} + rcv.UnPackTo(t) + return t +} + +type AxsCmdFlexProfileExData struct { + _tab flatbuffers.Table +} + +func GetRootAsAxsCmdFlexProfileExData(buf []byte, offset flatbuffers.UOffsetT) *AxsCmdFlexProfileExData { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &AxsCmdFlexProfileExData{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsAxsCmdFlexProfileExData(buf []byte, offset flatbuffers.UOffsetT) *AxsCmdFlexProfileExData { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &AxsCmdFlexProfileExData{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *AxsCmdFlexProfileExData) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *AxsCmdFlexProfileExData) Table() flatbuffers.Table { + return rcv._tab +} + +/// name of the master axis +func (rcv *AxsCmdFlexProfileExData) Master() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// name of the master axis +/// sync source (Setpoint) +func (rcv *AxsCmdFlexProfileExData) SyncSource() SyncSource { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return SyncSource(rcv._tab.GetInt8(o + rcv._tab.Pos)) + } + return 0 +} + +/// sync source (Setpoint) +func (rcv *AxsCmdFlexProfileExData) MutateSyncSource(n SyncSource) bool { + return rcv._tab.MutateInt8Slot(6, int8(n)) +} + +/// sync direction (ShortestPath) +func (rcv *AxsCmdFlexProfileExData) SyncDirection() SyncDirection { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return SyncDirection(rcv._tab.GetInt8(o + rcv._tab.Pos)) + } + return 0 +} + +/// sync direction (ShortestPath) +func (rcv *AxsCmdFlexProfileExData) MutateSyncDirection(n SyncDirection) bool { + return rcv._tab.MutateInt8Slot(8, int8(n)) +} + +/// FlexProfile parameters (master offset, slave offset, ratio numerator, ratio denominator, fine adjust, profileEntry, setSelection) +func (rcv *AxsCmdFlexProfileExData) Parameters(obj *AxsCmdFlexProfileParams) *AxsCmdFlexProfileParams { + o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) + if o != 0 { + x := rcv._tab.Indirect(o + rcv._tab.Pos) + if obj == nil { + obj = new(AxsCmdFlexProfileParams) + } + obj.Init(rcv._tab.Bytes, x) + return obj + } + return nil +} + +/// FlexProfile parameters (master offset, slave offset, ratio numerator, ratio denominator, fine adjust, profileEntry, setSelection) +/// FlexProfile data layer parameters +func (rcv *AxsCmdFlexProfileExData) DlParameters(obj *AxsCmdFlexProfileDlParams) *AxsCmdFlexProfileDlParams { + o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) + if o != 0 { + x := rcv._tab.Indirect(o + rcv._tab.Pos) + if obj == nil { + obj = new(AxsCmdFlexProfileDlParams) + } + obj.Init(rcv._tab.Bytes, x) + return obj + } + return nil +} + +/// FlexProfile data layer parameters +/// should this be a buffered command? +func (rcv *AxsCmdFlexProfileExData) Buffered() bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) + if o != 0 { + return rcv._tab.GetBool(o + rcv._tab.Pos) + } + return false +} + +/// should this be a buffered command? +func (rcv *AxsCmdFlexProfileExData) MutateBuffered(n bool) bool { + return rcv._tab.MutateBoolSlot(14, n) +} + +func AxsCmdFlexProfileExDataStart(builder *flatbuffers.Builder) { + builder.StartObject(6) +} +func AxsCmdFlexProfileExDataAddMaster(builder *flatbuffers.Builder, master flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(master), 0) +} +func AxsCmdFlexProfileExDataAddSyncSource(builder *flatbuffers.Builder, syncSource SyncSource) { + builder.PrependInt8Slot(1, int8(syncSource), 0) +} +func AxsCmdFlexProfileExDataAddSyncDirection(builder *flatbuffers.Builder, syncDirection SyncDirection) { + builder.PrependInt8Slot(2, int8(syncDirection), 0) +} +func AxsCmdFlexProfileExDataAddParameters(builder *flatbuffers.Builder, parameters flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(parameters), 0) +} +func AxsCmdFlexProfileExDataAddDlParameters(builder *flatbuffers.Builder, dlParameters flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(4, flatbuffers.UOffsetT(dlParameters), 0) +} +func AxsCmdFlexProfileExDataAddBuffered(builder *flatbuffers.Builder, buffered bool) { + builder.PrependBoolSlot(5, buffered, false) +} +func AxsCmdFlexProfileExDataEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/sync/fbtypes/AxsCmdFlexProfileParams.go b/pkg/fbs/motion/sync/fbtypes/AxsCmdFlexProfileParams.go new file mode 100644 index 0000000..ac28c54 --- /dev/null +++ b/pkg/fbs/motion/sync/fbtypes/AxsCmdFlexProfileParams.go @@ -0,0 +1,281 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// FlexProfile calculation pipeline parameters for the axis FlexProfile command +type AxsCmdFlexProfileParamsT struct { + MasterOffset float64 `json:"masterOffset"` + SlaveOffset float64 `json:"slaveOffset"` + RatioNumerator int32 `json:"ratioNumerator"` + RatioDenominator int32 `json:"ratioDenominator"` + FineAdjust float64 `json:"fineAdjust"` + ProfileEntry ProfileEntry `json:"profileEntry"` + Profile string `json:"profile"` + ProfileExecutionMode ProfileExecutionMode `json:"profileExecutionMode"` + SwitchPosition float64 `json:"switchPosition"` + SwitchProfileOnPos bool `json:"switchProfileOnPos"` + SwitchGearOnPos bool `json:"switchGearOnPos"` +} + +func (t *AxsCmdFlexProfileParamsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + profileOffset := flatbuffers.UOffsetT(0) + if t.Profile != "" { + profileOffset = builder.CreateString(t.Profile) + } + AxsCmdFlexProfileParamsStart(builder) + AxsCmdFlexProfileParamsAddMasterOffset(builder, t.MasterOffset) + AxsCmdFlexProfileParamsAddSlaveOffset(builder, t.SlaveOffset) + AxsCmdFlexProfileParamsAddRatioNumerator(builder, t.RatioNumerator) + AxsCmdFlexProfileParamsAddRatioDenominator(builder, t.RatioDenominator) + AxsCmdFlexProfileParamsAddFineAdjust(builder, t.FineAdjust) + AxsCmdFlexProfileParamsAddProfileEntry(builder, t.ProfileEntry) + AxsCmdFlexProfileParamsAddProfile(builder, profileOffset) + AxsCmdFlexProfileParamsAddProfileExecutionMode(builder, t.ProfileExecutionMode) + AxsCmdFlexProfileParamsAddSwitchPosition(builder, t.SwitchPosition) + AxsCmdFlexProfileParamsAddSwitchProfileOnPos(builder, t.SwitchProfileOnPos) + AxsCmdFlexProfileParamsAddSwitchGearOnPos(builder, t.SwitchGearOnPos) + return AxsCmdFlexProfileParamsEnd(builder) +} + +func (rcv *AxsCmdFlexProfileParams) UnPackTo(t *AxsCmdFlexProfileParamsT) { + t.MasterOffset = rcv.MasterOffset() + t.SlaveOffset = rcv.SlaveOffset() + t.RatioNumerator = rcv.RatioNumerator() + t.RatioDenominator = rcv.RatioDenominator() + t.FineAdjust = rcv.FineAdjust() + t.ProfileEntry = rcv.ProfileEntry() + t.Profile = string(rcv.Profile()) + t.ProfileExecutionMode = rcv.ProfileExecutionMode() + t.SwitchPosition = rcv.SwitchPosition() + t.SwitchProfileOnPos = rcv.SwitchProfileOnPos() + t.SwitchGearOnPos = rcv.SwitchGearOnPos() +} + +func (rcv *AxsCmdFlexProfileParams) UnPack() *AxsCmdFlexProfileParamsT { + if rcv == nil { return nil } + t := &AxsCmdFlexProfileParamsT{} + rcv.UnPackTo(t) + return t +} + +type AxsCmdFlexProfileParams struct { + _tab flatbuffers.Table +} + +func GetRootAsAxsCmdFlexProfileParams(buf []byte, offset flatbuffers.UOffsetT) *AxsCmdFlexProfileParams { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &AxsCmdFlexProfileParams{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsAxsCmdFlexProfileParams(buf []byte, offset flatbuffers.UOffsetT) *AxsCmdFlexProfileParams { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &AxsCmdFlexProfileParams{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *AxsCmdFlexProfileParams) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *AxsCmdFlexProfileParams) Table() flatbuffers.Table { + return rcv._tab +} + +/// master offset value +func (rcv *AxsCmdFlexProfileParams) MasterOffset() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// master offset value +func (rcv *AxsCmdFlexProfileParams) MutateMasterOffset(n float64) bool { + return rcv._tab.MutateFloat64Slot(4, n) +} + +/// slave offset value +func (rcv *AxsCmdFlexProfileParams) SlaveOffset() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// slave offset value +func (rcv *AxsCmdFlexProfileParams) MutateSlaveOffset(n float64) bool { + return rcv._tab.MutateFloat64Slot(6, n) +} + +/// ratio numerator value +func (rcv *AxsCmdFlexProfileParams) RatioNumerator() int32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return rcv._tab.GetInt32(o + rcv._tab.Pos) + } + return 1 +} + +/// ratio numerator value +func (rcv *AxsCmdFlexProfileParams) MutateRatioNumerator(n int32) bool { + return rcv._tab.MutateInt32Slot(8, n) +} + +/// ratio denominator value +func (rcv *AxsCmdFlexProfileParams) RatioDenominator() int32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) + if o != 0 { + return rcv._tab.GetInt32(o + rcv._tab.Pos) + } + return 1 +} + +/// ratio denominator value +func (rcv *AxsCmdFlexProfileParams) MutateRatioDenominator(n int32) bool { + return rcv._tab.MutateInt32Slot(10, n) +} + +/// fine adjust parameter +func (rcv *AxsCmdFlexProfileParams) FineAdjust() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// fine adjust parameter +func (rcv *AxsCmdFlexProfileParams) MutateFineAdjust(n float64) bool { + return rcv._tab.MutateFloat64Slot(12, n) +} + +/// profileEntry parameter e.g. SLAVE_CURRENT_MASTER_CURRENT +func (rcv *AxsCmdFlexProfileParams) ProfileEntry() ProfileEntry { + o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) + if o != 0 { + return ProfileEntry(rcv._tab.GetInt8(o + rcv._tab.Pos)) + } + return 1 +} + +/// profileEntry parameter e.g. SLAVE_CURRENT_MASTER_CURRENT +func (rcv *AxsCmdFlexProfileParams) MutateProfileEntry(n ProfileEntry) bool { + return rcv._tab.MutateInt8Slot(14, int8(n)) +} + +/// profile parameter e.g. "0", "1", "2", "3" +func (rcv *AxsCmdFlexProfileParams) Profile() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(16)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// profile parameter e.g. "0", "1", "2", "3" +/// profile execution mode e.g. CYCLIC or SINGLE +func (rcv *AxsCmdFlexProfileParams) ProfileExecutionMode() ProfileExecutionMode { + o := flatbuffers.UOffsetT(rcv._tab.Offset(18)) + if o != 0 { + return ProfileExecutionMode(rcv._tab.GetInt8(o + rcv._tab.Pos)) + } + return 0 +} + +/// profile execution mode e.g. CYCLIC or SINGLE +func (rcv *AxsCmdFlexProfileParams) MutateProfileExecutionMode(n ProfileExecutionMode) bool { + return rcv._tab.MutateInt8Slot(18, int8(n)) +} + +/// position that switches a FlexProfile +func (rcv *AxsCmdFlexProfileParams) SwitchPosition() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(20)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// position that switches a FlexProfile +func (rcv *AxsCmdFlexProfileParams) MutateSwitchPosition(n float64) bool { + return rcv._tab.MutateFloat64Slot(20, n) +} + +/// switch the profile on the switch position +func (rcv *AxsCmdFlexProfileParams) SwitchProfileOnPos() bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(22)) + if o != 0 { + return rcv._tab.GetBool(o + rcv._tab.Pos) + } + return false +} + +/// switch the profile on the switch position +func (rcv *AxsCmdFlexProfileParams) MutateSwitchProfileOnPos(n bool) bool { + return rcv._tab.MutateBoolSlot(22, n) +} + +/// switch the gear on the switch position +func (rcv *AxsCmdFlexProfileParams) SwitchGearOnPos() bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(24)) + if o != 0 { + return rcv._tab.GetBool(o + rcv._tab.Pos) + } + return false +} + +/// switch the gear on the switch position +func (rcv *AxsCmdFlexProfileParams) MutateSwitchGearOnPos(n bool) bool { + return rcv._tab.MutateBoolSlot(24, n) +} + +func AxsCmdFlexProfileParamsStart(builder *flatbuffers.Builder) { + builder.StartObject(11) +} +func AxsCmdFlexProfileParamsAddMasterOffset(builder *flatbuffers.Builder, masterOffset float64) { + builder.PrependFloat64Slot(0, masterOffset, 0.0) +} +func AxsCmdFlexProfileParamsAddSlaveOffset(builder *flatbuffers.Builder, slaveOffset float64) { + builder.PrependFloat64Slot(1, slaveOffset, 0.0) +} +func AxsCmdFlexProfileParamsAddRatioNumerator(builder *flatbuffers.Builder, ratioNumerator int32) { + builder.PrependInt32Slot(2, ratioNumerator, 1) +} +func AxsCmdFlexProfileParamsAddRatioDenominator(builder *flatbuffers.Builder, ratioDenominator int32) { + builder.PrependInt32Slot(3, ratioDenominator, 1) +} +func AxsCmdFlexProfileParamsAddFineAdjust(builder *flatbuffers.Builder, fineAdjust float64) { + builder.PrependFloat64Slot(4, fineAdjust, 0.0) +} +func AxsCmdFlexProfileParamsAddProfileEntry(builder *flatbuffers.Builder, profileEntry ProfileEntry) { + builder.PrependInt8Slot(5, int8(profileEntry), 1) +} +func AxsCmdFlexProfileParamsAddProfile(builder *flatbuffers.Builder, profile flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(6, flatbuffers.UOffsetT(profile), 0) +} +func AxsCmdFlexProfileParamsAddProfileExecutionMode(builder *flatbuffers.Builder, profileExecutionMode ProfileExecutionMode) { + builder.PrependInt8Slot(7, int8(profileExecutionMode), 0) +} +func AxsCmdFlexProfileParamsAddSwitchPosition(builder *flatbuffers.Builder, switchPosition float64) { + builder.PrependFloat64Slot(8, switchPosition, 0.0) +} +func AxsCmdFlexProfileParamsAddSwitchProfileOnPos(builder *flatbuffers.Builder, switchProfileOnPos bool) { + builder.PrependBoolSlot(9, switchProfileOnPos, false) +} +func AxsCmdFlexProfileParamsAddSwitchGearOnPos(builder *flatbuffers.Builder, switchGearOnPos bool) { + builder.PrependBoolSlot(10, switchGearOnPos, false) +} +func AxsCmdFlexProfileParamsEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/sync/fbtypes/AxsStateFlexProfileAllEvents.go b/pkg/fbs/motion/sync/fbtypes/AxsStateFlexProfileAllEvents.go new file mode 100644 index 0000000..b002be1 --- /dev/null +++ b/pkg/fbs/motion/sync/fbtypes/AxsStateFlexProfileAllEvents.go @@ -0,0 +1,101 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// state of triggered, signaled and active events +type AxsStateFlexProfileAllEventsT struct { + ConditionStatusMask uint64 `json:"conditionStatusMask"` + ConditionControlMask uint64 `json:"conditionControlMask"` +} + +func (t *AxsStateFlexProfileAllEventsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + AxsStateFlexProfileAllEventsStart(builder) + AxsStateFlexProfileAllEventsAddConditionStatusMask(builder, t.ConditionStatusMask) + AxsStateFlexProfileAllEventsAddConditionControlMask(builder, t.ConditionControlMask) + return AxsStateFlexProfileAllEventsEnd(builder) +} + +func (rcv *AxsStateFlexProfileAllEvents) UnPackTo(t *AxsStateFlexProfileAllEventsT) { + t.ConditionStatusMask = rcv.ConditionStatusMask() + t.ConditionControlMask = rcv.ConditionControlMask() +} + +func (rcv *AxsStateFlexProfileAllEvents) UnPack() *AxsStateFlexProfileAllEventsT { + if rcv == nil { return nil } + t := &AxsStateFlexProfileAllEventsT{} + rcv.UnPackTo(t) + return t +} + +type AxsStateFlexProfileAllEvents struct { + _tab flatbuffers.Table +} + +func GetRootAsAxsStateFlexProfileAllEvents(buf []byte, offset flatbuffers.UOffsetT) *AxsStateFlexProfileAllEvents { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &AxsStateFlexProfileAllEvents{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsAxsStateFlexProfileAllEvents(buf []byte, offset flatbuffers.UOffsetT) *AxsStateFlexProfileAllEvents { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &AxsStateFlexProfileAllEvents{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *AxsStateFlexProfileAllEvents) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *AxsStateFlexProfileAllEvents) Table() flatbuffers.Table { + return rcv._tab +} + +/// bit mask shows triggered and signaled events +func (rcv *AxsStateFlexProfileAllEvents) ConditionStatusMask() uint64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.GetUint64(o + rcv._tab.Pos) + } + return 0 +} + +/// bit mask shows triggered and signaled events +func (rcv *AxsStateFlexProfileAllEvents) MutateConditionStatusMask(n uint64) bool { + return rcv._tab.MutateUint64Slot(4, n) +} + +/// bit mask with active control events +func (rcv *AxsStateFlexProfileAllEvents) ConditionControlMask() uint64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.GetUint64(o + rcv._tab.Pos) + } + return 0 +} + +/// bit mask with active control events +func (rcv *AxsStateFlexProfileAllEvents) MutateConditionControlMask(n uint64) bool { + return rcv._tab.MutateUint64Slot(6, n) +} + +func AxsStateFlexProfileAllEventsStart(builder *flatbuffers.Builder) { + builder.StartObject(2) +} +func AxsStateFlexProfileAllEventsAddConditionStatusMask(builder *flatbuffers.Builder, conditionStatusMask uint64) { + builder.PrependUint64Slot(0, conditionStatusMask, 0) +} +func AxsStateFlexProfileAllEventsAddConditionControlMask(builder *flatbuffers.Builder, conditionControlMask uint64) { + builder.PrependUint64Slot(1, conditionControlMask, 0) +} +func AxsStateFlexProfileAllEventsEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/sync/fbtypes/AxsStateFlexProfileExecution.go b/pkg/fbs/motion/sync/fbtypes/AxsStateFlexProfileExecution.go new file mode 100644 index 0000000..89b27b5 --- /dev/null +++ b/pkg/fbs/motion/sync/fbtypes/AxsStateFlexProfileExecution.go @@ -0,0 +1,141 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// state information of the execution +type AxsStateFlexProfileExecutionT struct { + ActiveProfile string `json:"activeProfile"` + ActiveSegment uint32 `json:"activeSegment"` + WaitForSwitchPos bool `json:"waitForSwitchPos"` + SingleExecutionDone bool `json:"singleExecutionDone"` +} + +func (t *AxsStateFlexProfileExecutionT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + activeProfileOffset := flatbuffers.UOffsetT(0) + if t.ActiveProfile != "" { + activeProfileOffset = builder.CreateString(t.ActiveProfile) + } + AxsStateFlexProfileExecutionStart(builder) + AxsStateFlexProfileExecutionAddActiveProfile(builder, activeProfileOffset) + AxsStateFlexProfileExecutionAddActiveSegment(builder, t.ActiveSegment) + AxsStateFlexProfileExecutionAddWaitForSwitchPos(builder, t.WaitForSwitchPos) + AxsStateFlexProfileExecutionAddSingleExecutionDone(builder, t.SingleExecutionDone) + return AxsStateFlexProfileExecutionEnd(builder) +} + +func (rcv *AxsStateFlexProfileExecution) UnPackTo(t *AxsStateFlexProfileExecutionT) { + t.ActiveProfile = string(rcv.ActiveProfile()) + t.ActiveSegment = rcv.ActiveSegment() + t.WaitForSwitchPos = rcv.WaitForSwitchPos() + t.SingleExecutionDone = rcv.SingleExecutionDone() +} + +func (rcv *AxsStateFlexProfileExecution) UnPack() *AxsStateFlexProfileExecutionT { + if rcv == nil { return nil } + t := &AxsStateFlexProfileExecutionT{} + rcv.UnPackTo(t) + return t +} + +type AxsStateFlexProfileExecution struct { + _tab flatbuffers.Table +} + +func GetRootAsAxsStateFlexProfileExecution(buf []byte, offset flatbuffers.UOffsetT) *AxsStateFlexProfileExecution { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &AxsStateFlexProfileExecution{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsAxsStateFlexProfileExecution(buf []byte, offset flatbuffers.UOffsetT) *AxsStateFlexProfileExecution { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &AxsStateFlexProfileExecution{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *AxsStateFlexProfileExecution) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *AxsStateFlexProfileExecution) Table() flatbuffers.Table { + return rcv._tab +} + +/// currently active profile from the axis +func (rcv *AxsStateFlexProfileExecution) ActiveProfile() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// currently active profile from the axis +/// currently active segment of the profile from the axis +func (rcv *AxsStateFlexProfileExecution) ActiveSegment() uint32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.GetUint32(o + rcv._tab.Pos) + } + return 0 +} + +/// currently active segment of the profile from the axis +func (rcv *AxsStateFlexProfileExecution) MutateActiveSegment(n uint32) bool { + return rcv._tab.MutateUint32Slot(6, n) +} + +/// the profile is waiting for the specified switching position +func (rcv *AxsStateFlexProfileExecution) WaitForSwitchPos() bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return rcv._tab.GetBool(o + rcv._tab.Pos) + } + return false +} + +/// the profile is waiting for the specified switching position +func (rcv *AxsStateFlexProfileExecution) MutateWaitForSwitchPos(n bool) bool { + return rcv._tab.MutateBoolSlot(8, n) +} + +/// the one-time execution of the profile was completed (only for execution mode "SINGLE") +func (rcv *AxsStateFlexProfileExecution) SingleExecutionDone() bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) + if o != 0 { + return rcv._tab.GetBool(o + rcv._tab.Pos) + } + return false +} + +/// the one-time execution of the profile was completed (only for execution mode "SINGLE") +func (rcv *AxsStateFlexProfileExecution) MutateSingleExecutionDone(n bool) bool { + return rcv._tab.MutateBoolSlot(10, n) +} + +func AxsStateFlexProfileExecutionStart(builder *flatbuffers.Builder) { + builder.StartObject(4) +} +func AxsStateFlexProfileExecutionAddActiveProfile(builder *flatbuffers.Builder, activeProfile flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(activeProfile), 0) +} +func AxsStateFlexProfileExecutionAddActiveSegment(builder *flatbuffers.Builder, activeSegment uint32) { + builder.PrependUint32Slot(1, activeSegment, 0) +} +func AxsStateFlexProfileExecutionAddWaitForSwitchPos(builder *flatbuffers.Builder, waitForSwitchPos bool) { + builder.PrependBoolSlot(2, waitForSwitchPos, false) +} +func AxsStateFlexProfileExecutionAddSingleExecutionDone(builder *flatbuffers.Builder, singleExecutionDone bool) { + builder.PrependBoolSlot(3, singleExecutionDone, false) +} +func AxsStateFlexProfileExecutionEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/sync/fbtypes/AxsStateFlexProfileObj.go b/pkg/fbs/motion/sync/fbtypes/AxsStateFlexProfileObj.go new file mode 100644 index 0000000..bcbc063 --- /dev/null +++ b/pkg/fbs/motion/sync/fbtypes/AxsStateFlexProfileObj.go @@ -0,0 +1,155 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// state of a FlexProfile object +type AxsStateFlexProfileObjT struct { + Profiles []*AxsStateSingleFlexProfileT `json:"profiles"` + Events *AxsStateFlexProfileAllEventsT `json:"events"` + Execution *AxsStateFlexProfileExecutionT `json:"execution"` +} + +func (t *AxsStateFlexProfileObjT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + profilesOffset := flatbuffers.UOffsetT(0) + if t.Profiles != nil { + profilesLength := len(t.Profiles) + profilesOffsets := make([]flatbuffers.UOffsetT, profilesLength) + for j := 0; j < profilesLength; j++ { + profilesOffsets[j] = t.Profiles[j].Pack(builder) + } + AxsStateFlexProfileObjStartProfilesVector(builder, profilesLength) + for j := profilesLength - 1; j >= 0; j-- { + builder.PrependUOffsetT(profilesOffsets[j]) + } + profilesOffset = builder.EndVector(profilesLength) + } + eventsOffset := t.Events.Pack(builder) + executionOffset := t.Execution.Pack(builder) + AxsStateFlexProfileObjStart(builder) + AxsStateFlexProfileObjAddProfiles(builder, profilesOffset) + AxsStateFlexProfileObjAddEvents(builder, eventsOffset) + AxsStateFlexProfileObjAddExecution(builder, executionOffset) + return AxsStateFlexProfileObjEnd(builder) +} + +func (rcv *AxsStateFlexProfileObj) UnPackTo(t *AxsStateFlexProfileObjT) { + profilesLength := rcv.ProfilesLength() + t.Profiles = make([]*AxsStateSingleFlexProfileT, profilesLength) + for j := 0; j < profilesLength; j++ { + x := AxsStateSingleFlexProfile{} + rcv.Profiles(&x, j) + t.Profiles[j] = x.UnPack() + } + t.Events = rcv.Events(nil).UnPack() + t.Execution = rcv.Execution(nil).UnPack() +} + +func (rcv *AxsStateFlexProfileObj) UnPack() *AxsStateFlexProfileObjT { + if rcv == nil { return nil } + t := &AxsStateFlexProfileObjT{} + rcv.UnPackTo(t) + return t +} + +type AxsStateFlexProfileObj struct { + _tab flatbuffers.Table +} + +func GetRootAsAxsStateFlexProfileObj(buf []byte, offset flatbuffers.UOffsetT) *AxsStateFlexProfileObj { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &AxsStateFlexProfileObj{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsAxsStateFlexProfileObj(buf []byte, offset flatbuffers.UOffsetT) *AxsStateFlexProfileObj { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &AxsStateFlexProfileObj{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *AxsStateFlexProfileObj) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *AxsStateFlexProfileObj) Table() flatbuffers.Table { + return rcv._tab +} + +/// state information of single FlexProfiles +func (rcv *AxsStateFlexProfileObj) Profiles(obj *AxsStateSingleFlexProfile, j int) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Vector(o) + x += flatbuffers.UOffsetT(j) * 4 + x = rcv._tab.Indirect(x) + obj.Init(rcv._tab.Bytes, x) + return true + } + return false +} + +func (rcv *AxsStateFlexProfileObj) ProfilesLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +/// state information of single FlexProfiles +/// state information of all events +func (rcv *AxsStateFlexProfileObj) Events(obj *AxsStateFlexProfileAllEvents) *AxsStateFlexProfileAllEvents { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + x := rcv._tab.Indirect(o + rcv._tab.Pos) + if obj == nil { + obj = new(AxsStateFlexProfileAllEvents) + } + obj.Init(rcv._tab.Bytes, x) + return obj + } + return nil +} + +/// state information of all events +/// state information of execution +func (rcv *AxsStateFlexProfileObj) Execution(obj *AxsStateFlexProfileExecution) *AxsStateFlexProfileExecution { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + x := rcv._tab.Indirect(o + rcv._tab.Pos) + if obj == nil { + obj = new(AxsStateFlexProfileExecution) + } + obj.Init(rcv._tab.Bytes, x) + return obj + } + return nil +} + +/// state information of execution +func AxsStateFlexProfileObjStart(builder *flatbuffers.Builder) { + builder.StartObject(3) +} +func AxsStateFlexProfileObjAddProfiles(builder *flatbuffers.Builder, profiles flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(profiles), 0) +} +func AxsStateFlexProfileObjStartProfilesVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} +func AxsStateFlexProfileObjAddEvents(builder *flatbuffers.Builder, events flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(events), 0) +} +func AxsStateFlexProfileObjAddExecution(builder *flatbuffers.Builder, execution flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(execution), 0) +} +func AxsStateFlexProfileObjEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/sync/fbtypes/AxsStateSingleFlexProfile.go b/pkg/fbs/motion/sync/fbtypes/AxsStateSingleFlexProfile.go new file mode 100644 index 0000000..8132371 --- /dev/null +++ b/pkg/fbs/motion/sync/fbtypes/AxsStateSingleFlexProfile.go @@ -0,0 +1,101 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// state of a single FlexProfile +type AxsStateSingleFlexProfileT struct { + Name string `json:"name"` + AccessState string `json:"accessState"` +} + +func (t *AxsStateSingleFlexProfileT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + accessStateOffset := flatbuffers.UOffsetT(0) + if t.AccessState != "" { + accessStateOffset = builder.CreateString(t.AccessState) + } + AxsStateSingleFlexProfileStart(builder) + AxsStateSingleFlexProfileAddName(builder, nameOffset) + AxsStateSingleFlexProfileAddAccessState(builder, accessStateOffset) + return AxsStateSingleFlexProfileEnd(builder) +} + +func (rcv *AxsStateSingleFlexProfile) UnPackTo(t *AxsStateSingleFlexProfileT) { + t.Name = string(rcv.Name()) + t.AccessState = string(rcv.AccessState()) +} + +func (rcv *AxsStateSingleFlexProfile) UnPack() *AxsStateSingleFlexProfileT { + if rcv == nil { return nil } + t := &AxsStateSingleFlexProfileT{} + rcv.UnPackTo(t) + return t +} + +type AxsStateSingleFlexProfile struct { + _tab flatbuffers.Table +} + +func GetRootAsAxsStateSingleFlexProfile(buf []byte, offset flatbuffers.UOffsetT) *AxsStateSingleFlexProfile { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &AxsStateSingleFlexProfile{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsAxsStateSingleFlexProfile(buf []byte, offset flatbuffers.UOffsetT) *AxsStateSingleFlexProfile { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &AxsStateSingleFlexProfile{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *AxsStateSingleFlexProfile) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *AxsStateSingleFlexProfile) Table() flatbuffers.Table { + return rcv._tab +} + +/// name of the single FlexProfile +func (rcv *AxsStateSingleFlexProfile) Name() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// name of the single FlexProfile +/// access state +func (rcv *AxsStateSingleFlexProfile) AccessState() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// access state +func AxsStateSingleFlexProfileStart(builder *flatbuffers.Builder) { + builder.StartObject(2) +} +func AxsStateSingleFlexProfileAddName(builder *flatbuffers.Builder, name flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(name), 0) +} +func AxsStateSingleFlexProfileAddAccessState(builder *flatbuffers.Builder, accessState flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(accessState), 0) +} +func AxsStateSingleFlexProfileEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/sync/fbtypes/CfgFlexProfileEvent.go b/pkg/fbs/motion/sync/fbtypes/CfgFlexProfileEvent.go new file mode 100644 index 0000000..d1305e2 --- /dev/null +++ b/pkg/fbs/motion/sync/fbtypes/CfgFlexProfileEvent.go @@ -0,0 +1,221 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// configuration of a FlexProfile event +type CfgFlexProfileEventT struct { + SegmentNmb uint32 `json:"segmentNmb"` + TriggerCondition SegmentTriggerCondition `json:"triggerCondition"` + TriggerValue float64 `json:"triggerValue"` + MasterType uint32 `json:"masterType"` + ActionMode SegmentActionMode `json:"actionMode"` + ActionBit uint32 `json:"actionBit"` + SegmentNmbFormula uint32 `json:"segmentNmbFormula"` + ValueFormula string `json:"valueFormula"` +} + +func (t *CfgFlexProfileEventT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + valueFormulaOffset := flatbuffers.UOffsetT(0) + if t.ValueFormula != "" { + valueFormulaOffset = builder.CreateString(t.ValueFormula) + } + CfgFlexProfileEventStart(builder) + CfgFlexProfileEventAddSegmentNmb(builder, t.SegmentNmb) + CfgFlexProfileEventAddTriggerCondition(builder, t.TriggerCondition) + CfgFlexProfileEventAddTriggerValue(builder, t.TriggerValue) + CfgFlexProfileEventAddMasterType(builder, t.MasterType) + CfgFlexProfileEventAddActionMode(builder, t.ActionMode) + CfgFlexProfileEventAddActionBit(builder, t.ActionBit) + CfgFlexProfileEventAddSegmentNmbFormula(builder, t.SegmentNmbFormula) + CfgFlexProfileEventAddValueFormula(builder, valueFormulaOffset) + return CfgFlexProfileEventEnd(builder) +} + +func (rcv *CfgFlexProfileEvent) UnPackTo(t *CfgFlexProfileEventT) { + t.SegmentNmb = rcv.SegmentNmb() + t.TriggerCondition = rcv.TriggerCondition() + t.TriggerValue = rcv.TriggerValue() + t.MasterType = rcv.MasterType() + t.ActionMode = rcv.ActionMode() + t.ActionBit = rcv.ActionBit() + t.SegmentNmbFormula = rcv.SegmentNmbFormula() + t.ValueFormula = string(rcv.ValueFormula()) +} + +func (rcv *CfgFlexProfileEvent) UnPack() *CfgFlexProfileEventT { + if rcv == nil { return nil } + t := &CfgFlexProfileEventT{} + rcv.UnPackTo(t) + return t +} + +type CfgFlexProfileEvent struct { + _tab flatbuffers.Table +} + +func GetRootAsCfgFlexProfileEvent(buf []byte, offset flatbuffers.UOffsetT) *CfgFlexProfileEvent { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &CfgFlexProfileEvent{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsCfgFlexProfileEvent(buf []byte, offset flatbuffers.UOffsetT) *CfgFlexProfileEvent { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &CfgFlexProfileEvent{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *CfgFlexProfileEvent) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *CfgFlexProfileEvent) Table() flatbuffers.Table { + return rcv._tab +} + +/// The event is configured for this segment number +func (rcv *CfgFlexProfileEvent) SegmentNmb() uint32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.GetUint32(o + rcv._tab.Pos) + } + return 0 +} + +/// The event is configured for this segment number +func (rcv *CfgFlexProfileEvent) MutateSegmentNmb(n uint32) bool { + return rcv._tab.MutateUint32Slot(4, n) +} + +/// Trigger condition of the event +func (rcv *CfgFlexProfileEvent) TriggerCondition() SegmentTriggerCondition { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return SegmentTriggerCondition(rcv._tab.GetInt8(o + rcv._tab.Pos)) + } + return 0 +} + +/// Trigger condition of the event +func (rcv *CfgFlexProfileEvent) MutateTriggerCondition(n SegmentTriggerCondition) bool { + return rcv._tab.MutateInt8Slot(6, int8(n)) +} + +/// Trigger value +func (rcv *CfgFlexProfileEvent) TriggerValue() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// Trigger value +func (rcv *CfgFlexProfileEvent) MutateTriggerValue(n float64) bool { + return rcv._tab.MutateFloat64Slot(8, n) +} + +/// Trigger master type (0: time master, 1: axis master) +func (rcv *CfgFlexProfileEvent) MasterType() uint32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) + if o != 0 { + return rcv._tab.GetUint32(o + rcv._tab.Pos) + } + return 0 +} + +/// Trigger master type (0: time master, 1: axis master) +func (rcv *CfgFlexProfileEvent) MutateMasterType(n uint32) bool { + return rcv._tab.MutateUint32Slot(10, n) +} + +/// Action mode of the event +func (rcv *CfgFlexProfileEvent) ActionMode() SegmentActionMode { + o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) + if o != 0 { + return SegmentActionMode(rcv._tab.GetUint32(o + rcv._tab.Pos)) + } + return 0 +} + +/// Action mode of the event +func (rcv *CfgFlexProfileEvent) MutateActionMode(n SegmentActionMode) bool { + return rcv._tab.MutateUint32Slot(12, uint32(n)) +} + +/// Number of the status bit, that is set by the action +func (rcv *CfgFlexProfileEvent) ActionBit() uint32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) + if o != 0 { + return rcv._tab.GetUint32(o + rcv._tab.Pos) + } + return 0 +} + +/// Number of the status bit, that is set by the action +func (rcv *CfgFlexProfileEvent) MutateActionBit(n uint32) bool { + return rcv._tab.MutateUint32Slot(14, n) +} + +/// Cam-Builder data: segment number for formula +func (rcv *CfgFlexProfileEvent) SegmentNmbFormula() uint32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(16)) + if o != 0 { + return rcv._tab.GetUint32(o + rcv._tab.Pos) + } + return 0 +} + +/// Cam-Builder data: segment number for formula +func (rcv *CfgFlexProfileEvent) MutateSegmentNmbFormula(n uint32) bool { + return rcv._tab.MutateUint32Slot(16, n) +} + +/// Cam-Builder data: formula string +func (rcv *CfgFlexProfileEvent) ValueFormula() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(18)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// Cam-Builder data: formula string +func CfgFlexProfileEventStart(builder *flatbuffers.Builder) { + builder.StartObject(8) +} +func CfgFlexProfileEventAddSegmentNmb(builder *flatbuffers.Builder, segmentNmb uint32) { + builder.PrependUint32Slot(0, segmentNmb, 0) +} +func CfgFlexProfileEventAddTriggerCondition(builder *flatbuffers.Builder, triggerCondition SegmentTriggerCondition) { + builder.PrependInt8Slot(1, int8(triggerCondition), 0) +} +func CfgFlexProfileEventAddTriggerValue(builder *flatbuffers.Builder, triggerValue float64) { + builder.PrependFloat64Slot(2, triggerValue, 0.0) +} +func CfgFlexProfileEventAddMasterType(builder *flatbuffers.Builder, masterType uint32) { + builder.PrependUint32Slot(3, masterType, 0) +} +func CfgFlexProfileEventAddActionMode(builder *flatbuffers.Builder, actionMode SegmentActionMode) { + builder.PrependUint32Slot(4, uint32(actionMode), 0) +} +func CfgFlexProfileEventAddActionBit(builder *flatbuffers.Builder, actionBit uint32) { + builder.PrependUint32Slot(5, actionBit, 0) +} +func CfgFlexProfileEventAddSegmentNmbFormula(builder *flatbuffers.Builder, segmentNmbFormula uint32) { + builder.PrependUint32Slot(6, segmentNmbFormula, 0) +} +func CfgFlexProfileEventAddValueFormula(builder *flatbuffers.Builder, valueFormula flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(7, flatbuffers.UOffsetT(valueFormula), 0) +} +func CfgFlexProfileEventEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/sync/fbtypes/CfgFlexProfileSegment.go b/pkg/fbs/motion/sync/fbtypes/CfgFlexProfileSegment.go new file mode 100644 index 0000000..1017ba0 --- /dev/null +++ b/pkg/fbs/motion/sync/fbtypes/CfgFlexProfileSegment.go @@ -0,0 +1,441 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// configuration of a FlexProfile segment +type CfgFlexProfileSegmentT struct { + Gain float64 `json:"gain"` + Range float64 `json:"range"` + V0 float64 `json:"v0"` + A0 float64 `json:"a0"` + J0 float64 `json:"j0"` + V1 float64 `json:"v1"` + A1 float64 `json:"a1"` + J1 float64 `json:"j1"` + LimV float64 `json:"limV"` + LimA0 float64 `json:"limA0"` + LimA1 float64 `json:"limA1"` + LimJ0 float64 `json:"limJ0"` + LimJ1 float64 `json:"limJ1"` + Lambda float64 `json:"lambda"` + SyncType SegmentSyncType `json:"syncType"` + LawType SegmentLawType `json:"lawType"` + PointTableReference string `json:"pointTableReference"` + Master uint32 `json:"master"` + CamBuilderSegmentData string `json:"camBuilderSegmentData"` +} + +func (t *CfgFlexProfileSegmentT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + pointTableReferenceOffset := flatbuffers.UOffsetT(0) + if t.PointTableReference != "" { + pointTableReferenceOffset = builder.CreateString(t.PointTableReference) + } + camBuilderSegmentDataOffset := flatbuffers.UOffsetT(0) + if t.CamBuilderSegmentData != "" { + camBuilderSegmentDataOffset = builder.CreateString(t.CamBuilderSegmentData) + } + CfgFlexProfileSegmentStart(builder) + CfgFlexProfileSegmentAddGain(builder, t.Gain) + CfgFlexProfileSegmentAddRange(builder, t.Range) + CfgFlexProfileSegmentAddV0(builder, t.V0) + CfgFlexProfileSegmentAddA0(builder, t.A0) + CfgFlexProfileSegmentAddJ0(builder, t.J0) + CfgFlexProfileSegmentAddV1(builder, t.V1) + CfgFlexProfileSegmentAddA1(builder, t.A1) + CfgFlexProfileSegmentAddJ1(builder, t.J1) + CfgFlexProfileSegmentAddLimV(builder, t.LimV) + CfgFlexProfileSegmentAddLimA0(builder, t.LimA0) + CfgFlexProfileSegmentAddLimA1(builder, t.LimA1) + CfgFlexProfileSegmentAddLimJ0(builder, t.LimJ0) + CfgFlexProfileSegmentAddLimJ1(builder, t.LimJ1) + CfgFlexProfileSegmentAddLambda(builder, t.Lambda) + CfgFlexProfileSegmentAddSyncType(builder, t.SyncType) + CfgFlexProfileSegmentAddLawType(builder, t.LawType) + CfgFlexProfileSegmentAddPointTableReference(builder, pointTableReferenceOffset) + CfgFlexProfileSegmentAddMaster(builder, t.Master) + CfgFlexProfileSegmentAddCamBuilderSegmentData(builder, camBuilderSegmentDataOffset) + return CfgFlexProfileSegmentEnd(builder) +} + +func (rcv *CfgFlexProfileSegment) UnPackTo(t *CfgFlexProfileSegmentT) { + t.Gain = rcv.Gain() + t.Range = rcv.Range() + t.V0 = rcv.V0() + t.A0 = rcv.A0() + t.J0 = rcv.J0() + t.V1 = rcv.V1() + t.A1 = rcv.A1() + t.J1 = rcv.J1() + t.LimV = rcv.LimV() + t.LimA0 = rcv.LimA0() + t.LimA1 = rcv.LimA1() + t.LimJ0 = rcv.LimJ0() + t.LimJ1 = rcv.LimJ1() + t.Lambda = rcv.Lambda() + t.SyncType = rcv.SyncType() + t.LawType = rcv.LawType() + t.PointTableReference = string(rcv.PointTableReference()) + t.Master = rcv.Master() + t.CamBuilderSegmentData = string(rcv.CamBuilderSegmentData()) +} + +func (rcv *CfgFlexProfileSegment) UnPack() *CfgFlexProfileSegmentT { + if rcv == nil { return nil } + t := &CfgFlexProfileSegmentT{} + rcv.UnPackTo(t) + return t +} + +type CfgFlexProfileSegment struct { + _tab flatbuffers.Table +} + +func GetRootAsCfgFlexProfileSegment(buf []byte, offset flatbuffers.UOffsetT) *CfgFlexProfileSegment { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &CfgFlexProfileSegment{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsCfgFlexProfileSegment(buf []byte, offset flatbuffers.UOffsetT) *CfgFlexProfileSegment { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &CfgFlexProfileSegment{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *CfgFlexProfileSegment) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *CfgFlexProfileSegment) Table() flatbuffers.Table { + return rcv._tab +} + +/// Gain/hub/lift of segment - slave range (Y) // Units +func (rcv *CfgFlexProfileSegment) Gain() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// Gain/hub/lift of segment - slave range (Y) // Units +func (rcv *CfgFlexProfileSegment) MutateGain(n float64) bool { + return rcv._tab.MutateFloat64Slot(4, n) +} + +/// Range of segment - master range (X) // Units +func (rcv *CfgFlexProfileSegment) Range() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// Range of segment - master range (X) // Units +func (rcv *CfgFlexProfileSegment) MutateRange(n float64) bool { + return rcv._tab.MutateFloat64Slot(6, n) +} + +/// Start Velocity // Units/s +func (rcv *CfgFlexProfileSegment) V0() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// Start Velocity // Units/s +func (rcv *CfgFlexProfileSegment) MutateV0(n float64) bool { + return rcv._tab.MutateFloat64Slot(8, n) +} + +/// Start Acceleration // Units/s^2 +func (rcv *CfgFlexProfileSegment) A0() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// Start Acceleration // Units/s^2 +func (rcv *CfgFlexProfileSegment) MutateA0(n float64) bool { + return rcv._tab.MutateFloat64Slot(10, n) +} + +/// Start Jerk // Units/s^3 +func (rcv *CfgFlexProfileSegment) J0() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// Start Jerk // Units/s^3 +func (rcv *CfgFlexProfileSegment) MutateJ0(n float64) bool { + return rcv._tab.MutateFloat64Slot(12, n) +} + +/// End Velocity // Units/s +func (rcv *CfgFlexProfileSegment) V1() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// End Velocity // Units/s +func (rcv *CfgFlexProfileSegment) MutateV1(n float64) bool { + return rcv._tab.MutateFloat64Slot(14, n) +} + +/// End Acceleration // Units/s^2 +func (rcv *CfgFlexProfileSegment) A1() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(16)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// End Acceleration // Units/s^2 +func (rcv *CfgFlexProfileSegment) MutateA1(n float64) bool { + return rcv._tab.MutateFloat64Slot(16, n) +} + +/// End Jerk // Units/s^3 +func (rcv *CfgFlexProfileSegment) J1() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(18)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// End Jerk // Units/s^3 +func (rcv *CfgFlexProfileSegment) MutateJ1(n float64) bool { + return rcv._tab.MutateFloat64Slot(18, n) +} + +/// Travel/Limit Velocity // Units/s +func (rcv *CfgFlexProfileSegment) LimV() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(20)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// Travel/Limit Velocity // Units/s +func (rcv *CfgFlexProfileSegment) MutateLimV(n float64) bool { + return rcv._tab.MutateFloat64Slot(20, n) +} + +/// Travel/Limit Acc // Units/s^2 +func (rcv *CfgFlexProfileSegment) LimA0() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(22)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// Travel/Limit Acc // Units/s^2 +func (rcv *CfgFlexProfileSegment) MutateLimA0(n float64) bool { + return rcv._tab.MutateFloat64Slot(22, n) +} + +/// Travel/Limit Dec // Units/s^2 +func (rcv *CfgFlexProfileSegment) LimA1() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(24)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// Travel/Limit Dec // Units/s^2 +func (rcv *CfgFlexProfileSegment) MutateLimA1(n float64) bool { + return rcv._tab.MutateFloat64Slot(24, n) +} + +/// Travel/Limit Acc-Jerk // Units/s^3 +func (rcv *CfgFlexProfileSegment) LimJ0() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(26)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// Travel/Limit Acc-Jerk // Units/s^3 +func (rcv *CfgFlexProfileSegment) MutateLimJ0(n float64) bool { + return rcv._tab.MutateFloat64Slot(26, n) +} + +/// Travel/Limit Acc-Jerk // Units/s^3 +func (rcv *CfgFlexProfileSegment) LimJ1() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(28)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// Travel/Limit Acc-Jerk // Units/s^3 +func (rcv *CfgFlexProfileSegment) MutateLimJ1(n float64) bool { + return rcv._tab.MutateFloat64Slot(28, n) +} + +/// Inflection point (Range 0.0 to 1.0) +func (rcv *CfgFlexProfileSegment) Lambda() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(30)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +/// Inflection point (Range 0.0 to 1.0) +func (rcv *CfgFlexProfileSegment) MutateLambda(n float64) bool { + return rcv._tab.MutateFloat64Slot(30, n) +} + +/// Type of the segment transition (fixed or flexible) +func (rcv *CfgFlexProfileSegment) SyncType() SegmentSyncType { + o := flatbuffers.UOffsetT(rcv._tab.Offset(32)) + if o != 0 { + return SegmentSyncType(rcv._tab.GetInt8(o + rcv._tab.Pos)) + } + return 0 +} + +/// Type of the segment transition (fixed or flexible) +func (rcv *CfgFlexProfileSegment) MutateSyncType(n SegmentSyncType) bool { + return rcv._tab.MutateInt8Slot(32, int8(n)) +} + +/// Type of the law (e.g. Polynomial 5th order) +func (rcv *CfgFlexProfileSegment) LawType() SegmentLawType { + o := flatbuffers.UOffsetT(rcv._tab.Offset(34)) + if o != 0 { + return SegmentLawType(rcv._tab.GetUint32(o + rcv._tab.Pos)) + } + return 0 +} + +/// Type of the law (e.g. Polynomial 5th order) +func (rcv *CfgFlexProfileSegment) MutateLawType(n SegmentLawType) bool { + return rcv._tab.MutateUint32Slot(34, uint32(n)) +} + +/// Name of the referenced point table for dedicated motion laws +func (rcv *CfgFlexProfileSegment) PointTableReference() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(36)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// Name of the referenced point table for dedicated motion laws +/// Type of the master (FML_MasterType - axis or time) +func (rcv *CfgFlexProfileSegment) Master() uint32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(38)) + if o != 0 { + return rcv._tab.GetUint32(o + rcv._tab.Pos) + } + return 0 +} + +/// Type of the master (FML_MasterType - axis or time) +func (rcv *CfgFlexProfileSegment) MutateMaster(n uint32) bool { + return rcv._tab.MutateUint32Slot(38, n) +} + +/// cam builder data (segment specific) +func (rcv *CfgFlexProfileSegment) CamBuilderSegmentData() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(40)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// cam builder data (segment specific) +func CfgFlexProfileSegmentStart(builder *flatbuffers.Builder) { + builder.StartObject(19) +} +func CfgFlexProfileSegmentAddGain(builder *flatbuffers.Builder, gain float64) { + builder.PrependFloat64Slot(0, gain, 0.0) +} +func CfgFlexProfileSegmentAddRange(builder *flatbuffers.Builder, range_ float64) { + builder.PrependFloat64Slot(1, range_, 0.0) +} +func CfgFlexProfileSegmentAddV0(builder *flatbuffers.Builder, v0 float64) { + builder.PrependFloat64Slot(2, v0, 0.0) +} +func CfgFlexProfileSegmentAddA0(builder *flatbuffers.Builder, a0 float64) { + builder.PrependFloat64Slot(3, a0, 0.0) +} +func CfgFlexProfileSegmentAddJ0(builder *flatbuffers.Builder, j0 float64) { + builder.PrependFloat64Slot(4, j0, 0.0) +} +func CfgFlexProfileSegmentAddV1(builder *flatbuffers.Builder, v1 float64) { + builder.PrependFloat64Slot(5, v1, 0.0) +} +func CfgFlexProfileSegmentAddA1(builder *flatbuffers.Builder, a1 float64) { + builder.PrependFloat64Slot(6, a1, 0.0) +} +func CfgFlexProfileSegmentAddJ1(builder *flatbuffers.Builder, j1 float64) { + builder.PrependFloat64Slot(7, j1, 0.0) +} +func CfgFlexProfileSegmentAddLimV(builder *flatbuffers.Builder, limV float64) { + builder.PrependFloat64Slot(8, limV, 0.0) +} +func CfgFlexProfileSegmentAddLimA0(builder *flatbuffers.Builder, limA0 float64) { + builder.PrependFloat64Slot(9, limA0, 0.0) +} +func CfgFlexProfileSegmentAddLimA1(builder *flatbuffers.Builder, limA1 float64) { + builder.PrependFloat64Slot(10, limA1, 0.0) +} +func CfgFlexProfileSegmentAddLimJ0(builder *flatbuffers.Builder, limJ0 float64) { + builder.PrependFloat64Slot(11, limJ0, 0.0) +} +func CfgFlexProfileSegmentAddLimJ1(builder *flatbuffers.Builder, limJ1 float64) { + builder.PrependFloat64Slot(12, limJ1, 0.0) +} +func CfgFlexProfileSegmentAddLambda(builder *flatbuffers.Builder, lambda float64) { + builder.PrependFloat64Slot(13, lambda, 0.0) +} +func CfgFlexProfileSegmentAddSyncType(builder *flatbuffers.Builder, syncType SegmentSyncType) { + builder.PrependInt8Slot(14, int8(syncType), 0) +} +func CfgFlexProfileSegmentAddLawType(builder *flatbuffers.Builder, lawType SegmentLawType) { + builder.PrependUint32Slot(15, uint32(lawType), 0) +} +func CfgFlexProfileSegmentAddPointTableReference(builder *flatbuffers.Builder, pointTableReference flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(16, flatbuffers.UOffsetT(pointTableReference), 0) +} +func CfgFlexProfileSegmentAddMaster(builder *flatbuffers.Builder, master uint32) { + builder.PrependUint32Slot(17, master, 0) +} +func CfgFlexProfileSegmentAddCamBuilderSegmentData(builder *flatbuffers.Builder, camBuilderSegmentData flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(18, flatbuffers.UOffsetT(camBuilderSegmentData), 0) +} +func CfgFlexProfileSegmentEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/sync/fbtypes/PointTableInterpolation.go b/pkg/fbs/motion/sync/fbtypes/PointTableInterpolation.go new file mode 100644 index 0000000..05bd93e --- /dev/null +++ b/pkg/fbs/motion/sync/fbtypes/PointTableInterpolation.go @@ -0,0 +1,36 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import "strconv" + +/// interpolation type of the point table +type PointTableInterpolation int8 + +const ( + /// interpolation variant of mlc ( spline up to 100, linear after) + PointTableInterpolationDEFAULT PointTableInterpolation = 0 + /// use linear interpolation between supporting points + PointTableInterpolationLINEAR PointTableInterpolation = 1 + /// use qubic spline interpolation between supporting points + PointTableInterpolationQUBIC_SPLINE PointTableInterpolation = 2 +) + +var EnumNamesPointTableInterpolation = map[PointTableInterpolation]string{ + PointTableInterpolationDEFAULT: "DEFAULT", + PointTableInterpolationLINEAR: "LINEAR", + PointTableInterpolationQUBIC_SPLINE: "QUBIC_SPLINE", +} + +var EnumValuesPointTableInterpolation = map[string]PointTableInterpolation{ + "DEFAULT": PointTableInterpolationDEFAULT, + "LINEAR": PointTableInterpolationLINEAR, + "QUBIC_SPLINE": PointTableInterpolationQUBIC_SPLINE, +} + +func (v PointTableInterpolation) String() string { + if s, ok := EnumNamesPointTableInterpolation[v]; ok { + return s + } + return "PointTableInterpolation(" + strconv.FormatInt(int64(v), 10) + ")" +} diff --git a/pkg/fbs/motion/sync/fbtypes/ProfileEntry.go b/pkg/fbs/motion/sync/fbtypes/ProfileEntry.go new file mode 100644 index 0000000..46661c1 --- /dev/null +++ b/pkg/fbs/motion/sync/fbtypes/ProfileEntry.go @@ -0,0 +1,44 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import "strconv" + +/// type of segment transition +type ProfileEntry int8 + +const ( + /// Absolute access to the profile + ProfileEntrySLAVE_ORIGIN_MASTER_ORIGIN ProfileEntry = 0 + /// Profile starts at the current master and slave axis position + ProfileEntrySLAVE_CURRENT_MASTER_CURRENT ProfileEntry = 1 + /// Profile starts at the current master axis position and the absolute slave axis position + ProfileEntrySLAVE_ORIGIN_MASTER_CURRENT ProfileEntry = 2 + /// Profile starts at the current slave axis position and the absolute master axis position + ProfileEntrySLAVE_CURRENT_MASTER_ORIGIN ProfileEntry = 3 + /// Profile starts at the current master axis position. + ProfileEntrySLAVE_RELATIVE_MASTER_ORIGIN ProfileEntry = 4 +) + +var EnumNamesProfileEntry = map[ProfileEntry]string{ + ProfileEntrySLAVE_ORIGIN_MASTER_ORIGIN: "SLAVE_ORIGIN_MASTER_ORIGIN", + ProfileEntrySLAVE_CURRENT_MASTER_CURRENT: "SLAVE_CURRENT_MASTER_CURRENT", + ProfileEntrySLAVE_ORIGIN_MASTER_CURRENT: "SLAVE_ORIGIN_MASTER_CURRENT", + ProfileEntrySLAVE_CURRENT_MASTER_ORIGIN: "SLAVE_CURRENT_MASTER_ORIGIN", + ProfileEntrySLAVE_RELATIVE_MASTER_ORIGIN: "SLAVE_RELATIVE_MASTER_ORIGIN", +} + +var EnumValuesProfileEntry = map[string]ProfileEntry{ + "SLAVE_ORIGIN_MASTER_ORIGIN": ProfileEntrySLAVE_ORIGIN_MASTER_ORIGIN, + "SLAVE_CURRENT_MASTER_CURRENT": ProfileEntrySLAVE_CURRENT_MASTER_CURRENT, + "SLAVE_ORIGIN_MASTER_CURRENT": ProfileEntrySLAVE_ORIGIN_MASTER_CURRENT, + "SLAVE_CURRENT_MASTER_ORIGIN": ProfileEntrySLAVE_CURRENT_MASTER_ORIGIN, + "SLAVE_RELATIVE_MASTER_ORIGIN": ProfileEntrySLAVE_RELATIVE_MASTER_ORIGIN, +} + +func (v ProfileEntry) String() string { + if s, ok := EnumNamesProfileEntry[v]; ok { + return s + } + return "ProfileEntry(" + strconv.FormatInt(int64(v), 10) + ")" +} diff --git a/pkg/fbs/motion/sync/fbtypes/ProfileExecutionMode.go b/pkg/fbs/motion/sync/fbtypes/ProfileExecutionMode.go new file mode 100644 index 0000000..eae5d1c --- /dev/null +++ b/pkg/fbs/motion/sync/fbtypes/ProfileExecutionMode.go @@ -0,0 +1,32 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import "strconv" + +/// type of segment transition +type ProfileExecutionMode int8 + +const ( + /// Cyclic -> group is executed continuously + ProfileExecutionModeCYCLIC ProfileExecutionMode = 0 + /// Single -> group is executed only once + ProfileExecutionModeSINGLE ProfileExecutionMode = 1 +) + +var EnumNamesProfileExecutionMode = map[ProfileExecutionMode]string{ + ProfileExecutionModeCYCLIC: "CYCLIC", + ProfileExecutionModeSINGLE: "SINGLE", +} + +var EnumValuesProfileExecutionMode = map[string]ProfileExecutionMode{ + "CYCLIC": ProfileExecutionModeCYCLIC, + "SINGLE": ProfileExecutionModeSINGLE, +} + +func (v ProfileExecutionMode) String() string { + if s, ok := EnumNamesProfileExecutionMode[v]; ok { + return s + } + return "ProfileExecutionMode(" + strconv.FormatInt(int64(v), 10) + ")" +} diff --git a/pkg/fbs/motion/sync/fbtypes/SegmentActionMode.go b/pkg/fbs/motion/sync/fbtypes/SegmentActionMode.go new file mode 100644 index 0000000..ace852c --- /dev/null +++ b/pkg/fbs/motion/sync/fbtypes/SegmentActionMode.go @@ -0,0 +1,35 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import "strconv" + +type SegmentActionMode uint32 + +const ( + SegmentActionModeSEG_ACTION_EXTERNAL_INSTANT SegmentActionMode = 0 + SegmentActionModeSEG_ACTION_EXTERNAL_AFTERSEG SegmentActionMode = 1 + SegmentActionModeSEG_ACTION_EXTERNAL_AFTERGROUP SegmentActionMode = 2 + SegmentActionModeSEG_ACTION_EXTERNAL_INSTANT_NEXTSEG SegmentActionMode = 3 +) + +var EnumNamesSegmentActionMode = map[SegmentActionMode]string{ + SegmentActionModeSEG_ACTION_EXTERNAL_INSTANT: "SEG_ACTION_EXTERNAL_INSTANT", + SegmentActionModeSEG_ACTION_EXTERNAL_AFTERSEG: "SEG_ACTION_EXTERNAL_AFTERSEG", + SegmentActionModeSEG_ACTION_EXTERNAL_AFTERGROUP: "SEG_ACTION_EXTERNAL_AFTERGROUP", + SegmentActionModeSEG_ACTION_EXTERNAL_INSTANT_NEXTSEG: "SEG_ACTION_EXTERNAL_INSTANT_NEXTSEG", +} + +var EnumValuesSegmentActionMode = map[string]SegmentActionMode{ + "SEG_ACTION_EXTERNAL_INSTANT": SegmentActionModeSEG_ACTION_EXTERNAL_INSTANT, + "SEG_ACTION_EXTERNAL_AFTERSEG": SegmentActionModeSEG_ACTION_EXTERNAL_AFTERSEG, + "SEG_ACTION_EXTERNAL_AFTERGROUP": SegmentActionModeSEG_ACTION_EXTERNAL_AFTERGROUP, + "SEG_ACTION_EXTERNAL_INSTANT_NEXTSEG": SegmentActionModeSEG_ACTION_EXTERNAL_INSTANT_NEXTSEG, +} + +func (v SegmentActionMode) String() string { + if s, ok := EnumNamesSegmentActionMode[v]; ok { + return s + } + return "SegmentActionMode(" + strconv.FormatInt(int64(v), 10) + ")" +} diff --git a/pkg/fbs/motion/sync/fbtypes/SegmentTriggerCondition.go b/pkg/fbs/motion/sync/fbtypes/SegmentTriggerCondition.go new file mode 100644 index 0000000..9a7eff5 --- /dev/null +++ b/pkg/fbs/motion/sync/fbtypes/SegmentTriggerCondition.go @@ -0,0 +1,38 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import "strconv" + +type SegmentTriggerCondition int8 + +const ( + SegmentTriggerConditionSEG_TRIGGER_EXTERNAL SegmentTriggerCondition = 0 + SegmentTriggerConditionSEG_TRIGGER_SLAVE_REACHED_ABS SegmentTriggerCondition = 1 + SegmentTriggerConditionSEG_TRIGGER_SLAVE_REACHED_REL SegmentTriggerCondition = 2 + SegmentTriggerConditionSEG_TRIGGER_MASTER_REACHED_ABS SegmentTriggerCondition = 3 + SegmentTriggerConditionSEG_TRIGGER_MASTER_REACHED_REL SegmentTriggerCondition = 4 +) + +var EnumNamesSegmentTriggerCondition = map[SegmentTriggerCondition]string{ + SegmentTriggerConditionSEG_TRIGGER_EXTERNAL: "SEG_TRIGGER_EXTERNAL", + SegmentTriggerConditionSEG_TRIGGER_SLAVE_REACHED_ABS: "SEG_TRIGGER_SLAVE_REACHED_ABS", + SegmentTriggerConditionSEG_TRIGGER_SLAVE_REACHED_REL: "SEG_TRIGGER_SLAVE_REACHED_REL", + SegmentTriggerConditionSEG_TRIGGER_MASTER_REACHED_ABS: "SEG_TRIGGER_MASTER_REACHED_ABS", + SegmentTriggerConditionSEG_TRIGGER_MASTER_REACHED_REL: "SEG_TRIGGER_MASTER_REACHED_REL", +} + +var EnumValuesSegmentTriggerCondition = map[string]SegmentTriggerCondition{ + "SEG_TRIGGER_EXTERNAL": SegmentTriggerConditionSEG_TRIGGER_EXTERNAL, + "SEG_TRIGGER_SLAVE_REACHED_ABS": SegmentTriggerConditionSEG_TRIGGER_SLAVE_REACHED_ABS, + "SEG_TRIGGER_SLAVE_REACHED_REL": SegmentTriggerConditionSEG_TRIGGER_SLAVE_REACHED_REL, + "SEG_TRIGGER_MASTER_REACHED_ABS": SegmentTriggerConditionSEG_TRIGGER_MASTER_REACHED_ABS, + "SEG_TRIGGER_MASTER_REACHED_REL": SegmentTriggerConditionSEG_TRIGGER_MASTER_REACHED_REL, +} + +func (v SegmentTriggerCondition) String() string { + if s, ok := EnumNamesSegmentTriggerCondition[v]; ok { + return s + } + return "SegmentTriggerCondition(" + strconv.FormatInt(int64(v), 10) + ")" +} diff --git a/pkg/fbs/motion/sync/fbtypes/SysCfgAllPointTables.go b/pkg/fbs/motion/sync/fbtypes/SysCfgAllPointTables.go new file mode 100644 index 0000000..106046f --- /dev/null +++ b/pkg/fbs/motion/sync/fbtypes/SysCfgAllPointTables.go @@ -0,0 +1,111 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// configuration of all point tables for the whole motion system +type SysCfgAllPointTablesT struct { + Tables []*SysCfgSinglePointTableT `json:"tables"` +} + +func (t *SysCfgAllPointTablesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + tablesOffset := flatbuffers.UOffsetT(0) + if t.Tables != nil { + tablesLength := len(t.Tables) + tablesOffsets := make([]flatbuffers.UOffsetT, tablesLength) + for j := 0; j < tablesLength; j++ { + tablesOffsets[j] = t.Tables[j].Pack(builder) + } + SysCfgAllPointTablesStartTablesVector(builder, tablesLength) + for j := tablesLength - 1; j >= 0; j-- { + builder.PrependUOffsetT(tablesOffsets[j]) + } + tablesOffset = builder.EndVector(tablesLength) + } + SysCfgAllPointTablesStart(builder) + SysCfgAllPointTablesAddTables(builder, tablesOffset) + return SysCfgAllPointTablesEnd(builder) +} + +func (rcv *SysCfgAllPointTables) UnPackTo(t *SysCfgAllPointTablesT) { + tablesLength := rcv.TablesLength() + t.Tables = make([]*SysCfgSinglePointTableT, tablesLength) + for j := 0; j < tablesLength; j++ { + x := SysCfgSinglePointTable{} + rcv.Tables(&x, j) + t.Tables[j] = x.UnPack() + } +} + +func (rcv *SysCfgAllPointTables) UnPack() *SysCfgAllPointTablesT { + if rcv == nil { return nil } + t := &SysCfgAllPointTablesT{} + rcv.UnPackTo(t) + return t +} + +type SysCfgAllPointTables struct { + _tab flatbuffers.Table +} + +func GetRootAsSysCfgAllPointTables(buf []byte, offset flatbuffers.UOffsetT) *SysCfgAllPointTables { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &SysCfgAllPointTables{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsSysCfgAllPointTables(buf []byte, offset flatbuffers.UOffsetT) *SysCfgAllPointTables { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &SysCfgAllPointTables{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *SysCfgAllPointTables) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *SysCfgAllPointTables) Table() flatbuffers.Table { + return rcv._tab +} + +/// vector of all configured point tables +func (rcv *SysCfgAllPointTables) Tables(obj *SysCfgSinglePointTable, j int) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Vector(o) + x += flatbuffers.UOffsetT(j) * 4 + x = rcv._tab.Indirect(x) + obj.Init(rcv._tab.Bytes, x) + return true + } + return false +} + +func (rcv *SysCfgAllPointTables) TablesLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +/// vector of all configured point tables +func SysCfgAllPointTablesStart(builder *flatbuffers.Builder) { + builder.StartObject(1) +} +func SysCfgAllPointTablesAddTables(builder *flatbuffers.Builder, tables flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(tables), 0) +} +func SysCfgAllPointTablesStartTablesVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} +func SysCfgAllPointTablesEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/motion/sync/fbtypes/SysCfgSinglePointTable.go b/pkg/fbs/motion/sync/fbtypes/SysCfgSinglePointTable.go new file mode 100644 index 0000000..4141bde --- /dev/null +++ b/pkg/fbs/motion/sync/fbtypes/SysCfgSinglePointTable.go @@ -0,0 +1,171 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// configuration of a single point table +type SysCfgSinglePointTableT struct { + Name string `json:"name"` + Points []float64 `json:"points"` + Interpolation PointTableInterpolation `json:"interpolation"` + CamBuilderData string `json:"camBuilderData"` +} + +func (t *SysCfgSinglePointTableT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + nameOffset := flatbuffers.UOffsetT(0) + if t.Name != "" { + nameOffset = builder.CreateString(t.Name) + } + pointsOffset := flatbuffers.UOffsetT(0) + if t.Points != nil { + pointsLength := len(t.Points) + SysCfgSinglePointTableStartPointsVector(builder, pointsLength) + for j := pointsLength - 1; j >= 0; j-- { + builder.PrependFloat64(t.Points[j]) + } + pointsOffset = builder.EndVector(pointsLength) + } + camBuilderDataOffset := flatbuffers.UOffsetT(0) + if t.CamBuilderData != "" { + camBuilderDataOffset = builder.CreateString(t.CamBuilderData) + } + SysCfgSinglePointTableStart(builder) + SysCfgSinglePointTableAddName(builder, nameOffset) + SysCfgSinglePointTableAddPoints(builder, pointsOffset) + SysCfgSinglePointTableAddInterpolation(builder, t.Interpolation) + SysCfgSinglePointTableAddCamBuilderData(builder, camBuilderDataOffset) + return SysCfgSinglePointTableEnd(builder) +} + +func (rcv *SysCfgSinglePointTable) UnPackTo(t *SysCfgSinglePointTableT) { + t.Name = string(rcv.Name()) + pointsLength := rcv.PointsLength() + t.Points = make([]float64, pointsLength) + for j := 0; j < pointsLength; j++ { + t.Points[j] = rcv.Points(j) + } + t.Interpolation = rcv.Interpolation() + t.CamBuilderData = string(rcv.CamBuilderData()) +} + +func (rcv *SysCfgSinglePointTable) UnPack() *SysCfgSinglePointTableT { + if rcv == nil { return nil } + t := &SysCfgSinglePointTableT{} + rcv.UnPackTo(t) + return t +} + +type SysCfgSinglePointTable struct { + _tab flatbuffers.Table +} + +func GetRootAsSysCfgSinglePointTable(buf []byte, offset flatbuffers.UOffsetT) *SysCfgSinglePointTable { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &SysCfgSinglePointTable{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsSysCfgSinglePointTable(buf []byte, offset flatbuffers.UOffsetT) *SysCfgSinglePointTable { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &SysCfgSinglePointTable{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *SysCfgSinglePointTable) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *SysCfgSinglePointTable) Table() flatbuffers.Table { + return rcv._tab +} + +/// name of the point table (filled when reading; optional for writing [content is always ignored]) +func (rcv *SysCfgSinglePointTable) Name() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// name of the point table (filled when reading; optional for writing [content is always ignored]) +/// interpolation points of the point table +func (rcv *SysCfgSinglePointTable) Points(j int) float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.GetFloat64(a + flatbuffers.UOffsetT(j*8)) + } + return 0 +} + +func (rcv *SysCfgSinglePointTable) PointsLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +/// interpolation points of the point table +func (rcv *SysCfgSinglePointTable) MutatePoints(j int, n float64) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateFloat64(a+flatbuffers.UOffsetT(j*8), n) + } + return false +} + +/// interpolation type for this point table +func (rcv *SysCfgSinglePointTable) Interpolation() PointTableInterpolation { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return PointTableInterpolation(rcv._tab.GetInt8(o + rcv._tab.Pos)) + } + return 0 +} + +/// interpolation type for this point table +func (rcv *SysCfgSinglePointTable) MutateInterpolation(n PointTableInterpolation) bool { + return rcv._tab.MutateInt8Slot(8, int8(n)) +} + +/// data of the CamBuilder +func (rcv *SysCfgSinglePointTable) CamBuilderData() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// data of the CamBuilder +func SysCfgSinglePointTableStart(builder *flatbuffers.Builder) { + builder.StartObject(4) +} +func SysCfgSinglePointTableAddName(builder *flatbuffers.Builder, name flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(name), 0) +} +func SysCfgSinglePointTableAddPoints(builder *flatbuffers.Builder, points flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(points), 0) +} +func SysCfgSinglePointTableStartPointsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(8, numElems, 8) +} +func SysCfgSinglePointTableAddInterpolation(builder *flatbuffers.Builder, interpolation PointTableInterpolation) { + builder.PrependInt8Slot(2, int8(interpolation), 0) +} +func SysCfgSinglePointTableAddCamBuilderData(builder *flatbuffers.Builder, camBuilderData flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(camBuilderData), 0) +} +func SysCfgSinglePointTableEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/script/manager/fbtypes/AxsStateFlexProfileExecution.go b/pkg/fbs/script/manager/fbtypes/AxsStateFlexProfileExecution.go new file mode 100644 index 0000000..1a0103d --- /dev/null +++ b/pkg/fbs/script/manager/fbtypes/AxsStateFlexProfileExecution.go @@ -0,0 +1,141 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +/// state information of the execution +type AxsStateFlexProfileExecutionT struct { + ActiveProfile string `json:"activeProfile"` + ActiveSegment uint32 `json:"activeSegment"` + WaitForSwitchPos bool `json:"waitForSwitchPos"` + SingleExecDone bool `json:"singleExecDone"` +} + +func (t *AxsStateFlexProfileExecutionT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + activeProfileOffset := flatbuffers.UOffsetT(0) + if t.ActiveProfile != "" { + activeProfileOffset = builder.CreateString(t.ActiveProfile) + } + AxsStateFlexProfileExecutionStart(builder) + AxsStateFlexProfileExecutionAddActiveProfile(builder, activeProfileOffset) + AxsStateFlexProfileExecutionAddActiveSegment(builder, t.ActiveSegment) + AxsStateFlexProfileExecutionAddWaitForSwitchPos(builder, t.WaitForSwitchPos) + AxsStateFlexProfileExecutionAddSingleExecDone(builder, t.SingleExecDone) + return AxsStateFlexProfileExecutionEnd(builder) +} + +func (rcv *AxsStateFlexProfileExecution) UnPackTo(t *AxsStateFlexProfileExecutionT) { + t.ActiveProfile = string(rcv.ActiveProfile()) + t.ActiveSegment = rcv.ActiveSegment() + t.WaitForSwitchPos = rcv.WaitForSwitchPos() + t.SingleExecDone = rcv.SingleExecDone() +} + +func (rcv *AxsStateFlexProfileExecution) UnPack() *AxsStateFlexProfileExecutionT { + if rcv == nil { return nil } + t := &AxsStateFlexProfileExecutionT{} + rcv.UnPackTo(t) + return t +} + +type AxsStateFlexProfileExecution struct { + _tab flatbuffers.Table +} + +func GetRootAsAxsStateFlexProfileExecution(buf []byte, offset flatbuffers.UOffsetT) *AxsStateFlexProfileExecution { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &AxsStateFlexProfileExecution{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsAxsStateFlexProfileExecution(buf []byte, offset flatbuffers.UOffsetT) *AxsStateFlexProfileExecution { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &AxsStateFlexProfileExecution{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *AxsStateFlexProfileExecution) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *AxsStateFlexProfileExecution) Table() flatbuffers.Table { + return rcv._tab +} + +/// currently active profile from the axis +func (rcv *AxsStateFlexProfileExecution) ActiveProfile() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +/// currently active profile from the axis +/// currently active segment of the profile from the axis +func (rcv *AxsStateFlexProfileExecution) ActiveSegment() uint32 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.GetUint32(o + rcv._tab.Pos) + } + return 0 +} + +/// currently active segment of the profile from the axis +func (rcv *AxsStateFlexProfileExecution) MutateActiveSegment(n uint32) bool { + return rcv._tab.MutateUint32Slot(6, n) +} + +/// the profile is waiting for the specified switching position +func (rcv *AxsStateFlexProfileExecution) WaitForSwitchPos() bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return rcv._tab.GetBool(o + rcv._tab.Pos) + } + return false +} + +/// the profile is waiting for the specified switching position +func (rcv *AxsStateFlexProfileExecution) MutateWaitForSwitchPos(n bool) bool { + return rcv._tab.MutateBoolSlot(8, n) +} + +/// the one-time execution of the profile was completed (only for execution mode "SINGLE") +func (rcv *AxsStateFlexProfileExecution) SingleExecDone() bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) + if o != 0 { + return rcv._tab.GetBool(o + rcv._tab.Pos) + } + return false +} + +/// the one-time execution of the profile was completed (only for execution mode "SINGLE") +func (rcv *AxsStateFlexProfileExecution) MutateSingleExecDone(n bool) bool { + return rcv._tab.MutateBoolSlot(10, n) +} + +func AxsStateFlexProfileExecutionStart(builder *flatbuffers.Builder) { + builder.StartObject(4) +} +func AxsStateFlexProfileExecutionAddActiveProfile(builder *flatbuffers.Builder, activeProfile flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(activeProfile), 0) +} +func AxsStateFlexProfileExecutionAddActiveSegment(builder *flatbuffers.Builder, activeSegment uint32) { + builder.PrependUint32Slot(1, activeSegment, 0) +} +func AxsStateFlexProfileExecutionAddWaitForSwitchPos(builder *flatbuffers.Builder, waitForSwitchPos bool) { + builder.PrependBoolSlot(2, waitForSwitchPos, false) +} +func AxsStateFlexProfileExecutionAddSingleExecDone(builder *flatbuffers.Builder, singleExecDone bool) { + builder.PrependBoolSlot(3, singleExecDone, false) +} +func AxsStateFlexProfileExecutionEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/pkg/fbs/script/manager/fbtypes/CmdPosAbsDir.go b/pkg/fbs/script/manager/fbtypes/CmdPosAbsDir.go new file mode 100644 index 0000000..65f9f16 --- /dev/null +++ b/pkg/fbs/script/manager/fbtypes/CmdPosAbsDir.go @@ -0,0 +1,41 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import "strconv" + +/// Selected direction for PosAbs with modulo axis +type CmdPosAbsDir int8 + +const ( + /// use shortest way to reach target position + CmdPosAbsDirSHORTEST_WAY CmdPosAbsDir = 0 + /// move only in positive direction to reach target position + CmdPosAbsDirPOSITIVE_DIR CmdPosAbsDir = 1 + /// move only in negative direction to reach target position + CmdPosAbsDirNEGATIVE_DIR CmdPosAbsDir = 2 + /// when currently moving: continue to move in this direction to reach target position; + /// when in stand still: use SHORTEST_WAY + CmdPosAbsDirCURRENT_DIR CmdPosAbsDir = 3 +) + +var EnumNamesCmdPosAbsDir = map[CmdPosAbsDir]string{ + CmdPosAbsDirSHORTEST_WAY: "SHORTEST_WAY", + CmdPosAbsDirPOSITIVE_DIR: "POSITIVE_DIR", + CmdPosAbsDirNEGATIVE_DIR: "NEGATIVE_DIR", + CmdPosAbsDirCURRENT_DIR: "CURRENT_DIR", +} + +var EnumValuesCmdPosAbsDir = map[string]CmdPosAbsDir{ + "SHORTEST_WAY": CmdPosAbsDirSHORTEST_WAY, + "POSITIVE_DIR": CmdPosAbsDirPOSITIVE_DIR, + "NEGATIVE_DIR": CmdPosAbsDirNEGATIVE_DIR, + "CURRENT_DIR": CmdPosAbsDirCURRENT_DIR, +} + +func (v CmdPosAbsDir) String() string { + if s, ok := EnumNamesCmdPosAbsDir[v]; ok { + return s + } + return "CmdPosAbsDir(" + strconv.FormatInt(int64(v), 10) + ")" +} diff --git a/pkg/fbs/script/manager/fbtypes/Cmd_AxsPosEx.go b/pkg/fbs/script/manager/fbtypes/Cmd_AxsPosEx.go new file mode 100644 index 0000000..6649213 --- /dev/null +++ b/pkg/fbs/script/manager/fbtypes/Cmd_AxsPosEx.go @@ -0,0 +1,156 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package fbtypes + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +type Cmd_AxsPosExT struct { + Base *Cmd_BaseT `json:"base"` + Pos float64 `json:"pos"` + Buffered bool `json:"buffered"` + Lim *Cmd_DynLimitsT `json:"lim"` + Direction CmdPosAbsDir `json:"direction"` +} + +func (t *Cmd_AxsPosExT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + if t == nil { return 0 } + baseOffset := t.Base.Pack(builder) + limOffset := t.Lim.Pack(builder) + Cmd_AxsPosExStart(builder) + Cmd_AxsPosExAddBase(builder, baseOffset) + Cmd_AxsPosExAddPos(builder, t.Pos) + Cmd_AxsPosExAddBuffered(builder, t.Buffered) + Cmd_AxsPosExAddLim(builder, limOffset) + Cmd_AxsPosExAddDirection(builder, t.Direction) + return Cmd_AxsPosExEnd(builder) +} + +func (rcv *Cmd_AxsPosEx) UnPackTo(t *Cmd_AxsPosExT) { + t.Base = rcv.Base(nil).UnPack() + t.Pos = rcv.Pos() + t.Buffered = rcv.Buffered() + t.Lim = rcv.Lim(nil).UnPack() + t.Direction = rcv.Direction() +} + +func (rcv *Cmd_AxsPosEx) UnPack() *Cmd_AxsPosExT { + if rcv == nil { return nil } + t := &Cmd_AxsPosExT{} + rcv.UnPackTo(t) + return t +} + +type Cmd_AxsPosEx struct { + _tab flatbuffers.Table +} + +func GetRootAsCmd_AxsPosEx(buf []byte, offset flatbuffers.UOffsetT) *Cmd_AxsPosEx { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &Cmd_AxsPosEx{} + x.Init(buf, n+offset) + return x +} + +func GetSizePrefixedRootAsCmd_AxsPosEx(buf []byte, offset flatbuffers.UOffsetT) *Cmd_AxsPosEx { + n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) + x := &Cmd_AxsPosEx{} + x.Init(buf, n+offset+flatbuffers.SizeUint32) + return x +} + +func (rcv *Cmd_AxsPosEx) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *Cmd_AxsPosEx) Table() flatbuffers.Table { + return rcv._tab +} + +func (rcv *Cmd_AxsPosEx) Base(obj *Cmd_Base) *Cmd_Base { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + x := rcv._tab.Indirect(o + rcv._tab.Pos) + if obj == nil { + obj = new(Cmd_Base) + } + obj.Init(rcv._tab.Bytes, x) + return obj + } + return nil +} + +func (rcv *Cmd_AxsPosEx) Pos() float64 { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.GetFloat64(o + rcv._tab.Pos) + } + return 0.0 +} + +func (rcv *Cmd_AxsPosEx) MutatePos(n float64) bool { + return rcv._tab.MutateFloat64Slot(6, n) +} + +func (rcv *Cmd_AxsPosEx) Buffered() bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return rcv._tab.GetBool(o + rcv._tab.Pos) + } + return false +} + +func (rcv *Cmd_AxsPosEx) MutateBuffered(n bool) bool { + return rcv._tab.MutateBoolSlot(8, n) +} + +func (rcv *Cmd_AxsPosEx) Lim(obj *Cmd_DynLimits) *Cmd_DynLimits { + o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) + if o != 0 { + x := rcv._tab.Indirect(o + rcv._tab.Pos) + if obj == nil { + obj = new(Cmd_DynLimits) + } + obj.Init(rcv._tab.Bytes, x) + return obj + } + return nil +} + +/// Selected direction for PosAbs with modulo axis (ignored in all other cases) +func (rcv *Cmd_AxsPosEx) Direction() CmdPosAbsDir { + o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) + if o != 0 { + return CmdPosAbsDir(rcv._tab.GetInt8(o + rcv._tab.Pos)) + } + return 0 +} + +/// Selected direction for PosAbs with modulo axis (ignored in all other cases) +func (rcv *Cmd_AxsPosEx) MutateDirection(n CmdPosAbsDir) bool { + return rcv._tab.MutateInt8Slot(12, int8(n)) +} + +func Cmd_AxsPosExStart(builder *flatbuffers.Builder) { + builder.StartObject(5) +} +func Cmd_AxsPosExAddBase(builder *flatbuffers.Builder, base flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(base), 0) +} +func Cmd_AxsPosExAddPos(builder *flatbuffers.Builder, pos float64) { + builder.PrependFloat64Slot(1, pos, 0.0) +} +func Cmd_AxsPosExAddBuffered(builder *flatbuffers.Builder, buffered bool) { + builder.PrependBoolSlot(2, buffered, false) +} +func Cmd_AxsPosExAddLim(builder *flatbuffers.Builder, lim flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(lim), 0) +} +func Cmd_AxsPosExAddDirection(builder *flatbuffers.Builder, direction CmdPosAbsDir) { + builder.PrependInt8Slot(4, int8(direction), 0) +} +func Cmd_AxsPosExEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} From 65b5331bdc87640c91d4058c32fd99187420e40c Mon Sep 17 00:00:00 2001 From: guidfort Date: Fri, 11 Aug 2023 04:54:22 +0000 Subject: [PATCH 3/8] update datalayer files --- pkg/datalayer/client.go | 4 ++-- pkg/datalayer/result.go | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/datalayer/client.go b/pkg/datalayer/client.go index cfed307..94edcba 100755 --- a/pkg/datalayer/client.go +++ b/pkg/datalayer/client.go @@ -221,8 +221,8 @@ func (c *Client) PingSync() Result { // CreateSync creates an object. This function is synchronous. // Parameter address is an address of the node to create object in. -// Parameter variant is a data of the object. -// It returns the status of function call or a variant result of write or a tuple (Result, Variant). +// Parameter data is a data of the object, result of write. +// It returns the status of function call. func (c *Client) CreateSync(address string, data *Variant) Result { if data == nil { return ResultMissingArgument diff --git a/pkg/datalayer/result.go b/pkg/datalayer/result.go index 5d2b768..fb97c24 100644 --- a/pkg/datalayer/result.go +++ b/pkg/datalayer/result.go @@ -179,3 +179,7 @@ func (r Result) String() string { } return "Result_Unknown" } + +func (r Result) Error() string { + return r.String() +} From 8323b7abdc0df652b47e65848b44a4bdbe187a8c Mon Sep 17 00:00:00 2001 From: guidfort Date: Fri, 11 Aug 2023 04:56:03 +0000 Subject: [PATCH 4/8] update test files --- test/datalayer/result_test.go | 5 +++++ test/datalayer/utils_test.go | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/test/datalayer/result_test.go b/test/datalayer/result_test.go index 217b2dc..fed25d6 100644 --- a/test/datalayer/result_test.go +++ b/test/datalayer/result_test.go @@ -224,3 +224,8 @@ func TestResult(t *testing.T) { assert.Equal(t, tc.expectedString, tc.result.String()) } } + +func TestResultAsError(t *testing.T) { + result := datalayer.ResultFailed + assert.Error(t, result) +} diff --git a/test/datalayer/utils_test.go b/test/datalayer/utils_test.go index 628adeb..947f5e8 100644 --- a/test/datalayer/utils_test.go +++ b/test/datalayer/utils_test.go @@ -114,7 +114,9 @@ func TestClientAddressNoTests(t *testing.T) { func TestClientAddressSetEnv(t *testing.T) { os.Setenv("CTRLX_ADDRESS", "10.0.2.2") e := ctrlxAddress() - assert.Equal(t, e, "tcp://boschrexroth:boschrexroth@10.0.2.2") + assert.True(t, e == "tcp://boschrexroth:boschrexroth@10.0.2.2" || + e == "tcp://boschrexroth:boschrexroth@10.0.2.2?sslport=443" || + e == "tcp://boschrexroth:boschrexroth@10.0.2.2?sslport=8443") resetGlobalEnvs() } From e55fe3aefcbbd33da00cb6c5881cb330f19da5c7 Mon Sep 17 00:00:00 2001 From: guidfort Date: Fri, 11 Aug 2023 04:57:22 +0000 Subject: [PATCH 5/8] update base files --- go.mod | 11 +++++++++-- go.sum | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 4f3d106..7ca4f78 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,19 @@ module github.com/boschrexroth/ctrlx-datalayer-golang -go 1.13 +go 1.20 require ( - github.com/google/flatbuffers v1.12.0 + github.com/google/flatbuffers v23.5.26+incompatible github.com/loov/hrtime v1.0.3 github.com/loov/hrtime/hrplot v1.0.2 github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 github.com/stretchr/testify v1.7.0 gopkg.in/yaml.v2 v2.4.0 ) + +require ( + github.com/davecgh/go-spew v1.1.0 // indirect + github.com/loov/plot v0.0.0-20200413101321-e09a6f01d2f5 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect +) diff --git a/go.sum b/go.sum index a598f5b..13c1a83 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/google/flatbuffers v1.12.0 h1:/PtAHvnBY4Kqnx/xCQ3OIV9uYcSFGScBsWI3Oogeh6w= -github.com/google/flatbuffers v1.12.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/flatbuffers v23.5.26+incompatible h1:M9dgRyhJemaM4Sw8+66GHBu8ioaQmyPLg1b8VwK5WJg= +github.com/google/flatbuffers v23.5.26+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/loov/hrtime v1.0.1/go.mod h1:yDY3Pwv2izeY4sq7YcPX/dtLwzg5NU1AxWuWxKwd0p0= github.com/loov/hrtime v1.0.3 h1:LiWKU3B9skJwRPUf0Urs9+0+OE3TxdMuiRPOTwR0gcU= github.com/loov/hrtime v1.0.3/go.mod h1:yDY3Pwv2izeY4sq7YcPX/dtLwzg5NU1AxWuWxKwd0p0= From 7a7e8b43fe96045952a01da970ba32a2c29e07b9 Mon Sep 17 00:00:00 2001 From: guidfort Date: Fri, 25 Aug 2023 09:11:49 +0000 Subject: [PATCH 6/8] Update Makefile - support ctrlx-datalayer 2.2.7 --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f5d2495..a93e9c7 100644 --- a/Makefile +++ b/Makefile @@ -8,8 +8,8 @@ GOOS := $(shell go env GOOS) GOARCH := $(shell go env GOARCH) BUILD := build/public/$(GOOS)_$(GOARCH) -DATALAYER_DEB_VERSION := 1.20.0 -DATALAYER_DEB_FILE_VERSION := 1.10.7 +DATALAYER_DEB_VERSION := 2.2.0 +DATALAYER_DEB_FILE_VERSION := 2.2.7 .PHONY: all go-dep apt-dep lint vet test test-coverage build clean From beefe8ca5e10fedb6c547569f65070aa17c95e22 Mon Sep 17 00:00:00 2001 From: guidfort Date: Fri, 25 Aug 2023 09:14:15 +0000 Subject: [PATCH 7/8] Update github workflows --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a622ab0..89f9bea 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,8 +24,8 @@ jobs: sudo apt-get update sudo apt-get install -y libsystemd-dev libzmq3-dev sudo apt install pkg-config - wget https://github.com/boschrexroth/ctrlx-automation-sdk/releases/download/1.20.0/ctrlx-datalayer-1.10.7.deb - sudo apt-get install -y -f ./ctrlx-datalayer-1.10.7.deb + wget https://github.com/boschrexroth/ctrlx-automation-sdk/releases/download/2.2.0/ctrlx-datalayer-2.2.7.deb + sudo apt-get install -y -f ./ctrlx-datalayer-2.2.7.deb - name: Go uses: actions/setup-go@v2 From ea85db654ecf8c733e49e11b3ed5e4e3afc82a9c Mon Sep 17 00:00:00 2001 From: guidfort Date: Fri, 25 Aug 2023 09:19:16 +0000 Subject: [PATCH 8/8] update readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5223c96..6774167 100644 --- a/README.md +++ b/README.md @@ -44,8 +44,8 @@ sudo apt-get install libsystemd-dev libsystemd-dev:arm64 libzmq3-dev libzmq3-dev Check the current [ctrlx Data Layer](https://github.com/boschrexroth/ctrlx-automation-sdk/releases) debian package, download and install this, see example. ```bash -wget https://github.com/boschrexroth/ctrlx-automation-sdk/releases/download/1.20.0/ctrlx-datalayer-1.10.7.deb -sudo dpkg -i ctrlx-datalayer-1.10.7.deb +wget https://github.com/boschrexroth/ctrlx-automation-sdk/releases/download/2.2.0/ctrlx-datalayer-2.2.7.deb +sudo dpkg -i ctrlx-datalayer-2.2.7.deb ``` ### Integrate in you project