Skip to content

Commit f47c01e

Browse files
authored
Merge pull request #173 from HyperloopUPV-H8/backend/adj
[backend][3] ADJ
2 parents 3ddc5c1 + cd8a82e commit f47c01e

32 files changed

Lines changed: 14 additions & 1526 deletions

.github/workflows/build-control-station.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: Build control station
22

33
on:
4-
workflow_call:
54
workflow_dispatch:
65
pull_request:
76
paths:

.github/workflows/build-ethernet-view.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: Build ethernet view
22

33
on:
4-
workflow_call:
54
workflow_dispatch:
65
pull_request:
76
paths:

backend/cmd/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"encoding/binary"
77
"flag"
88
"fmt"
9-
"github.com/HyperloopUPV-H8/h9-backend/pkg/excel/utils"
109

1110
"log"
1211
"net"
@@ -24,6 +23,7 @@ import (
2423
"github.com/HyperloopUPV-H8/h9-backend/internal/common"
2524
"github.com/HyperloopUPV-H8/h9-backend/internal/pod_data"
2625
"github.com/HyperloopUPV-H8/h9-backend/internal/update_factory"
26+
"github.com/HyperloopUPV-H8/h9-backend/internal/utils"
2727
vehicle_models "github.com/HyperloopUPV-H8/h9-backend/internal/vehicle/models"
2828
"github.com/HyperloopUPV-H8/h9-backend/pkg/abstraction"
2929
"github.com/HyperloopUPV-H8/h9-backend/pkg/broker"

backend/internal/adj/adj.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ func getBoards(info Info, boardsList map[string]string) (map[string]Board, error
9797
return nil, err
9898
}
9999

100-
// board.Structures = getBoardStructures( boardJSON.StructuresPaths) // TODO: Issued in JSON_ADE #1
101-
102100
boards[boardName] = board
103101
}
104102

backend/internal/adj/models.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
package adj
22

3+
import "github.com/HyperloopUPV-H8/h9-backend/internal/utils"
4+
35
type ADJ struct {
46
Info Info
57
Boards map[string]Board
68
}
79

810
type Info struct {
9-
Ports map[string]uint16 `json:"ports"`
10-
Addresses map[string]string `json:"addresses"`
11-
Units map[string]string `json:"units"`
12-
MessageIds map[string]uint16 `json:"message_ids"`
11+
Ports map[string]uint16 `json:"ports"`
12+
Addresses map[string]string `json:"addresses"`
13+
Units map[string]utils.Operations `json:"units"`
14+
MessageIds map[string]uint16 `json:"message_ids"`
1315
BoardIds map[string]uint16
1416
}
1517

backend/internal/pod_data/measurement.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"fmt"
55
"strings"
66

7+
"github.com/HyperloopUPV-H8/h9-backend/internal/adj"
78
"github.com/HyperloopUPV-H8/h9-backend/internal/common"
8-
"github.com/HyperloopUPV-H8/h9-backend/internal/excel/adj"
9-
"github.com/HyperloopUPV-H8/h9-backend/internal/excel/utils"
9+
"github.com/HyperloopUPV-H8/h9-backend/internal/utils"
1010
)
1111

1212
const EnumType = "enum"
@@ -114,7 +114,7 @@ func getBooleanMeasurement(adeMeas adj.Measurement) BooleanMeasurement {
114114
}
115115

116116
func isNumeric(kind string) bool {
117-
return (kind == "uint8" ||
117+
return kind == "uint8" ||
118118
kind == "uint16" ||
119119
kind == "uint32" ||
120120
kind == "uint64" ||
@@ -123,5 +123,5 @@ func isNumeric(kind string) bool {
123123
kind == "int32" ||
124124
kind == "int64" ||
125125
kind == "float32" ||
126-
kind == "float64")
126+
kind == "float64"
127127
}

backend/internal/pod_data/models.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package pod_data
22

3-
import "github.com/HyperloopUPV-H8/h9-backend/internal/excel/utils"
3+
import "github.com/HyperloopUPV-H8/h9-backend/internal/utils"
44

55
type PodData struct {
66
Boards []Board `json:"boards"`

backend/internal/pod_data/pod_data.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package pod_data
22

33
import (
4+
"github.com/HyperloopUPV-H8/h9-backend/internal/utils"
45
"strconv"
56

7+
"github.com/HyperloopUPV-H8/h9-backend/internal/adj"
68
"github.com/HyperloopUPV-H8/h9-backend/internal/common"
7-
"github.com/HyperloopUPV-H8/h9-backend/internal/excel/adj"
8-
"github.com/HyperloopUPV-H8/h9-backend/internal/excel/utils"
99
)
1010

1111
func NewPodData(adeBoards map[string]adj.Board, globalUnits map[string]utils.Operations) (PodData, error) {

0 commit comments

Comments
 (0)