@@ -29,7 +29,7 @@ angular.module("mrlapp.service.RemoteSpeechGui", []).controller("RemoteSpeechGui
29
29
}
30
30
31
31
$scope . setType = function ( ) {
32
- msg . send ( "setSpeechType" , $scope . speechType )
32
+ msg . send ( "setSpeechType" , $scope . service . config . speechType )
33
33
}
34
34
35
35
$scope . speak = function ( text ) {
@@ -42,6 +42,12 @@ angular.module("mrlapp.service.RemoteSpeechGui", []).controller("RemoteSpeechGui
42
42
}
43
43
44
44
$scope . getEndpoint = function ( key ) {
45
+ if ( ! $scope . service . config . speechType ) {
46
+ return null
47
+ }
48
+ if ( ! key ) {
49
+ return null
50
+ }
45
51
return $scope . service . config . speechTypes [ $scope . service . config . speechType ] [ key ]
46
52
}
47
53
@@ -69,7 +75,7 @@ angular.module("mrlapp.service.RemoteSpeechGui", []).controller("RemoteSpeechGui
69
75
$scope . editableVerb = $scope . getVerb ( $scope . service )
70
76
$scope . editableTemplate = $scope . getTemplate ( $scope . service )
71
77
$scope . editableAuthToken = $scope . getAuthToken ( $scope . service )
72
- $scope . editableSpeechType = $scope . speechType
78
+ $scope . editableSpeechType = $scope . service . config . speechType
73
79
}
74
80
}
75
81
@@ -92,9 +98,11 @@ angular.module("mrlapp.service.RemoteSpeechGui", []).controller("RemoteSpeechGui
92
98
//$scope.service.config.endpoint.class = "org.myrobotlab.service.config.RemoteSpeechConfig$Endpoint"
93
99
94
100
// Update the speechType and send the updated type to the backend
95
- $scope . speechType = $scope . editableSpeechType
96
- msg . send ( "addSpeechType" , $scope . speechType , newEndpoint )
101
+ $scope . service . config . speechType = $scope . editableSpeechType
102
+ msg . send ( "addSpeechType" , $scope . service . config . speechType , newEndpoint )
97
103
$scope . setType ( )
104
+ msg . send ( "save" )
105
+ msg . send ( "broadcastState" )
98
106
99
107
// Toggle back to view mode
100
108
$scope . isEditing = false
0 commit comments