Commit cb43c25c authored by Sonja Happ's avatar Sonja Happ
Browse files

add fitting number of input and output signals for signal generator in test data

parent 1e708e9c
......@@ -136,7 +136,7 @@ var ScenarioB = database.Scenario{
// Component Configuration
var ConfigA = database.ComponentConfiguration{
Name: "Example simulation",
Name: "Example for Signal generator",
StartParameters: postgres.Jsonb{startParametersA},
SelectedFileID: 3,
}
......@@ -163,18 +163,39 @@ var OutSignalB = database.Signal{
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{
Name: "inSignal_A",
Direction: "in",
Index: 1,
Unit: "A",
Unit: "---",
}
var InSignalB = database.Signal{
Name: "inSignal_B",
Direction: "in",
Index: 2,
Unit: "A",
Unit: "---",
}
// Dashboards
......
......@@ -147,8 +147,8 @@ func AddTestData(basePath string, router *gin.Engine) (*bytes.Buffer, error) {
configB := helper.ConfigB
configA.ScenarioID = 1
configB.ScenarioID = 1
configA.ICID = 1
configB.ICID = 2
configA.ICID = 2
configB.ICID = 1
code, resp, err = helper.TestEndpoint(router, token, basePath+"/configs", "POST", helper.KeyModels{"config": configA})
if code != http.StatusOK {
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
inSignalA := helper.InSignalA
inSignalB := helper.InSignalB
outSignalC := helper.OutSignalC
outSignalD := helper.OutSignalD
outSignalE := helper.OutSignalE
outSignalA.ConfigID = 1
outSignalB.ConfigID = 1
outSignalC.ConfigID = 1
outSignalD.ConfigID = 1
outSignalE.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})
if code != http.StatusOK {
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 {
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})
if code != http.StatusOK {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment