Added persistent brightness etc feature.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1114 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2004-09-25 16:37:41 +00:00
parent 250370463a
commit aff2ef8430
12 changed files with 128 additions and 75 deletions

View File

@ -5,6 +5,10 @@
-- --
alter table Monitors add column EventPrefix varchar(32) not null default 'Event-' after Orientation; alter table Monitors add column EventPrefix varchar(32) not null default 'Event-' after Orientation;
alter table Monitors add column AlarmFrameCount smallint(5) unsigned not null default '1' after PostEventCount; alter table Monitors add column AlarmFrameCount smallint(5) unsigned not null default '1' after PostEventCount;
alter table Monitors add column Brightness mediumint(7) NOT NULL default '-1' after Orientation;
alter table Monitors add column Contrast mediumint(7) NOT NULL default '-1' after Brightness;
alter table Monitors add column Hue mediumint(7) NOT NULL default '-1' after Contrast;
alter table Monitors add column Colour mediumint(7) NOT NULL default '-1' after Hue;
-- --
-- These are optional, but we might as well do it now -- These are optional, but we might as well do it now
-- --

View File

@ -111,6 +111,10 @@ CREATE TABLE Monitors (
Height smallint(5) unsigned NOT NULL default '0', Height smallint(5) unsigned NOT NULL default '0',
Palette tinyint(3) unsigned NOT NULL default '1', Palette tinyint(3) unsigned NOT NULL default '1',
Orientation enum('0','90','180','270') NOT NULL default '0', Orientation enum('0','90','180','270') NOT NULL default '0',
Brightness mediumint(7) unsigned NOT NULL default '-1',
Contrast mediumint(7) unsigned NOT NULL default '-1',
Hue mediumint(7) unsigned NOT NULL default '-1',
Colour mediumint(7) unsigned NOT NULL default '-1',
EventPrefix varchar(32) NOT NULL default 'Event-', EventPrefix varchar(32) NOT NULL default 'Event-',
LabelFormat varchar(32) NOT NULL default '%%s - %y/%m/%d %H:%M:%S', LabelFormat varchar(32) NOT NULL default '%%s - %y/%m/%d %H:%M:%S',
LabelX smallint(5) unsigned default NULL, LabelX smallint(5) unsigned default NULL,

View File

@ -20,7 +20,7 @@
#include "zm.h" #include "zm.h"
#include "zm_camera.h" #include "zm_camera.h"
Camera::Camera( SourceType p_type, int p_width, int p_height, int p_palette, bool p_capture ) : type( p_type ), width( p_width), height( p_height ), palette( p_palette ), capture( p_capture ) Camera::Camera( SourceType p_type, int p_width, int p_height, int p_palette, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture ) : type( p_type ), width( p_width), height( p_height ), palette( p_palette ), brightness( p_brightness ), contrast( p_contrast ), hue( p_hue ), colour( p_colour ), capture( p_capture )
{ {
colours = (palette==VIDEO_PALETTE_GREY?1:3); colours = (palette==VIDEO_PALETTE_GREY?1:3);
} }

View File

@ -40,10 +40,14 @@ protected:
unsigned int height; unsigned int height;
unsigned int palette; unsigned int palette;
unsigned int colours; unsigned int colours;
unsigned int brightness;
unsigned int hue;
unsigned int colour;
unsigned int contrast;
bool capture; bool capture;
public: public:
Camera( SourceType p_type, int p_width, int p_height, int p_palette, bool p_capture=true ); Camera( SourceType p_type, int p_width, int p_height, int p_palette, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture=true );
virtual ~Camera(); virtual ~Camera();
SourceType Type() const { return( type ); } SourceType Type() const { return( type ); }

View File

@ -42,7 +42,7 @@ short *LocalCamera::g_v_table;
short *LocalCamera::g_u_table; short *LocalCamera::g_u_table;
short *LocalCamera::b_u_table; short *LocalCamera::b_u_table;
LocalCamera::LocalCamera( int p_device, int p_channel, int p_format, int p_width, int p_height, int p_palette, bool p_capture ) : Camera( LOCAL, p_width, p_height, p_palette, p_capture ), device( p_device ), channel( p_channel ), format( p_format ) LocalCamera::LocalCamera( int p_device, int p_channel, int p_format, int p_width, int p_height, int p_palette, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture ) : Camera( LOCAL, p_width, p_height, p_palette, p_brightness, p_contrast, p_hue, p_colour, p_capture ), device( p_device ), channel( p_channel ), format( p_format )
{ {
if ( !camera_count++ && capture ) if ( !camera_count++ && capture )
{ {
@ -104,6 +104,11 @@ void LocalCamera::Initialise()
} }
} }
if ( brightness >= 0 ) vid_pic.brightness = brightness;
if ( hue >= 0 ) vid_pic.hue = hue;
if ( colour >= 0 ) vid_pic.colour = colour;
if ( contrast >= 0 ) vid_pic.contrast = contrast;
if ( ioctl( m_videohandle, VIDIOCSPICT, &vid_pic ) < 0 ) if ( ioctl( m_videohandle, VIDIOCSPICT, &vid_pic ) < 0 )
{ {
Error(( "Failed to set picture attributes: %s", strerror(errno) )); Error(( "Failed to set picture attributes: %s", strerror(errno) ));

View File

@ -53,7 +53,7 @@ protected:
static short *b_u_table; static short *b_u_table;
public: public:
LocalCamera( int p_device, int p_channel, int p_format, int p_width, int p_height, int p_palette, bool p_capture=true ); LocalCamera( int p_device, int p_channel, int p_format, int p_width, int p_height, int p_palette, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture=true );
~LocalCamera(); ~LocalCamera();
void Initialise(); void Initialise();

View File

@ -47,6 +47,10 @@ Monitor::Monitor(
int p_height, int p_height,
int p_palette, int p_palette,
int p_orientation, int p_orientation,
int p_brightness,
int p_contrast,
int p_hue,
int p_colour,
char *p_event_prefix, char *p_event_prefix,
char *p_label_format, char *p_label_format,
const Coord &p_label_coord, const Coord &p_label_coord,
@ -68,6 +72,10 @@ Monitor::Monitor(
width( p_width ), width( p_width ),
height( p_height ), height( p_height ),
orientation( (Orientation)p_orientation ), orientation( (Orientation)p_orientation ),
brightness( p_brightness ),
contrast( p_contrast ),
hue( p_hue ),
colour( p_colour ),
label_coord( p_label_coord ), label_coord( p_label_coord ),
image_buffer_count( p_image_buffer_count ), image_buffer_count( p_image_buffer_count ),
warmup_count( p_warmup_count ), warmup_count( p_warmup_count ),
@ -91,7 +99,7 @@ Monitor::Monitor(
strncpy( event_prefix, p_event_prefix, sizeof(event_prefix) ); strncpy( event_prefix, p_event_prefix, sizeof(event_prefix) );
strncpy( label_format, p_label_format, sizeof(label_format) ); strncpy( label_format, p_label_format, sizeof(label_format) );
camera = new LocalCamera( p_device, p_channel, p_format, (p_orientation%2)?width:height, (orientation%2)?height:width, p_palette, purpose==CAPTURE ); camera = new LocalCamera( p_device, p_channel, p_format, (p_orientation%2)?width:height, (orientation%2)?height:width, p_palette, p_brightness, p_contrast, p_hue, p_colour, purpose==CAPTURE );
Setup(); Setup();
} }
@ -107,6 +115,10 @@ Monitor::Monitor(
int p_height, int p_height,
int p_palette, int p_palette,
int p_orientation, int p_orientation,
int p_brightness,
int p_contrast,
int p_hue,
int p_colour,
char *p_event_prefix, char *p_event_prefix,
char *p_label_format, char *p_label_format,
const Coord &p_label_coord, const Coord &p_label_coord,
@ -128,6 +140,10 @@ Monitor::Monitor(
width( p_width ), width( p_width ),
height( p_height ), height( p_height ),
orientation( (Orientation)p_orientation ), orientation( (Orientation)p_orientation ),
brightness( p_brightness ),
contrast( p_contrast ),
hue( p_hue ),
colour( p_colour ),
label_coord( p_label_coord ), label_coord( p_label_coord ),
image_buffer_count( p_image_buffer_count ), image_buffer_count( p_image_buffer_count ),
warmup_count( p_warmup_count ), warmup_count( p_warmup_count ),
@ -151,7 +167,7 @@ Monitor::Monitor(
strncpy( event_prefix, p_event_prefix, sizeof(event_prefix) ); strncpy( event_prefix, p_event_prefix, sizeof(event_prefix) );
strncpy( label_format, p_label_format, sizeof(label_format) ); strncpy( label_format, p_label_format, sizeof(label_format) );
camera = new RemoteCamera( p_host, p_port, p_path, (p_orientation%2)?width:height, (orientation%2)?height:width, p_palette, purpose==CAPTURE ); camera = new RemoteCamera( p_host, p_port, p_path, (p_orientation%2)?width:height, (orientation%2)?height:width, p_palette, p_brightness, p_contrast, p_hue, p_colour, purpose==CAPTURE );
Setup(); Setup();
} }
@ -925,11 +941,11 @@ int Monitor::Load( int device, Monitor **&monitors, Purpose purpose )
static char sql[BUFSIZ]; static char sql[BUFSIZ];
if ( device == -1 ) if ( device == -1 )
{ {
strncpy( sql, "select Id, Name, Function+0, Device, Channel, Format, Width, Height, Palette, Orientation+0, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, FPSReportInterval, RefBlendPerc from Monitors where Function != 'None' and Type = 'Local'", sizeof(sql) ); strncpy( sql, "select Id, Name, Function+0, Device, Channel, Format, Width, Height, Palette, Orientation+0, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, FPSReportInterval, RefBlendPerc from Monitors where Function != 'None' and Type = 'Local'", sizeof(sql) );
} }
else else
{ {
snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Device, Channel, Format, Width, Height, Palette, Orientation+0, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, FPSReportInterval, RefBlendPerc from Monitors where Function != 'None' and Type = 'Local' and Device = %d", device ); snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Device, Channel, Format, Width, Height, Palette, Orientation+0, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, FPSReportInterval, RefBlendPerc from Monitors where Function != 'None' and Type = 'Local' and Device = %d", device );
} }
if ( mysql_query( &dbconn, sql ) ) if ( mysql_query( &dbconn, sql ) )
{ {
@ -960,19 +976,23 @@ int Monitor::Load( int device, Monitor **&monitors, Purpose purpose )
atoi(dbrow[7]), // Height atoi(dbrow[7]), // Height
atoi(dbrow[8]), // Palette atoi(dbrow[8]), // Palette
atoi(dbrow[9]), // Orientation atoi(dbrow[9]), // Orientation
dbrow[10], // EventPrefix atoi(dbrow[10]), // Brightness
dbrow[11], // LabelFormat atoi(dbrow[11]), // Contrast
Coord( atoi(dbrow[12]), atoi(dbrow[13]) ), // LabelX, LabelY atoi(dbrow[12]), // Hue
atoi(dbrow[14]), // ImageBufferCount atoi(dbrow[13]), // Colour
atoi(dbrow[15]), // WarmupCount dbrow[14], // EventPrefix
atoi(dbrow[16]), // PreEventCount dbrow[15], // LabelFormat
atoi(dbrow[17]), // PostEventCount Coord( atoi(dbrow[16]), atoi(dbrow[17]) ), // LabelX, LabelY
atoi(dbrow[18]), // AlarmFrameCount atoi(dbrow[18]), // ImageBufferCount
atoi(dbrow[19]), // SectionLength atoi(dbrow[19]), // WarmupCount
atoi(dbrow[20]), // FrameSkip atoi(dbrow[20]), // PreEventCount
atof(dbrow[21])>0.0?int(DT_PREC_3/atof(dbrow[21])):0, // MaxFPS atoi(dbrow[21]), // PostEventCount
atoi(dbrow[22]), // FPSReportInterval atoi(dbrow[22]), // AlarmFrameCount
atoi(dbrow[23]), // RefBlendPerc atoi(dbrow[23]), // SectionLength
atoi(dbrow[24]), // FrameSkip
atof(dbrow[25])>0.0?int(DT_PREC_3/atof(dbrow[25])):0, // MaxFPS
atoi(dbrow[26]), // FPSReportInterval
atoi(dbrow[27]), // RefBlendPerc
purpose purpose
); );
Zone **zones = 0; Zone **zones = 0;
@ -996,11 +1016,11 @@ int Monitor::Load( const char *host, const char*port, const char *path, Monitor
static char sql[BUFSIZ]; static char sql[BUFSIZ];
if ( !host ) if ( !host )
{ {
strncpy( sql, "select Id, Name, Function+0, Host, Port, Path, Width, Height, Palette, Orientation+0, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, FPSReportInterval, RefBlendPerc from Monitors where Function != 'None' and Type = 'Remote'", sizeof(sql) ); strncpy( sql, "select Id, Name, Function+0, Host, Port, Path, Width, Height, Palette, Orientation+0, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, FPSReportInterval, RefBlendPerc from Monitors where Function != 'None' and Type = 'Remote'", sizeof(sql) );
} }
else else
{ {
snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Host, Port, Path, Width, Height, Palette, Orientation+0, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, FPSReportInterval, RefBlendPerc from Monitors where Function != 'None' and Type = 'Remote' and Host = '%s' and Port = '%s' and Path = '%s'", host, port, path ); snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Host, Port, Path, Width, Height, Palette, Orientation+0, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, FPSReportInterval, RefBlendPerc from Monitors where Function != 'None' and Type = 'Remote' and Host = '%s' and Port = '%s' and Path = '%s'", host, port, path );
} }
if ( mysql_query( &dbconn, sql ) ) if ( mysql_query( &dbconn, sql ) )
{ {
@ -1031,19 +1051,23 @@ int Monitor::Load( const char *host, const char*port, const char *path, Monitor
atoi(dbrow[7]), // Height atoi(dbrow[7]), // Height
atoi(dbrow[8]), // Palette atoi(dbrow[8]), // Palette
atoi(dbrow[9]), // Orientation atoi(dbrow[9]), // Orientation
dbrow[10], // EventPrefix atoi(dbrow[10]), // Brightness
dbrow[11], // LabelFormat atoi(dbrow[11]), // Contrast
Coord( atoi(dbrow[12]), atoi(dbrow[13]) ), // LabelX, LabelY atoi(dbrow[12]), // Hue
atoi(dbrow[14]), // ImageBufferCount atoi(dbrow[13]), // Colour
atoi(dbrow[15]), // WarmupCount dbrow[14], // EventPrefix
atoi(dbrow[16]), // PreEventCount dbrow[15], // LabelFormat
atoi(dbrow[17]), // PostEventCount Coord( atoi(dbrow[16]), atoi(dbrow[17]) ), // LabelX, LabelY
atoi(dbrow[18]), // AlarmFrameCount atoi(dbrow[18]), // ImageBufferCount
atoi(dbrow[19]), // SectionLength atoi(dbrow[19]), // WarmupCount
atoi(dbrow[20]), // FrameSkip atoi(dbrow[20]), // PreEventCount
atof(dbrow[21])>0.0?int(DT_PREC_3/atof(dbrow[21])):0, // MaxFPS atoi(dbrow[21]), // PostEventCount
atoi(dbrow[22]), // FPSReportInterval atoi(dbrow[22]), // AlarmFrameCount
atoi(dbrow[23]), // RefBlendPerc atoi(dbrow[23]), // SectionLength
atoi(dbrow[24]), // FrameSkip
atof(dbrow[25])>0.0?int(DT_PREC_3/atof(dbrow[25])):0, // MaxFPS
atoi(dbrow[26]), // FPSReportInterval
atoi(dbrow[27]), // RefBlendPerc
purpose purpose
); );
Zone **zones = 0; Zone **zones = 0;
@ -1065,7 +1089,7 @@ int Monitor::Load( const char *host, const char*port, const char *path, Monitor
Monitor *Monitor::Load( int id, bool load_zones, Purpose purpose ) Monitor *Monitor::Load( int id, bool load_zones, Purpose purpose )
{ {
static char sql[BUFSIZ]; static char sql[BUFSIZ];
snprintf( sql, sizeof(sql), "select Id, Name, Type, Function+0, Device, Channel, Format, Host, Port, Path, Width, Height, Palette, Orientation+0, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, FPSReportInterval, RefBlendPerc from Monitors where Id = %d", id ); snprintf( sql, sizeof(sql), "select Id, Name, Type, Function+0, Device, Channel, Format, Host, Port, Path, Width, Height, Palette, Orientation+0, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, FPSReportInterval, RefBlendPerc from Monitors where Id = %d", id );
if ( mysql_query( &dbconn, sql ) ) if ( mysql_query( &dbconn, sql ) )
{ {
Error(( "Can't run query: %s", mysql_error( &dbconn ) )); Error(( "Can't run query: %s", mysql_error( &dbconn ) ));
@ -1096,19 +1120,23 @@ Monitor *Monitor::Load( int id, bool load_zones, Purpose purpose )
atoi(dbrow[11]), // Height atoi(dbrow[11]), // Height
atoi(dbrow[12]), // Palette atoi(dbrow[12]), // Palette
atoi(dbrow[13]), // Orientation atoi(dbrow[13]), // Orientation
dbrow[14], // EventPrefix atoi(dbrow[14]), // Brightness
dbrow[15], // LabelFormat atoi(dbrow[15]), // Contrast
Coord( atoi(dbrow[16]), atoi(dbrow[17]) ), // LabelX, LabelY atoi(dbrow[16]), // Hue
atoi(dbrow[18]), // ImageBufferCount atoi(dbrow[17]), // Colour
atoi(dbrow[19]), // WarmupCount dbrow[18], // EventPrefix
atoi(dbrow[20]), // PreEventCount dbrow[19], // LabelFormat
atoi(dbrow[21]), // PostEventCount Coord( atoi(dbrow[20]), atoi(dbrow[21]) ), // LabelX, LabelY
atoi(dbrow[22]), // AlarmFrameCount atoi(dbrow[22]), // ImageBufferCount
atoi(dbrow[23]), // SectionLength atoi(dbrow[23]), // WarmupCount
atoi(dbrow[24]), // FrameSkip atoi(dbrow[24]), // PreEventCount
atof(dbrow[25])>0.0?int(DT_PREC_3/atof(dbrow[25])):0, // MaxFPS atoi(dbrow[25]), // PostEventCount
atoi(dbrow[26]), // FPSReportInterval atoi(dbrow[26]), // AlarmFrameCount
atoi(dbrow[27]), // RefBlendPerc atoi(dbrow[27]), // SectionLength
atoi(dbrow[28]), // FrameSkip
atof(dbrow[29])>0.0?int(DT_PREC_3/atof(dbrow[29])):0, // MaxFPS
atoi(dbrow[30]), // FPSReportInterval
atoi(dbrow[31]), // RefBlendPerc
purpose purpose
); );
} }
@ -1125,19 +1153,23 @@ Monitor *Monitor::Load( int id, bool load_zones, Purpose purpose )
atoi(dbrow[11]), // Height atoi(dbrow[11]), // Height
atoi(dbrow[12]), // Palette atoi(dbrow[12]), // Palette
atoi(dbrow[13]), // Orientation atoi(dbrow[13]), // Orientation
dbrow[14], // EventPrefix atoi(dbrow[14]), // Brightness
dbrow[15], // LabelFormat atoi(dbrow[15]), // Contrast
Coord( atoi(dbrow[16]), atoi(dbrow[17]) ), // LabelX, LabelY atoi(dbrow[16]), // Hue
atoi(dbrow[18]), // ImageBufferCount atoi(dbrow[17]), // Colour
atoi(dbrow[19]), // WarmupCount dbrow[18], // EventPrefix
atoi(dbrow[20]), // PreEventCount dbrow[19], // LabelFormat
atoi(dbrow[21]), // PostEventCount Coord( atoi(dbrow[20]), atoi(dbrow[21]) ), // LabelX, LabelY
atoi(dbrow[22]), // AlarmFrameCount atoi(dbrow[22]), // ImageBufferCount
atoi(dbrow[23]), // SectionLength atoi(dbrow[23]), // WarmupCount
atoi(dbrow[24]), // FrameSkip atoi(dbrow[24]), // PreEventCount
atof(dbrow[25])>0.0?int(DT_PREC_3/atof(dbrow[25])):0, // MaxFPS atoi(dbrow[25]), // PostEventCount
atoi(dbrow[26]), // FPSReportInterval atoi(dbrow[26]), // AlarmFrameCount
atoi(dbrow[27]), // RefBlendPerc atoi(dbrow[27]), // SectionLength
atoi(dbrow[28]), // FrameSkip
atof(dbrow[29])>0.0?int(DT_PREC_3/atof(dbrow[29])):0, // MaxFPS
atoi(dbrow[30]), // FPSReportInterval
atoi(dbrow[31]), // RefBlendPerc
purpose purpose
); );
} }

View File

@ -81,6 +81,10 @@ protected:
unsigned int height; // Normally the same as the camera, but not if partly rotated unsigned int height; // Normally the same as the camera, but not if partly rotated
RunMode run_mode; // Whether the monitor is running continuously or is triggered RunMode run_mode; // Whether the monitor is running continuously or is triggered
Orientation orientation; // Whether the image has to be rotated at all Orientation orientation; // Whether the image has to be rotated at all
unsigned int brightness; // The statically saved brightness of the camera
unsigned int contrast; // The statically saved contrast of the camera
unsigned int hue; // The statically saved hue of the camera
unsigned int colour; // The statically saved colour of the camera
char event_prefix[64]; // The prefix applied to event names as they are created char event_prefix[64]; // The prefix applied to event names as they are created
char label_format[64]; // The format of the timestamp on the images char label_format[64]; // The format of the timestamp on the images
Coord label_coord; // The coordinates of the timestamp on the images Coord label_coord; // The coordinates of the timestamp on the images
@ -160,8 +164,8 @@ protected:
} }
public: public:
Monitor( int p_id, char *p_name, int p_function, int p_device, int p_channel, int p_format, int p_width, int p_height, int p_palette, int p_orientation, char *p_event_prefix, char *p_label_format, const Coord &p_label_coord, int p_image_buffer_count, int p_warmup_count, int p_pre_event_count, int p_post_event_count, int p_alarm_frame_count, int p_section_length, int p_frame_skip, int p_capture_delay, int p_fps_report_interval, int p_ref_blend_perc, Purpose p_purpose=QUERY, int p_n_zones=0, Zone *p_zones[]=0 ); Monitor( int p_id, char *p_name, int p_function, int p_device, int p_channel, int p_format, int p_width, int p_height, int p_palette, int p_orientation, int p_brightness, int p_contrast, int p_hue, int p_colour, char *p_event_prefix, char *p_label_format, const Coord &p_label_coord, int p_image_buffer_count, int p_warmup_count, int p_pre_event_count, int p_post_event_count, int p_alarm_frame_count, int p_section_length, int p_frame_skip, int p_capture_delay, int p_fps_report_interval, int p_ref_blend_perc, Purpose p_purpose=QUERY, int p_n_zones=0, Zone *p_zones[]=0 );
Monitor( int p_id, char *p_name, int p_function, const char *p_host, const char *p_port, const char *p_path, int p_width, int p_height, int p_palette, int p_orientation, char *p_event_prefix, char *p_label_format, const Coord &p_label_coord, int p_image_buffer_count, int p_warmup_count, int p_pre_event_count, int p_post_event_count, int p_alarm_frame_count, int p_section_length, int p_frame_skip, int p_capture_delay, int p_fps_report_interval, int p_ref_blend_perc, Purpose p_purpose=QUERY, int p_n_zones=0, Zone *p_zones[]=0 ); Monitor( int p_id, char *p_name, int p_function, const char *p_host, const char *p_port, const char *p_path, int p_width, int p_height, int p_palette, int p_orientation, int p_brightness, int p_contrast, int p_hue, int p_colour, char *p_event_prefix, char *p_label_format, const Coord &p_label_coord, int p_image_buffer_count, int p_warmup_count, int p_pre_event_count, int p_post_event_count, int p_alarm_frame_count, int p_section_length, int p_frame_skip, int p_capture_delay, int p_fps_report_interval, int p_ref_blend_perc, Purpose p_purpose=QUERY, int p_n_zones=0, Zone *p_zones[]=0 );
~Monitor(); ~Monitor();
void Setup(); void Setup();

