ALMaSS Skylark ODDox
1.1
The skylark model description following ODdox protocol
|
#include <SpringBarleyPTreatment.h>
◆ SpringBarleyPTreatment()
SpringBarleyPTreatment::SpringBarleyPTreatment |
( |
| ) |
|
|
inline |
◆ Do()
bool SpringBarleyPTreatment::Do |
( |
Farm * |
a_farm, |
|
|
LE * |
a_field, |
|
|
FarmEvent * |
a_ev |
|
) |
| |
|
virtual |
Reimplemented from Crop.
60 m_field->SetMDates(0,0,g_date->DayInYear(20,8));
62 m_field->SetMDates(1,0,g_date->DayInYear(10,8));
63 m_field->SetMDates(0,1,g_date->DayInYear(10,8));
64 m_field->SetMDates(1,1,g_date->DayInYear(30,8));
72 g_msg->Warn( WARN_BUG,
"SpringBarleyPTreatment::Do(): "
73 "Harvest too late for the next crop to start!!!",
"" );
77 for (
int i=0; i<noDates; i++)
90 int today=g_date->Date();
92 d1 = g_date->OldDays() + g_date->DayInYear( 1,7 );
96 g_msg->Warn( WARN_BUG,
"SpringBarleyPTreatment::Do(): "
97 "Crop start attempt between 1st Jan & 1st July",
"" );
106 g_msg->Warn( WARN_BUG,
"SpringBarleyPTreatment::Do(): "
107 "Crop start attempt after last possible start date",
"" );
114 SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1,4 ),
121 d1 = g_date->OldDays() + g_date->DayInYear( 2,11 );
122 if ( g_date->Date() > d1 ) {
140 g_date->DayInYear( 30,11 ) - g_date->DayInYear())) {
149 SimpleEvent( g_date->OldDays() + g_date->DayInYear( 15,3 )+365,
151 SimpleEvent( g_date->OldDays() + g_date->DayInYear( 15,3 )+365,
155 SimpleEvent( g_date->OldDays() + g_date->DayInYear( 20,3 )+365,
165 g_date->DayInYear( 15,4 ) - g_date->DayInYear())) {
182 g_date->DayInYear( 15,5 ) - g_date->DayInYear())) {
198 g_date->DayInYear( 10,4 ) -
199 g_date->DayInYear())) {
205 int d1 = g_date->Date();
206 if ( d1 < g_date->OldDays() + g_date->DayInYear( 20,3 )) {
207 d1 = g_date->OldDays() + g_date->DayInYear( 20,3 );
215 g_date->DayInYear( 10,4 ) - g_date->DayInYear())) {
220 SimpleEvent( g_date->OldDays() + g_date->DayInYear( 5,4 ),
223 SimpleEvent( g_date->OldDays() + g_date->DayInYear( 20,3 ),
233 g_date->DayInYear( 10,4 ) - g_date->DayInYear())) {
239 int d1 = g_date->Date();
240 if ( d1 < g_date->OldDays() + g_date->DayInYear( 25,3 )) {
241 d1 = g_date->OldDays() + g_date->DayInYear( 25,3 );
251 g_date->DayInYear( 10, 4 ) - g_date->DayInYear())) {
257 int d1 = g_date->Date();
258 if ( d1 < g_date->OldDays() + g_date->DayInYear( 25,3 )) {
259 d1 = g_date->OldDays() + g_date->DayInYear( 25,3 );
270 g_date->DayInYear( 10, 4 ) -
271 g_date->DayInYear())) {
280 g_date->DayInYear( 10, 4 ) -
281 g_date->DayInYear())) {
286 int d1 = g_date->Date();
287 if ( d1 < g_date->OldDays() + g_date->DayInYear( 25,3 )) {
288 d1 = g_date->OldDays() + g_date->DayInYear( 25,3 );
296 g_date->DayInYear( 10,4 ) - g_date->DayInYear())) {
301 int d1 = g_date->Date();
302 if ( d1 < g_date->OldDays() + g_date->DayInYear( 5,4 )) {
303 d1 = g_date->OldDays() + g_date->DayInYear( 5,4 );
313 g_date->DayInYear( 20,4 ) - g_date->DayInYear())) {
323 SimpleEvent( g_date->OldDays() + g_date->DayInYear( 5,5 ),
325 SimpleEvent( g_date->OldDays() + g_date->DayInYear( 10,5 ),
327 SimpleEvent( g_date->OldDays() + g_date->DayInYear( 10,5 ),
329 SimpleEvent( g_date->OldDays() + g_date->DayInYear( 15,5 ),
345 g_date->DayInYear( 15,5 ) - g_date->DayInYear()))
353 int d1 = g_date->Date() + 10;
354 if ( d1 < g_date->OldDays() + g_date->DayInYear( 16,5 )) {
355 d1 = g_date->OldDays() + g_date->DayInYear( 16,5 );
370 g_date->DayInYear( 30,5 ) - g_date->DayInYear())) {
388 g_date->DayInYear( 25,5 ) - g_date->DayInYear())) {
410 int d1 = g_date->Date() + 10;
411 if ( d1 < g_date->OldDays() + g_date->DayInYear( 25,5 )) {
412 d1 = g_date->OldDays() + g_date->DayInYear( 25,5 );
416 int d1 = g_date->Date();
417 if ( d1 < g_date->OldDays() + g_date->DayInYear( 16,5 )) {
418 d1 = g_date->OldDays() + g_date->DayInYear( 16,5 );
433 g_date->DayInYear( 10,6 ) - g_date->DayInYear())) {
451 g_date->DayInYear( 30,5 ) - g_date->DayInYear())) {
457 SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1,6 ),
469 g_date->DayInYear( 1,7 ) - g_date->DayInYear())) {
509 g_date->DayInYear( 20,8 ) - g_date->DayInYear())) {
536 m_field->GetMDates(1,0) - g_date->DayInYear())) {
548 m_field->GetMDates(1,1) - g_date->DayInYear())) {
558 g_msg->Warn( WARN_BUG,
"SpringBarleyPTreatment::Do(): "
559 "Unknown event type! ",
"" );
References Farm::AutumnPlough(), cfg_fungi_app_prop1, cfg_greg_app_prop, cfg_herbi_app_prop, cfg_pest_product_1_amount, cfg_productapplicendyear, cfg_productapplicstartyear, Farm::DoIt(), Farm::FA_Manure(), Farm::FA_NPK(), Farm::FA_Slurry(), Farm::FP_LiquidNH3(), Farm::FP_NPK(), Farm::FP_PK(), Farm::FungicideTreat(), g_landscape_p, Farm::GrowthRegulator(), Farm::Harvest(), Farm::HayBailing(), Farm::HerbicideTreat(), Farm::IsStockFarmer(), Crop::m_ev, Crop::m_farm, Crop::m_field, Crop::m_first_date, FarmEvent::m_first_year, Crop::m_last_date, FarmEvent::m_lock, FarmEvent::m_startday, FarmEvent::m_todo, ppp_1, Farm::ProductApplication(), sbpt_autumn_plough, SBPT_DID_AUTUMN_PLOUGH, sbpt_fertlnh3_plant, sbpt_fertmanure_plant, sbpt_fertmanure_stock_one, sbpt_fertmanure_stock_two, sbpt_fertpk_plant, sbpt_fertslurry_stock, SBPT_FUNGI_DATE, sbpt_fungicide_one, sbpt_fungicide_two, sbpt_GR, SBPT_GR_DATE, sbpt_harvest, sbpt_hay_baling, SBPT_HERBI_DATE, sbpt_herbicide_one, sbpt_herbicide_two, SBPT_INSECT_DATE, sbpt_insecticide1, sbpt_insecticide2, sbpt_insecticide3, SBPT_MANURE_DONE, SBPT_MANURE_EXEC, SBPT_SLURRY_DONE, SBPT_SLURRY_EXEC, sbpt_spring_harrow, sbpt_spring_plough, sbpt_spring_roll, sbpt_spring_sow, sbpt_start, sbpt_straw_chopping, sbpt_stubble_harrow, SBPT_WATER_DATE, sbpt_water_one, sbpt_water_two, Crop::SimpleEvent(), Farm::SpringHarrow(), Farm::SpringPlough(), Farm::SpringRoll(), Farm::SpringSow(), Farm::StrawChopping(), Farm::StubbleHarrowing(), Landscape::SupplyYearNumber(), and Farm::Water().
The documentation for this class was generated from the following files:
virtual bool SpringRoll(LE *a_field, double a_user, int a_days)
Carry out a roll event in the spring on a_field.
Definition: farmfuncs.cpp:525
virtual bool FA_Slurry(LE *a_field, double a_user, int a_days)
Spready slurry on a_field owned by an stock farmer.
Definition: farmfuncs.cpp:965
Definition: SpringBarleyPTreatment.h:63
Definition: SpringBarleyPTreatment.h:71
virtual bool SpringPlough(LE *a_field, double a_user, int a_days)
Carry out a ploughing event in the spring on a_field.
Definition: farmfuncs.cpp:444
virtual bool HerbicideTreat(LE *a_field, double a_user, int a_days)
Apply herbicide to a_field.
Definition: farmfuncs.cpp:1156
bool IsStockFarmer(void)
Definition: farm.h:905
virtual bool Harvest(LE *a_field, double a_user, int a_days)
Carry out a harvest on a_field.
Definition: farmfuncs.cpp:1769
bool m_lock
Definition: farm.h:465
#define SBPT_HERBI_DATE
Definition: SpringBarleyPTreatment.h:38
virtual bool ProductApplication(LE *a_field, double a_user, int a_days, double a_applicationrate, PlantProtectionProducts a_ppp)
Apply test pesticide to a_field.
Definition: farmfuncs.cpp:1445
Definition: SpringBarleyPTreatment.h:56
virtual bool FP_NPK(LE *a_field, double a_user, int a_days)
Apply NPK fertilizer, on a_field owned by an arable farmer.
Definition: farmfuncs.cpp:629
bool DoIt(double a_probability)
Return chance out of 0 to 100.
Definition: farm.cpp:800
bool m_first_year
Definition: farm.h:467
#define SBPT_GR_DATE
Definition: SpringBarleyPTreatment.h:39
Definition: SpringBarleyPTreatment.h:48
virtual bool FA_Manure(LE *a_field, double a_user, int a_days)
Spread manure on a_field owned by an stock farmer.
Definition: farmfuncs.cpp:1036
int m_first_date
Definition: farm.h:540
int m_startday
Definition: farm.h:466
virtual bool FA_NPK(LE *a_field, double a_user, int a_days)
Apply NPK fertilizer to a_field owned by an stock farmer.
Definition: farmfuncs.cpp:917
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: farmfuncs.cpp:1279
Definition: SpringBarleyPTreatment.h:70
Definition: SpringBarleyPTreatment.h:69
virtual bool FP_PK(LE *a_field, double a_user, int a_days)
Apply PK fertilizer, on a_field owned by an arable farmer.
Definition: farmfuncs.cpp:653
Definition: SpringBarleyPTreatment.h:65
void SimpleEvent(long a_date, int a_todo, bool a_lock)
Adds an event to this crop management.
Definition: farm.cpp:307
Definition: SpringBarleyPTreatment.h:64
#define SBPT_WATER_DATE
Definition: SpringBarleyPTreatment.h:41
Definition: SpringBarleyPTreatment.h:60
#define SBPT_DID_AUTUMN_PLOUGH
Definition: SpringBarleyPTreatment.h:36
#define SBPT_INSECT_DATE
Definition: SpringBarleyPTreatment.h:42
Definition: SpringBarleyPTreatment.h:66
virtual bool HayBailing(LE *a_field, double a_user, int a_days)
Carry out hay bailing on a_field.
Definition: farmfuncs.cpp:2184
Definition: SpringBarleyPTreatment.h:67
CfgInt cfg_productapplicstartyear
virtual bool StrawChopping(LE *a_field, double a_user, int a_days)
Carry out straw chopping on a_field.
Definition: farmfuncs.cpp:2132
Definition: SpringBarleyPTreatment.h:49
Definition: SpringBarleyPTreatment.h:68
Definition: SpringBarleyPTreatment.h:50
CfgFloat cfg_herbi_app_prop
int SupplyYearNumber(void)
Definition: Landscape.h:1616
Farm * m_farm
Definition: farm.h:537
LE * m_field
Definition: farm.h:538
int m_todo
Definition: farm.h:469
Definition: SpringBarleyPTreatment.h:58
Definition: SpringBarleyPTreatment.h:59
virtual bool Water(LE *a_field, double a_user, int a_days)
Carry out a watering on a_field.
Definition: farmfuncs.cpp:1717
int m_last_date
Definition: farm.h:542
CfgFloat cfg_fungi_app_prop1
virtual bool AutumnPlough(LE *a_field, double a_user, int a_days)
Carry out a ploughing event in the autumn on a_field.
Definition: farmfuncs.cpp:132
virtual bool SpringSow(LE *a_field, double a_user, int a_days)
Carry out a sowing event in the spring on a_field.
Definition: farmfuncs.cpp:546
#define SBPT_MANURE_DONE
Definition: SpringBarleyPTreatment.h:33
Definition: SpringBarleyPTreatment.h:61
virtual bool FP_LiquidNH3(LE *a_field, double a_user, int a_days)
Apply liquid ammonia fertilizer to a_field owned by an arable farmer.
Definition: farmfuncs.cpp:677
CfgFloat cfg_pest_product_1_amount
CfgInt cfg_productapplicendyear
Definition: SpringBarleyPTreatment.h:62
Definition: SpringBarleyPTreatment.h:54
Definition: SpringBarleyPTreatment.h:52
virtual bool GrowthRegulator(LE *a_field, double a_user, int a_days)
Apply growth regulator to a_field.
Definition: farmfuncs.cpp:1250
Definition: SpringBarleyPTreatment.h:53
Definition: SpringBarleyPTreatment.h:45
CfgFloat cfg_greg_app_prop
Definition: SpringBarleyPTreatment.h:57
#define SBPT_MANURE_EXEC
Definition: SpringBarleyPTreatment.h:35
Definition: SpringBarleyPTreatment.h:47
#define SBPT_FUNGI_DATE
Definition: SpringBarleyPTreatment.h:40
FarmEvent * m_ev
Definition: farm.h:539
Definition: SpringBarleyPTreatment.h:46
#define SBPT_SLURRY_EXEC
Definition: SpringBarleyPTreatment.h:34
Landscape * g_landscape_p
Definition: Landscape.cpp:258
virtual bool StubbleHarrowing(LE *a_field, double a_user, int a_days)
Carry out stubble harrowing on a_field.
Definition: farmfuncs.cpp:2209
virtual bool SpringHarrow(LE *a_field, double a_user, int a_days)
Carry out a harrow event in the spring on a_field.
Definition: farmfuncs.cpp:471
Definition: SpringBarleyPTreatment.h:51
#define SBPT_SLURRY_DONE
Definition: SpringBarleyPTreatment.h:32