Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/aktos-io/scada.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Cerem Cem ASLAN committed Aug 15, 2017
2 parents db1f2ed + 737dc2d commit 4fc21af
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 27 deletions.
53 changes: 39 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
![ScadaJS](https://cdn.rawgit.com/aktos-io/scada.js/master/assets/scadajs-logo-long.svg)

# Description

ScadaJS is a library to easily create Single Page Applications, targeted to industrial SCADA and MRP/ERP systems. Main objective of this library is to provide an integrated Distributed Control System layer which will make it possible to communicate with any type of hardware in realtime in any location (distributed), within the browser.

# Key features

* Uses HTML for building user interfaces and supports [Pug](https://pugjs.org) for advanced usage (and sanity)
Expand All @@ -14,37 +18,58 @@
* Siemens Comm
* Omron Hostlink
* and many others...
* Fully compatible with [aktos-dcs (Python)](https://github.com/aktos-io/aktos-dcs), [aktos-dcs-cs (C# port)](https://github.com/aktos-io/aktos-dcs-cs), [aktos-dcs-node (Node.js port)](https://github.com/aktos-io/aktos-dcs-node) libraries, a message passing library for distributed control systems by [aktos.io](https://aktos.io).
* Fully compatible with aktos.io hardwares
* Fully compatible with [aktos-dcs](https://github.com/aktos-io/aktos-dcs), a message passing library for distributed control systems.
* Fully compatible with aktos.io hardwares, such as [ScadaGateway](https://aktos.io/scada/pdf).
* Supports tools and documentation for [DRY](https://en.wikipedia.org/wiki/Don't_repeat_yourself) and [TDD](https://en.wikipedia.org/wiki/Test-driven_development) in mind.
* Provides build system via [Gulp](http://gulpjs.com).

# INSTALL
# DEMO

Demo application [source is here](https://github.com/aktos-io/scadajs-template) and can be seen in action at https://aktos.io/showcase

# Usage

### 1. Install Global Dependencies

1. Install [`NodeJs`](https://nodejs.org)
2. Install global dependencies:
2. Install global `npm` dependencies:

npm install -g gulp yarn [email protected]

...and optionally [follow the aea-way](doc/aea-way.md).

# Create a ScadaJS Project
### 2. Add ScadaJS Into Your Project

Add ScadaJS into your project
You can add ScadaJS any existing project:

git init your-project
# if there is no project yet
git init your-project

cd your-project
git submodule add https://github.com/aktos-io/scada.js

# Start Your Project
### 3. Install ScadaJS Dependencies

When you first create or clone a ScadaJS project, you need to install the dependencies:


cd your-project
git submodule update --init --recursive
cd scada.js
yarn
yarn # or `npm install`


### 4. Build Your Webapp

# DEMO
You can simply build your webapp:

cd your-project/scada.js
gulp --webapp your-webapp [--optimize]

Demo application source is [here](http://TODO) and can be seen here in action: https://aktos.io/showcase

> For a full example project, take a look at the [scadajs-template](https://github.com/aktos-io/scadajs-template).
# Tested on

* **Linux**
* Debian 8
* Raspbian (on Raspberry 2 and 3)


12 changes: 10 additions & 2 deletions components/data-table/index.ls
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,13 @@ Ractive.components['data-table'] = Ractive.extend do
@set \clickedIndex, index
@set \openingRow, yes
@set \openedRow, no
@set \openingRowMsg, "opening row..."
@set \openingRowMsg, "Opening #{index}..."
opening-dimmer.dimmer \show
curr <~ settings.on-create-view.call this, clone row
row-clone = clone row
curr <~ settings.on-create-view.call this, row-clone
if curr
@set \curr, curr
@set \row, row-clone
opening-dimmer.dimmer \hide
@set \openingRow, no
@set \openedRow, yes
Expand Down Expand Up @@ -328,3 +330,9 @@ Ractive.components['data-table'] = Ractive.extend do
@logger.clog "error in range generator: from: #{_from}, to: #{_to}"

unix-to-readable: unix-to-readable

lookup: (obj-array, key-field, key-value) ->
x = find (.[key-field] is key-value), obj-array
console.log "lookup input: ", obj-array, key-field, key-value
console.log "lookup result: ", x
x
16 changes: 5 additions & 11 deletions components/data-table/pagination.pug
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
+if('settings.pageSize > 0')
+if('(tableview_filtered.length / settings.pageSize) > 1')
tfoot
tr
th(colspan="{{ colNames.length }}")
.ui.right.floated.pagination.menu
+each('range(1, Math.ceil(tableview_filtered.length / settings.pageSize)):i')
a(on-click="@.fire('selectPage', i)" class!="item {{#if currPage === i}}active{{/if}}") {{ . }}

+if('openingRowMsg')
tr
th(colspan="{{ colNames.length }}")
| {{ openingRowMsg }}
.ui.pagination.menu
+each('range(1, Math.ceil(tableview_filtered.length / settings.pageSize)):i')
a(
on-click="@.fire('selectPage', i)"
class!="item {{#if currPage === i}}active{{/if}}") {{ . }}

0 comments on commit 4fc21af

Please sign in to comment.