Skip to content

Commit 22419ca

Browse files
committed
update
1 parent 3195abd commit 22419ca

File tree

23 files changed

+1462
-85
lines changed

23 files changed

+1462
-85
lines changed

debug.log

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,9 @@
127127
[0313/145230.051:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
128128
[0313/145406.265:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
129129
[0313/145406.519:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
130+
[0321/164925.550:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
131+
[0321/164937.739:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
132+
[0321/164939.592:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
133+
[0324/164224.456:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
134+
[0324/164236.394:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
135+
[0325/013346.288:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)

src/app/Services/API/Requests/debug.log

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@
2626
[0218/153720.858:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
2727
[0218/165012.869:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
2828
[0218/165857.541:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
29+
[0321/164946.804:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
30+
[0325/013343.875:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
31+
[0325/014807.843:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)

src/app/Services/API/Requests/index.ts

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -531,11 +531,28 @@ export class RequestApi extends Http {
531531
mode: string = 'forecast',
532532
) => {
533533
const ret: Promise<AxiosResponse<any, any>>[] = [];
534-
for (let id of series) {
535-
ret.push(this.getTimeserieV2(id, lat, lng, withStation));
536-
if (withStation) {
537-
withStation = false;
534+
if (mode === 'forecast') {
535+
for (let id of series) {
536+
ret.push(
537+
this.getTimeserieV2(
538+
id,
539+
lat,
540+
lng,
541+
withStation,
542+
true,
543+
true,
544+
true,
545+
mode,
546+
),
547+
);
548+
if (withStation) {
549+
withStation = false;
550+
}
538551
}
552+
} else {
553+
ret.push(
554+
this.getTimeserieV2(series[0], lat, lng, false, true, true, true, mode),
555+
);
539556
}
540557
return Promise.all(ret).then(x => {
541558
return this.merge.apply(this, x);
@@ -554,6 +571,24 @@ export class RequestApi extends Http {
554571
{},
555572
);
556573

574+
public updateCache = () => {
575+
this.instance.get(`${BACKEND_API_URL}/base`).then((x: any) => {
576+
const curr = localStorage.getItem('git_commit');
577+
console.log('current_version', curr);
578+
if (curr) {
579+
if (curr !== x.git_commit) {
580+
localStorage.clear();
581+
console.log('localStorage cleaered');
582+
}
583+
localStorage.setItem('git_commit', x.git_commit);
584+
} else {
585+
localStorage.clear();
586+
console.log('localStorage cleaered');
587+
localStorage.setItem('git_commit', x.git_commit);
588+
}
589+
});
590+
};
591+
557592
public getTimeserieV2 = (
558593
serie: string,
559594
lat: number,
@@ -564,6 +599,7 @@ export class RequestApi extends Http {
564599
uncertainty: boolean = true,
565600
mode: string = 'forecast',
566601
) => {
602+
serie.indexOf('forecast') >= 0 ? (mode = 'forecast') : (mode = 'past');
567603
const ep =
568604
mode === 'forecast' ? 'forecast-time-series' : 'historical-time-series';
569605
let url = `${BACKEND_API_URL}/coverages/${ep}/${serie}?coords=POINT(${lng.toFixed(
@@ -572,8 +608,13 @@ export class RequestApi extends Http {
572608
4,
573609
)})&datetime=..%2F..&include_coverage_data=true&coverage_data_smoothing=NO_SMOOTHING`;
574610
if (smoothing) {
575-
url +=
576-
'&coverage_data_smoothing=MOVING_AVERAGE_11_YEARS&coverage_data_smoothing=LOESS_SMOOTHING';
611+
if (mode === 'forecast') {
612+
url +=
613+
'&coverage_data_smoothing=MOVING_AVERAGE_11_YEARS&coverage_data_smoothing=LOESS_SMOOTHING';
614+
} else {
615+
url +=
616+
'&mann_kendall_datetime=..%2F..&include_moving_average_series=true&include_decade_aggregation_series=true&include_loess_series=true';
617+
}
577618
}
578619
if (uncertainty) {
579620
url += '&include_coverage_uncertainty=true';
@@ -590,6 +631,8 @@ export class RequestApi extends Http {
590631
} else {
591632
url += '&include_observation_data=false';
592633
}
634+
if (mode !== 'forecast') {
635+
}
593636

594637
return this.instance.get<any>(url).then((x: any) => {
595638
x.series.map(a => {
@@ -688,7 +731,7 @@ export class RequestApi extends Http {
688731
};
689732

690733
public getAttributes = (
691-
data: string = 'future',
734+
data: string = 'forecast',
692735
mode: string = 'advanced',
693736
force: boolean = false,
694737
) => {
@@ -703,7 +746,7 @@ export class RequestApi extends Http {
703746
return d.items;
704747
});
705748
reqs.push(ret);
706-
if (data === 'future') {
749+
if (data === 'forecast') {
707750
const cret = this.instance.get<any>(
708751
`${BACKEND_API_URL}/coverages/forecast-variable-combinations?navigation_section=${mode}`,
709752
);

src/app/components/DownloadDataDialog/debug.log

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@
2323
[0218/143947.059:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
2424
[0218/165848.560:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
2525
[0313/145634.426:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
26+
[0321/165014.043:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
27+
[0324/164323.215:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)

src/app/components/Map/DynamicStationsLayer.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ export const DynamicStationsLayer = (props: any) => {
4242
const vtlstyles = {};
4343
vtlstyles[ln] = (properties, zoom, geometryDimension) => {
4444
let opacity = 0.9;
45-
let color = data === 'future' ? '#abb2b9' : '#464b52';
45+
let color = data === 'forecast' ? '#abb2b9' : '#464b52';
4646
// console.log(zoom, color, opacity)
4747
return {
4848
color: color,
49-
weight: data === 'future' ? 2 : 4,
50-
radius: data === 'future' ? 5 : 10,
49+
weight: data === 'forecast' ? 2 : 4,
50+
radius: data === 'forecast' ? 5 : 10,
5151
fill: true,
5252
fillOpacity: 0.7,
5353
opacity: opacity,

src/app/components/Map/StationsLayer.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ export const StationsLayer = (props: any) => {
3737
vectorTileLayerStyles: {
3838
stations: (properties, zoom, geometryDimension) => {
3939
let opacity = 0.9;
40-
let color = data === 'future' ? '#bdc2cf' : '#778494';
40+
let color = data === 'forecast' ? '#bdc2cf' : '#778494';
4141
// console.log(zoom, color, opacity)
4242
return {
4343
color: color,
44-
weight: data === 'future' ? 1 : 2,
45-
radius: data === 'future' ? 3 : 8,
44+
weight: data === 'forecast' ? 1 : 2,
45+
radius: data === 'forecast' ? 3 : 8,
4646
fill: true,
4747
fillOpacity: 0.7,
4848
opacity: opacity,

src/app/components/Map/debug.log

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,12 @@
8888
[0218/165852.376:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
8989
[0313/154620.678:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
9090
[0313/154627.326:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
91+
[0321/165012.212:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
92+
[0321/165012.796:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
93+
[0321/165013.257:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
94+
[0324/164321.508:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
95+
[0324/164322.085:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
96+
[0324/164322.450:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
97+
[0325/064615.109:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
98+
[0325/064655.551:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
99+
[0325/064656.903:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)

src/app/components/Map/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ const Map = (props: MapProps) => {
115115
setCurrentMap = () => { },
116116
setCurrentYear = () => { },
117117
mode = 'advanced',
118-
data = 'future',
118+
data = 'forecast',
119119
} = props;
120120

121121
const theme = useTheme();

src/app/components/MapMenuBar/debug.log

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,6 @@
3434
[0218/122028.305:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
3535
[0218/165903.919:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
3636
[0313/145615.907:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
37+
[0321/165011.301:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
38+
[0324/164320.684:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)
39+
[0325/064653.918:ERROR:registration_protocol_win.cc(108)] CreateFile: Impossibile trovare il file specificato. (0x2)

src/app/components/MapMenuBar/index.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export interface MapMenuBar {
7171
}
7272

7373
const MAP_MODES = {
74-
future: 'Proiezioni',
74+
forecast: 'Proiezioni',
7575
past: 'Storico',
7676
advanced: 'Avanzata',
7777
simple: 'Semplice',
@@ -199,7 +199,7 @@ export function MapMenuBar(props: MapMenuBar) {
199199
rows: [
200200
{
201201
key:
202-
map_data === 'future'
202+
map_data === 'forecast'
203203
? 'aggregation_period'
204204
: 'aggregation_period',
205205
groupName: t('app.map.menu.dataSeries'),
@@ -219,11 +219,11 @@ export function MapMenuBar(props: MapMenuBar) {
219219
criteria: (x, c) => x?.measure,
220220
},
221221
{
222-
key: map_data === 'future' ? 'time_window' : 'reference_period',
222+
key: map_data === 'forecast' ? 'time_window' : 'reference_period',
223223
groupName: t('app.map.menu.timeWindows'),
224224
...mapParameters(
225-
map_data === 'future' ? 'time_window' : 'reference_period',
226-
map_data === 'future' ? 'time_window' : 'reference_period',
225+
map_data === 'forecast' ? 'time_window' : 'reference_period',
226+
map_data === 'forecast' ? 'time_window' : 'reference_period',
227227
),
228228
disableable: true,
229229
disabled: x => x.aggregation_period !== 'thirty_year',
@@ -239,11 +239,11 @@ export function MapMenuBar(props: MapMenuBar) {
239239
rows: [
240240
{
241241
multicol: [5, 11, 16],
242-
key: map_data === 'future' ? 'year_period' : 'year_period',
242+
key: map_data === 'forecast' ? 'year_period' : 'year_period',
243243
groupName: '',
244244
...mapParameters(
245-
map_data === 'future' ? 'year_period' : 'year_period',
246-
map_data === 'future' ? 'year_period' : 'year_period',
245+
map_data === 'forecast' ? 'year_period' : 'year_period',
246+
map_data === 'forecast' ? 'year_period' : 'year_period',
247247
),
248248
disableable: true,
249249
disabled: x => false,
@@ -446,7 +446,7 @@ export function MapMenuBar(props: MapMenuBar) {
446446
}, [foundLayers]);
447447

448448
const labelFor = (itm: string) => {
449-
api.getConfigurationParams().then(x => console.log(x));
449+
api.getConfigurationParams().then(x => { });
450450
const confs = localStorage.getItem('configs');
451451
let configs = [];
452452
if (confs) {

0 commit comments

Comments
 (0)