Skip to content

Commit

Permalink
Merge pull request #10 from boschrexroth/feature/update_datalayer
Browse files Browse the repository at this point in the history
update ctrlX Data Layer
  • Loading branch information
albrecht-j authored May 8, 2024
2 parents e96a4de + 6b217ce commit 7fe2fc4
Show file tree
Hide file tree
Showing 103 changed files with 6,847 additions and 1,664 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Run check
run: |
uname -a
ls -lah
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/2.4.0/ctrlx-datalayer-2.4.5.deb
sudo apt-get install -y -f ./ctrlx-datalayer-2.4.5.deb
sudo apt install pkg-config
wget https://github.com/boschrexroth/ctrlx-automation-sdk/releases/download/2.6.0/ctrlx-datalayer-2.6.1.deb
sudo apt-get install -y -f ./ctrlx-datalayer-2.6.1.deb
- name: Go
uses: actions/setup-go@v3
with:
Expand All @@ -38,7 +38,7 @@ jobs:
go mod vendor
go mod tidy
go test -race -short -count=1 -mod=vendor ./test/datalayer ./test/sseclient ./test/token
- name: Set up Go
uses: actions/setup-go@v3
with:
Expand All @@ -49,4 +49,4 @@ jobs:
go mod download
go mod vendor
go test -race -short -count=1 -mod=vendor ./test/datalayer ./test/sseclient ./test/token
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@ GOOS := $(shell go env GOOS)
GOARCH := $(shell go env GOARCH)
BUILD := build/public/$(GOOS)_$(GOARCH)

DATALAYER_DEB_VERSION := 2.4.0
DATALAYER_DEB_FILE_VERSION := 2.4.5
DATALAYER_DEB_VERSION := 2.6.0
DATALAYER_DEB_FILE_VERSION := 2.6.1

.PHONY: all go-dep apt-dep lint vet test test-coverage build clean

all: build

go-dep: ## Get go dependencies
@go get -u ./...
@go mod download
@go mod vendor
@go mod tidy

apt-dep: ## Get native dependencies
@sudo apt-get update
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This project provides:

It wraps the original ctrlX Data Layer written in C++.

You can find documentation and examples here [ctrlX Software Development Kit](https://boschrexroth.github.io/ctrlx-automation-sdk/) and [GoDoc](https://pkg.go.dev/github.com/boschrexroth/ctrlx-datalayer-golang/pkg/datalayer).
You can find documentation and examples here [ctrlX Software Development Kit](https://boschrexroth.github.io/ctrlx-automation-sdk/) and [GoDoc](https://pkg.go.dev/github.com/boschrexroth/ctrlx-datalayer-golang/v2/pkg/datalayer).

2. Server-Sent Events(SSE) Client

Expand All @@ -16,15 +16,15 @@ This project provides:

The SSE client library can be used to connect to the SSE Server of the ctrlX Data Layer running on the ctrlX Device. It is possible to subscribe to nodes on the server and the server will automatically send new updates on value changes.

You can find documentation here [GoDoc](https://pkg.go.dev/github.com/boschrexroth/ctrlx-datalayer-golang/pkg/sseclient)
You can find documentation here [GoDoc](https://pkg.go.dev/github.com/boschrexroth/ctrlx-datalayer-golang/v2/pkg/sseclient)

3. Token handling

JSON Web Token is used for authentification in ctrlX Core.

The token library can be used to get token from ctrlX Core and later on check if the token is still valid.

You can find documentation here [GoDoc](https://pkg.go.dev/github.com/boschrexroth/ctrlx-datalayer-golang/pkg/token)
You can find documentation here [GoDoc](https://pkg.go.dev/github.com/boschrexroth/ctrlx-datalayer-golang/v2/pkg/token)

## Status

Expand All @@ -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/2.4.0/ctrlx-datalayer-2.4.5.deb
sudo dpkg -i ctrlx-datalayer-2.4.5.deb
wget https://github.com/boschrexroth/ctrlx-automation-sdk/releases/download/2.6.0/ctrlx-datalayer-2.6.1.deb
sudo dpkg -i ctrlx-datalayer-2.6.1.deb
```

### Integrate in you project
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ module github.com/boschrexroth/ctrlx-datalayer-golang/v2
go 1.21

require (
github.com/google/flatbuffers v23.5.26+incompatible
github.com/google/flatbuffers v24.3.25+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.8.4
github.com/stretchr/testify v1.9.0
gopkg.in/yaml.v2 v2.4.0
)

Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
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/google/flatbuffers v24.3.25+incompatible h1:CX395cjN9Kke9mmalRoL3d81AtFUxJM+yDthflgJGkI=
github.com/google/flatbuffers v24.3.25+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=
Expand All @@ -14,8 +14,8 @@ github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 h1:Yl0tPBa8QPjG
github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852/go.mod h1:eqOVx5Vwu4gd2mmMZvVZsgIqNSaW3xxRThUJ0k/TPk4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
Expand Down
21 changes: 16 additions & 5 deletions pkg/datalayer/metadatabuilder.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* MIT License
*
* Copyright (c) 2021-2023 Bosch Rexroth AG
* Copyright (c) 2021-2024 Bosch Rexroth AG
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -89,7 +89,10 @@ type MetaDataBuilder struct {
}

// NewMetaDataBuilder generates MetaDataBuilder instance
func NewMetaDataBuilder(a AllowedOperation, desc string, descurl string) *MetaDataBuilder {
// Parameter operations are the allowed operations of the provider node
// Parameter desc is the description of the provider node and should not be empty ("")
// Parameter descurl is the URL of the description and should not be empty ("")
func NewMetaDataBuilder(operations AllowedOperation, desc string, descurl string) *MetaDataBuilder {
m := &MetaDataBuilder{description: desc, descriptionurl: descurl}
m.name = ""
m.unit = ""
Expand All @@ -99,7 +102,7 @@ func NewMetaDataBuilder(a AllowedOperation, desc string, descurl string) *MetaDa
m.extensions = make(map[string]string)
m.descriptions = make(map[string]string)
m.displaynames = make(map[string]string)
m.Operations(a)
m.Operations(operations)
return m
}

Expand All @@ -123,8 +126,8 @@ func (m *MetaDataBuilder) Build() *Variant {
operations := m.operations()

meta := fbs.MetadataT{}
meta.Description = m.description
meta.DescriptionUrl = m.descriptionurl
meta.Description = m.fixFlatcOptimizer(m.description)
meta.DescriptionUrl = m.fixFlatcOptimizer(m.descriptionurl)
meta.DisplayName = m.name
meta.Unit = m.unit
meta.DisplayFormat = m.displayformat
Expand Down Expand Up @@ -286,3 +289,11 @@ func (m *MetaDataBuilder) AddLocalizationDisplayName(id, txt string) *MetaDataBu
m.displaynames[id] = txt
return m
}

// see flatbuffers commit: https://github.com/google/flatbuffers/commit/96d438df47d
func (m *MetaDataBuilder) fixFlatcOptimizer(val string) string {
if val == "" {
return " "
}
return val
}
8 changes: 8 additions & 0 deletions pkg/fbs/comm/axisprofile/fbtypes/variableType.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

114 changes: 114 additions & 0 deletions pkg/fbs/comm/datalayer/Capabilities.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions pkg/fbs/comm/datalayer/DataChangeTrigger.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7fe2fc4

Please sign in to comment.