Skip to content

Commit

Permalink
Update Bundle Description (#37)
Browse files Browse the repository at this point in the history
* check if the bundle file works

* solve the problems from piplines
  • Loading branch information
KlaudiaLum authored Apr 2, 2024
1 parent 0842bf2 commit c0e715f
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 26 deletions.
20 changes: 18 additions & 2 deletions bundle-description.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,24 @@
"paths": ["WebApps/webapps.weatherApp"],
"thumbnail": "WebApps/thumbnail.svg",
"projectType": "MOBILE",
"url": "/WebApps/webapps.weatherApp/index.html"

"url": "/WebApps/webapps.weatherApp/index.html",
"parameters": [
{
"name": "weatherLookupType",
"options": [
{
"value": "GPS",
"label": "GPS"
},
{
"value": "Location Name",
"label": "Location Name"
}
],
"label": "Weather Lookup Type",
"type": "ENUM"
}
]
}
]
}
9 changes: 2 additions & 7 deletions mosquitto/mosquitto.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,8 @@ allow_anonymous true

connection the-bridge
address luminator-realtime-emqx-dev-weu-01.westeurope.azurecontainer.io
topic pis/0/# both 0 "" krono/9031007000110725/
topic pis/0/# both 0 "" krono/9031007000110718/
bridge_attempt_unsubscribe false
remote_clientid ORCHESTRATOR_remote
local_clientid ORCHESTRATOR_local
log_type all




# krono/9031007000109107/
log_type all
39 changes: 22 additions & 17 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { CoordinatesService } from '../service/coordinates.service';
import { StopButtonService } from '../service/stop-button.service';
import { LocationService } from '../service/location.service';
import { filter } from 'rxjs';

@Component({
selector: 'app-root',
template: `
Expand Down Expand Up @@ -65,26 +64,30 @@ export class AppComponent implements OnInit {

ngOnInit(): void {
this.initConnection();
this.getWeatherCoordinates(this.latitude, this.longitude);
this.fetWeatherCoordinates(this.latitude, this.longitude);
this.fetchWeatherByCityName(this.cityName);
}

// get weather coordinats
getWeatherCoordinates(latitude: number, longitude: number): void {
fetchWeatherByCityName(cityName: string): void {
this.apiService
.getWeatherCoordinates(latitude, longitude)
.subscribe((data) => {
this.weatherCoordinates = data;
this.weatherTemperature = this.weatherCoordinates.temp;
this.weatherWind = this.weatherCoordinates.winSpd;
if (this.weatherCoordinates && this.weatherCoordinates.wsymb) {
this.weatherIconValue = this.weatherCoordinates.wsymb;
}
console.log('Weather', data);
.getWeatherCityName(cityName)
.pipe(filter((data) => data !== undefined))
.subscribe({
next: (data) => {
this.weatherDataArray.push(data);
console.log('API weather:', data);
},
error(err) {
console.error('Something wrong occurred: ' + err);
},
});
}
fetchWeatherByCityName(cityName: string): void {


// get weather coordinats
fetWeatherCoordinates(latitude: number, longitude: number): void {
this.apiService
.getWeatherCityName(cityName)
.getWeatherCoordinates(latitude, longitude)
.pipe(filter((data) => data !== undefined))
.subscribe({
next: (data) => {
Expand All @@ -94,8 +97,10 @@ export class AppComponent implements OnInit {
error(err) {
console.error('Something wrong occurred: ' + err);
},

});
}

// connectet libpis with mqtt broker
initConnection() {
window.luminator.pis.init(this.mqttConfig);
Expand Down Expand Up @@ -135,8 +140,8 @@ export class AppComponent implements OnInit {
this.handleButtonStopClear();
}
}

// read Latitude and Longitude

handleCoordinates(state: any): void {
if (state.stopList && state.stopList.length > 0) {
const areStopsSame = this.areStopsSame(state.stopList);
Expand All @@ -154,7 +159,7 @@ export class AppComponent implements OnInit {
if (coordinate) {
this.coordinates = coordinate;
this.coordinates.forEach((element) => {
this.getWeatherCoordinates(element.latitude, element.longitude);
this.fetWeatherCoordinates(element.latitude, element.longitude);
console.log('handleCoordinates', this.coordinates);
});
} else {
Expand Down

0 comments on commit c0e715f

Please sign in to comment.