Skip to content

Commit

Permalink
#306 - convert W/S/R buttons to elements of list for easier formattin…
Browse files Browse the repository at this point in the history
…g - no overlaps
  • Loading branch information
pliablepixels committed Aug 22, 2016
1 parent 83cb200 commit c95ae8d
Showing 1 changed file with 37 additions and 2 deletions.
39 changes: 37 additions & 2 deletions www/js/MonitorModalCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -1052,17 +1052,31 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$
.success (function (data)
{
$scope.isControllable = data.monitor.Monitor.Controllable;

// *** Only for testing - comment out //
//$scope.isControllable = '1';
// for testing only
// $scope.isControllable = 1;
$scope.controlid = data.monitor.Monitor.ControlId;
if ($scope.isControllable=='1')
if ($scope.isControllable=='1' )
{


var apiurl = ZMDataModel.getLogin().apiurl;
var myurl = apiurl + "/controls/" + $scope.controlid + ".json";
ZMDataModel.zmDebug("configurePTZ : getting controllable data " + myurl);

$http.get(myurl)
.success(function (data) {

// *** Only for testing - comment out - start//
/*data.Control.Control.CanSleep = '1';
data.Control.Control.CanWake = '1';
data.Control.Control.CanReset = '1';
data.Control.Control.CanZoom = '1';
data.control.Control.HasPresets = '1';
data.control.Control.HasHomePreset = '1';*/
// *** Only for testing - comment out - end //

if (data.control.Control.CanWake == '1')
{
Expand Down Expand Up @@ -1146,8 +1160,29 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$
if (data.control.Control.HasHomePreset == '1')
{
$scope.ptzPresets.unshift({name:'', icon:"ion-ios-home", cmd:'presetHome'});

}

// lets add these to the end
// strictly speaking, they aren't really presets, but meh for now

if (data.control.Control.CanWake == '1')
{

$scope.ptzPresetCount++;
$scope.ptzPresets.push({name:'', icon:"ion-eye", cmd:'wake'});

}

if (data.control.Control.CanSleep == '1')
{
$scope.ptzPresets.push({name:'', icon:"ion-eye-disabled", cmd:'sleep'});

}

if (data.control.Control.CanReset == '1')
{
$scope.ptzPresets.push({name:'', icon:"ion-ios-loop-strong", cmd:'reset'});

}

}
Expand Down

0 comments on commit c95ae8d

Please sign in to comment.