Commit 598676ad authored by Yann Garcia's avatar Yann Garcia
Browse files

Bug fixed in qosKpis construtor

parent 8b08a46a
Loading
Loading
Loading
Loading
+10 −10
Changes for go-apps/meep-vis/server/vis.go: 10 added lines, 10 removed lines.
Original line number Diff line number Diff line
@@ -716,9 +716,9 @@ func predictedQosPost(w http.ResponseWriter, r *http.Request) {
	}

	if requestData.PredictionTarget == "SINGLE_UE_PREDICTION" {
		if requestData.predictionArea != nil || len(requestData.predictionArea) != 0 {
			log.Error("PredictionArea field shall not be present when predictionTarget is SINGLE_UE_PREDICTION")
			errHandlerProblemDetails(w, "PredictionArea field shall not be present when predictionTarget is SINGLE_UE_PREDICTION in the request.", http.StatusBadRequest)
		if requestData.PredictionArea != nil {
			log.Error("PredictionArea field shall not be present when PredictionTarget is SINGLE_UE_PREDICTION")
			errHandlerProblemDetails(w, "PredictionArea field shall not be present when PredictionTarget is SINGLE_UE_PREDICTION in the request.", http.StatusBadRequest)
			return
		}
		if requestData.Routes == nil || len(requestData.Routes) == 0 {
@@ -728,13 +728,13 @@ func predictedQosPost(w http.ResponseWriter, r *http.Request) {
		}
	} else if requestData.PredictionTarget == "E2E_APPLICATION_INSTANCE_PREDICTION" {
		if requestData.Routes != nil || len(requestData.Routes) != 0 {
			log.Error("Routes field shall not present when predictionTarget is E2E_APPLICATION_INSTANCE_PREDICTION")
			errHandlerProblemDetails(w, "Routes field shall not present when predictionTarget is E2E_APPLICATION_INSTANCE_PREDICTION in the request.", http.StatusBadRequest)
			log.Error("Routes field shall not present when PredictionTarget is E2E_APPLICATION_INSTANCE_PREDICTION")
			errHandlerProblemDetails(w, "Routes field shall not present when PredictionTarget is E2E_APPLICATION_INSTANCE_PREDICTION in the request.", http.StatusBadRequest)
			return
		}
		if requestData.predictionArea == nil || len(requestData.predictionArea) == 0 {
			log.Error("PredictionArea field shall be present when predictionTarget is E2E_APPLICATION_INSTANCE_PREDICTION")
			errHandlerProblemDetails(w, "PredictionArea field shall be present when predictionTarget is E2E_APPLICATION_INSTANCE_PREDICTION in the request.", http.StatusBadRequest)
		if requestData.PredictionArea == nil {
			log.Error("PredictionArea field shall be present when PredictionTarget is E2E_APPLICATION_INSTANCE_PREDICTION")
			errHandlerProblemDetails(w, "PredictionArea field shall be present when PredictionTarget is E2E_APPLICATION_INSTANCE_PREDICTION in the request.", http.StatusBadRequest)
			return
		}
		log.Error("E2E_APPLICATION_INSTANCE_PREDICTION is not supported")
@@ -840,8 +840,8 @@ func predictedQosPost(w http.ResponseWriter, r *http.Request) {
			log.Debug("predictedQosPost: longCheck: ", longCheck)
			if latCheck && longCheck {
				qosKpis := make([]QosKpi, 2)
				qosKpis[0] = QosKpi{"rsrp", strconv.Itoa(int(currGeoCoordinate.Rsrp)), "1"}
				qosKpis[1] = QosKpi{"rsrq", strconv.Itoa(int(currGeoCoordinate.Rsrq)), "1"}
				qosKpis[0] = QosKpi{Confidence: "1", KpiName: "rsrp", KpiValue: strconv.Itoa(int(currGeoCoordinate.Rsrp))}
				qosKpis[1] = QosKpi{Confidence: "1", KpiName: "rsrq", KpiValue: strconv.Itoa(int(currGeoCoordinate.Rsrq))}
				qos.Stream = append(qos.Stream, Stream{StreamId: strconv.Itoa(j), QosKpi: qosKpis})
			}
			routeInfo.Location.Ecgi = nil