diff --git a/bower.json b/bower.json index 0acf5c0..fd15b94 100644 --- a/bower.json +++ b/bower.json @@ -11,8 +11,12 @@ "iron-iconset-svg": "PolymerElements/iron-iconset-svg#^2.0.0", "iron-media-query": "PolymerElements/iron-media-query#^2.0.0", "iron-pages": "PolymerElements/iron-pages#^2.0.0", + "iron-label": "PolymerElements/iron-label#^2.0.0", "iron-selector": "PolymerElements/iron-selector#^2.0.0", "paper-icon-button": "PolymerElements/paper-icon-button#^2.0.0", + "paper-checkbox": "PolymerElements/paper-checkbox#^2.0.1", + "paper-input": "PolymerElements/paper-input#^2.0.1", + "paper-dropdown-menu": "PolymerElements/paper-dropdown-menu#^2.0.1", "polymer": "Polymer/polymer#^2.0.0", "webcomponentsjs": "webcomponents/webcomponentsjs#^1.0.0", "iron-ajax": "^2.0.6", diff --git a/polymer.json b/polymer.json index 09c215c..b539a63 100644 --- a/polymer.json +++ b/polymer.json @@ -3,8 +3,11 @@ "shell": "src/my-app.html", "fragments": [ "src/status-view.html", + "src/settings-view.html", "src/colors-view.html", + "src/lamps-view.html", "src/schedule-view.html", + "src/json-view.html", "src/view404-view.html" ], "sources": [ diff --git a/src/colors-view.html b/src/colors-view.html index 3ea89f1..69c14cc 100644 --- a/src/colors-view.html +++ b/src/colors-view.html @@ -10,6 +10,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN + + + + + + + - diff --git a/src/js/schema.js b/src/js/schema.js new file mode 100644 index 0000000..7013e92 --- /dev/null +++ b/src/js/schema.js @@ -0,0 +1,110 @@ + +(function() { + var definitions = { + "time": { + "type": "string", + "format": "time" + }, + "schedule_item": { + "type": "object", + "properties": { + "time": { + "$ref": "#/definitions/time", + // "description": "Start time, when this schedule item should fire" + }, + "lamp": { + "type": "string", + "watch": { + "lamps": "lampmapping" + }, + "enumSource": [{ "source": "lamps", "value": "{{item}}" }] + }, + "color": { + "type": "string", + "watch": { "selectableColors": "colors" }, + "enumSource" : [{ "source": "selectableColors", "value": "{{item.name}}" }] + // "description": "Name of the color to be shown; corresponds to color name in color definitions." + }, + "mode": { + "type": "string", + // "description": "Dynamic behaviour / mode; allowed values are: OnOff", + "enum": ["OnOff", "Ramp", "Neon-on"] + } + } + } + }; + var colorsProperties = { + "description": "DLite color definition", + "type": "array", + "format": "table", + "uniqueItems": true, + "disable_collapse": true, + "items": { + "type": "object", + "description": "Color definition", + "properties": { + "name": { + "type": "string", + /*"description": "Color name used as identifier"*/ + }, + "color": { + "type": "string", + "format": "color", + /*"description": "Color definition"*/ + } + } + } + }; + var lampmappingProperties = { + "type": "array", + "format": "table", + "description": "LED/Lamp names, used as identifier; order according to LED address", + "items": { + "type": "string" + } + }; + var settingsProperties = { + "description": "DLite settings", + "type": "object", + "properties": { + "comment": { + "type": "string", + "format": "textarea", + "description": "Info about this schedule definition" + }, + "mrclock": { + "type": "string", + "description": "Name of a MR-Clock fastclock" + }, + "clock_starttime": { + "$ref": "#/definitions/time", + "description": "After boot, at which clock should this start to animate?" + }, + "clock_speed": { + "type": "number", + "description": "Real time seconds for every model minute" + }, + }, + }; + var scheduleProperties = { + "description": "DLite schedule definition", + "type": "array", + "format": "table", + // "description": "The schedule definition as an array of schedule items", + "items": { "$ref": "#/definitions/schedule_item" } + }; + var schema = { + "$schema": "http://json-schema.org/draft-06/schema#", + "description": "DLite Light Controller Configuration", + "type": "object", + "properties": { + "colors": colorsProperties, + "lampmapping": lampmappingProperties, + "settings": settingsProperties, + "schedule": scheduleProperties, + }, + "definitions": definitions + }; + window.schema = schema; +})(); + diff --git a/src/json-view.html b/src/json-view.html new file mode 100644 index 0000000..fa54576 --- /dev/null +++ b/src/json-view.html @@ -0,0 +1,72 @@ + + + + + + + + + + + + + diff --git a/src/lamps-view.html b/src/lamps-view.html new file mode 100644 index 0000000..79646a1 --- /dev/null +++ b/src/lamps-view.html @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + diff --git a/src/my-app.html b/src/my-app.html index 5f72aa4..ba41d83 100644 --- a/src/my-app.html +++ b/src/my-app.html @@ -20,11 +20,21 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN + + + + + + + + + + @@ -83,11 +93,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN - Menu + Config Status + Settings Colors + Lamps Schedule + JSON @@ -107,8 +120,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN fallback-selection="view404" role="main"> + + + diff --git a/src/schedule-view.html b/src/schedule-view.html index 999219b..980e429 100644 --- a/src/schedule-view.html +++ b/src/schedule-view.html @@ -10,6 +10,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN + + + + + + + + - - diff --git a/src/settings-view.html b/src/settings-view.html new file mode 100644 index 0000000..fb3f480 --- /dev/null +++ b/src/settings-view.html @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + diff --git a/test/my-view1.html b/test/settings-view.html similarity index 82% rename from test/my-view1.html rename to test/settings-view.html index 8fdba14..531ac19 100644 --- a/test/my-view1.html +++ b/test/settings-view.html @@ -20,21 +20,21 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN - +