Skip to content

Commit

Permalink
Merge pull request #1358 from SCADA-LTS/feature_r23/#1355-correcting-…
Browse files Browse the repository at this point in the history
…history-alarms-translation1

Feature r23/#1355 correcting history alarms translation1
  • Loading branch information
grzesiekb authored Aug 22, 2020
2 parents cb1e105 + 833436b commit bdbdb99
Show file tree
Hide file tree
Showing 6 changed files with 189 additions and 154 deletions.
279 changes: 138 additions & 141 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,141 +1,138 @@
# [Scada-LTS](http://scada-lts.org)

[![Build Status](https://img.shields.io/travis/grzesiekb/json.svg?style=flat-square)](https://travis-ci.org/sdtabilit/Scada-LTS)
[![GPL-2.0](https://img.shields.io/npm/l/gb-json.svg?style=flat-square)](https://github.com/sdtabilit/Scada-LTS/blob/master-sdtabilit/LICENSE)
[![](https://images.microbadger.com/badges/version/dockergb/scadalts-dev.svg)](https://microbadger.com/images/dockergb/scadalts-dev "Get your own version badge on microbadger.com")
[![](https://images.microbadger.com/badges/image/dockergb/scadalts-dev.svg)](https://microbadger.com/images/dockergb/scadalts-dev "Get your own image badge on microbadger.com")
[![Waffle.io - Columns and their card count](https://badge.waffle.io/SCADA-LTS/User-Management.svg?columns=all)](https://waffle.io/SCADA-LTS/User-Management)

Scada-LTS is an Open Source, web-based, multi-platform solution for building your own SCADA (Supervisory Control and Data Acquisiton) system.


## Table of contents

* [Quick start](#quick-start)
* [Bugs and feature requests](#bugs-and-feature-requests)
* [Documentation](#documentation)
* [Contributing](#contributing)
* [Community](#community)
* [Versioning](#versioning)
* [Creators](#creators)
* [Copyright and license](#copyright-and-license)


## Quick start

Here is two of the several start options:

### To Run ScadaLTS on Docker:
* Download and install Docker from: https://www.docker.com/
* Download Docker Toolbox from: https://kitematic.com/
* Run Docker and Docker Toolbox.
* When the download is completed in the Docker Toolbox run Docker CLI (bottom-left corner).
* In the Docker CLI type in: `docker pull scadalts/scadalts` to download repository.
* Type in: `docker images` to check if repository is created. It should show "scadalts/scadalts" on the list.
* To run Scada on Docker type in:
``docker run -it -e DOCKER_HOST_IP=`docker-machine ip` -p 81:8080 scadalts/scadalts /root/start.sh``.
* Type in: `Get-NetIPAddress` and find IPAdrress for "DockerNAT" InterfaceAlias (You need a new CLI window to do it).
* Type in docker IP adrress in the browser with port 81 and `/ScadaLTS/` sufix. Example:
`http://10.0.75.2:81/ScadaLTS/`

### Second option:
* [Download the latest release](https://github.com/sdtabilit/Scada-LTS/releases/download/v0.0.6-test-modbus.3.0.2/ScadaBR.war).
* Install tomcat7: `apt-get install tomcat7`.
* Install mysql: `apt-get install mysql-server`.
* Login to mysql: `mysql -u [user] -p`.
* Create db:`create dababase scadalts;`.
* Copy ScadaBR.war & ScadaLTS.war to dir tomacat webapps: `cp ScadaBR.war /var/lib/tomcat7/webapps/`.
* Restart tomcat7 to generate ScadaLTS folder: `/etc/init.d/tomcat7 restart`
* Change config file env.properties set connection to db: `vim /var/lib/tomcat7/webapps/ScadaBR/WEB-INF/classes/env.properties`.
* Restart tomcat7: `/etc/init.d/tomcat7 restart`


### What's included

App ScadaBR.war
App ScadaLTS.war

## Bugs and feature requests

Have a bug or a feature request? Please first read the [issue guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md#using-the-issue-tracker) and search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](https://github.com/sdtabilit/Scada-LTS/issues/new).

## Documentation

Scada-LTS documentation, will be included in this repo in the root directory.


## Contributing

In the process of making.

## Community

* ScadaLTS tag is finally available on Stack Overflow. Feel free to ask questions - http://stackoverflow.com/questions/tagged/scadalts.

## Tests

[scada-lts.testquality.com](https://scada-lts.testquality.com)


## Versioning

For transparency into our release cycle and in striving to maintain backward compatibility, Scada-LTS is maintained under [the Semantic Versioning guidelines](http://semver.org/). Sometimes we screw up, but we'll adhere to those rules whenever possible.

See [the Releases section of our GitHub project](https://github.com/grzesiekb/Scada-LTS/releases) for changelogs for each release version of Scada-LTS.

## Creators

Code base on [ScadaBR](https://sourceforge.net/projects/scadabr/?source=directory)

**Michał Rokitiański**

* <https://github.com/SoftQ>

**Grzesiek Bylica**

* <https://github.com/grzesiekb>

**Arkadiusz Parafiniuk**

* <https://github.com/ArkadiuszParafiniuk>

**Konrad Daniek**

* <https://github.com/wisyr>

**Jarosław Morzyniec**

* <https://github.com/Morzyniec> Testing

**Mateusz Kaproń**

* <https://github.com/matkapron>

**Diego Rodrigues Ferreira**

* <https://github.com/katesclau>

**Jerzy Piejko**

* <https://github.com/JerzyPiejko>

**Radosław Jajko**

* <https://github.com/radek2s>

**Marcin Gołda**

* <https://github.com/marcingolda>

**Tomasz Skrobol**

* <https://github.com/TomashHawk>

## Support

If you need support for deployment please contact us and find more information on [our website](http://scada-lts.comhttp://scada-lts.com/#support)


## Copyright and license

Code released under [the GPL license](https://github.com/sdtabilit/Scada-LTS/blob/master-sdtabilit/LICENSE).
# [Scada-LTS](http://scada-lts.org)

[![](https://images.microbadger.com/badges/version/dockergb/scadalts-dev.svg)](https://microbadger.com/images/dockergb/scadalts-dev "Get your own version badge on microbadger.com")
[![](https://images.microbadger.com/badges/image/dockergb/scadalts-dev.svg)](https://microbadger.com/images/dockergb/scadalts-dev "Get your own image badge on microbadger.com")

Scada-LTS is an Open Source, web-based, multi-platform solution for building your own SCADA (Supervisory Control and Data Acquisition) system.


## Table of contents

* [Quick start](#quick-start)
* [Bugs and feature requests](#bugs-and-feature-requests)
* [Documentation](#documentation)
* [Contributing](#contributing)
* [Community](#community)
* [Versioning](#versioning)
* [Creators](#creators)
* [Copyright and license](#copyright-and-license)


## Quick start

Here is two of the several start options:

### To Run ScadaLTS on Docker:
* Download and install Docker from: https://www.docker.com/
* Download Docker Toolbox from: https://kitematic.com/
* Run Docker and Docker Toolbox.
* When the download is completed in the Docker Toolbox run Docker CLI (bottom-left corner).
* In the Docker CLI type in: `docker pull scadalts/scadalts` to download repository.
* Type in: `docker images` to check if repository is created. It should show "scadalts/scadalts" on the list.
* To run Scada on Docker type in:
``docker run -it -e DOCKER_HOST_IP=`docker-machine ip` -p 81:8080 scadalts/scadalts /root/start.sh``.
* Type in: `Get-NetIPAddress` and find IPAdrress for "DockerNAT" InterfaceAlias (You need a new CLI window to do it).
* Type in docker IP adrress in the browser with port 81 and `/ScadaLTS/` sufix. Example:
`http://10.0.75.2:81/ScadaLTS/`

### Second option:
* [Download the latest release](https://github.com/sdtabilit/Scada-LTS/releases/download/v0.0.6-test-modbus.3.0.2/ScadaBR.war).
* Install tomcat7: `apt-get install tomcat7`.
* Install mysql: `apt-get install mysql-server`.
* Login to mysql: `mysql -u [user] -p`.
* Create db:`create dababase scadalts;`.
* Copy ScadaBR.war & ScadaLTS.war to dir tomacat webapps: `cp ScadaBR.war /var/lib/tomcat7/webapps/`.
* Restart tomcat7 to generate ScadaLTS folder: `/etc/init.d/tomcat7 restart`
* Change config file env.properties set connection to db: `vim /var/lib/tomcat7/webapps/ScadaBR/WEB-INF/classes/env.properties`.
* Restart tomcat7: `/etc/init.d/tomcat7 restart`


### What's included

App ScadaBR.war
App ScadaLTS.war

## Bugs and feature requests

Have a bug or a feature request? Please first read the [issue guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md#using-the-issue-tracker) and search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](https://github.com/sdtabilit/Scada-LTS/issues/new).

## Documentation

Scada-LTS documentation, will be included in this repo in the root directory.


## Contributing

In the process of making.

## Community

* ScadaLTS tag is finally available on Stack Overflow. Feel free to ask questions - http://stackoverflow.com/questions/tagged/scadalts.

## Tests

[scada-lts.testquality.com](https://scada-lts.testquality.com)


## Versioning

For transparency into our release cycle and in striving to maintain backward compatibility, Scada-LTS is maintained under [the Semantic Versioning guidelines](http://semver.org/). Sometimes we screw up, but we'll adhere to those rules whenever possible.

See [the Releases section of our GitHub project](https://github.com/grzesiekb/Scada-LTS/releases) for changelogs for each release version of Scada-LTS.

## Creators

Code base on [ScadaBR](https://sourceforge.net/projects/scadabr/?source=directory)

**Michał Rokitiański**

* <https://github.com/SoftQ>

**Grzesiek Bylica**

* <https://github.com/grzesiekb>

**Arkadiusz Parafiniuk**

* <https://github.com/ArkadiuszParafiniuk>

**Konrad Daniek**

* <https://github.com/wisyr>

**Jarosław Morzyniec**

* <https://github.com/Morzyniec> Testing

**Mateusz Kaproń**

* <https://github.com/matkapron>

**Diego Rodrigues Ferreira**

* <https://github.com/katesclau>

**Jerzy Piejko**

* <https://github.com/JerzyPiejko>

**Radosław Jajko**

* <https://github.com/radek2s>

**Marcin Gołda**

* <https://github.com/marcingolda>

**Tomasz Skrobol**

* <https://github.com/TomashHawk>

## Support

If you need support for deployment please contact us and find more information on [our website](http://scada-lts.comhttp://scada-lts.com/#support)


## Copyright and license

Code released under [the GPL license](https://github.com/sdtabilit/Scada-LTS/blob/master-sdtabilit/LICENSE).
2 changes: 2 additions & 0 deletions scadalts-ui/src/locales/de.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"plcalarms.fault.inactive":"Störung ist gegangen",
"plcalarms.fault.active":"Störung kommt",
"plcalarms.fault.acknowledge": "Fault acknowledge",
"plcalarms.alarm.inactive":"Alarm ist gegangen",
"plcalarms.alarm.active":"Alarm ausgelöst",
"plcalarms.alarm.acknowledge": "Alarm acknowledge",
"about": "Dies ist eine Über-Seite (i18n test) locales"
}
2 changes: 2 additions & 0 deletions scadalts-ui/src/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"plcalarms.fault.inactive":"Fault has gone",
"plcalarms.fault.active":"Fault comes",
"plcalarms.fault.acknowledge": "Fault acknowledge",
"plcalarms.alarm.inactive":"Alarm is gone",
"plcalarms.alarm.active":"Alarm triggered",
"plcalarms.alarm.acknowledge": "Alarm acknowledge",
"about": "This is an about page (i18n test) locales"
}
6 changes: 4 additions & 2 deletions scadalts-ui/src/views/components/AlarmsComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
},
data() {
return {
LEVEL_FAULT: 1,
LEVEL_ALARM: 2,
alarms: [],
currentPage: 1,
pageCount: 10,
Expand Down Expand Up @@ -125,7 +127,7 @@
isActivation(activationTime, inactivationTime, level) {
if (!this.checkPrm(activationTime, inactivationTime, level)) return false
if (activationTime.trim().length > 0 && inactivationTime.trim().length == 0 && level == 2) {
if (activationTime.trim().length > 0 && inactivationTime.trim().length == 0 && level == this.LEVEL_FAULT) {
return true
} else {
return false
Expand All @@ -134,7 +136,7 @@
isActivationAlarm(activationTime, inactivationTime, level) {
if (!this.checkPrm(activationTime, inactivationTime, level)) return false
if (activationTime.trim().length > 0 && inactivationTime.trim().length == 0 && level == 1) {
if (activationTime.trim().length > 0 && inactivationTime.trim().length == 0 && level == this.LEVEL_ALARM) {
return true
} else {
return false
Expand Down
51 changes: 41 additions & 10 deletions scadalts-ui/src/views/components/HistoricalAlarmsComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
v-bind:class="{input_disabled:filterOn==true}"
></datepicker>


<input
v-model="frlike"
class="min-gb-input"
Expand Down Expand Up @@ -118,23 +117,55 @@ export default {
offset: loffset,
limit: llimit
}).then((ret) => {
//{"activeTime":"2020-08-21 17:38:17","inactiveTime":" ","acknowledgeTime":" ","name":"test AL test","level":2}
//transform to {time: "",utc:"", type:"aT", name:"",description:""}
console.log(ret)
let toRet = [];
ret.find(r => {
if (r.description.includes('2')) {
if (r.description.includes('active')) {
r.description = i18n.t('plcalarms.alarm.active')
if (r.acknowledgeTime != undefined && r.acknowledgeTime.trim() != "" && r.acknowledgeTime.length > 0) {
let toAdd = {}
toAdd.time = r.acknowledgeTime
toAdd.utc = new Date(r.time)
if (r.level === 2) {
toAdd.description = i18n.t('plcalarms.alarm.acknowledge')
} else {
r.description = i18n.t('plcalarms.alarm.inactive')
toAdd.description = i18n.t('plcalarms.fault.acknowledge')
}
} else if (r.description.include('1')) {
if (r.description.include('active')) {
r.description = i18n.t('plcalarms.fault.active')
toRet.push(toAdd)
}
if (r.inactiveTime != undefined && r.inactiveTime.trim() != "" && r.inactiveTime.length > 0) {
let toAdd = {}
toAdd.time = r.inactiveTime
toAdd.utc = new Date(r.time)
if (r.level === 2) {
toAdd.description = i18n.t('plcalarms.alarm.inactive')
} else {
toAdd.description = i18n.t('plcalarms.fault.inactive')
}
toRet.push(toAdd)
}
if (r.activeTime != undefined && r.activeTime.trim() != "" && r.activeTime.length > 0) {
let toAdd = {}
toAdd.time = r.activeTime
toAdd.utc = new Date(r.time)
if (r.level === 2) {
toAdd.description = i18n.t('plcalarms.alarm.active')
} else {
r.description = i18n.t('plcalarms.fault.inactive')
toAdd.description = i18n.t('plcalarms.fault.active')
}
toRet.push(toAdd)
}
})
this.historicalAlarms = ret;
console.log(toRet)
//sorting time
toRet.sort((a, b) => a.utc - b.utc);
console.log(ret)
this.historicalAlarms = toRet;
}).catch((err) => {
this.historicalAlarms = []
Expand Down
Loading

0 comments on commit bdbdb99

Please sign in to comment.