View File

@ -38,7 +38,7 @@
#include "zm.h" #include "zm.h"
#include "zm_remote_camera.h" #include "zm_remote_camera.h"
RemoteCamera::RemoteCamera( const char *p_host, const char *p_port, const char *p_path, int p_width, int p_height, int p_palette, bool p_capture ) : Camera( REMOTE, p_width, p_height, p_palette, p_capture ), host( p_host ), port( p_port ), path( p_path ) RemoteCamera::RemoteCamera( const char *p_host, const char *p_port, const char *p_path, int p_width, int p_height, int p_palette, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture ) : Camera( REMOTE, p_width, p_height, p_palette, p_brightness, p_contrast, p_hue, p_colour, p_capture ), host( p_host ), port( p_port ), path( p_path )
{ {
auth = 0; auth = 0;
auth64[0] = '\0'; auth64[0] = '\0';

View File

@ -68,7 +68,7 @@ protected:
static void Base64Encode( const char *in_string, char *out_string ); static void Base64Encode( const char *in_string, char *out_string );
public: public:
RemoteCamera( const char *p_host, const char *p_port, const char *p_path, int p_width, int p_height, int p_palette, bool p_capture=true ); RemoteCamera( const char *p_host, const char *p_port, const char *p_path, int p_width, int p_height, int p_palette, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture=true );
~RemoteCamera(); ~RemoteCamera();
const char *Host() const { return( host ); } const char *Host() const { return( host ); }

View File

@ -310,6 +310,10 @@ if ( isset($action) )
$zmu_command = ZMU_COMMAND." -m $mid -B$new_brightness -C$new_contrast -H$new_hue -O$new_colour"; $zmu_command = ZMU_COMMAND." -m $mid -B$new_brightness -C$new_contrast -H$new_hue -O$new_colour";
$zmu_output = exec( escapeshellcmd( $zmu_command ) ); $zmu_output = exec( escapeshellcmd( $zmu_command ) );
list( $brightness, $contrast, $hue, $colour ) = split( ' ', $zmu_output ); list( $brightness, $contrast, $hue, $colour ) = split( ' ', $zmu_output );
$sql = "update Monitors set Brightness = $brightness, Contrast = $contrast, Hue = $hue, Colour = $colour where Id = '$mid'";
$result = mysql_query( $sql );
if ( !$result )
die( mysql_error() );
} }
elseif ( $action == "delete" ) elseif ( $action == "delete" )
{ {

View File

@ -28,10 +28,6 @@ if ( !$result )
die( mysql_error() ); die( mysql_error() );
$monitor = mysql_fetch_assoc( $result ); $monitor = mysql_fetch_assoc( $result );
$zmu_command = ZMU_COMMAND." -m $mid -B -C -H -O";
$zmu_output = exec( escapeshellcmd( $zmu_command ) );
list( $brightness, $contrast, $hue, $colour ) = split( ' ', $zmu_output );
?> ?>
<html> <html>
<head> <head>
@ -70,10 +66,10 @@ function closeWindow()
<tr> <tr>
<td align="right" class="smallhead"><?= $zmSlangParameter ?></td><td align="left" class="smallhead"><?= $zmSlangValue ?></td> <td align="right" class="smallhead"><?= $zmSlangParameter ?></td><td align="left" class="smallhead"><?= $zmSlangValue ?></td>
</tr> </tr>
<tr><td align="right" class="text"><?= $zmSlangBrightness ?></td><td align="left" class="text"><input type="text" name="new_brightness" value="<?= $brightness ?>" size="8" class="form"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled<?php } ?>></td></tr> <tr><td align="right" class="text"><?= $zmSlangBrightness ?></td><td align="left" class="text"><input type="text" name="new_brightness" value="<?= $monitor['Brightness'] ?>" size="8" class="form"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled<?php } ?>></td></tr>
<tr><td align="right" class="text"><?= $zmSlangContrast ?></td><td align="left" class="text"><input type="text" name="new_contrast" value="<?= $contrast ?>" size="8" class="form"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled<?php } ?>></td></tr> <tr><td align="right" class="text"><?= $zmSlangContrast ?></td><td align="left" class="text"><input type="text" name="new_contrast" value="<?= $monitor['Contrast'] ?>" size="8" class="form"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled<?php } ?>></td></tr>
<tr><td align="right" class="text"><?= $zmSlangHue ?></td><td align="left" class="text"><input type="text" name="new_hue" value="<?= $hue ?>" size="8" class="form"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled<?php } ?>></td></tr> <tr><td align="right" class="text"><?= $zmSlangHue ?></td><td align="left" class="text"><input type="text" name="new_hue" value="<?= $monitor['Hue'] ?>" size="8" class="form"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled<?php } ?>></td></tr>
<tr><td align="right" class="text"><?= $zmSlangColour ?></td><td align="left" class="text"><input type="text" name="new_colour" value="<?= $colour ?>" size="8" class="form"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled<?php } ?>></td></tr> <tr><td align="right" class="text"><?= $zmSlangColour ?></td><td align="left" class="text"><input type="text" name="new_colour" value="<?= $monitor['Colour'] ?>" size="8" class="form"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled<?php } ?>></td></tr>
<tr> <tr>
<td colspan="2" align="right"><input type="submit" value="<?= $zmSlangSave ?>" class="form"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled<?php } ?>>&nbsp;&nbsp;<input type="button" value="<?= $zmSlangClose ?>" class="form" onClick="closeWindow()"></td> <td colspan="2" align="right"><input type="submit" value="<?= $zmSlangSave ?>" class="form"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled<?php } ?>>&nbsp;&nbsp;<input type="button" value="<?= $zmSlangClose ?>" class="form" onClick="closeWindow()"></td>
</tr> </tr>