Skip to content

Commit

Permalink
updated mysql structure
Browse files Browse the repository at this point in the history
  • Loading branch information
berwinter committed Apr 5, 2015
1 parent 75031fc commit 0c9a5f5
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 6 deletions.
8 changes: 4 additions & 4 deletions js/main.js
Expand Up @@ -236,7 +236,7 @@ var actualValues =
try {
var value = actualValues.values[i];
var type = "value";
var text = value.format.replace(/((DIGITAL|MWH|KWH|MISCHER_AUF|MISCHER_ZU|VENTIL|DREHZAHL|COLOR|ANIMATION)\()?#\.?(#*)\)?/g, function(number,tmp,modifier,fractions) {
var text = value.format.replace(/((DIGITAL|MWH|KWH|MISCHER_AUF|MISCHER_ZU|VENTIL|DREHZAHL|GRADCOLOR|ANIMATION)\()?#\.?(#*)\)?/g, function(number,tmp,modifier,fractions) {
switch(modifier) {
case "MISCHER_AUF":
return converter.mixerOn(data[value.frame][value.type]);
Expand All @@ -252,8 +252,8 @@ var actualValues =
return converter.kwh(data[value.frame][value.type]).toFixed(fractions.length);
case "DREHZAHL":
return converter.speed(data[value.frame][value.type]);
case "COLOR":
type = "color";
case "GRADCOLOR":
type = "gradcolor";
return converter.color(data[value.frame][value.type]);
case "ANIMATION":
for(var i in $(value.path))
Expand Down Expand Up @@ -286,7 +286,7 @@ var actualValues =
if(text != null)
{
switch(type) {
case "color":
case "gradcolor":
$(value.path).attr("style","stop-color:"+text);
break;
default:
Expand Down
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions sql/migration/table-migration_v95_v96.sql
@@ -0,0 +1,13 @@
ALTER TABLE `t_schema`
DROP INDEX `UNIQUE`;

ALTER TABLE `t_menu`
CHANGE COLUMN `type` `type` VARCHAR(20) NOT NULL ;

CREATE TABLE `t_chartoptions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`chard_id` int(11) NOT NULL,
`property` varchar(120) NOT NULL,
`value` varchar(120) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
13 changes: 11 additions & 2 deletions sql/structure.sql
@@ -1,6 +1,16 @@
CREATE DATABASE IF NOT EXISTS `uvr1611`;
USE `uvr1611`;

DROP TABLE IF EXISTS `t_chartoptions`;
CREATE TABLE `t_chartoptions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`chard_id` int(11) NOT NULL,
`property` varchar(120) NOT NULL,
`value` varchar(120) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


DROP TABLE IF EXISTS `t_data`;
CREATE TABLE `t_data` (
`id` int(11) NOT NULL AUTO_INCREMENT,
Expand Down Expand Up @@ -56,7 +66,7 @@ CREATE TABLE `t_menu` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(200) NOT NULL,
`unit` varchar(10) DEFAULT NULL,
`type` enum('schema','line','power','energy','weather') NOT NULL,
`type` varchar(20) DEFAULT NOT NULL,
`order` tinyint(4) DEFAULT NULL,
`schema` varchar(200) DEFAULT NULL,
PRIMARY KEY (`id`)
Expand All @@ -70,7 +80,6 @@ CREATE TABLE `t_schema` (
`type` enum('analog1','analog2','analog3','analog4','analog5','analog6','analog7','analog8','analog9','analog10','analog11','analog12','analog13','analog14','analog15','analog16','digital1','digital2','digital3','digital4','digital5','digital6','digital7','digital8','digital9','digital10','digital11','digital12','digital13','digital14','digital15','digital16','speed1','speed2','speed3','speed4','energy1','energy2','power1','power2','current_energy1','current_energy2') NOT NULL,
`format` varchar(200) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UNIQUE` (`frame`,`type`),
KEY `index` (`frame`,`type`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Expand Down

0 comments on commit 0c9a5f5

Please sign in to comment.