Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VIPSWeb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIPS
VIPSWeb
Commits
17d125dd
Commit
17d125dd
authored
6 years ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Patches
Plain Diff
Bugfix related to JSON parsing
parent
6d048701
No related branches found
No related tags found
2 merge requests
!2
Spotit multi org
,
!1
Ny server 2019
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fusarium/static/fusarium/js/oatFloweringModelForm.js
+23
-15
23 additions, 15 deletions
fusarium/static/fusarium/js/oatFloweringModelForm.js
with
23 additions
and
15 deletions
fusarium/static/fusarium/js/oatFloweringModelForm.js
+
23
−
15
View file @
17d125dd
...
...
@@ -34,7 +34,7 @@
// Internal ID for the form
var
theFormId
=
"
_oatFloweringModelForm
"
;
var
detailURL
=
null
;
var
DEBUG
=
fals
e
;
var
DEBUG
=
tru
e
;
// Settings for VIPS forecasting system
//var serverUri = settings.vipsCoremanagerServerName;
...
...
@@ -45,8 +45,8 @@ var coreUserName = "";
var
corePass
=
""
;
// Location of weather data source
var
weatherDataBaseUri
=
"
https://lmt.nibio.no/agrometbase/export/getSeasonDailyTemperaturesJSON.php
"
;
//
var weatherDataBaseUri = "http://agrometbase-local/agrometbase/export/getSeasonDailyTemperaturesJSON.php";
//
var weatherDataBaseUri = "https://lmt.nibio.no/agrometbase/export/getSeasonDailyTemperaturesJSON.php";
var
weatherDataBaseUri
=
"
http://agrometbase-local/agrometbase/export/getSeasonDailyTemperaturesJSON.php
"
;
// Setting current time
var
now
=
moment
();
...
...
@@ -219,15 +219,16 @@ var displayResults = function(data)
now
=
getNow
();
var
weekNow
=
now
.
isoWeek
();
var
weeksFromNowToZ625
=
Math
.
abs
(
weekZ625
-
weekNow
);
/*console.log("now: " + now.tz("Europe/Oslo").format());
console.log("week now: " +weekNow);
console.log("weekZ625: " +weekZ625);
console.log("weeksFromNowToZ625: " + weeksFromNowToZ625);
console.log("z60: " + dateZ60.tz("Europe/Oslo").format());
console.log("z62.5: " + getDateForZ(data,62.5).tz("Europe/Oslo").format());
console.log("z69: " + dateZ69.tz("Europe/Oslo").format());*/
/*
console.info(data);
console.log("now: " + now.tz("Europe/Oslo").format());
console.log("week now: " +weekNow);
console.log("weekZ625: " +weekZ625);
console.log("weeksFromNowToZ625: " + weeksFromNowToZ625);
console.log("z60: " + dateZ60.tz("Europe/Oslo").format());
console.log("z62.5: " + getDateForZ(data,62.5).tz("Europe/Oslo").format());
console.log("z69: " + dateZ69.tz("Europe/Oslo").format());
*/
// Scenario 1: Today is before date of sowing
if
(
now
.
isBefore
(
dateOfSowing
))
{
...
...
@@ -320,8 +321,10 @@ var getDateForZ = function(data,z)
{
for
(
var
key
in
data
)
{
if
(
data
[
key
].
allValues
[
"
OATFLOWERM.ZREACHED
"
]
==
z
)
//console.info (key + ":" + getAllValues(data[key].allValues)["OATFLOWERM.ZREACHED"]);
if
(
getAllValues
(
data
[
key
].
allValues
)[
"
OATFLOWERM.ZREACHED
"
]
==
z
)
{
//console.info(moment(data[key].validTimeStart));
return
moment
(
data
[
key
].
validTimeStart
);
}
}
...
...
@@ -335,9 +338,9 @@ var getWeekForZ = function(data,z)
{
for
(
var
key
in
data
)
{
if
(
data
[
key
].
allValues
[
"
OATFLOWERM.ZREACHED
"
]
==
z
)
if
(
getAllValues
(
data
[
key
].
allValues
)
[
"
OATFLOWERM.ZREACHED
"
]
==
z
)
{
return
data
[
key
].
allValues
[
"
OATFLOWERM.WEEK_IN_YEAR
"
];
return
getAllValues
(
data
[
key
].
allValues
)
[
"
OATFLOWERM.WEEK_IN_YEAR
"
];
}
}
}
...
...
@@ -394,3 +397,8 @@ var getStartHTML = function()
"
<div id='resultsTable'></div>
"
].
join
(
""
);
}
var
getAllValues
=
function
(
allValuesStr
)
{
return
JSON
.
parse
(
allValuesStr
);
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment