mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
add fitting number of input and output signals for signal generator in test data
This commit is contained in:
parent
1e708e9cb5
commit
cb43c25c27
2 changed files with 46 additions and 6 deletions
|
@ -136,7 +136,7 @@ var ScenarioB = database.Scenario{
|
||||||
// Component Configuration
|
// Component Configuration
|
||||||
|
|
||||||
var ConfigA = database.ComponentConfiguration{
|
var ConfigA = database.ComponentConfiguration{
|
||||||
Name: "Example simulation",
|
Name: "Example for Signal generator",
|
||||||
StartParameters: postgres.Jsonb{startParametersA},
|
StartParameters: postgres.Jsonb{startParametersA},
|
||||||
SelectedFileID: 3,
|
SelectedFileID: 3,
|
||||||
}
|
}
|
||||||
|
@ -163,18 +163,39 @@ var OutSignalB = database.Signal{
|
||||||
Unit: "V",
|
Unit: "V",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var OutSignalC = database.Signal{
|
||||||
|
Name: "outSignal_C",
|
||||||
|
Direction: "out",
|
||||||
|
Index: 3,
|
||||||
|
Unit: "---",
|
||||||
|
}
|
||||||
|
|
||||||
|
var OutSignalD = database.Signal{
|
||||||
|
Name: "outSignal_D",
|
||||||
|
Direction: "out",
|
||||||
|
Index: 4,
|
||||||
|
Unit: "---",
|
||||||
|
}
|
||||||
|
|
||||||
|
var OutSignalE = database.Signal{
|
||||||
|
Name: "outSignal_E",
|
||||||
|
Direction: "out",
|
||||||
|
Index: 5,
|
||||||
|
Unit: "---",
|
||||||
|
}
|
||||||
|
|
||||||
var InSignalA = database.Signal{
|
var InSignalA = database.Signal{
|
||||||
Name: "inSignal_A",
|
Name: "inSignal_A",
|
||||||
Direction: "in",
|
Direction: "in",
|
||||||
Index: 1,
|
Index: 1,
|
||||||
Unit: "A",
|
Unit: "---",
|
||||||
}
|
}
|
||||||
|
|
||||||
var InSignalB = database.Signal{
|
var InSignalB = database.Signal{
|
||||||
Name: "inSignal_B",
|
Name: "inSignal_B",
|
||||||
Direction: "in",
|
Direction: "in",
|
||||||
Index: 2,
|
Index: 2,
|
||||||
Unit: "A",
|
Unit: "---",
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dashboards
|
// Dashboards
|
||||||
|
|
|
@ -147,8 +147,8 @@ func AddTestData(basePath string, router *gin.Engine) (*bytes.Buffer, error) {
|
||||||
configB := helper.ConfigB
|
configB := helper.ConfigB
|
||||||
configA.ScenarioID = 1
|
configA.ScenarioID = 1
|
||||||
configB.ScenarioID = 1
|
configB.ScenarioID = 1
|
||||||
configA.ICID = 1
|
configA.ICID = 2
|
||||||
configB.ICID = 2
|
configB.ICID = 1
|
||||||
code, resp, err = helper.TestEndpoint(router, token, basePath+"/configs", "POST", helper.KeyModels{"config": configA})
|
code, resp, err = helper.TestEndpoint(router, token, basePath+"/configs", "POST", helper.KeyModels{"config": configA})
|
||||||
if code != http.StatusOK {
|
if code != http.StatusOK {
|
||||||
return resp, fmt.Errorf("error adding Config A")
|
return resp, fmt.Errorf("error adding Config A")
|
||||||
|
@ -209,10 +209,17 @@ func AddTestData(basePath string, router *gin.Engine) (*bytes.Buffer, error) {
|
||||||
outSignalB := helper.OutSignalB
|
outSignalB := helper.OutSignalB
|
||||||
inSignalA := helper.InSignalA
|
inSignalA := helper.InSignalA
|
||||||
inSignalB := helper.InSignalB
|
inSignalB := helper.InSignalB
|
||||||
|
outSignalC := helper.OutSignalC
|
||||||
|
outSignalD := helper.OutSignalD
|
||||||
|
outSignalE := helper.OutSignalE
|
||||||
outSignalA.ConfigID = 1
|
outSignalA.ConfigID = 1
|
||||||
outSignalB.ConfigID = 1
|
outSignalB.ConfigID = 1
|
||||||
|
outSignalC.ConfigID = 1
|
||||||
|
outSignalD.ConfigID = 1
|
||||||
|
outSignalE.ConfigID = 1
|
||||||
inSignalA.ConfigID = 1
|
inSignalA.ConfigID = 1
|
||||||
inSignalB.ConfigID = 1
|
inSignalB.ConfigID = 2
|
||||||
|
|
||||||
code, resp, err = helper.TestEndpoint(router, token, basePath+"/signals", "POST", helper.KeyModels{"signal": outSignalB})
|
code, resp, err = helper.TestEndpoint(router, token, basePath+"/signals", "POST", helper.KeyModels{"signal": outSignalB})
|
||||||
if code != http.StatusOK {
|
if code != http.StatusOK {
|
||||||
return resp, fmt.Errorf("error adding outSignalB")
|
return resp, fmt.Errorf("error adding outSignalB")
|
||||||
|
@ -221,6 +228,18 @@ func AddTestData(basePath string, router *gin.Engine) (*bytes.Buffer, error) {
|
||||||
if code != http.StatusOK {
|
if code != http.StatusOK {
|
||||||
return resp, fmt.Errorf("error adding outSignalA")
|
return resp, fmt.Errorf("error adding outSignalA")
|
||||||
}
|
}
|
||||||
|
code, resp, err = helper.TestEndpoint(router, token, basePath+"/signals", "POST", helper.KeyModels{"signal": outSignalC})
|
||||||
|
if code != http.StatusOK {
|
||||||
|
return resp, fmt.Errorf("error adding outSignalC")
|
||||||
|
}
|
||||||
|
code, resp, err = helper.TestEndpoint(router, token, basePath+"/signals", "POST", helper.KeyModels{"signal": outSignalD})
|
||||||
|
if code != http.StatusOK {
|
||||||
|
return resp, fmt.Errorf("error adding outSignalD")
|
||||||
|
}
|
||||||
|
code, resp, err = helper.TestEndpoint(router, token, basePath+"/signals", "POST", helper.KeyModels{"signal": outSignalE})
|
||||||
|
if code != http.StatusOK {
|
||||||
|
return resp, fmt.Errorf("error adding outSignalE")
|
||||||
|
}
|
||||||
|
|
||||||
code, resp, err = helper.TestEndpoint(router, token, basePath+"/signals", "POST", helper.KeyModels{"signal": inSignalA})
|
code, resp, err = helper.TestEndpoint(router, token, basePath+"/signals", "POST", helper.KeyModels{"signal": inSignalA})
|
||||||
if code != http.StatusOK {
|
if code != http.StatusOK {
|
||||||
|
|
Loading…
Add table
Reference in a new issue