Camera reboot function (#2554)

* Adding a button for camera reboot function

This series of commits will add a camera reboot function to the
control interface if supported by the camera configuration.

* Adding reboot function option to contorl configuration

This patch adds a reboot option to the camera control configuration
view.

* Adding Reboot field to Controls table

This patch adds a Reboot field to the Controls table to support
a camera reboot control option.

* Correcting button value to match reset

* Updating language files

I'm not sure of the proper procedure to trigger updating of
non-english language files so I'm updating them all with English
hoping that that will draw attention to the changes and others
will translate accordingly.

* Add missing forward slash
This commit is contained in:
Chris 2019-03-18 14:49:05 -04:00 committed by Isaac Connor
parent b794c2ca20
commit ad5f6a8729
25 changed files with 31 additions and 1 deletions

View File

@ -68,6 +68,7 @@ CREATE TABLE `Controls` (
`CanWake` tinyint(3) unsigned NOT NULL default '0', `CanWake` tinyint(3) unsigned NOT NULL default '0',
`CanSleep` tinyint(3) unsigned NOT NULL default '0', `CanSleep` tinyint(3) unsigned NOT NULL default '0',
`CanReset` tinyint(3) unsigned NOT NULL default '0', `CanReset` tinyint(3) unsigned NOT NULL default '0',
`CanReboot` tinyint(3) unsigned NOT NULL default '0',
`CanZoom` tinyint(3) unsigned NOT NULL default '0', `CanZoom` tinyint(3) unsigned NOT NULL default '0',
`CanAutoZoom` tinyint(3) unsigned NOT NULL default '0', `CanAutoZoom` tinyint(3) unsigned NOT NULL default '0',
`CanZoomAbs` tinyint(3) unsigned NOT NULL default '0', `CanZoomAbs` tinyint(3) unsigned NOT NULL default '0',

View File

@ -444,7 +444,7 @@ sub reboot
{ {
my $self = shift; my $self = shift;
Debug( "Camera Reboot" ); Debug( "Camera Reboot" );
my $cmd = "cgi-bin/magicBox.cgi?action=reboot"; my $cmd = "/cgi-bin/magicBox.cgi?action=reboot";
$self->_sendGetRequest($cmd); $self->_sendGetRequest($cmd);
} }

View File

@ -216,6 +216,7 @@ $SLANG = array(
'CanMoveRel' => 'Podržava Relativno kretanje', 'CanMoveRel' => 'Podržava Relativno kretanje',
'CanPan' => 'Podržava Pomak' , 'CanPan' => 'Podržava Pomak' ,
'CanReset' => 'PodržavaReset', 'CanReset' => 'PodržavaReset',
'CanReboot' => 'Can Reboot',
'CanSetPresets' => 'Podržava presetove', 'CanSetPresets' => 'Podržava presetove',
'CanSleep' => 'Podržava Sleep', 'CanSleep' => 'Podržava Sleep',
'CanTilt' => 'Podržava nagib', 'CanTilt' => 'Podržava nagib',

View File

@ -209,6 +209,7 @@ $SLANG = array(
'CanMoveRel' => 'Can Move Relative', 'CanMoveRel' => 'Can Move Relative',
'CanPan' => 'Can Pan' , 'CanPan' => 'Can Pan' ,
'CanReset' => 'Can Reset', 'CanReset' => 'Can Reset',
'CanReboot' => 'Can Reboot',
'CanSetPresets' => 'Can Set Presets', 'CanSetPresets' => 'Can Set Presets',
'CanSleep' => 'Can Sleep', 'CanSleep' => 'Can Sleep',
'CanTilt' => 'Can Tilt', 'CanTilt' => 'Can Tilt',

View File

@ -205,6 +205,7 @@ $SLANG = array(
'CanMoveRel' => '可以相对移动', 'CanMoveRel' => '可以相对移动',
'CanPan' => '可以平移' , 'CanPan' => '可以平移' ,
'CanReset' => '可以复位', 'CanReset' => '可以复位',
'CanReboot' => 'Can Reboot',
'CanSetPresets' => '可以进行预设', 'CanSetPresets' => '可以进行预设',
'CanSleep' => '可以休眠', 'CanSleep' => '可以休眠',
'CanTilt' => '可以倾斜', 'CanTilt' => '可以倾斜',

View File

@ -205,6 +205,7 @@ $SLANG = array(
'CanMoveRel' => 'Umí relativní pohyb', 'CanMoveRel' => 'Umí relativní pohyb',
'CanPan' => 'Umí otáčení', 'CanPan' => 'Umí otáčení',
'CanReset' => 'Umí reset', 'CanReset' => 'Umí reset',
'CanReboot' => 'Can Reboot',
'CanSetPresets' => 'Umí navolit předvolby', 'CanSetPresets' => 'Umí navolit předvolby',
'CanSleep' => 'Může spát', 'CanSleep' => 'Může spát',
'CanTilt' => 'Umí náklon', 'CanTilt' => 'Umí náklon',

View File

@ -207,6 +207,7 @@ $SLANG = array(
'CanMoveRel' => 'Kann relative Bewegung', 'CanMoveRel' => 'Kann relative Bewegung',
'CanPan' => 'Kann Pan' , 'CanPan' => 'Kann Pan' ,
'CanReset' => 'Kann Reset', 'CanReset' => 'Kann Reset',
'CanReboot' => 'Can Reboot',
'CanSetPresets' => 'Kann Voreinstellungen setzen', 'CanSetPresets' => 'Kann Voreinstellungen setzen',
'CanSleep' => 'Kann Sleep', 'CanSleep' => 'Kann Sleep',
'CanTilt' => 'Kann Neigung', 'CanTilt' => 'Kann Neigung',

View File

@ -206,6 +206,7 @@ $SLANG = array(
'CanMoveRel' => 'Can Move Relative', 'CanMoveRel' => 'Can Move Relative',
'CanPan' => 'Can Pan' , 'CanPan' => 'Can Pan' ,
'CanReset' => 'Can Reset', 'CanReset' => 'Can Reset',
'CanReboot' => 'Can Reboot',
'CanSetPresets' => 'Can Set Presets', 'CanSetPresets' => 'Can Set Presets',
'CanSleep' => 'Can Sleep', 'CanSleep' => 'Can Sleep',
'CanTilt' => 'Can Tilt', 'CanTilt' => 'Can Tilt',

View File

@ -216,6 +216,7 @@ $SLANG = array(
'CanMoveRel' => 'Can Move Relative', 'CanMoveRel' => 'Can Move Relative',
'CanPan' => 'Can Pan' , 'CanPan' => 'Can Pan' ,
'CanReset' => 'Can Reset', 'CanReset' => 'Can Reset',
'CanReboot' => 'Can Reboot',
'CanSetPresets' => 'Can Set Presets', 'CanSetPresets' => 'Can Set Presets',
'CanSleep' => 'Can Sleep', 'CanSleep' => 'Can Sleep',
'CanTilt' => 'Can Tilt', 'CanTilt' => 'Can Tilt',

View File

@ -156,6 +156,7 @@ $SLANG = array(
'CanMoveRel' => 'Can Move Relative', 'CanMoveRel' => 'Can Move Relative',
'CanPan' => 'Can Pan' , 'CanPan' => 'Can Pan' ,
'CanReset' => 'Can Reset', 'CanReset' => 'Can Reset',
'CanReboot' => 'Can Reboot',
'CanSetPresets' => 'Can Set Presets', 'CanSetPresets' => 'Can Set Presets',
'CanSleep' => 'Can Sleep', 'CanSleep' => 'Can Sleep',
'CanTilt' => 'Can Tilt', 'CanTilt' => 'Can Tilt',

View File

@ -205,6 +205,7 @@ $SLANG = array(
'CanMoveRel' => 'Puede moverse de forma relativa', 'CanMoveRel' => 'Puede moverse de forma relativa',
'CanPan' => 'Puede desplazarse' , 'CanPan' => 'Puede desplazarse' ,
'CanReset' => 'Puede restablecerse', 'CanReset' => 'Puede restablecerse',
'CanReboot' => 'Can Reboot',
'CanSetPresets' => 'Puede fefinir programaciones', 'CanSetPresets' => 'Puede fefinir programaciones',
'CanSleep' => 'Puede dormirse', 'CanSleep' => 'Puede dormirse',
'CanTilt' => 'Puede inclinarse', 'CanTilt' => 'Puede inclinarse',

View File

@ -212,6 +212,7 @@ $SLANG = array(
'CanMoveRel' => 'Can Move Relative', 'CanMoveRel' => 'Can Move Relative',
'CanPan' => 'Can Pan' , 'CanPan' => 'Can Pan' ,
'CanReset' => 'Can Reset', 'CanReset' => 'Can Reset',
'CanReboot' => 'Can Reboot',
'CanSetPresets' => 'Can Set Presets', 'CanSetPresets' => 'Can Set Presets',
'CanSleep' => 'Can Sleep', 'CanSleep' => 'Can Sleep',
'CanTilt' => 'Can Tilt', 'CanTilt' => 'Can Tilt',

View File

@ -211,6 +211,7 @@ $SLANG = array(
'CanMoveRel' => 'Relatif', 'CanMoveRel' => 'Relatif',
'CanPan' => 'Panoramique' , 'CanPan' => 'Panoramique' ,
'CanReset' => 'RàZ', 'CanReset' => 'RàZ',
'CanReboot' => 'Can Reboot',
'CanSetPresets' => 'Stockage prépos.', 'CanSetPresets' => 'Stockage prépos.',
'CanSleep' => 'Veille', 'CanSleep' => 'Veille',
'CanTilt' => 'Inclinaison', 'CanTilt' => 'Inclinaison',

View File

@ -205,6 +205,7 @@ $SLANG = array(
'CanMoveRel' => 'àôùø úæåæä éçñéú', 'CanMoveRel' => 'àôùø úæåæä éçñéú',
'CanPan' => 'Can Pan' , 'CanPan' => 'Can Pan' ,
'CanReset' => 'àôùø àúçåì', 'CanReset' => 'àôùø àúçåì',
'CanReboot' => 'Can Reboot',
'CanSetPresets' => 'Can Set Presets', 'CanSetPresets' => 'Can Set Presets',
'CanSleep' => 'àôùø îöá ùéðä', 'CanSleep' => 'àôùø îöá ùéðä',
'CanTilt' => 'àôùø æòæåò', 'CanTilt' => 'àôùø æòæåò',

View File

@ -248,6 +248,7 @@ $SLANG = array(
'CanMoveRel' => 'Relatíven tud mozogni', 'CanMoveRel' => 'Relatíven tud mozogni',
'CanPan' => 'Tud jobb-bal mozgást' , 'CanPan' => 'Tud jobb-bal mozgást' ,
'CanReset' => 'Tud alaphelyzetbe jönni', 'CanReset' => 'Tud alaphelyzetbe jönni',
'CanReboot' => 'Can Reboot',
'CanSetPresets' => 'Tud menteni profilokat', 'CanSetPresets' => 'Tud menteni profilokat',
'CanSleep' => 'Tud phihenő üzemmódot', 'CanSleep' => 'Tud phihenő üzemmódot',
'CanTilt' => 'Tud fel-le mozgást', 'CanTilt' => 'Tud fel-le mozgást',

View File

@ -210,6 +210,7 @@ $SLANG = array(
'CanMoveRel' => 'Puo\' Mov. Relativo', 'CanMoveRel' => 'Puo\' Mov. Relativo',
'CanPan' => 'Puo\' Pan' , 'CanPan' => 'Puo\' Pan' ,
'CanReset' => 'Puo\' Reset', 'CanReset' => 'Puo\' Reset',
'CanReboot' => 'Can Reboot',
'CanSetPresets' => 'Puo\' impostare preset', 'CanSetPresets' => 'Puo\' impostare preset',
'CanSleep' => 'Puo\' andare in sleep', 'CanSleep' => 'Puo\' andare in sleep',
'CanTilt' => 'Puo\' Tilt', 'CanTilt' => 'Puo\' Tilt',

View File

@ -206,6 +206,7 @@ $SLANG = array(
'CanMoveRel' => 'Can Move Relative', 'CanMoveRel' => 'Can Move Relative',
'CanPan' => 'Can Pan' , 'CanPan' => 'Can Pan' ,
'CanReset' => 'Can Reset', 'CanReset' => 'Can Reset',
'CanReboot' => 'Can Reboot',
'CanSetPresets' => 'Can Set Presets', 'CanSetPresets' => 'Can Set Presets',
'CanSleep' => 'Can Sleep', 'CanSleep' => 'Can Sleep',
'CanTilt' => 'Can Tilt', 'CanTilt' => 'Can Tilt',

View File

@ -206,6 +206,7 @@ $SLANG = array(
'CanMoveRel' => 'Can Move Relatief', 'CanMoveRel' => 'Can Move Relatief',
'CanPan' => 'Can Pan' , 'CanPan' => 'Can Pan' ,
'CanReset' => 'Can Reset', 'CanReset' => 'Can Reset',
'CanReboot' => 'Can Reboot',
'CanSetPresets' => 'Can Set Presets', 'CanSetPresets' => 'Can Set Presets',
'CanSleep' => 'Can Sleep', 'CanSleep' => 'Can Sleep',
'CanTilt' => 'Can Tilt', 'CanTilt' => 'Can Tilt',

View File

@ -220,6 +220,7 @@ $SLANG = array(
'CanMoveRel' => 'Can Move Relative', 'CanMoveRel' => 'Can Move Relative',
'CanPan' => 'Can Pan' , 'CanPan' => 'Can Pan' ,
'CanReset' => 'Can Reset', 'CanReset' => 'Can Reset',
'CanReboot' => 'Can Reboot',
'CanSetPresets' => 'Can Set Presets', 'CanSetPresets' => 'Can Set Presets',
'CanSleep' => 'Can Sleep', 'CanSleep' => 'Can Sleep',
'CanTilt' => 'Can Tilt', 'CanTilt' => 'Can Tilt',

View File

@ -145,6 +145,7 @@ $SLANG = array(
'CanMoveRel' => 'Can Move Relative', 'CanMoveRel' => 'Can Move Relative',
'CanPan' => 'Can Pan' , 'CanPan' => 'Can Pan' ,
'CanReset' => 'Can Reset', 'CanReset' => 'Can Reset',
'CanReboot' => 'Can Reboot',
'CanSetPresets' => 'Can Set Presets', 'CanSetPresets' => 'Can Set Presets',
'CanSleep' => 'Can Sleep', 'CanSleep' => 'Can Sleep',
'CanTilt' => 'Can Tilt', 'CanTilt' => 'Can Tilt',

View File

@ -176,6 +176,7 @@ $SLANG = array(
'CanMoveRel' => 'Mişcare relativă', 'CanMoveRel' => 'Mişcare relativă',
'CanPan' => 'Rotativ' , 'CanPan' => 'Rotativ' ,
'CanReset' => 'Can Reset', 'CanReset' => 'Can Reset',
'CanReboot' => 'Can Reboot',
'CanSetPresets' => 'Can Set Presets', 'CanSetPresets' => 'Can Set Presets',
'CanSleep' => 'Can Sleep', 'CanSleep' => 'Can Sleep',
'CanTilt' => 'Se poate înclina', 'CanTilt' => 'Se poate înclina',

View File

@ -206,6 +206,7 @@ $SLANG = array(
'CanMoveRel' => 'Относительное перемещение', 'CanMoveRel' => 'Относительное перемещение',
'CanPan' => 'Панорама' , 'CanPan' => 'Панорама' ,
'CanReset' => 'Сброс', 'CanReset' => 'Сброс',
'CanReboot' => 'Can Reboot',
'CanSetPresets' => 'Создание предустановок', 'CanSetPresets' => 'Создание предустановок',
'CanSleep' => 'Сон', 'CanSleep' => 'Сон',
'CanTilt' => 'Наклон', 'CanTilt' => 'Наклон',

View File

@ -206,6 +206,7 @@ $SLANG = array(
'CanMoveRel' => 'Har relativ förflyttning', 'CanMoveRel' => 'Har relativ förflyttning',
'CanPan' => 'Har panorering', 'CanPan' => 'Har panorering',
'CanReset' => 'Har återställning', 'CanReset' => 'Har återställning',
'CanReboot' => 'Can Reboot',
'CanSetPresets' => 'Har förinställningar', 'CanSetPresets' => 'Har förinställningar',
'CanSleep' => 'Kan vila', 'CanSleep' => 'Kan vila',
'CanTilt' => 'Kan tilta', 'CanTilt' => 'Kan tilta',

View File

@ -24,6 +24,7 @@ function getControlCommands( $monitor ) {
$cmds['Wake'] = 'wake'; $cmds['Wake'] = 'wake';
$cmds['Sleep'] = 'sleep'; $cmds['Sleep'] = 'sleep';
$cmds['Reset'] = 'reset'; $cmds['Reset'] = 'reset';
$cmds['Reboot'] = 'reboot';
$cmds['PresetSet'] = 'presetSet'; $cmds['PresetSet'] = 'presetSet';
$cmds['PresetGoto'] = 'presetGoto'; $cmds['PresetGoto'] = 'presetGoto';
@ -319,6 +320,11 @@ function controlPower( $monitor, $cmds ) {
if ( $monitor->CanReset() ) { if ( $monitor->CanReset() ) {
?> ?>
<button type="button" class="ptzTextBtn" value="Reset" onclick="controlCmd('<?php echo $cmds['Reset'] ?>')"><?php echo translate('Reset') ?></button> <button type="button" class="ptzTextBtn" value="Reset" onclick="controlCmd('<?php echo $cmds['Reset'] ?>')"><?php echo translate('Reset') ?></button>
<?php
}
if ( $monitor->CanReboot() ) {
?>
<button type="button" class="ptzTextBtn" value="Reboot" onclick="controlCmd('<?php echo $cmds['Reboot'] ?>')"><?php echo translate('Reboot') ?></button>
<?php <?php
} }
?> ?>

View File

@ -59,6 +59,7 @@ else
'CanWake' => "", 'CanWake' => "",
'CanSleep' => "", 'CanSleep' => "",
'CanReset' => "", 'CanReset' => "",
'CanReboot' => "",
'CanMove' => "", 'CanMove' => "",
'CanMoveDiag' => "", 'CanMoveDiag' => "",
'CanMoveMap' => "", 'CanMoveMap' => "",
@ -352,6 +353,7 @@ switch ( $tab )
<tr><th scope="row"><?php echo translate('CanWake') ?></th><td><input type="checkbox" name="newControl[CanWake]" value="1"<?php if ( !empty($newControl['CanWake']) ) { ?> checked="checked"<?php } ?>/></td></tr> <tr><th scope="row"><?php echo translate('CanWake') ?></th><td><input type="checkbox" name="newControl[CanWake]" value="1"<?php if ( !empty($newControl['CanWake']) ) { ?> checked="checked"<?php } ?>/></td></tr>
<tr><th scope="row"><?php echo translate('CanSleep') ?></th><td><input type="checkbox" name="newControl[CanSleep]" value="1"<?php if ( !empty($newControl['CanSleep']) ) { ?> checked="checked"<?php } ?>/></td></tr> <tr><th scope="row"><?php echo translate('CanSleep') ?></th><td><input type="checkbox" name="newControl[CanSleep]" value="1"<?php if ( !empty($newControl['CanSleep']) ) { ?> checked="checked"<?php } ?>/></td></tr>
<tr><th scope="row"><?php echo translate('CanReset') ?></th><td><input type="checkbox" name="newControl[CanReset]" value="1"<?php if ( !empty($newControl['CanReset']) ) { ?> checked="checked"<?php } ?>/></td></tr> <tr><th scope="row"><?php echo translate('CanReset') ?></th><td><input type="checkbox" name="newControl[CanReset]" value="1"<?php if ( !empty($newControl['CanReset']) ) { ?> checked="checked"<?php } ?>/></td></tr>
<tr><th scope="row"><?php echo translate('CanReboot') ?></th><td><input type="checkbox" name="newControl[CanReboot]" value="1"<?php if ( !empty($newControl['CanReboot']) ) { ?> checked="checked"<?php } ?>/></td></tr>
<?php <?php
break; break;
} }