Skip to content

Commit

Permalink
New gestures + saving files to sdcard
Browse files Browse the repository at this point in the history
  • Loading branch information
DariusIMP committed Mar 19, 2022
1 parent 14fb45c commit 232d8cd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
9 changes: 5 additions & 4 deletions lib/datacollection/storage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:path_provider/path_provider.dart';
import 'dart:developer' as developer;

class GloveEventsStorage {
static const String TAG = "GloveEventsStorage";
static final GloveEventsStorage _singleton = GloveEventsStorage._internal();

factory GloveEventsStorage() {
Expand All @@ -16,15 +17,15 @@ class GloveEventsStorage {
GloveEventsStorage._internal();

Future<String> get _localPath async {
final directory = await getApplicationDocumentsDirectory();
return directory.path;
final directory = await getExternalStorageDirectory();
return directory!.path;
}

Future<List<DeviceMeasurementsFile>> getListOfFiles() async {
var fileList = <DeviceMeasurementsFile>[];
var completer = Completer<List<DeviceMeasurementsFile>>();
final dir = await getApplicationDocumentsDirectory();
var lister = dir.list(recursive: false);
final dir = await getExternalStorageDirectory();
var lister = dir!.list(recursive: false);
lister
.where((entity) => entity is File)
.asyncMap((f) async => DeviceMeasurementsFile.fromFileSystem(
Expand Down
39 changes: 21 additions & 18 deletions lib/pages/ble_data_collection_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ class _BleDataCollectionState extends State<BleDataCollectionPage>
_stopRecording(backend);
_collections++;
} else {
await Future.wait([
showDialog(
context: context,
builder: (context) {
return this._countDownDialogBuilder();
})
.then((value) =>
developer.log("CountDown dialog complete", name: TAG))
]);
// await Future.wait([
// showDialog(
// context: context,
// builder: (context) {
// return this._countDownDialogBuilder();
// })
// .then((value) =>
// developer.log("CountDown dialog complete", name: TAG))
// ]);
setState(() {
_startRecording(backend);
});
Expand Down Expand Up @@ -197,21 +197,24 @@ class _BleDataCollectionState extends State<BleDataCollectionPage>
}

static List<String> getCategoryList() {
return <String>["Test", "Números", "Letras", "Saludo"];
return <String>["Tiempo", "Sujeto / objeto", "Verbos", "Determinadores", "Calificativo"];
}

static List<String> getGestureList(String category) {
if (category == "Test") {
return <String>["pointing-up", "pointing-front", "pointing-down", "up-down", "right-left", "idle"];
if (category == "Tiempo") {
return <String>["Antes", "Manana"];
}
if (category == "Números") {
return <String>["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
if (category == "Sujeto / objeto") {
return <String>["Campo", "Mamá", "Papá", "Casa"];
}
if (category == "Letras") {
return <String>["a", "b", "c"];
if (category == "Verbos") {
return <String>["Vivir", "Haber", "Ir"];
}
if (category == "Saludo") {
return <String>["Hola", "¿Cómo estás?", "Adiós"];
if (category == "Determinadores") {
return <String>["Todos"];
}
if (category == "Calificativo") {
return <String>["Azul", "Blanco"];
}
return [];
}
Expand Down

0 comments on commit 232d8cd

Please sign in to comment.