mirror of
https://github.com/sensebox/blockly-app
synced 2026-01-03 02:01:34 +01:00
preparations for demo
This commit is contained in:
parent
ab19194acd
commit
f4d854c7d7
6 changed files with 22 additions and 32 deletions
|
|
@ -14,7 +14,7 @@ export class openSenseApp {
|
||||||
|
|
||||||
@ViewChild(Nav) nav: Nav;
|
@ViewChild(Nav) nav: Nav;
|
||||||
|
|
||||||
rootPage:any = OtaWizardPage; // TODO: for development, revert to HomePage
|
rootPage:any = BlocklyPage; // TODO: for development, revert to HomePage
|
||||||
|
|
||||||
pages: Array<{title: string, component: any}> = [
|
pages: Array<{title: string, component: any}> = [
|
||||||
{ title: 'Home', component: HomePage },
|
{ title: 'Home', component: HomePage },
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,8 @@ import { ApiProvider } from '../providers/api/api';
|
||||||
import { HttpClientModule } from '@angular/common/http';
|
import { HttpClientModule } from '@angular/common/http';
|
||||||
import { OtaWizardPage } from '../pages/ota-wizard/ota-wizard';
|
import { OtaWizardPage } from '../pages/ota-wizard/ota-wizard';
|
||||||
import { OtaWizardPageModule } from '../pages/ota-wizard/ota-wizard.module';
|
import { OtaWizardPageModule } from '../pages/ota-wizard/ota-wizard.module';
|
||||||
import { CompilerProvider } from '../providers/compiler/compiler';
|
import { BlocklyPage } from '../pages/Blockly/blockly';
|
||||||
|
import { BlocklyPageModule } from '../pages/Blockly/blockly.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
|
|
@ -21,12 +22,14 @@ import { CompilerProvider } from '../providers/compiler/compiler';
|
||||||
HttpClientModule,
|
HttpClientModule,
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
OtaWizardPageModule,
|
OtaWizardPageModule,
|
||||||
|
BlocklyPageModule,
|
||||||
IonicModule.forRoot(openSenseApp)
|
IonicModule.forRoot(openSenseApp)
|
||||||
],
|
],
|
||||||
bootstrap: [IonicApp],
|
bootstrap: [IonicApp],
|
||||||
entryComponents: [
|
entryComponents: [
|
||||||
openSenseApp,
|
openSenseApp,
|
||||||
OtaWizardPage,
|
OtaWizardPage,
|
||||||
|
BlocklyPage,
|
||||||
HomePage
|
HomePage
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
|
|
@ -34,7 +37,6 @@ import { CompilerProvider } from '../providers/compiler/compiler';
|
||||||
SplashScreen,
|
SplashScreen,
|
||||||
{provide: ErrorHandler, useClass: IonicErrorHandler},
|
{provide: ErrorHandler, useClass: IonicErrorHandler},
|
||||||
ApiProvider,
|
ApiProvider,
|
||||||
CompilerProvider,
|
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class AppModule {}
|
export class AppModule {}
|
||||||
|
|
|
||||||
|
|
@ -16,21 +16,17 @@
|
||||||
|
|
||||||
<ion-content padding>
|
<ion-content padding>
|
||||||
|
|
||||||
|
|
||||||
<!-- Real floating action button, fixed. It will not scroll with the content -->
|
<!-- Real floating action button, fixed. It will not scroll with the content -->
|
||||||
<ion-fab top right edge>
|
<ion-fab top right edge>
|
||||||
|
|
||||||
<button ion-fab mini (click)="launchOtaWizard() " color ="light"><ion-icon name="wifi"></ion-icon></button>
|
<button ion-fab mini (click)="launchOtaWizard() " color ="light"><ion-icon name="wifi"></ion-icon></button>
|
||||||
|
|
||||||
</ion-fab>
|
</ion-fab>
|
||||||
<div>
|
<div>
|
||||||
Blockly should be displayed here !
|
Blockly should be displayed here !
|
||||||
</div>
|
</div>
|
||||||
<ion-item>
|
|
||||||
<ion-textarea placeholder="Enter your text here" #sketchtext>
|
<textarea placeholder="Enter your Sketch here" [(ngModel)]="sketchtext"></textarea>
|
||||||
<ion-input>id = "sketchtext" </ion-input>
|
|
||||||
|
|
||||||
</ion-textarea>
|
|
||||||
</ion-item>
|
|
||||||
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
page-blockly {
|
page-blockly {
|
||||||
$text-input-highlight-color-valid : #32db64
|
textarea {
|
||||||
Color of the input highlight when valid
|
width: 100%;
|
||||||
|
height: 90%;
|
||||||
$text-input-highlight-color-invalid #f53d3d
|
resize: none;
|
||||||
Color of the input highlight when invalid
|
margin-top: 20px;
|
||||||
|
}
|
||||||
$text-input-placeholder-color #999
|
|
||||||
Color of the input placeholder
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,20 +15,14 @@ import { OtaWizardPage } from '../ota-wizard/ota-wizard';
|
||||||
templateUrl: 'blockly.html',
|
templateUrl: 'blockly.html',
|
||||||
})
|
})
|
||||||
export class BlocklyPage {
|
export class BlocklyPage {
|
||||||
sketchtext = ""
|
sketchtext = 'void setup() {\n Serial.begin(9600);\n Serial.println(\"Hello World\");\n}\n\nvoid loop() {\n\n}'
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public navCtrl: NavController,
|
public navCtrl: NavController,
|
||||||
public navParams: NavParams) {
|
public navParams: NavParams) { }
|
||||||
}
|
|
||||||
goTo(sketch) {
|
|
||||||
this.sketchtext = '' || 'No text Entered';}
|
|
||||||
ionViewDidLoad() {
|
|
||||||
console.log('ionViewDidLoad SenseBoxPage');
|
|
||||||
}
|
|
||||||
|
|
||||||
launchOtaWizard() {
|
launchOtaWizard() {
|
||||||
this.navCtrl.setRoot(OtaWizardPage,{sketch : this.sketchtext})
|
this.navCtrl.push(OtaWizardPage,{ sketch : this.sketchtext })
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ export class OtaWizardPage implements OnInit, OnDestroy {
|
||||||
this.compiledSketch = 'firmware binary here..'
|
this.compiledSketch = 'firmware binary here..'
|
||||||
this.state.compilation = 'done'
|
this.state.compilation = 'done'
|
||||||
this.slides.lockSwipeToNext(false)
|
this.slides.lockSwipeToNext(false)
|
||||||
}, 1000)
|
}, 5000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue