Skip to content

Commit

Permalink
update Ben comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rbs333 committed Apr 30, 2019
1 parent ea5077d commit 91900c3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
9 changes: 5 additions & 4 deletions frontend/src/components/Csv_Formatter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ export default {
}
},
methods: {
//Create a single csv file with mutliple tables. This is technically not
//possible to do normally, so simply add rows to a single giant table that
//are either empty (to act like spacers), and have header information
//to signify start of new "table"
/*
CSV file format does not support writing to multiple
tabs (like a spredsheet can), for this reason one large
csv file is created with added rows as spacers.
*/
generateCsv(data, refinery_location) {
var csv_index = 0;
Expand Down
13 changes: 8 additions & 5 deletions frontend/src/components/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,14 @@ export default {
//Submit locations to background for optimization
submitLocations() {
//This removes all the elements in the map that were deleted (became null)
//The array has to act like this because if we simply remove elements
//during deletion on the map, then all the references to each point will
//be off by 1 element. Instead, we make that element null when removed,
//and when we send to the backend, we create new arrays without the null elements.
/*
Because the backend code relies on the position of elements
added to the coordinate arrays, we cannot simply delete
entries because this would mess up the order. Therefore,
we instead null the item that was deleted before submission
and then use this function to remove the null entries at
the end to maintain proper ordering.
*/
var filteredFarm = this.farms.filter(function (el) {
return el != null;
});
Expand Down

0 comments on commit 91900c3

Please sign in to comment.