Skip to content

Commit

Permalink
Add message about successfull send data to server
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergii Ivanchenko authored and Sergii Ivanchenko committed Jan 30, 2017
1 parent 5dd5a90 commit f14df67
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion frontEnd/src/pages/home/home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,8 @@ export class HomePage {
() => {
// this.serverService.sendDataToServer();
this.localDataSaveService.saveCSVFile();
this.global.clOnScreen = "Сессия успешно записана в csv-файл "
// this.global.clOnScreen = "Сессия успешно записана в csv-файл ";
// this.global.clOnScreen = this.global.msg9;
}, 1000
);

Expand Down
6 changes: 5 additions & 1 deletion frontEnd/src/providers/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,15 @@ export class Global {
public msg3 = "Err during data sending. See errorLog file";
public msg4 = "Technical error. Please contact application administrator (log file included)";
public msg5 = "Please turn on your Wi-Fi";
public msg6 = "Невозможно отправить данные на сервер. Убедитесь что вы подключены к Wi-Fi и нажмите кнопку, а затем stop для повторной попытки";
public msg7 = "Нет доступа к сети. Попробуйте позже";
public msg8 = "Данные успешно отправлены на сервер";
public msg9 = "Сессия успешно записана в csv-файл";
public generalSpinnerMsg = "Please wait...";
public spinnerSensorCheckMsg = "Checking sensors availability...";

constructor(public platform: Platform, public alertController: AlertController, public loadingController: LoadingController) {
console.log('Hello Global Provider');
// console.log('Hello Global Provider');
this.propertyObj.sessionId = this.sessionID;
this.propertyObj.status = this.stateStatus;
}
Expand Down
2 changes: 1 addition & 1 deletion frontEnd/src/providers/local-data-save-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export class LocalDataSaveService {
)
.then(
(result) => {

this.global.clOnScreen = this.global.msg9;
return this.serverService.sendDataToServer(fileContent, "data");

}
Expand Down
8 changes: 5 additions & 3 deletions frontEnd/src/providers/server-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ export class ServerService {
HTTP.post(SERVER_URL, body, headers)
.then(data => {

this.global.clOnScreen = this.global.msg8;

if (dataType == "log") {
this.global.globalCleanLogFile();
} else if (dataType == "data") {
Expand All @@ -126,7 +128,7 @@ export class ServerService {
.catch(error => {

// this.localDataSaveService.saveErrorLog(JSON.stringify(error));
// this.global.clOnScreen = this.global.msg3;
this.global.clOnScreen = this.global.msg3;
this.global.saveErrorLog("sendDataToServer()", "Err during data sending: " + JSON.stringify(error));
// console.log(error);
// console.log(error.status);
Expand All @@ -142,14 +144,14 @@ export class ServerService {
}

} else {
// this.clOnScreen4 = "Phone is offline. Try send data later";
this.global.clOnScreen = this.global.msg7;
// this.global.saveErrorLog("sendDataToServer()", "Phone is offline. Try send data later");
}

}
catch (err) {

// this.global.clOnScreen9 = "err in send data/log to server";
this.global.clOnScreen = this.global.msg3;
this.global.saveErrorLog("sendDataToServer()", "try-catch err: " + err);
}
}
Expand Down

0 comments on commit f14df67

Please sign in to comment.