From 1a868116614dd9996c78e69941b537e9da19460b Mon Sep 17 00:00:00 2001 From: Aijana Schumann Date: Tue, 1 Feb 2022 13:18:42 +0100 Subject: Update ODLUX Updated to Material-ui 5, updated dashboard view, removed NetworkMap, LinkCalculator and LineOfSightApp, small bugfixes Issue-ID: CCSDK-3580 Signed-off-by: Aijana Schumann Change-Id: Id0fc148673e23a755cafc2be1c489248c38ff47c --- sdnr/wt/odlux/apps/linkCalculationApp/.babelrc | 17 - sdnr/wt/odlux/apps/linkCalculationApp/package.json | 49 -- sdnr/wt/odlux/apps/linkCalculationApp/pom.xml | 159 ------ .../src/actions/commonLinkCalculationActions.ts | 160 ------ .../src/components/connectionInfo.tsx | 56 -- .../src/handlers/linkCalculationAppRootHandler.ts | 199 ------- .../odlux/apps/linkCalculationApp/src/index.html | 28 - .../src/pluginLinkCalculation.tsx | 192 ------- .../apps/linkCalculationApp/src/views/Style.scss | 116 ----- .../src/views/linkCalculationComponent.tsx | 579 --------------------- .../sdnr/wt/odlux/bundles/MyOdluxBundle.java | 68 --- .../resources/OSGI-INF/blueprint/blueprint.xml | 9 - .../sdnr/wt/odlux/bundles/test/TestBundleRes.java | 46 -- .../linkCalculationApp/src2/test/resources/test.js | 5 - .../wt/odlux/apps/linkCalculationApp/tsconfig.json | 37 -- .../apps/linkCalculationApp/webpack.config.js | 187 ------- 16 files changed, 1907 deletions(-) delete mode 100644 sdnr/wt/odlux/apps/linkCalculationApp/.babelrc delete mode 100644 sdnr/wt/odlux/apps/linkCalculationApp/package.json delete mode 100644 sdnr/wt/odlux/apps/linkCalculationApp/pom.xml delete mode 100644 sdnr/wt/odlux/apps/linkCalculationApp/src/actions/commonLinkCalculationActions.ts delete mode 100644 sdnr/wt/odlux/apps/linkCalculationApp/src/components/connectionInfo.tsx delete mode 100644 sdnr/wt/odlux/apps/linkCalculationApp/src/handlers/linkCalculationAppRootHandler.ts delete mode 100644 sdnr/wt/odlux/apps/linkCalculationApp/src/index.html delete mode 100644 sdnr/wt/odlux/apps/linkCalculationApp/src/pluginLinkCalculation.tsx delete mode 100644 sdnr/wt/odlux/apps/linkCalculationApp/src/views/Style.scss delete mode 100644 sdnr/wt/odlux/apps/linkCalculationApp/src/views/linkCalculationComponent.tsx delete mode 100644 sdnr/wt/odlux/apps/linkCalculationApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java delete mode 100644 sdnr/wt/odlux/apps/linkCalculationApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml delete mode 100644 sdnr/wt/odlux/apps/linkCalculationApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java delete mode 100644 sdnr/wt/odlux/apps/linkCalculationApp/src2/test/resources/test.js delete mode 100644 sdnr/wt/odlux/apps/linkCalculationApp/tsconfig.json delete mode 100644 sdnr/wt/odlux/apps/linkCalculationApp/webpack.config.js (limited to 'sdnr/wt/odlux/apps/linkCalculationApp') diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/.babelrc b/sdnr/wt/odlux/apps/linkCalculationApp/.babelrc deleted file mode 100644 index 3d8cd1260..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/.babelrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "presets": [ - ["@babel/preset-react"], - ["@babel/preset-env", { - "targets": { - "chrome": "66" - }, - "spec": true, - "loose": false, - "modules": false, - "debug": false, - "useBuiltIns": "usage", - "forceAllTransforms": true - }] - ], - "plugins": [] -} diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/package.json b/sdnr/wt/odlux/apps/linkCalculationApp/package.json deleted file mode 100644 index c03afe19b..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "@odlux/linkcalculation-app", - "version": "0.1.0", - "description": "A react based modular UI to do link analysis.", - "main": "index.js", - "scripts": { - "start": "webpack-dev-server --env debug", - "build": "webpack --env release --config webpack.config.js", - "build:dev": "webpack --env debug --config webpack.config.js" - }, - "repository": { - "type": "git", - "url": "https://git.mfico.de/highstreet-technologies/odlux.git" - }, - "keywords": [ - "reactjs", - "redux", - "ui", - "framework" - ], - "author": "Mohammad Boroon", - "license": "Apache-2.0", - "dependencies": { - "@odlux/framework": "*", - "formik": "^2.1.5", - "yup": "^0.29.3" - }, - "peerDependencies": { - "@types/react": "17.0.3", - "@types/react-dom": "17.0.2", - "@types/react-router-dom": "5.1.7", - "@material-ui/core": "4.11.4", - "@material-ui/icons": "4.11.2", - "@types/classnames": "2.2.6", - "@types/flux": "3.1.8", - "@types/jquery": "3.3.10", - "jquery": "3.3.1", - "react": "17.0.1", - "react-dom": "17.0.1", - "react-router-dom": "5.2.0" - }, - "devDependencies": { - "@types/yup": "^0.29.7", - "node-sass": "^4.14.1", - "sass": "^1.26.11", - "sass-loader": "^10.0.2", - "webpack": "^4.44.2" - } -} diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/pom.xml b/sdnr/wt/odlux/apps/linkCalculationApp/pom.xml deleted file mode 100644 index 606eb24df..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/pom.xml +++ /dev/null @@ -1,159 +0,0 @@ - - - - 4.0.0 - - - org.onap.ccsdk.parent - binding-parent - 2.3.2 - - - - org.onap.ccsdk.features.sdnr.wt - sdnr-wt-odlux-app-linkCalculationApp - 1.3.0-SNAPSHOT - bundle - - ccsdk-features :: ${project.artifactId} - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0 - - - - - true - - - - - ${project.groupId} - sdnr-wt-odlux-core-model - ${project.version} - - - ${project.groupId} - sdnr-wt-odlux-core-provider - ${project.version} - test - - - junit - junit - test - - - - - src2/main/java - - - dist - odlux - - - src2/main/resources - - - src2/test/resources - - - - - maven-clean-plugin - - - - dist - false - - - node - false - - - node_modules - false - - - ../node_modules - false - - - - bin - false - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - add-test-source - generate-test-sources - - add-test-source - - - - src2/test/java - - - - - - - de.jacks-it-lab - frontend-maven-plugin - 1.7.2 - - - install node and yarn - - install-node-and-yarn - - - initialize - - v12.13.0 - v1.22.10 - - - - yarn build - - yarn - - - run build - - - - - - - diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/src/actions/commonLinkCalculationActions.ts b/sdnr/wt/odlux/apps/linkCalculationApp/src/actions/commonLinkCalculationActions.ts deleted file mode 100644 index d499ec209..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/src/actions/commonLinkCalculationActions.ts +++ /dev/null @@ -1,160 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 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 { Action } from "../../../../framework/src/flux/action"; -import { Dispatch } from "../../../../framework/src/flux/store"; -import { IApplicationStoreState } from "../../../../framework/src/store/applicationStore"; - - -export class UpdateLinkIdAction extends Action { - constructor(public linkId: string) { - super(); - } -} - -export class UpdateFrequencyAction extends Action { - constructor(public frequency: number) { - super(); - } -} -export class UpdateSiteAction extends Action { - constructor( - public siteA?: any, - public siteB?: any - ) { - super(); - } -} -export class UpdateRainAttAction extends Action { - - constructor(public rainAtt: number) { - super(); - } -} -export class UpdateRainValAction extends Action { - constructor(public rainVal: number) { - super(); - } -} - -export class updateHideForm extends Action { - constructor(public formView: boolean) { - super(); - } -} -export class UpdateDistanceAction extends Action { - constructor(public distance: number) { - super(); - } -} - -export class UpdateFslCalculation extends Action { - constructor(public fsl: number) { - super(); - } -} - - -export class UpdateLatLonAction extends Action { - constructor( - public Lat1: number, - public Lon1: number, - public Lat2: number, - public Lon2: number - ) { - super(); - - } -} -export class UpdatePolAction extends Action { - constructor(public polarization: string) { - super(); - } -} -export class isCalculationServerReachableAction extends Action { - constructor(public reachable: boolean) { - super(); - } -} -export class updateAltitudeAction extends Action { - constructor( - public amslA: number, - public aglA: number, - public amslB: number, - public aglB: number - ) { - super(); - } -} -export class UpdateAbsorptionLossAction extends Action { - constructor( - public absorptionOxygen: number, - public absorptionWater: number, - - ) { - super(); - } -} -export class UpdateWorstMonthRainAction extends Action { - constructor(public month: string) { - super(); - } -} - - -export class UpdateAntennaGainAction extends Action { - constructor(public antennaGainA: number, public antennaGainB: number) { - super(); - } -} -export class updateAntennaNameAction extends Action { - constructor(public antennaNameA: string, public antennaNameB: string) { - super(); - } -} -export class UpdateTxPowerAction extends Action { - constructor(public txPowerA: string | null, public txPowerB: string | null) { - super(); - } -} -export class UpdateRxSensitivityAction extends Action { - constructor(public rxSensitivityA: string | null, public rxSensitivityB: string | null) { - super(); - } -} -export class UpdateWaveguideLossAction extends Action { - constructor(public waveguideLossA: number, public waveguideLossB: number) { - super(); - } -} - -export class UpdateEIRPAction extends Action { - constructor(public eirpA: number, public eirpB: number) { - super(); - } -} -export class UpdateRxPowerAction extends Action { - constructor(public rxPowerA: number, public rxPowerB: number) { - super(); - } -} -export class UpdateSomAction extends Action { - constructor(public somA: number, public somB:number) { - super(); - } -} diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/src/components/connectionInfo.tsx b/sdnr/wt/odlux/apps/linkCalculationApp/src/components/connectionInfo.tsx deleted file mode 100644 index e6d82e236..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/src/components/connectionInfo.tsx +++ /dev/null @@ -1,56 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 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 * as React from 'react' - -import { IApplicationStoreState } from "../../../../framework/src/store/applicationStore"; -import connect, { IDispatcher, Connect } from "../../../../framework/src/flux/connect"; -import { Paper, Typography } from "@material-ui/core"; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons'; - - -type props = Connect; - -const ConnectionInfo: React.FunctionComponent = (props) => { - - return ( - (props.isCalculationServerReachable === false)? -
-
Connection Error
- {props.isCalculationServerReachable === false && Calculation data can't be loaded.} -
-
: null - -)} - -const mapStateToProps = (state: IApplicationStoreState) => ({ - isCalculationServerReachable: state.linkCalculation.calculations.reachable -}); - - - -const mapDispatchToProps = (dispatcher: IDispatcher) => ({ - - //zoomToSearchResult: (lat: number, lon: number) => dispatcher.dispatch(new ZoomToSearchResultAction(lat, lon)) - -});; - - -export default connect(mapStateToProps,mapDispatchToProps)(ConnectionInfo) - diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/src/handlers/linkCalculationAppRootHandler.ts b/sdnr/wt/odlux/apps/linkCalculationApp/src/handlers/linkCalculationAppRootHandler.ts deleted file mode 100644 index 01512eb92..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/src/handlers/linkCalculationAppRootHandler.ts +++ /dev/null @@ -1,199 +0,0 @@ -/** -* ============LICENSE_START======================================================================== -* ONAP : ccsdk feature sdnr wt odlux -* ================================================================================================= -* Copyright (C) 2020 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 { combineActionHandler } from '../../../../framework/src/flux/middleware'; - -// ** do not remove ** -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; -import { IActionHandler } from '../../../../framework/src/flux/action';; -import { UpdateLinkIdAction, UpdateFrequencyAction , UpdateLatLonAction, UpdateRainAttAction, UpdateRainValAction, updateHideForm, UpdateFslCalculation, UpdateSiteAction, UpdateDistanceAction, isCalculationServerReachableAction, UpdatePolAction, updateAltitudeAction, UpdateAbsorptionLossAction, UpdateWorstMonthRainAction, UpdateEIRPAction, UpdateAntennaGainAction, UpdateTxPowerAction, UpdateRxSensitivityAction, updateAntennaNameAction, UpdateWaveguideLossAction, UpdateRxPowerAction, UpdateSomAction} from '../actions/commonLinkCalculationActions'; - -declare module '../../../../framework/src/store/applicationStore' { - interface IApplicationStoreState { - linkCalculation: ICalculationsState; - } -} - -type ICalculationsState = { - calculations:ILinkCalculationAppStateState -} - -export type ILinkCalculationAppStateState= { - linkId: string | null, - frequency: number, - formView:boolean, - fsl:number, - distance:number, - Lat1: number, - Lon1: number, - Lat2: number, - Lon2: number, - rainVal : number, - rainAtt : number, - siteA: string, - siteB: string, - reachable: boolean, - polarization : string | null, - amslA: number, - amslB:number, - aglA: number, - aglB:number, - absorptionWater:number, - absorptionOxygen: number, - month: string, - eirpA: number, - eirpB: number, - antennaGainA: number, - antennaGainB :number, - antennaNameA: string, - antennaNameB:string, - systemOperatingMarginA : number, - systemOperatingMarginB : number, - txPowerA : string, - txPowerB: string, - rxSensitivityA : string, - rxSensitivityB: string, - waveguideLossA : number, - waveguideLossB: number, - rxPowerA :number, - rxPowerB: number -} - -const initialState: ILinkCalculationAppStateState ={ - linkId: null, - frequency: 0, - Lat1: 0, - Lon1: 0, - Lat2: 0, - Lon2: 0, - formView : false, - fsl:0, - distance:0, - siteA : '', - siteB: '', - rainVal : 0, - rainAtt: 0, - reachable : true, - polarization : 'Horizontal', - amslA: 0, - amslB:0, - aglA: 0, - aglB:0, - absorptionWater:0, - absorptionOxygen: 0, - month: '', - eirpA: 0, - eirpB: 0, - antennaGainA :0, - antennaGainB :0, - antennaNameA: '', - antennaNameB:'', - systemOperatingMarginA : 0, - systemOperatingMarginB : 0, - txPowerA : '0', - txPowerB: '0', - rxSensitivityA: '0', - rxSensitivityB: '0', - waveguideLossA : 0, - waveguideLossB: 0, - rxPowerA : 0, - rxPowerB: 0 -} - -export const LinkCalculationHandler: IActionHandler = (state=initialState, action) => { - - if(action instanceof UpdateLinkIdAction){ - state = Object.assign({}, state, {linkId:action.linkId}) - } - else if(action instanceof updateHideForm){ - - state = Object.assign({}, state, {formView:action.formView}) - } - else if (action instanceof UpdateDistanceAction){ - state = Object.assign({}, state, {distance:action.distance}) - } - else if (action instanceof UpdateFrequencyAction){ - state = Object.assign({}, state, {frequency:action.frequency}) - } - else if (action instanceof UpdateFslCalculation){ - state = Object.assign({}, state, {fsl:action.fsl}) - } - else if (action instanceof UpdateLatLonAction){ - state = Object.assign({}, state, {Lat1:action.Lat1, Lon1:action.Lon1, Lat2:action.Lat2, Lon2:action.Lon2}) - } - else if (action instanceof UpdateRainAttAction){ - state = Object.assign({}, state, {rainAtt:action.rainAtt}) - } - else if (action instanceof UpdateRainValAction){ - state = Object.assign({}, state, {rainVal:action.rainVal}) - } - else if (action instanceof UpdateSiteAction){ - state = Object.assign({}, state, {siteA:action.siteA, siteB:action.siteB}) - } - else if(action instanceof isCalculationServerReachableAction){ - state = Object.assign({}, state, { reachable: action.reachable }); - } - else if (action instanceof UpdatePolAction){ - state = Object.assign({}, state, {polarization: action.polarization}) - } - else if (action instanceof updateAltitudeAction){ - state = Object.assign({}, state, {amslA:action.amslA, amslB:action.amslA, aglA:action.aglA, aglB:action.aglB}) - } - else if (action instanceof UpdateAbsorptionLossAction){ - state = Object.assign({}, state, {absorptionOxygen:action.absorptionOxygen, absorptionWater:action.absorptionWater}) - } - else if (action instanceof UpdateWorstMonthRainAction){ - state = Object.assign({}, state, {month:action.month}) - } - - else if (action instanceof UpdateAntennaGainAction){ - state = Object.assign({}, state, {antennaGainA:action.antennaGainA,antennaGainB:action.antennaGainB}) - } - else if (action instanceof updateAntennaNameAction){ - state = Object.assign({}, state, {antennaNameA:action.antennaNameA, antennaNameB: action.antennaNameB}) - } - else if (action instanceof UpdateTxPowerAction){ - state = Object.assign({}, state, {txPowerA:action.txPowerA == null ? state.txPowerA : action.txPowerA , txPowerB: action.txPowerB == null? state.txPowerB : action.txPowerB}) - } - else if (action instanceof UpdateRxSensitivityAction){ - state = Object.assign({}, state, {rxSensitivityA:action.rxSensitivityA == null ? state.rxSensitivityA : action.rxSensitivityA , rxSensitivityB: action.rxSensitivityB == null? state.rxSensitivityB : action.rxSensitivityB}) - } - else if (action instanceof UpdateWaveguideLossAction){ - state = Object.assign({}, state, {waveguideLossA:action.waveguideLossA, waveguideLossB: action.waveguideLossB}) - } - else if (action instanceof UpdateEIRPAction){ - state = Object.assign({}, state, {eirpA:action.eirpA, eirpB:action.eirpB}) - } - else if (action instanceof UpdateRxPowerAction){ - state = Object.assign({}, state, {rxPowerA:action.rxPowerA, rxPowerB:action.rxPowerB}) - } - else if (action instanceof UpdateSomAction){ - state = Object.assign({}, state, {systemOperatingMarginA:action.somA , systemOperatingMarginB :action.somB}) - } - - - return state -} - -const actionHandlers = { - calculations: LinkCalculationHandler -} - -export const LinkCalculationAppRootHandler = combineActionHandler(actionHandlers); -export default LinkCalculationAppRootHandler; - diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/src/index.html b/sdnr/wt/odlux/apps/linkCalculationApp/src/index.html deleted file mode 100644 index edcbd2514..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/src/index.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - Link Calculation App - - - -
- - - - - - \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/src/pluginLinkCalculation.tsx b/sdnr/wt/odlux/apps/linkCalculationApp/src/pluginLinkCalculation.tsx deleted file mode 100644 index a15bf033d..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/src/pluginLinkCalculation.tsx +++ /dev/null @@ -1,192 +0,0 @@ -/** -* ============LICENSE_START======================================================================== -* ONAP : ccsdk feature sdnr wt odlux -* ================================================================================================= -* Copyright (C) 2020 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========================================================================== -*/ - -// app configuration and main entry point for the app - -import * as React from "react"; -import { withRouter, RouteComponentProps, Route, Switch, Redirect } from 'react-router-dom'; - -import { faBookOpen } from '@fortawesome/free-solid-svg-icons'; // select app icon -import applicationManager from '../../../framework/src/services/applicationManager'; - -import LinkCalculation from './views/linkCalculationComponent'; -import LinkCalculationAppRootHandler from './handlers/linkCalculationAppRootHandler'; -import connect, { Connect, IDispatcher } from '../../../framework/src/flux/connect'; -import { IApplicationStoreState } from "../../../framework/src/store/applicationStore"; -import { UpdateLinkIdAction, UpdateLatLonAction, updateHideForm, UpdateSiteAction, UpdateDistanceAction, isCalculationServerReachableAction, updateAltitudeAction, updateAntennaNameAction, UpdateAntennaGainAction, UpdateWaveguideLossAction } from "./actions/commonLinkCalculationActions"; - - -let currentLinkId: string | null = null; -let lastUrl: string = "/linkCalculation"; - -const mapProps = (state: IApplicationStoreState) => ({ - reachable: state.linkCalculation.calculations.reachable -}); - -const mapDisp = (dispatcher: IDispatcher) => ({ - updateLinkId: (mountId: string) => dispatcher.dispatch(new UpdateLinkIdAction(mountId)), - - updateSiteName: (siteNameA?: any, siteNameB?: any) => { - dispatcher.dispatch(new UpdateSiteAction(siteNameA, siteNameB)) - }, - updateDistance: (distance: number) => { - dispatcher.dispatch(new UpdateDistanceAction(distance)) - }, - updateLatLon: (Lat1: number, Lon1: number, Lat2: number, Lon2: number) => { - - dispatcher.dispatch(new UpdateLatLonAction(Lat1, Lon1, Lat2, Lon2)) - dispatcher.dispatch(new updateHideForm(true)) - }, - updateAltitude: (amslA: number, aglA: number, amslB: number, aglB: number) => { - dispatcher.dispatch(new updateAltitudeAction(amslA, aglA, amslB, aglB)) - }, - updateAntennaName: (antennaNameA: string, antennaNameB: string) => { - dispatcher.dispatch(new updateAntennaNameAction(antennaNameA, antennaNameB)) - }, - updateAntennaGainAction: (antennaGainA: number, antennaGainB: number) => { - dispatcher.dispatch(new UpdateAntennaGainAction(antennaGainA, antennaGainB)) - }, - updateWaveguideLossAction: (waveguideLossA: number, waveguideLossB: number) => { - dispatcher.dispatch(new UpdateWaveguideLossAction(waveguideLossA, waveguideLossB)) - } -}); - - -const LinkCalculationRouteAdapter = connect(mapProps, mapDisp)((props: RouteComponentProps<{ mountId?: string }> & Connect) => { - let linkId: string = ""; - - // called when component finshed mounting - React.useEffect(() => { - - lastUrl = props.location.pathname; - linkId = getLinkId(lastUrl); - - const data = props.location.search - - - - if (data !== undefined && data.length > 0) { - - - const lat1 = data.split('&')[0].split('=')[1] - const lon1 = data.split('&')[1].split('=')[1] - const lat2 = data.split('&')[2].split('=')[1] - const lon2 = data.split('&')[3].split('=')[1] - - const siteNameA = data.split('&')[4].split('=')[1] - const siteNameB = data.split('&')[5].split('=')[1] - - const distance = data.split('&')[8].split('=')[1] - - const amslA = data.split('&')[9].split('=')[1] - const aglA = data.split('&')[10].split('=')[1] - - const amslB = data.split('&')[11].split('=')[1] - const aglB = data.split('&')[12].split('=')[1] - - const antennaNameA = data.split('&')[13].split('=')[1].replace("%20", " ") - const antennaGainA = data.split('&')[14].split('=')[1] - const waveguideLossA = data.split('&')[15].split('=')[1] - const antennaNameB = data.split('&')[16].split('=')[1].replace("%20", " ") - const antennaGainB = data.split('&')[17].split('=')[1] - const waveguideLossB = data.split('&')[18].split('=')[1] - - - if (siteNameA !== null && siteNameB !== null) { - props.updateSiteName(String(siteNameA), String(siteNameB)) - } - - if (Number(distance) !== null) { - props.updateDistance(Number(distance)) - } - if (Number(lat1) >= -90 && Number(lat2) >= -90 && Number(lat1) <= 90 && Number(lat2) <= 90 && Number(lon1) >= -180 && Number(lon2) >= -180 && Number(lon1) <= 180 && Number(lon2) <= 180) { - props.updateLatLon(Number(lat1), Number(lon1), Number(lat2), Number(lon2)) - } - if (Number(amslA)> 0 && Number(amslB)> 0) { - if (Number(aglA)>= Number(amslA) && Number(aglB)>= Number(amslB)) { - props.updateAltitude(Number(amslA), Number(aglA), Number(amslB), Number(aglB)) - } - } - if (antennaNameA && antennaNameB.length) { - props.updateAntennaName(String(antennaNameA), String(antennaNameB)) - } - if (Number(antennaGainA) > 0 && Number(antennaGainA) > 0) { - props.updateAntennaGainAction(Number(antennaGainA), Number(antennaGainB)) - } - if(Number(waveguideLossA) !== null, Number(waveguideLossB) !== null){ - props.updateWaveguideLossAction(Number(waveguideLossA),Number(waveguideLossB) ) - } - } - - - if (currentLinkId !== linkId) { // new element is loaded - currentLinkId = linkId; - props.updateLinkId(currentLinkId); - } - }, []); - - // called when component gets updated - React.useEffect(() => { - - lastUrl = props.location.pathname; - linkId = getLinkId(lastUrl); - - if (currentLinkId !== linkId) { - currentLinkId = linkId; - props.updateLinkId(currentLinkId); - } - }); - - const getLinkId = (lastUrl: string) => { - let index = lastUrl.lastIndexOf("linkCalculation/"); - if (index >= 0) { - linkId = lastUrl.substr(index + 16); - } else { - linkId = ""; - } - - return linkId; - } - - - return ( - - ); -}); - -const App = withRouter((props: RouteComponentProps) => { - props.history.action = "POP"; - return ( - - - - - - ) -}); - -export function register() { - applicationManager.registerApplication({ - name: "linkCalculation", - icon: faBookOpen, - rootActionHandler: LinkCalculationAppRootHandler, - rootComponent: App, - menuEntry: "Link Calculation" - }); -} - diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/src/views/Style.scss b/sdnr/wt/odlux/apps/linkCalculationApp/src/views/Style.scss deleted file mode 100644 index e4b0c7797..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/src/views/Style.scss +++ /dev/null @@ -1,116 +0,0 @@ -// .parent{ - -// display: flex; -// justify-content: space-evenly; -// margin: auto; - - -//} -.input { - width: 150px; - box-sizing: border-box; - // margin-bottom: 5px; - -} -.error { - border: 1px solid red; - width: 150px; - box-sizing: border-box; -} - -.container1{ - margin-bottom: 15px; - -} - -.container1 div{ - display:flex; - flex-direction: row; - - width:100%; - padding-top: 2px; -} - -.container1 div div{ - width:50%; - border-bottom-style: solid; - border-bottom-width: thin; - border-color: silver; -} - -.firstBox div:first-child{ - margin-left: 33.5%; -} - -// .container-1 { -// width: 80%; -// justify-content: center; -// align-items: baseline;; -// display: flex; -// flex-direction: row; -// align-content: space-between; -// padding: 20px 40px; -// border-radius: 10px; -// // box-shadow: 0px 10px 50px #555; -// background-color: #ffffff; -// // padding-top: 10px; - -// } - - // .column1 { - // flex-direction: column; - // width: 30%; - // align-items: flex-end;; - // // padding: 2em; - - // } - // .column1 div { - // margin-top: 10px; - // // align-items: space-between; - // // flex-wrap: wrap; - // border-bottom-style: solid; - // border-bottom-width: thin; - // border-color: silver; - // } - // .middlecolumn{ - - // flex-direction: column; - // flex-grow: 1; - // // padding: 10px 10px; - // } - - // .middlecolumn div{ - // margin-top: 10px; - // border-bottom-style: solid; - // border-bottom-width: thin; - // border-color: silver; - // } - - // .column2 { - // margin-left: 200px; - // } - // .column2 div{ - // margin-top: 10px; - - // } - - .antennaContainer{ - margin-bottom: 15px; - background-color: rgb(184, 181, 181); - - } - .antennaContainer div { - display:flex; - flex-direction: row; - - width:100%; - padding-top: 2px; -} -.antennaContainer div div{ - - width:50%; - -} -.antennaFont{ - font-family: "Lucida Console"; -} \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/src/views/linkCalculationComponent.tsx b/sdnr/wt/odlux/apps/linkCalculationApp/src/views/linkCalculationComponent.tsx deleted file mode 100644 index e3eaa6ba0..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/src/views/linkCalculationComponent.tsx +++ /dev/null @@ -1,579 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 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 * as React from "react"; - -import { Connect, connect, IDispatcher } from '../../../../framework/src/flux/connect'; -import { MaterialTable, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; -import { TextField, Tabs, Tab, Typography, AppBar, Button, Tooltip, Checkbox, Table, TableCell, TableHead, TableRow, TableBody, Paper } from '@material-ui/core'; -import './Style.scss' - -import { IApplicationStoreState } from "../../../../framework/src/store/applicationStore"; -import { UpdateFrequencyAction, UpdateLatLonAction, UpdateRainAttAction, UpdateRainValAction, UpdateFslCalculation, isCalculationServerReachableAction, UpdatePolAction, UpdateDistanceAction, updateAltitudeAction, UpdateAbsorptionLossAction, UpdateWorstMonthRainAction, UpdateTxPowerAction, UpdateRxSensitivityAction, UpdateEIRPAction, UpdateRxPowerAction, UpdateSomAction } from "../actions/commonLinkCalculationActions"; -import { faPlaneArrival, faAlignCenter } from "@fortawesome/free-solid-svg-icons"; -import ConnectionInfo from '../components/connectionInfo' -import { red } from "@material-ui/core/colors"; -import { Dvr } from "@material-ui/icons"; - - - -const mapProps = (state: IApplicationStoreState) => ({ - linkId: state.linkCalculation.calculations.linkId, - frequency: state.linkCalculation.calculations.frequency, - lat1: state.linkCalculation.calculations.Lat1, - lon1: state.linkCalculation.calculations.Lon1, - lat2: state.linkCalculation.calculations.Lat2, - lon2: state.linkCalculation.calculations.Lon2, - rainAtt: state.linkCalculation.calculations.rainAtt, - rainVal: state.linkCalculation.calculations.rainVal, - formView: state.linkCalculation.calculations.formView, - fsl: state.linkCalculation.calculations.fsl, - siteA: state.linkCalculation.calculations.siteA, - siteB: state.linkCalculation.calculations.siteB, - distance: state.linkCalculation.calculations.distance, - reachable: state.linkCalculation.calculations.reachable, - polarization: state.linkCalculation.calculations.polarization, - amslA: state.linkCalculation.calculations.amslA, - amslB: state.linkCalculation.calculations.amslB, - aglA: state.linkCalculation.calculations.aglA, - aglB: state.linkCalculation.calculations.aglB, - absorptionOxygen: state.linkCalculation.calculations.absorptionOxygen, - absorptionWater: state.linkCalculation.calculations.absorptionWater, - month: state.linkCalculation.calculations.month, - eirpA: state.linkCalculation.calculations.eirpA, - eirpB: state.linkCalculation.calculations.eirpB, - antennaGainA: state.linkCalculation.calculations.antennaGainA, - antennaGainB: state.linkCalculation.calculations.antennaGainB, - antennaNameA: state.linkCalculation.calculations.antennaNameA, - antennaNameB: state.linkCalculation.calculations.antennaNameB, - systemOperatingMarginA: state.linkCalculation.calculations.systemOperatingMarginA, - systemOperatingMarginB: state.linkCalculation.calculations.systemOperatingMarginB, - waveguideLossA: state.linkCalculation.calculations.waveguideLossA, - waveguideLossB: state.linkCalculation.calculations.waveguideLossB, - rxPowerA: state.linkCalculation.calculations.rxPowerA, - rxPowerB: state.linkCalculation.calculations.rxPowerB, - txPowerA: state.linkCalculation.calculations.txPowerA, - txPowerB: state.linkCalculation.calculations.txPowerB, - rxSensitivityA: state.linkCalculation.calculations.rxSensitivityA, - rxSensitivityB: state.linkCalculation.calculations.rxSensitivityB - -}); - -const BASE_URL = "/topology/linkcalculator" - -const mapDispatch = (dispatcher: IDispatcher) => ({ - - updateFrequency: (frequency: number) => { - - dispatcher.dispatch(new UpdateFrequencyAction(frequency)) - }, - updateLatLon: (Lat1: number, Lon1: number, Lat2: number, Lon2: number) => { - dispatcher.dispatch(new UpdateLatLonAction(Lat1, Lon1, Lat2, Lon2)) - }, - - updateRainValue: (rainVal: number) => { - dispatcher.dispatch(new UpdateRainValAction(rainVal)) - }, - - UpdateRainAtt: (rainAtt: number) => { - dispatcher.dispatch(new UpdateRainAttAction(rainAtt)) - }, - - specificRain: (rainAtt: number) => { - dispatcher.dispatch(new UpdateRainAttAction(rainAtt)) - - }, - - FSL: (free: number) => { - dispatcher.dispatch(new UpdateFslCalculation(free)) - }, - - UpdateConectivity: (reachable: boolean) => { - dispatcher.dispatch(new isCalculationServerReachableAction(reachable)) - }, - - updatePolarization: (polarization: any) => { - dispatcher.dispatch(new UpdatePolAction(polarization)) - }, - - updateAutoDistance: (distance: number) => { - dispatcher.dispatch(new UpdateDistanceAction(distance)) - }, - UpdateAbsorption: (OxLoss: number, WaterLoss: number) => { - dispatcher.dispatch(new UpdateAbsorptionLossAction(OxLoss, WaterLoss)) - }, - UpdateWorstMonthRain: (month: string) => { - dispatcher.dispatch(new UpdateWorstMonthRainAction(month)) - }, - UpdateEIRP: (eirpA: number, eirpB: number) => { - dispatcher.dispatch(new UpdateEIRPAction(eirpA, eirpB)) - }, - UpdateRxPower: (rxPowerA: number, rxPowerB: number) => { - dispatcher.dispatch(new UpdateRxPowerAction(rxPowerA, rxPowerB)) - }, - UpdateSom: (somA: number, somB: number) => { - dispatcher.dispatch(new UpdateSomAction(somA, somB)) - }, - - UpdateTxPower: (txPowerA: string | null, txPowerB: string | null) => { - dispatcher.dispatch(new UpdateTxPowerAction(txPowerA, txPowerB)) - }, - UpdateRxSensitivity: (rxSensitivityA: string | null, rxSensitivityB: string | null) => { - dispatcher.dispatch(new UpdateRxSensitivityAction(rxSensitivityA, rxSensitivityB)) - } -}); - - -type linkCalculationProps = Connect; - -interface initialState { - rainMethodDisplay: boolean, - absorptionMethod: string; - horizontalBoxChecked: boolean, - latitude1Error: string, - longitude1Error: string - latitude2Error: string, - longitude2Error: string, - frequencyError: string, - rainMethodError: string, - antennaTypeError: string, - attenuationMethodError: string, - worstmonth: boolean, - showWM: string, - rainMethodErrorState: string -} - -class LinkCalculation extends React.Component { - constructor(props: any) { - super(props); - this.state = { - rainMethodDisplay: false, - horizontalBoxChecked: true, - absorptionMethod: '0', - latitude1Error: '', - longitude1Error: '', - latitude2Error: '', - longitude2Error: '', - frequencyError: '', - rainMethodError: '', - attenuationMethodError: '', - antennaTypeError: '', - worstmonth: false, - showWM: '', - rainMethodErrorState: '0' - }; - } - - updateAutoDistance = async (lat1: number, lon1: number, lat2: number, lon2: number) => { - const result = await fetch(BASE_URL + '/distance/' + lat1 + ',' + lon1 + ',' + lat2 + ',' + lon2) - const json = await result.json() - return json.distanceInKm - } - - updateLatLon = (e: any) => { - - e.target.id == 'Lat1' ? this.props.updateLatLon(e.target.value, this.props.lon1, this.props.lat2, this.props.lon2) : null - e.target.id == 'Lon1' ? this.props.updateLatLon(this.props.lat1, e.target.value, this.props.lat2, this.props.lon2) : null - e.target.id == 'Lat2' ? this.props.updateLatLon(this.props.lat1, this.props.lon1, e.target.value, this.props.lon2) : null - e.target.id == 'Lon2' ? this.props.updateLatLon(this.props.lat1, e.target.value, this.props.lat2, e.target.value) : null - - - } - - updatePoli = (val: string) => { - - this.setState({ horizontalBoxChecked: !this.state.horizontalBoxChecked }); - this.props.updatePolarization(val); - - } - - LatLonToDMS = (value: number, isLon: boolean = false) => { - const absoluteValue = Math.abs(value); - const d = Math.floor(absoluteValue); - const m = Math.floor((absoluteValue - d) * 60); - const s = (absoluteValue - d - m / 60) * 3600; - const dms = `${d}° ${m}' ${s.toFixed(2)}"`; - - const sign = Math.sign(value); - - if (isLon) { - return (sign === -1 || sign === -0) ? dms + " W" : dms + " E"; - } else { - return (sign === -1 || sign === -0) ? dms + " S" : dms + " N"; - } - } - - rainAttCal = (lat1: any, lon1: any, lat2: any, lon2: any, frequency: any, distance: number, polarization: string, worstmonth: boolean) => { - if (!worstmonth) { - fetch(BASE_URL + '/rain/annual/' + lat1 + ',' + lon1 + ',' + lat2 + ',' + lon2 + '/' + frequency + '/' + distance + '/' + polarization.toUpperCase()) - .then(res => res.json()) - .then(result => { this.props.UpdateRainAtt(result.rainAttenuation); this.props.updateRainValue(result.rainFall.rainrate) }) - } - else { - fetch(BASE_URL + '/rain/worstmonth/' + lat1 + ',' + lon1 + ',' + lat2 + ',' + lon2 + '/' + frequency + '/' + distance + '/' + polarization.toUpperCase()) - .then(res => res.json()) - .then(result => { this.props.UpdateRainAtt(result.rainAttenuation); this.props.updateRainValue(result.rainFall.rainrate); this.props.UpdateWorstMonthRain(result.rainFall.period); this.setState({ showWM: '- Wm is : ' }) }) - } - } - - - manualRain = (rainfall: number, frequency: number, distance: number, polarization: string) => { - fetch(BASE_URL + '/rain/' + rainfall + '/' + frequency + '/' + distance + '/' + polarization.toUpperCase()) - .then(res => res.json()) - .then(result => { this.props.specificRain(result.rainAttenuation) }) - } - - - FSL = (distance: number, frequency: number) => { - fetch(BASE_URL + '/fsl/' + distance + '/' + frequency) - .then(res => res.json()) - .then(result => { this.props.FSL(result.fspl) }) - } - - AbsorptionAtt = (lat1: number, lon1: number, lat2: number, lon2: number, distance: number, frequency: number, worstmonth: boolean, absorptionMethod: string) => { - if (!worstmonth) { - fetch(BASE_URL + '/absorption/annual/' + lat1 + ',' + lon1 + ',' + lat2 + ',' + lon2 + '/' + distance + '/' + frequency + '/' + absorptionMethod) - .then(res => res.json()) - .then(result => { this.props.UpdateAbsorption(result.oxygenLoss, result.waterLoss) }) - } - else { - fetch(BASE_URL + '/absorption/annual/' + lat1 + ',' + lon1 + ',' + lat2 + ',' + lon2 + '/' + distance + '/' + frequency + '/' + absorptionMethod) - .then(res => res.json()) - .then(result => { this.props.UpdateAbsorption(result.oxygenLoss, result.waterLoss) }) - } - } - - linkBudget = (lat1: number, lon1: number, lat2: number, lon2: number, distance: number, frequency: number, absorptionMethod: string, polarization: string, antennaGainA: number, antennaGainB: number, waveguideLossA: number, waveguideLossB: number, transmissionPowerA: number, transmissionPowerB: number, rxSensitivityA: number, rxSensitivityB: number) => { - fetch(BASE_URL + '/linkbudget/' + lat1 + ',' + lon1 + ',' + lat2 + ',' + lon2 + '/' + distance + '/' + frequency + '/' + absorptionMethod + '/' + polarization.toUpperCase() + '/' + antennaGainA + '/' + antennaGainB + '/' + waveguideLossA + '/' + waveguideLossB + '/' + transmissionPowerA + '/' + transmissionPowerB + '/' + rxSensitivityA + '/' + rxSensitivityB) - .then(res => res.json()) - .then(result => { this.props.UpdateEIRP(result.eirpA, result.eirpB); this.props.UpdateRxPower(result.receivedPowerA, result.receivedPowerB); this.props.UpdateSom(result.systemOperatingMarginA, result.systemOperatingMarginA) }) - } - - formValid = () => { - - this.props.lat1 === 0 ? this.setState({ latitude1Error: 'Enter a number between -90 to 90' }) : null - this.props.lat2 === 0 ? this.setState({ latitude2Error: 'Enter a number between -90 to 90' }) : null - this.props.lon1 === 0 ? this.setState({ longitude1Error: 'Enter a number between -180 to 180' }) : null - this.props.lon2 === 0 ? this.setState({ longitude2Error: 'Enter a number between -180 to 180' }) : null - this.props.frequency === 0 ? this.setState({ frequencyError: 'Select a frequency' }) : this.setState({ frequencyError: '' }) - - // this.state.rainMethodDisplay === null && this.props.rainVal === 0 ? this.setState({ rainMethodError: 'Select the rain method' }) : this.setState({ rainMethodError: '' }) - - this.state.rainMethodErrorState === '0' ? this.setState({ rainMethodError: 'Select the rain method' }) : this.setState({ rainMethodError: '' }) - - this.state.absorptionMethod === '0' ? this.setState({ attenuationMethodError: 'Select the attenuation method' }) : this.setState({ attenuationMethodError: '' }) - console.log(this.state); - console.log(this.props.lat1 !== 0 && this.props.lat2 !== 0 && this.props.lon1 !== 0 && this.props.lon2 !== 0 && this.props.frequency !== 0 && this.state.rainMethodError === '' && this.state.attenuationMethodError === ''); - - return this.props.lat1 !== 0 && this.props.lat2 !== 0 && this.props.lon1 !== 0 && this.props.lon2 !== 0 && this.props.frequency !== 0 && this.state.rainMethodError === '' && this.state.attenuationMethodError === ''; - - } - - - - buttonHandler = async () => { - - if (this.formValid()) { - - this.props.updateAutoDistance(await this.updateAutoDistance(this.props.lat1, this.props.lon1, this.props.lat2, this.props.lon2)) - this.FSL(this.props.distance, this.props.frequency) - - if (this.state.worstmonth === false) { - this.setState({ showWM: ' ' }) - this.props.UpdateWorstMonthRain('') - this.AbsorptionAtt(this.props.lat1, this.props.lon1, this.props.lat2, this.props.lon2, this.props.distance, this.props.frequency, this.state.worstmonth, this.state.absorptionMethod) - this.linkBudget(this.props.lat1, this.props.lon1, this.props.lat2, this.props.lon2, this.props.distance, this.props.frequency, this.state.absorptionMethod, this.props.polarization!, this.props.antennaGainA, this.props.antennaGainB, this.props.waveguideLossA, this.props.waveguideLossB, Number(this.props.txPowerA), Number(this.props.txPowerB), Number(this.props.rxSensitivityA), Number(this.props.rxSensitivityB)) - - if (this.state.rainMethodDisplay === true) { - - this.manualRain(this.props.rainVal, this.props.frequency, this.props.distance, this.props.polarization!); - } - else { - this.rainAttCal(this.props.lat1, this.props.lon1, this.props.lat2, this.props.lon2, this.props.frequency, this.props.distance, this.props.polarization!, this.state.worstmonth); - } - } - else { - this.AbsorptionAtt(this.props.lat1, this.props.lon1, this.props.lat2, this.props.lon2, this.props.distance, this.props.frequency, this.state.worstmonth, this.state.absorptionMethod) - this.rainAttCal(this.props.lat1, this.props.lon1, this.props.lat2, this.props.lon2, this.props.frequency, this.props.distance, this.props.polarization!, this.state.worstmonth); - } - } - else console.log('form is not valid') - - } - - componentDidMount = () => { - fetch(BASE_URL + '/fsl/1/1') - .then(res => { if (res.ok) { this.props.UpdateConectivity(true) } else { this.props.UpdateConectivity(false) } }) - .catch(res => { this.props.UpdateConectivity(false) }) - } - - handleChange = (e: any) => { - - switch (e.target.id) { - case 'Lat1': if (e.target.value > 90 || e.target.value < -90) { this.setState({ latitude1Error: 'Enter a number between -90 to 90' }) } - else { - this.updateLatLon(e) - this.setState({ latitude1Error: '' }) - } - break; - case 'Lat2': if (e.target.value > 90 || e.target.value < -90) { this.setState({ latitude2Error: 'Enter a number between -90 to 90' }) } - else { - this.updateLatLon(e) - this.setState({ latitude2Error: '' }) - } - break; - case 'Lon1': if (e.target.value > 180 || e.target.value < -180) { this.setState({ longitude1Error: 'Enter a number between -180 to 180' }) } - else { - this.updateLatLon(e) - this.setState({ longitude1Error: '' }) - } - break; - case 'Lon2': if (e.target.value > 180 || e.target.value < -180) { this.setState({ longitude2Error: 'Enter a number between -180 to 180' }) } - else { - this.updateLatLon(e) - this.setState({ longitude2Error: '' }) - } - break; - - } - } - - render() { - return ( - -
- - {!this.props.formView && - -
-
-
SiteA
-
SiteB
-
- -
-
-
- -
{this.state.latitude1Error}
-
-
-
-
{this.state.latitude2Error}
-
-
- -
-
-
{this.state.longitude1Error}
-
-
-
{this.state.longitude2Error}
-
-
- - - -
- } - - -
-
{
this.setState({ worstmonth: false })}>Annual - this.setState({ worstmonth: true })}>WM
} -
-
-
Site A
-
Site B
-
- {/*
 
*/} -
- {(this.props.siteA.length > 0 || this.props.siteB.length > 0) &&
Site Name
} -
{this.props.siteA}
-
{this.props.siteB}
-
-
-
Latitude
-
{this.props.lat1 && this.LatLonToDMS(this.props.lat1)}
-
{this.props.lat2 && this.LatLonToDMS(this.props.lat2)}
- -
-
-
Longitude
-
{this.props.lon1 && this.LatLonToDMS(this.props.lon1)}
-
{this.props.lon2 && this.LatLonToDMS(this.props.lon2)}
-
-
-
Azimuth
-
0
-
0
-
-
-
Average Mean Sea Level
-
{this.props.amslA.toFixed(2)} m
-
{this.props.amslB.toFixed(2)} m
-
-
-
Antenna Height Above Ground
-
{this.props.aglA.toFixed(2)} m
-
{this.props.aglB.toFixed(2)} m
-
-
-
Distance
-
{this.props.distance?.toFixed(3)} km
-
-
-
Polarization
-
{
this.props.updatePolarization(e.target.value)}>Horizontal - { this.props.updatePolarization(e.target.value) }}>Vertical
}
-
-
-
Frequency
-
{}
{this.state.frequencyError}
-
-
-
Free Space Loss
-
{this.props.fsl.toFixed(3)} dB
-
-
-
Rain Model
-
{}
{this.state.rainMethodError}
-
-
-
-
Rainfall Rate
-
{
{ this.props.updateRainValue(Number(e.target.value)) }} - value={this.props.rainVal} disabled={this.state.rainMethodDisplay === false ? true : false}> - mm/hr {this.state.showWM} {this.props.month}
}
-
-
-
Rain Loss
-
{this.props.rainAtt.toFixed(3)} dB
-
-
-
Absorption Model
-
{}
{this.state.attenuationMethodError}
-
-
-
-
Oxygen Specific Attenuation
-
{this.props.absorptionOxygen.toFixed(3)} dB
-
-
-
Water Vapor Specific Attenuation
-
{this.props.absorptionWater.toFixed(3)} dB
-
-
-
System Operating Margin
-
{this.props.systemOperatingMarginA.toFixed(3)} dB
-
{this.props.systemOperatingMarginB.toFixed(3)} dB
-
-
-
Radio Transmitted Power
-
{
{ if (e.target.value !== '') this.props.UpdateTxPower(e.target.value, null) }} - > - dBm
}
-
{
{ if (e.target.value !== '') this.props.UpdateTxPower(null, e.target.value) }} - > - dBm
}
-
-
-
RF Receiver Sensitivity
-
{
{ if (e.target.value !== '') this.props.UpdateRxSensitivity(e.target.value, null) }} - > - dBm
}
-
{
{ if (e.target.value !== '') this.props.UpdateRxSensitivity(null, e.target.value) }} - > - dBm
}
-
-
-
Rx power
-
{this.props.rxPowerA.toFixed(3)} dBm
-
{this.props.rxPowerB.toFixed(3)} dBm
-
-
-
-
-
-
Antenna Settings
-
- -
-
Antenna
-
{this.props.antennaNameA}
-
{this.props.antennaNameB}
-
- - -
-
EIRP
-
{this.props.eirpA.toFixed(3)} dBm
-
{this.props.eirpB.toFixed(3)} dBm
-
- -
-
Gain
-
{this.props.antennaGainA} dBi
-
{this.props.antennaGainB} dBi
-
-
-
Waveguide Loss
-
{this.props.waveguideLossA} dB
-
{this.props.waveguideLossB} dB
-
- -
-
-
{}
-
-
- - - - - -
- - ) - } - -} - -export default connect(mapProps, mapDispatch)(LinkCalculation); diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java b/sdnr/wt/odlux/apps/linkCalculationApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java deleted file mode 100644 index 43b072c4b..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt - * ================================================================================================= - * Copyright (C) 2019 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========================================================================== - */ -package org.onap.ccsdk.features.sdnr.wt.odlux.bundles; - -import org.onap.ccsdk.features.sdnr.wt.odlux.model.bundles.OdluxBundle; -import org.onap.ccsdk.features.sdnr.wt.odlux.model.bundles.OdluxBundleLoader; - -public class MyOdluxBundle extends OdluxBundle { - - @Override - public void initialize() { - super.initialize(); - } - - @Override - public void clean() { - super.clean(); - } - - @Override - public String getResourceFileContent(String filename) { - return super.getResourceFileContent(filename); - } - - @Override - public boolean hasResource(String filename) { - return super.hasResource(filename); - } - - @Override - public void setBundleName(String bundleName) { - super.setBundleName(bundleName); - } - - @Override - public void setLoader(OdluxBundleLoader loader) { - super.setLoader(loader); - } - - @Override - public String getBundleName() { - return super.getBundleName(); - } - - @Override - public OdluxBundleLoader getLoader() { - return super.getLoader(); - } - - public MyOdluxBundle() { - super(); - } -} diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml b/sdnr/wt/odlux/apps/linkCalculationApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml deleted file mode 100644 index 8eb652e2d..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java b/sdnr/wt/odlux/apps/linkCalculationApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java deleted file mode 100644 index c319bb189..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt - * ================================================================================================= - * Copyright (C) 2019 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========================================================================== - */ -package org.onap.ccsdk.features.sdnr.wt.odlux.bundles.test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import org.junit.Test; -import org.onap.ccsdk.features.sdnr.wt.odlux.OdluxBundleLoaderImpl; -import org.onap.ccsdk.features.sdnr.wt.odlux.bundles.MyOdluxBundle; - -public class TestBundleRes { - - @Test - public void test() { - OdluxBundleLoaderImpl loader = OdluxBundleLoaderImpl.getInstance(); - MyOdluxBundle b = new MyOdluxBundle(); - b.setLoader(loader); - b.setIndex(0); - b.setBundleName("abc"); - b.initialize(); - assertTrue(loader.getNumberOfBundles()==1); - assertNotNull(b.getLoader()); - assertEquals("abc",b.getBundleName()); - assertTrue(b.hasResource("test.js")); - assertNotNull(b.getResourceFileContent("test.js")); - b.clean(); - assertTrue(loader.getNumberOfBundles()==0); - } - -} diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/src2/test/resources/test.js b/sdnr/wt/odlux/apps/linkCalculationApp/src2/test/resources/test.js deleted file mode 100644 index b47fdc39f..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/src2/test/resources/test.js +++ /dev/null @@ -1,5 +0,0 @@ -asdac sad -as -d -sad - sadfa \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/tsconfig.json b/sdnr/wt/odlux/apps/linkCalculationApp/tsconfig.json deleted file mode 100644 index a66b5d828..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/tsconfig.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "./src", - "outDir": "./dist", - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "allowSyntheticDefaultImports": false, - "allowUnreachableCode": false, - "allowUnusedLabels": false, - "noFallthroughCasesInSwitch": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "strictNullChecks": true, - "pretty": true, - "newLine": "LF", - "module": "es2015", - "target": "es2016", - "moduleResolution": "node", - "experimentalDecorators": true, - "jsx": "preserve", - "lib": [ - "dom", - "es2015", - "es2016" - ], - "types": [ - "prop-types", - "react", - "react-dom" - ] - }, - "exclude": [ - "dist", - "node_modules" - ] -} diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/webpack.config.js b/sdnr/wt/odlux/apps/linkCalculationApp/webpack.config.js deleted file mode 100644 index 55d98b4d7..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/webpack.config.js +++ /dev/null @@ -1,187 +0,0 @@ -/** - * Webpack 4 configuration file - * see https://webpack.js.org/configuration/ - * see https://webpack.js.org/configuration/dev-server/ - */ - -"use strict"; - -const path = require("path"); -const webpack = require("webpack"); -const CopyWebpackPlugin = require("copy-webpack-plugin"); -const TerserPlugin = require('terser-webpack-plugin'); - -// const __dirname = (path => path.replace(/^([a-z]\:)/, c => c.toUpperCase()))(process.__dirname()); - -module.exports = (env) => { - const distPath = path.resolve(__dirname, env === "release" ? "." : "../..", "dist"); - const frameworkPath = path.resolve(__dirname, env === "release" ? "../../framework" : "../..", "dist"); - return [{ - name: "App", - - mode: "none", //disable default behavior - - target: "web", - - context: path.resolve(__dirname, "src"), - - entry: { - linkCalculationApp: ["./pluginLinkCalculation.tsx"] - }, - - devtool: env === "release" ? false : "source-map", - - resolve: { - extensions: [".ts", ".tsx", ".js", ".jsx"] - }, - - output: { - path: distPath, - filename: "[name].js", - library: "[name]", - libraryTarget: "umd2", - chunkFilename: "[name].js" - }, - module: { - rules: [{ - test: /\.tsx?$/, - exclude: /node_modules/, - use: [{ - loader: "babel-loader" - }, { - loader: "ts-loader" - }] - }, { - test: /\.jsx?$/, - exclude: /node_modules/, - use: [{ - loader: "babel-loader" - }] - },{ - test: /\.scss$/, - include: /node_modules/, - use: ['style-loader', 'css-loader', 'sass-loader'], - },{ - test: /\.s[ac]ss$/i, - use: [ - // Creates `style` nodes from JS strings - 'style-loader', - // Translates CSS into CommonJS - 'css-loader', - // Compiles Sass to CSS - 'sass-loader', - ], - }] - }, - - optimization: { - noEmitOnErrors: true, - namedModules: env !== "release", - minimize: env === "release", - minimizer: env !== "release" ? [] : [new TerserPlugin({ - terserOptions: { - warnings: false, // false, true, "verbose" - compress: { - drop_console: true, - drop_debugger: true, - } - } - })], - }, - - plugins: [ - new webpack.DllReferencePlugin({ - context: path.resolve(__dirname, "../../framework/src"), - manifest: require(path.resolve(frameworkPath, "vendor-manifest.json")), - sourceType: "umd2" - }), - new webpack.DllReferencePlugin({ - context: path.resolve(__dirname, "../../framework/src"), - manifest: require(path.resolve(frameworkPath, "app-manifest.json")), - sourceType: "umd2" - }), - ...(env === "release") ? [ - new webpack.DefinePlugin({ - "process.env": { - NODE_ENV: "'production'", - VERSION: JSON.stringify(require("./package.json").version) - } - }), - ] : [ - new webpack.DefinePlugin({ - "process.env": { - NODE_ENV: "'development'", - VERSION: JSON.stringify(require("./package.json").version) - } - }), - new CopyWebpackPlugin([{ - from: 'index.html', - to: distPath - }]), - ] - ], - - devServer: { - public: "http://localhost:3100", - contentBase: frameworkPath, - - compress: true, - headers: { - "Access-Control-Allow-Origin": "*" - }, - host: "0.0.0.0", - port: 3100, - disableHostCheck: true, - historyApiFallback: true, - inline: true, - hot: false, - quiet: false, - stats: { - colors: true - }, - proxy: { - "/oauth2/": { - target: "http://sdnr:8181", - secure: false - }, - "/database/": { - target: "http://sdnr:8181", - secure: false - }, - "/rests/": { - target: "http://sdnr:8181", - secure: false - }, - "/topology/": { - target: "http://localhost:3002", - secure: false - }, - "/help/": { - target: "http://sdnr:8181", - secure: false - }, - "/websocket/": { - target: "http://sdnr:8181", - ws: true, - changeOrigin: true, - secure: false - }, - "/terrain": { - target: "http://10.20.11.163:5200", - secure: false, - pathRewrite(pathname) { - return pathname.replace(/^\/terrain/, '') - } - }, - "/terrain/": { - target: "http://10.20.11.163:5200", - secure: false, - pathRewrite(pathname) { - return pathname.replace(/^\/terrain/, '/') - } - } - } - - } - }]; -} -- cgit 1.2.3-korg