diff --git a/client/app/components/coordinator/js/ros_scripts.js b/client/app/components/coordinator/js/ros_scripts.js index c5079a3..b38e6e2 100644 --- a/client/app/components/coordinator/js/ros_scripts.js +++ b/client/app/components/coordinator/js/ros_scripts.js @@ -390,7 +390,6 @@ playbackStatus.subscribe(function(message) { triggerService('/right/aescape/mode/activateReadyController'); displayMessage(true, "Loaded the selected bag file!") } - lastPlaybackStatus = status; } }); diff --git a/client/app/components/coordinator/js/update_guis.js b/client/app/components/coordinator/js/update_guis.js index 1294a8f..cfbf376 100644 --- a/client/app/components/coordinator/js/update_guis.js +++ b/client/app/components/coordinator/js/update_guis.js @@ -77,7 +77,7 @@ function displayTaggingOptions(mode) { }, 600) var $fileNameSelect = $(fileNameSelector).selectize({ - valueField: 'name', + valueField: '_id', labelField: 'name', searchField: ['name'], options: [], @@ -89,11 +89,9 @@ function displayTaggingOptions(mode) { fileNameSelectize.clearOptions() // /aescape/bags/getBagList getBagList(function(results){ - fileNameSelectize.addOption(results.map(function(element){ - return {name : element.filename} - })); + fileNameSelectize.addOption(results) if(results[0]) { - fileNameSelectize.setValue(results[0].filename); + fileNameSelectize.setValue(results[0]._id); } }) @@ -154,13 +152,13 @@ function hideTaggingOptions(mode, updateValues=false) { var tags = $(tagSelector).val(); getBagList(function(results){ - if(!(results && results[0] && results[0].filename)) { + if(!(results && results[0] && results[0]._id)) { console.log(results); displayMessage(false, "Could not retrieve the last recorded bag :("); return; } - bag_name = results[0].filename; - updateBagMetadata(mode, bag_name, bagLabel, category, tags, function(updateError) { + bag_id = results[0]._id; + updateBagMetadata(mode, bag_id, bagLabel, category, tags, function(updateError) { if(updateError) { displayMessage(flase, updateError); } else { @@ -178,7 +176,7 @@ function hideTaggingOptions(mode, updateValues=false) { document.querySelector(modeTag).classList.remove('open'); } -function updateBagMetadata(mode, bag_name, bag_label, category, tags, callback) { +function updateBagMetadata(mode, bag_id, bag_label, category, tags, callback) { if(!mode) { return callback(); } @@ -188,7 +186,7 @@ function updateBagMetadata(mode, bag_name, bag_label, category, tags, callback) var toSend = { mode : mode, - bag_name : bag_name, + bag_id : bag_id, bag_label : bag_label, category : category, tags : tags @@ -214,32 +212,32 @@ function displayLoadingOptions() { //Putting this in a timeout to wait for the animation to finish completing setTimeout(function(){ document.querySelector(selector).style.overflow = "visible"; - }, 420) + }, 420) //This is not a Hitchhiker's reference. This is not a 420 reference. This value has been computed to match the speed of the larger drop down. var $select = $('#loadBagList').selectize({ - valueField: 'filename', - labelField: 'filename', - searchField: ['filename', 'category', 'tags'], + valueField: '_id', + labelField: 'name', + searchField: ['name', 'category', 'tags'], options: [], create: false, placeholder : "Select bag to play", render : { item: function(item, escape) { - filename = item.filename; + name = item.name; category = item.category || 'None'; return '