Compare commits

...

2 Commits

Author SHA1 Message Date
Fedde Sijbrandij
ad49bafa07 update blight 2020-12-15 17:10:42 +01:00
Fedde Sijbrandij
f3a2b33810 update Blight 2020-12-15 16:28:19 +01:00
4 changed files with 122 additions and 7 deletions

View File

@ -74,8 +74,8 @@ namespace FarmMapsBlight
cropfieldItem = await _farmmapsApiService.GetItemAsync(_settings.CropfieldItemCode);
}
DateTime adviceDate = DateTime.Now.Date;
DateTime plantingDate = new DateTime(2020, 3, 20);
DateTime adviceDate = new DateTime(2020, 7, 7);// DateTime.Now.Date;
DateTime plantingDate = new DateTime(2020, 4, 20);
DateTime emergeDate = new DateTime(2020, 5, 20);
var blightItem = await _blightService.CreateAdvice(cropfieldItem, adviceDate, plantingDate, emergeDate);

View File

@ -32,12 +32,12 @@ namespace FarmMapsBlight
TaskType = "vnd.farmmaps.task.blight"
};
taskRequest.attributes["d"] = DateTime.Now.Date.ToString("o");
taskRequest.attributes["d"] = adviceDate.ToUniversalTime().ToString("o");
taskRequest.attributes["plantingDate"] = plantingDate.ToUniversalTime().ToString("o");
taskRequest.attributes["emergeDate"] = emergeDate.ToUniversalTime().ToString("o");
List<Spray> sprays = new List<Spray>();
sprays.Add(new Spray() { fungicideCode = "FLEX", SprayTime = new DateTime(2020, 9, 1), dose = 0.6, isVRA = false });
sprays.Add(new Spray() { fungicideCode = "FLEX", SprayTime = new DateTime(2020, 7, 1), dose = 0.6, isVRA = false });
taskRequest.attributes["sprays"] = JsonConvert.SerializeObject(sprays);
List<Irrigation> irrigations = new List<Irrigation>();
@ -47,8 +47,8 @@ namespace FarmMapsBlight
var taskCode = await _farmmapsApiService.QueueTaskAsync(cropfieldItem.Code, taskRequest);
await PollTask(TimeSpan.FromSeconds(3), async (tokenSource) =>
{
_logger.LogInformation("Checking blight task status");
var itemTaskStatus = await _farmmapsApiService.GetTaskStatusAsync(cropfieldItem.Code, taskCode);
_logger.LogInformation($"Checking blight task status: { itemTaskStatus.State}");
if (itemTaskStatus.IsFinished)
tokenSource.Cancel();
});

View File

@ -11,7 +11,7 @@
<ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
<CopyToOutputDirectory>always</CopyToOutputDirectory>
</None>
</ItemGroup>

View File

@ -1,4 +1,111 @@
[
{
"file": "Scan_1_20190605.json",
"inputVariable": "irmi",
"outputFileName": "vranbs1",
"plantingDate": "2019-04-18",
"measurementDate": "2019-06-05",
"potatoPurposeType": "consumption",
"targetYield": 45,
"geometryJson": {
"type": "Polygon",
"coordinates": [
[
[ 3.40843828875524, 50.638966444680605 ],
[ 3.408953272886064, 50.639197789621612 ],
[ 3.409242951459603, 50.639469958681836 ],
[ 3.409328782148028, 50.639612846807708 ],
[ 3.409457528180712, 50.639789755314411 ],
[ 3.409639918393741, 50.640014292074966 ],
[ 3.409833037442765, 50.640211611372706 ],
[ 3.410069071836049, 50.640395321698435 ],
[ 3.410380208081761, 50.640572227259661 ],
[ 3.410605513638958, 50.640715112034222 ],
[ 3.411925160474145, 50.641177783561204 ],
[ 3.411935889310142, 50.640728720085136 ],
[ 3.412590348309737, 50.63948356709389 ],
[ 3.413244807309242, 50.638224772339846 ],
[ 3.413400375432099, 50.637901562841307 ],
[ 3.413539850300779, 50.637449065809889 ],
[ 3.413475477284437, 50.637418445552932 ],
[ 3.40999396998362, 50.637449065810451 ],
[ 3.409940325803365, 50.638102293212661 ],
[ 3.409575545377398, 50.638483338338325 ],
[ 3.409060561246574, 50.638707881340494 ],
[ 3.40843828875524, 50.638966444680605 ]
]
]
},
//{
//"file": "[...].json",
//"inputVariable": "wdvi",
//"outputFileName": "20201211_Mahindra",
//"plantingDate": "2020-11-25",
//"measurementDate": "2020-12-08",
//"potatoPurposeType": "consumption",
//"targetYield": 45,
//"geometryJson": {
// "type": "Polygon",
// "coordinates": [
// [
// [ 75.4652734163369, 31.26328617861426 ],
// [ 75.46527659380338, 31.26437743805827 ],
// [ 75.46494267602188, 31.26438166160194 ],
// [ 75.46493257618651, 31.26462192072676 ],
// [ 75.46438242791261, 31.26462132638865 ],
// [ 75.46438225728252, 31.26334267015003 ],
// [ 75.46448543502072, 31.26333463263533 ],
// [ 75.46448842093658, 31.26302891147988 ],
// [ 75.46507631089699, 31.26299589154944 ],
// [ 75.46509039016291, 31.26329023051392 ],
// [ 75.4652734163369, 31.26328617861426 ]
// ]
// ]
//}
//}
//},
//{
// "file": "Scan_1_20190605.zip",
// "inputVariable": "irmi",
// "outputFileName": "vranbs2",
// "plantingDate": "2019-04-18",
// "measurementDate": "2019-06-05",
// "potatoPurposeType": "starch",
// "targetYield": 45,
// "geometryJson": {
// "type": "Polygon",
// "coordinates": [
// [
// [ 3.40843828875524, 50.638966444680605 ],
// [ 3.408953272886064, 50.639197789621612 ],
// [ 3.409242951459603, 50.639469958681836 ],
// [ 3.409328782148028, 50.639612846807708 ],
// [ 3.409457528180712, 50.639789755314411 ],
// [ 3.409639918393741, 50.640014292074966 ],
// [ 3.409833037442765, 50.640211611372706 ],
// [ 3.410069071836049, 50.640395321698435 ],
// [ 3.410380208081761, 50.640572227259661 ],
// [ 3.410605513638958, 50.640715112034222 ],
// [ 3.411925160474145, 50.641177783561204 ],
// [ 3.411935889310142, 50.640728720085136 ],
// [ 3.412590348309737, 50.63948356709389 ],
// [ 3.413244807309242, 50.638224772339846 ],
// [ 3.413400375432099, 50.637901562841307 ],
// [ 3.413539850300779, 50.637449065809889 ],
// [ 3.413475477284437, 50.637418445552932 ],
// [ 3.40999396998362, 50.637449065810451 ],
// [ 3.409940325803365, 50.638102293212661 ],
// [ 3.409575545377398, 50.638483338338325 ],
// [ 3.409060561246574, 50.638707881340494 ],
// [ 3.40843828875524, 50.638966444680605 ]
// ]
// ]
// }
//},
//{
// "file": "Scan_1_20190605.zip",
// "inputVariable": "irmi",
{
"file": "", // keep emptpy to use satellite image
"inputVariable": "wdvi",
@ -151,6 +258,10 @@
// ]
// ]
// }
//},
//{
// "file": "Scan_1_20190605.zip",
// "inputVariable": "irmi",
//}
//,
//{
@ -191,5 +302,9 @@
// ]
// ]
// }
}
//}
]