Fixed a bug where the compliation screen wasnt showing

development
Thiemann96 5 years ago
parent 19521d0302
commit d03b613cc7

@ -35,13 +35,37 @@
</ion-row>
</ion-grid>
</ion-slide>
<!-- compilation waiting screen -->
<ion-slide *ngIf="!slideIsHidden(slideCompilation)">
<ng-container *ngIf="state.compilation == 'compiling'">
<h2 translate>OTAWIZ.COMPILATION.COMPILING.TITLE</h2>
<!-- getActiveIndex() check because animated icons use loads of CPU, even when not visible! -->
<ion-spinner *ngIf="currentSlide == slideCompilation" item-start name="dots"></ion-spinner>
</ng-container>
<ng-container *ngIf="state.compilation == 'go-online'">
<h2 translate>OTAWIZ.COMPILATION.GO_ONLINE.TITLE</h2>
<p translate>OTAWIZ.COMPILATION.GO_ONLINE.TEXT</p>
</ng-container>
<ng-container *ngIf="state.compilation == 'done'">
<h2 translate>OTAWIZ.COMPILATION.DONE.TITLE</h2>
<button ion-button large clear icon-end color="primary" (click)="slides.slideNext()">
{{ 'OTAWIZ.BTN_NEXT' | translate }}
<ion-icon name="arrow-forward"></ion-icon>
</button>
</ng-container>
<ng-container *ngIf="state.compilation == 'error'">
<h2 translate>OTAWIZ.COMPILATION.ERROR.TITLE</h2>
<p [innerHTML]="errorMsg"></p> <!-- @TODO: translate? -->
</ng-container>
</ion-slide>
<!-- OTA Mode guide-->
<ion-slide>
<ion-grid>
<ion-row align-items-center>
<ion-col col-12>
<h2 translate>OTAWIZ.OTAMODE.TITLE</h2>
</ion-col>
<h2 translate>OTAWIZ.OTAMODE.TITLE</h2>
</ion-col>
</ion-row>
<ion-row align-items-center>
<ion-col col-12 col-md-6>
@ -50,7 +74,7 @@
Automatic mode
</ion-card-header>
<ion-card-content>
<ion-icon class="mode_selection" name="wifi" ></ion-icon> <br>
<ion-icon class="mode_selection" name="wifi"></ion-icon> <br>
{{ 'OTAWIZ.OTAMODESELECTION.AUTOMATIC' | translate}}
</ion-card-content>
</ion-card>
@ -61,7 +85,7 @@
Manual mode
</ion-card-header>
<ion-card-content>
<ion-icon class="mode_selection" name="hammer" ></ion-icon> <br>
<ion-icon class="mode_selection" name="hammer"></ion-icon> <br>
{{ 'OTAWIZ.OTAMODESELECTION.MANUAL' | translate}}
</ion-card-content>
</ion-card>
@ -71,7 +95,7 @@
</ion-grid>
</ion-slide>
<!-- OTA Manual -->
<ion-slide id="manual-slide">
<ion-slide id="manual-slide">
<ion-grid *ngIf="modus==='manual'">
<ion-row align-items-center>
<ion-col col-12 col-md-6>
@ -85,13 +109,14 @@
<li [innerHTML]="'OTAWIZ.OTAMODE.STEP3' | translate"></li>
</ol>
<!-- @TODO: diagram! -->
<button ion-button large clear icon-end color="primary" (click)="slides.slideNext()">
<button ion-button large clear icon-end color="primary" (click)="slides.slideNext()">
{{ 'OTAWIZ.BTN_NEXT' | translate }}
<ion-icon name="arrow-forward"></ion-icon>
</button>
</ion-col>
</ion-row>
</ion-grid>
<!-- OTA Automatic-->
<ion-grid *ngIf="modus === 'automatic' ">
<ion-row align-items-center>
<ion-col col-12 col-md-6>
@ -103,7 +128,7 @@
</ion-col>
<ion-col col-12 col-md-6>
<!-- @TODO: diagram! -->
<button ion-button large clear icon-end color="primary" (click)="slides.slideNext()">
<button ion-button large clear icon-end color="primary" (click)="slides.slideNext()">
{{ 'OTAWIZ.BTN_NEXT' | translate }}
<ion-icon name="arrow-forward"></ion-icon>
</button>
@ -111,30 +136,6 @@
</ion-row>
</ion-grid>
</ion-slide>
<!-- compilation waiting screen -->
<ion-slide *ngIf="!slideIsHidden(slideCompilation)">
<ng-container *ngIf="state.compilation == 'compiling'">
<h2 translate>OTAWIZ.COMPILATION.COMPILING.TITLE</h2>
<!-- getActiveIndex() check because animated icons use loads of CPU, even when not visible! -->
<ion-spinner *ngIf="currentSlide == slideCompilation" item-start name="dots"></ion-spinner>
</ng-container>
<ng-container *ngIf="state.compilation == 'go-online'">
<h2 translate>OTAWIZ.COMPILATION.GO_ONLINE.TITLE</h2>
<p translate>OTAWIZ.COMPILATION.GO_ONLINE.TEXT</p>
</ng-container>
<ng-container *ngIf="state.compilation == 'done'">
<h2 translate>OTAWIZ.COMPILATION.DONE.TITLE</h2>
<button ion-button large clear icon-end color="primary" (click)="slides.slideNext()">
{{ 'OTAWIZ.BTN_NEXT' | translate }}
<ion-icon name="arrow-forward"></ion-icon>
</button>
</ng-container>
<ng-container *ngIf="state.compilation == 'error'">
<h2 translate>OTAWIZ.COMPILATION.ERROR.TITLE</h2>
<p [innerHTML]="errorMsg"></p> <!-- @TODO: translate? -->
</ng-container>
</ion-slide>
<!-- wifi selection -->
<ion-slide id="wifi-slide" *ngIf="!slideIsHidden(slideWifi)">
<ion-grid>

@ -160,12 +160,12 @@ export class OtaWizardPage implements OnInit, OnDestroy {
// call logic for each slide
onSlideChange() {
this.slideHistory.push(OtaSlides[this.currentSlide])
console.log("currentSlide",this.currentSlide);
switch (this.currentSlide) {
case OtaSlides.Intro:
case OtaSlides.Intro2:
if(this.modus == undefined) this.slides.lockSwipeToNext(true);
break
case OtaSlides.Intro3:
case OtaSlides.ModeGuide:
//if(this.modus == undefined) this.slides.lockSwipeToNext(true);
break
case OtaSlides.Compilation:
this.handleCompilation()
@ -224,6 +224,7 @@ export class OtaWizardPage implements OnInit, OnDestroy {
}
private handleCompilation() {
console.log("handleCompilation",this.compiledSketch);
this.slides.lockSwipeToNext(!this.compiledSketch)
// need to go online for compilation. compilation is retriggered via this.onlineSub
@ -311,9 +312,10 @@ type OtaState = {
// names for the slide indices for easier access
enum OtaSlides {
Intro = 0,
Intro2 = 1,
Compilation = 2,
Intro3 = 3,
// Intro2 = 1,
Compilation = 1,
ModeGuide = 2,
Mode = 3,
WifiSelection = 4,
Upload = 5,
}

Loading…
Cancel
Save