Skip to content

Commit

Permalink
gui corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
supertick committed May 20, 2024
1 parent 4b5ccef commit 82c82b1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ angular.module("mrlapp.service.RemoteSpeechGui", []).controller("RemoteSpeechGui
}

$scope.setType = function () {
msg.send("setSpeechType", $scope.speechType)
msg.send("setSpeechType", $scope.service.config.speechType)
}

$scope.speak = function (text) {
Expand All @@ -42,6 +42,12 @@ angular.module("mrlapp.service.RemoteSpeechGui", []).controller("RemoteSpeechGui
}

$scope.getEndpoint = function (key) {
if (!$scope.service.config.speechType){
return null
}
if (!key){
return null
}
return $scope.service.config.speechTypes[$scope.service.config.speechType][key]
}

Expand Down Expand Up @@ -69,7 +75,7 @@ angular.module("mrlapp.service.RemoteSpeechGui", []).controller("RemoteSpeechGui
$scope.editableVerb = $scope.getVerb($scope.service)
$scope.editableTemplate = $scope.getTemplate($scope.service)
$scope.editableAuthToken = $scope.getAuthToken($scope.service)
$scope.editableSpeechType = $scope.speechType
$scope.editableSpeechType = $scope.service.config.speechType
}
}

Expand All @@ -92,9 +98,11 @@ angular.module("mrlapp.service.RemoteSpeechGui", []).controller("RemoteSpeechGui
//$scope.service.config.endpoint.class = "org.myrobotlab.service.config.RemoteSpeechConfig$Endpoint"

// Update the speechType and send the updated type to the backend
$scope.speechType = $scope.editableSpeechType
msg.send("addSpeechType", $scope.speechType, newEndpoint)
$scope.service.config.speechType = $scope.editableSpeechType
msg.send("addSpeechType", $scope.service.config.speechType, newEndpoint)
$scope.setType()
msg.send("save")
msg.send("broadcastState")

// Toggle back to view mode
$scope.isEditing = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div ng-show="!isEditing">
<b>type</b>
<br />
<select ng-model="speechType" ng-change="setType()" class="form-control"
<select ng-model="service.config.speechType" ng-change="setType()" class="form-control"
title="select a type of local voice control">
<option ng-repeat="(key, value) in service.config.speechTypes" ng-value="key">
{{ key }}
Expand Down Expand Up @@ -78,4 +78,4 @@
<button class="btn btn-default" ng-click="speak(text)">Speak</button>
<button class="btn btn-default" ng-click="text=''">Clear</button>
</div>
</div>
</div>

0 comments on commit 82c82b1

Please sign in to comment.