aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/apps/lineOfSightApp/src/handlers/mapHandler.ts
diff options
context:
space:
mode:
Diffstat (limited to 'sdnr/wt/odlux/apps/lineOfSightApp/src/handlers/mapHandler.ts')
-rw-r--r--sdnr/wt/odlux/apps/lineOfSightApp/src/handlers/mapHandler.ts82
1 files changed, 82 insertions, 0 deletions
diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src/handlers/mapHandler.ts b/sdnr/wt/odlux/apps/lineOfSightApp/src/handlers/mapHandler.ts
new file mode 100644
index 000000000..6d11977bf
--- /dev/null
+++ b/sdnr/wt/odlux/apps/lineOfSightApp/src/handlers/mapHandler.ts
@@ -0,0 +1,82 @@
+/**
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt odlux
+ * =================================================================================================
+ * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ */
+
+ import { LatLon } from "../model/LatLon";
+import { IActionHandler } from "../../../../framework/src/flux/action";
+import { SetPassedInValuesAction, SetReachableAction } from "../actions/commonActions";
+import { ClearSavedChartAction, SetChartAction, SetEndpointAction, SetHeightA, SetHeightB, SetMapCenterAction, SetStartPointAction } from "../actions/mapActions";
+import { Height } from "model/Height";
+import { isNullOrUndefined } from "util";
+
+
+
+ export interface IMap {
+ center: LatLon;
+ zoom: number;
+ start: LatLon |null;
+ heightA: Height | null;
+ end: LatLon|null;
+ heightB: Height | null;
+ ready: boolean |null;
+ }
+
+ const initialState: IMap = {
+ center: {latitude:52.4003, longitude:13.0584},
+ zoom: 12,
+ start: null,
+ end: null,
+ ready: null,
+ heightA: null,
+ heightB: null
+
+ }
+
+ export const mapHandler: IActionHandler<IMap> = (state = initialState, action) => {
+ if (action instanceof SetPassedInValuesAction) {
+ state = { ...state, start: action.start, end: action.end, center: action.center, heightA: action.heightA, heightB: action.heightB };
+ }
+ else if(action instanceof SetReachableAction){
+ state = { ...state, ready: action.reachable };
+
+ }else if(action instanceof SetChartAction){
+ state = {...state, start:action.startPoint, end: action.endPoint, heightA: action.heightA, heightB: action.heightB}
+ }
+ else if(action instanceof SetStartPointAction){
+ state = {...state, start:action.startPoint}
+
+ }
+ else if(action instanceof SetEndpointAction){
+ state = {...state, end:action.endPoint}
+
+ }
+ else if(action instanceof SetHeightA){
+ state = {...state, heightA:action.height}
+
+ }
+ else if(action instanceof SetHeightB){
+ state = {...state, heightB:action.height}
+
+ }
+ else if(action instanceof ClearSavedChartAction){
+ state= {...state, start: null, end: null, heightA:null, heightB: null}
+ }else if(action instanceof SetMapCenterAction){
+ state={...state, zoom: action.zoom,center:action.point}
+ }
+
+ return state;
+ } \ No newline at end of file
ht .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
# Copyright © 2018  AT&T Intellectual Property.  All rights reserved.
# Modifications Copyright © 2018 Amdocs,Bell Canada
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#################################################################
# Global configuration defaults.
#################################################################
global:
  nodePortPrefix: 302
  readinessRepository: oomk8s
  readinessImage: readiness-check:2.0.0
  loggingRepository: docker.elastic.co
  loggingImage: beats/filebeat:5.5.0

#################################################################
# Application configuration defaults.
#################################################################
pullPolicy: Always

# application images
repository: nexus3.onap.org:10001

image: onap/dmaap/buscontroller:1.0.12


# application configuration
dmaapMessageRouterService: message-router
aafURL: https://aaf-authz/
topicMgrUser: m23456@dmaapbc.onap.org
topicMgrPwd: onapdemo
adminUser: m12345@dmaapbc.onap.org
adminPwd: onapdemo

nodeSelector: {}

affinity: {}

# probe configuration parameters
liveness:
  initialDelaySeconds: 10
  periodSeconds: 10
  # necessary to disable liveness probe when setting breakpoints
  # in debugger so K8s doesn't restart unresponsive container
  enabled: false

readiness:
  initialDelaySeconds: 10
  periodSeconds: 10


service:
  type: NodePort
  name: dmaap-bc
  portName: dmaap-bc
  portName2: dmaap-bc
  externalPort: 8080
  internalPort: 8080
  externalPort2: 8443
  internalPort2: 8443
  nodePort: 41
  nodePort2: 42


# application configuration override for postgres
postgres:
  nameOverride: dbc-pg
  service:
    name: dbc-postgres
    name2: dbc-pg-primary
    name3: dbc-pg-replica
  container:
    name:
      primary: dbc-pg-primary
      replica: dbc-pg-replica
  config:
    pgUserName: dmaap_admin
    pgDatabase: dmaap
    pgPrimaryPassword: onapdemodb
    pgUserPassword: onapdemodb
    pgRootPassword: onapdemodb
  persistence:
    mountSubPath: dbc/data
    mountInitPath: dbc

ingress:
  enabled: false

resources: {}
  # We usually recommend not to specify default resources and to leave this as a conscious
  # choice for the user. This also increases chances charts run on environments with little
  # resources, such as Minikube. If you do want to specify resources, uncomment the following
  # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
  #
  # Example:
  # Configure resource requests and limits
  # ref: http://kubernetes.io/docs/user-guide/compute-resources/
  # Minimum memory for development is 2 CPU cores and 4GB memory
  # Minimum memory for production is 4 CPU cores and 8GB memory
#resources:
#  limits:
#    cpu: 2
#    memory: 4Gi
#  requests:
#    cpu: 2
#    memory: 4Gi