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',
`CanSleep` 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',
`CanAutoZoom` 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;
Debug( "Camera Reboot" );
my $cmd = "cgi-bin/magicBox.cgi?action=reboot";
my $cmd = "/cgi-bin/magicBox.cgi?action=reboot";
$self->_sendGetRequest($cmd);
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -24,6 +24,7 @@ function getControlCommands( $monitor ) {
$cmds['Wake'] = 'wake';
$cmds['Sleep'] = 'sleep';
$cmds['Reset'] = 'reset';
$cmds['Reboot'] = 'reboot';
$cmds['PresetSet'] = 'presetSet';
$cmds['PresetGoto'] = 'presetGoto';
@ -319,6 +320,11 @@ function controlPower( $monitor, $cmds ) {
if ( $monitor->CanReset() ) {
?>
<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
}
?>

View File

@ -59,6 +59,7 @@ else
'CanWake' => "",
'CanSleep' => "",
'CanReset' => "",
'CanReboot' => "",
'CanMove' => "",
'CanMoveDiag' => "",
'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('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('CanReboot') ?></th><td><input type="checkbox" name="newControl[CanReboot]" value="1"<?php if ( !empty($newControl['CanReboot']) ) { ?> checked="checked"<?php } ?>/></td></tr>
<?php
break;
}