diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index 3211d20e4..ea920f627 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -257,13 +257,14 @@ CREATE TABLE Monitors ( Type enum('Local','Remote','File') NOT NULL default 'Local', Function enum('None','Monitor','Modect','Record','Mocord','Nodect') NOT NULL default 'Monitor', Enabled tinyint(3) unsigned NOT NULL default '1', + LinkedMonitors varchar(255) NOT NULL default '', Triggers set('X10') NOT NULL default '', - Device tinytext, + Device varchar(64) NOT NULL default '', Channel tinyint(3) unsigned NOT NULL default '0', Format tinyint(3) unsigned NOT NULL default '0', - Host varchar(64) default NULL, - Port varchar(8) default '80', - Path varchar(255) default NULL, + Host varchar(64) NOT NULL default '', + Port varchar(8) NOT NULL default '', + Path varchar(255) NOT NULL default '', Width smallint(5) unsigned NOT NULL default '0', Height smallint(5) unsigned NOT NULL default '0', Palette tinyint(3) unsigned NOT NULL default '1', @@ -274,8 +275,8 @@ CREATE TABLE Monitors ( Colour mediumint(7) NOT NULL default '-1', EventPrefix varchar(32) NOT NULL default 'Event-', LabelFormat varchar(32) NOT NULL default '%%s - %y/%m/%d %H:%M:%S', - LabelX smallint(5) unsigned default NULL, - LabelY smallint(5) unsigned default NULL, + LabelX smallint(5) unsigned NOT NULL default 0, + LabelY smallint(5) unsigned NOT NULL default 0, ImageBufferCount smallint(5) unsigned NOT NULL default '100', WarmupCount smallint(5) unsigned NOT NULL default '25', PreEventCount smallint(5) unsigned NOT NULL default '10', diff --git a/db/zm_update-1.22.0.sql b/db/zm_update-1.22.0.sql index b3e328426..40b248946 100644 --- a/db/zm_update-1.22.0.sql +++ b/db/zm_update-1.22.0.sql @@ -1,6 +1,18 @@ -- -- This updates a 1.22.0 database to 1.22.1 -- + +-- +-- Add support for linked monitors +-- +alter table Monitors add column LinkedMonitors varchar(255) NOT NULL default '' after Enabled; +alter table Monitors modify column Device varchar(64) not null default ''; +alter table Monitors modify column Host varchar(64) not null default ''; +alter table Monitors modify column Port varchar(8) not null default ''; +alter table Monitors modify column Path varchar(255) not null default ''; +alter table Monitors modify column LabelX smallint(5) unsigned not null default 0; +alter table Monitors modify column LabelY smallint(5) unsigned not null default 0; + -- -- Modify zone presets a bit -- diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index 4679e9362..fa5a1c7a0 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -1002,7 +1002,7 @@ bool Monitor::Analyse() { score += motion_score; cause_ptr += snprintf( cause_ptr, sizeof(cause)-(cause_ptr-cause), "%s%s", cause[0]?", ":"", "Motion" ); - text_ptr += snprintf( text_ptr, sizeof(text)-(text_ptr-text), "%sZone: %s", text[0]?"\n":"", motion_text ); + text_ptr += snprintf( text_ptr, sizeof(text)-(text_ptr-text), "%sMotion: %s", text[0]?"\n":"", motion_text ); } } else @@ -1024,8 +1024,8 @@ bool Monitor::Analyse() { if ( first_link ) { - cause_ptr += snprintf( cause_ptr, sizeof(cause)-(cause_ptr-cause), "%s%s", cause[0]?", ":"", "Linked Monitor" ); - text_ptr += snprintf( text_ptr, sizeof(text)-(text_ptr-text), "%sMonitor: %s", text[0]?"\n":"", linked_monitors[i]->Name() ); + cause_ptr += snprintf( cause_ptr, sizeof(cause)-(cause_ptr-cause), "%s%s", cause[0]?", ":"", "Linked" ); + text_ptr += snprintf( text_ptr, sizeof(text)-(text_ptr-text), "%sLinked: %s", text[0]?"\n":"", linked_monitors[i]->Name() ); first_link = false; } else