28 #include "../../Landscape/ls.h"
29 #include "../../Landscape/cropprogs/PermanentGrassGrazed.h"
57 m_field->SetMDates(0,0,g_date->DayInYear(15,9));
59 m_field->SetMDates( 1, 0, g_date->DayInYear(1,10) );
71 g_msg->Warn( WARN_BUG,
"PermanentGrassGrazed::Do(): "
72 "Harvest too late for the next crop to start!!!",
"" );
76 for (
int i=0; i<noDates; i++) {
87 int today=g_date->Date();
92 g_msg->Warn( WARN_BUG,
" PermanentGrassGrazed::Do(): "
93 "Crop start attempt after last possible start date",
"" );
101 if ( g_date->Date() > d1 ) {
118 g_date->DayInYear( 15,6 ) - g_date->DayInYear())) {
131 g_date->DayInYear( 15,6 ) - g_date->DayInYear())) {
144 g_date->DayInYear( 15,8 ) - g_date->DayInYear())) {
151 SimpleEvent( g_date->OldDays() + g_date->DayInYear( 15,6 ),
158 SimpleEvent( g_date->OldDays() + g_date->DayInYear( 15, 6 ),
171 g_date->DayInYear( 15,8 ) - g_date->DayInYear()))
192 g_date->DayInYear( 16,8 ) - g_date->DayInYear())) {
202 g_date->DayInYear( 17,8 ) - g_date->DayInYear()))
216 if (
m_field->GetMConstants(0)==0) {
218 g_msg->Warn( WARN_BUG,
"PermanentGrassGrazed::Do(): failure in 'CattleOut' execution",
"" );
233 if (
m_field->GetMConstants(0)==0) {
235 g_msg->Warn( WARN_BUG,
"PermanentGrassGrazed::Do(): failure in 'CattleOut' execution",
"" );
258 if (
m_field->GetMConstants(0)==0) {
261 if(g_date->Date() ==
m_field->GetMDates(1,0)){
262 g_msg->Warn( WARN_BUG,
"PermanentGrassGrazed::Do(): failure in 'CattleIsOut' execution",
"" );
274 if (g_date->DayInYear()<g_date->DayInYear(10,9))
285 (g_date->DayInYear()<g_date->DayInYear(15,8)))
290 Field * pf = dynamic_cast<Field*>(
m_field);
291 pf->Add_missed_herb_app();
301 SimpleEvent( g_date->OldDays() + g_date->DayInYear(15,8),
308 (g_date->DayInYear()<g_date->DayInYear(15,9)))
311 g_date->DayInYear( 15,9 ) - g_date->DayInYear())) {
322 g_msg->Warn( WARN_BUG,
"PermanantGrassGrazed::Do(): "
323 "Unknown event type! ",
"" );