ALMaSS  1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
MapErrorMsg Class Reference

#include <MapErrorMsg.h>

Public Member Functions

void Warn (MapErrorState a_level, std::string a_msg1, std::string a_msg2)
 
void Warn (MapErrorState a_level, std::string a_msg1, int)
 
void Warn (std::string a_msg1, std::string a_msg2)
 
void Warn (std::string a_msg1, double a_num)
 
void WarnAddInfo (MapErrorState a_level, std::string a_add1, std::string a_add2)
 
void WarnAddInfo (MapErrorState a_level, std::string a_add1, double a_num)
 
void SetWarnLevel (MapErrorState a_level)
 
void SetFilename (std::string a_warnfile)
 
std::string GetFilename ()
 
 MapErrorMsg ()
 

Public Attributes

MapErrorState m_level
 
std::string m_warnfile
 

Constructor & Destructor Documentation

◆ MapErrorMsg()

MapErrorMsg::MapErrorMsg ( )
44 {
45  m_warnfile = "ErrorFile.txt";
46 }

Member Function Documentation

◆ GetFilename()

std::string MapErrorMsg::GetFilename ( )
54 {
55  return m_warnfile;
56 }

◆ SetFilename()

void MapErrorMsg::SetFilename ( std::string  a_warnfile)
49 {
50  m_warnfile = a_warnfile;
51 }

Referenced by main().

◆ SetWarnLevel()

void MapErrorMsg::SetWarnLevel ( MapErrorState  a_level)
59 {
60  if ( a_level > WARN_BUG && a_level <= WARN_ALL )
61  m_level = a_level;
62  else {
63  m_level = WARN_ALL;
64  Warn( WARN_BUG, "MapErrorMsg::SetWarnLevel(): Illegal error level!", "");
65  exit(1);
66  }
67 }

References WARN_ALL, and WARN_BUG.

Referenced by main().

◆ Warn() [1/4]

void MapErrorMsg::Warn ( MapErrorState  a_level,
std::string  a_msg1,
int  a_msg2 
)
94 {
95  FILE * EFile;
96  time_t aclock;
97  tm* newtime;
98  time(&aclock); // Get time in seconds.
99  newtime = localtime(&aclock); // Convert time to struct tm form.
100 
101  // Print local time as a string
102  EFile = fopen(m_warnfile.c_str(), "a+");
103  if (!EFile) {
104  fprintf(stderr, "MapErrorMsg::Warn(): Unable to open file"
105  " for error messages: %s\n", m_warnfile.c_str());
106  exit(1);
107  }
108 
109  fprintf(EFile, "%s Level %d *****\n%s %d\n",
110  asctime(newtime), a_level, a_msg1.c_str(), a_msg2);
111  fflush(EFile);
112  fclose(EFile);
113 }

◆ Warn() [2/4]

void MapErrorMsg::Warn ( MapErrorState  a_level,
std::string  a_msg1,
std::string  a_msg2 
)
72 {
73  FILE * EFile;
74  time_t aclock;
75  tm* newtime;
76  time(&aclock); // Get time in seconds.
77  newtime = localtime(&aclock); // Convert time to struct tm form.
78 
79  // Print local time as a string
80  EFile = fopen(m_warnfile.c_str(), "a+");
81  if (!EFile) {
82  fprintf(stderr, "MapErrorMsg::Warn(): Unable to open file"
83  " for error messages: %s\n", m_warnfile.c_str());
84  exit(1);
85  }
86 
87  fprintf(EFile, "%s Level %d *****\n%s %s\n",
88  asctime(newtime), a_level, a_msg1.c_str(), a_msg2.c_str());
89  fflush(EFile);
90  fclose(EFile);
91 }

Referenced by Landscape::AddBeetleBanks(), Landscape::AddPatches(), AlleleFreq::AlleleFreq(), AlleleFreq1616::AlleleFreq1616(), AlleleFreq256_16::AlleleFreq256_16(), AOR_Probe::AOR_Probe(), FarmManager::BackTranslateCropCodes(), LE_TypeClass::BackTranslateEleTypes(), LE_TypeClass::BackTranslateVegTypes(), beetle_tole_movemap_init(), Landscape::BorderNeed(), Skylark_Population_Manager::BreedingPairsOutput(), Skylark_Population_Manager::BreedingSuccessProbeOutput(), Skylark_Female::CalcFoodTime(), RasterMap::CellReplacementNeighbour(), Farm::Centroids(), Landscape::CentroidSpiralOut(), Configurator::CheckBounds(), Farm::CheckRotationManagementLoop(), Beetle_Base::ChooseDirection(), FarmManager::ConnectFarm(), Landscape::ConsolidatePolys(), FarmManager::CreateFarms(), CreatePopulationManager(), CropRotation::CropRotation(), Pesticide::DailyQueueProcess(), Calendar::DayLength(), SimplePositionMapInt::DecMapValue(), OFirstYearDanger::Do(), PermanentSetAside::Do(), DK_GrazingPigs::Do(), DK_GrazingPigs_Perm::Do(), DK_OGrazingPigs::Do(), DK_OGrazingPigs_Perm::Do(), OGrazingPigs::Do(), OrchardCrop::Do(), PermanentGrassTussocky::Do(), UKMaize::Do(), DK_GrassTussocky_Perm::Do(), GenericCatchCrop::Do(), NorwegianSpringBarley::Do(), NorwegianOats::Do(), DK_OptimalFlowerMix2::Do(), OSeedGrass1::Do(), WinterRapeStrigling::Do(), OCloverGrassGrazed2::Do(), DK_FarmYoungForest_Perm::Do(), DK_FarmForest_Perm::Do(), BroadBeans::Do(), DK_OFarmForest_Perm::Do(), DK_OFarmYoungForest_Perm::Do(), OSeedGrass2::Do(), DK_PlantNursery_Perm::Do(), HorticultureCrop::Do(), OSBarleySilage::Do(), PermanentGrassLowYield::Do(), YoungForestCrop::Do(), DK_OGrassLowYield_Perm::Do(), NLCatchCropPea::Do(), OCloverGrassGrazed1::Do(), OFieldPeas::Do(), OCloverGrassSilage1::Do(), OFieldPeasSilage::Do(), OPermanentGrassGrazed::Do(), DK_GrassLowYield_Perm::Do(), DK_OLegume::Do(), OCarrots::Do(), DE_OPeas::Do(), BECatchPeaCrop::Do(), SeedGrass1::Do(), CloverGrassGrazed2::Do(), DK_OCatchCrop::Do(), OBarleyPeaCloverGrass::Do(), OMaizeSilage::Do(), PermanentGrassGrazed::Do(), DK_CerealLegume::Do(), DK_CerealLegume_Whole::Do(), FI_OPotato_North::Do(), FI_OPotato_South::Do(), FI_OPotatoIndustry_North::Do(), FI_OPotatoIndustry_South::Do(), FI_OStarchPotato_North::Do(), FI_OStarchPotato_South::Do(), DK_Legume_Peas::Do(), FodderGrass::Do(), DK_OLegume_Peas_CC::Do(), DE_OLegume::Do(), OWinterBarleyExt::Do(), DK_SpringBarley_Green::Do(), CloverGrassGrazed1::Do(), DK_OLegume_Beans::Do(), DK_OLegume_Beans_CC::Do(), DK_OLegume_Peas::Do(), DK_OLentils::Do(), OWinterBarley::Do(), SeedGrass2::Do(), BEOrchardCrop::Do(), DK_SpringBarleySilage::Do(), DK_CatchCrop::Do(), DK_FodderBeet::Do(), DK_MaizeSilage::Do(), NLOrchardCrop::Do(), DK_OLupines::Do(), OWinterRye::Do(), DK_OSpringBarleyCloverGrass::Do(), DK_Legume_Beans::Do(), FI_SugarBeet::Do(), DE_OMaizeSilage::Do(), OOats::Do(), DE_OOats::Do(), DK_OptimalFlowerMix3::Do(), DE_OSpringRye::Do(), DK_OWinterRye::Do(), DK_SpringOats::Do(), DK_SpringOats_CC::Do(), DK_SugarBeet::Do(), DK_OCerealLegume_Whole::Do(), Maize::Do(), MaizeSilage::Do(), MaizeStrigling::Do(), DK_OLegume_Whole::Do(), DK_OLegumeCloverGrass_Whole::Do(), DK_OLegume_Whole_CC::Do(), DE_OMaize::Do(), DK_OptimalFlowerMix1::Do(), OTriticale::Do(), DK_OSpringBarley_CC::Do(), DE_OWinterWheat::Do(), DK_OWinterRye_CC::Do(), DK_Maize::Do(), NLMaizeSpring::Do(), Oats::Do(), OSpringBarleyExt::Do(), DK_OWinterBarley::Do(), UKBeans::Do(), BEMaizeSpring::Do(), DK_SpringWheat::Do(), DK_Legume_Whole::Do(), DK_OCerealLegume::Do(), OSpringBarley::Do(), DK_OSpringBarley::Do(), DK_OSugarBeet::Do(), SpringBarleySeed::Do(), FI_Potato_North::Do(), FieldPeas::Do(), FieldPeasStrigling::Do(), FieldPeasSilage::Do(), DK_OFodderBeet::Do(), OPotatoes::Do(), SpringBarleyCloverGrassStrigling::Do(), BEMaizeCC::Do(), DummyCropPestTesting::Do(), DE_OWinterRape::Do(), FI_StarchPotato_North::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), FI_PotatoIndustry_North::Do(), OFodderBeet::Do(), SpringBarleyCloverGrass::Do(), FI_Potato_South::Do(), FI_PotatoIndustry_South::Do(), FI_StarchPotato_South::Do(), OWinterRape::Do(), PLFodderLucerne2::Do(), BEBeetSpring::Do(), DK_OSpringOats::Do(), DK_OSpringWheat::Do(), BEMaize::Do(), PTOliveGroveTradOrganic::Do(), Triticale::Do(), UKBeet::Do(), Carrots::Do(), DE_OCabbages::Do(), NLBeetSpring::Do(), NLMaize::Do(), DE_OSugarBeet::Do(), DK_OVegSeeds::Do(), DK_SpringBarleyCloverGrass::Do(), DE_OBushFruitPerm::Do(), DK_OSpringOats_CC::Do(), UKSpringBarley::Do(), UKWinterBarley::Do(), DK_WinterFodderGrass::Do(), NLCarrotsSpring::Do(), DK_OMaizeSilage::Do(), DK_OMaize::Do(), DE_OPotatoes::Do(), BEBeet::Do(), DK_OWinterRape::Do(), DK_SpringBarley::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), DK_SpringBarley_CC::Do(), DK_OCabbages::Do(), DK_OEnergyCrop_Perm::Do(), NLBeet::Do(), DE_OCarrots::Do(), NLGrassGrazedExtensive2::Do(), NLPermanentGrassGrazedExtensive::Do(), DK_OSpringBarleySilage::Do(), SetAside::Do(), DK_SpringFodderGrass::Do(), DK_WinterCloverGrassGrazedSown::Do(), DK_OCarrots::Do(), NLCarrots::Do(), NLGrassGrazedExtensive1Spring::Do(), NLGrassGrazedExtensiveLast::Do(), NLCabbageSpring::Do(), NLSpringBarleySpring::Do(), DK_WinterBarley::Do(), PotatoesIndustry::Do(), SugarBeet::Do(), BEWinterBarleyCC::Do(), BEWinterBarley::Do(), FodderBeet::Do(), NorwegianPotatoes::Do(), Potatoes::Do(), PTOliveGroveIntensive::Do(), DKOBroadBeans_test::Do(), BEWinterWheatCC::Do(), DK_EnergyCrop_Perm::Do(), PTCorkOak::Do(), DK_VegSeeds::Do(), BEWinterWheat::Do(), NLCabbage::Do(), NLGrassGrazedExtensive1::Do(), SpringBarleySKManagement::Do(), DK_WinterRye_CC::Do(), DK_WinterRye::Do(), DK_Carrots_Spring::Do(), SpringBarleySilage::Do(), DK_OGrassGrazed_Perm::Do(), PLCarrots::Do(), PTSetAside::Do(), SpringBarleySpr::Do(), UKWinterWheat::Do(), WinterRyeStrigling::Do(), DK_Carrots::Do(), DK_GrassGrazed_Perm::Do(), NLSpringBarley::Do(), WinterRye::Do(), DE_OPermanentGrassLowYield::Do(), BEGrassGrazed1Spring::Do(), DE_PermanentGrassLowYield::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingSingle::Do(), TestCrop::Do(), UKWinterRape::Do(), DK_Cabbages::Do(), SpringBarleyStriglingCulm::Do(), NLWinterWheat::Do(), DK_OMixedVeg::Do(), PLSpringBarleySpr::Do(), BEGrassGrazed1::Do(), PTBeans::Do(), BEGrassGrazed2::Do(), PTOliveGroveSuperIntensive::Do(), PTTurnipGrazed::Do(), BEGrassGrazedLast::Do(), FI_OCaraway2::Do(), PTCabbage_Hort::Do(), DK_OPotatoIndustry::Do(), DK_OPotato::Do(), DK_OPotatoSeed::Do(), PTCabbage::Do(), DE_PermanentGrassGrazed::Do(), PTOtherDryBeans::Do(), SpringBarley::Do(), DK_WinterWheat::Do(), DK_WinterWheat_CC::Do(), PLFodderLucerne1::Do(), PTHorticulture::Do(), FR_Grassland_Perm::Do(), UKPotatoes::Do(), DK_Potato::Do(), UKPermanentGrass::Do(), FI_GreenFallow_1year::Do(), DE_GreenFallow_1year::Do(), PTOliveGroveTraditional::Do(), PTPotatoes::Do(), UKTempGrass::Do(), FI_NaturalGrassland_Perm::Do(), DK_OBushFruit_Perm2::Do(), DE_HerbsPerennial_after1year::Do(), DE_OGreenFallow_1year::Do(), SpringRape::Do(), DE_OPermanentGrassGrazed::Do(), DK_OSeedGrassRye_Spring::Do(), PTOats::Do(), PTShrubPastures::Do(), FI_Caraway2::Do(), DK_CloverGrassGrazed1::Do(), DE_HerbsPerennial_1year::Do(), DK_MixedVeg::Do(), NLGrassGrazed2::Do(), NLPermanentGrassGrazed::Do(), DE_OHerbsPerennial_after1year::Do(), PLBeetSpr::Do(), FI_GreenFallow_Perm::Do(), WinterWheatStriglingCulm::Do(), NLGrassGrazed1Spring::Do(), NLGrassGrazedLast::Do(), DE_OHerbsPerennial_1year::Do(), PLBeans::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingSingle::Do(), DE_OGrasslandSilageAnnual::Do(), PTMaize_Hort::Do(), PTMaize::Do(), PTWinterRye::Do(), PTWinterWheat::Do(), PTWinterBarley::Do(), FI_BufferZone::Do(), FI_BufferZone_Perm::Do(), FI_NaturalGrassland::Do(), FI_OSpringBarley_Malt::Do(), ITGrassland::Do(), DK_SetAside::Do(), PTTriticale::Do(), PTCloverGrassGrazed2::Do(), PTFodderMix::Do(), DK_WinterRape::Do(), DK_OSetAside::Do(), WinterRape::Do(), DK_OSetAside_PerennialFlower::Do(), DK_OSetAside_SummerMow::Do(), PTGrassGrazed::Do(), DK_OSetAside_AnnualFlower::Do(), PTSorghum::Do(), PTYellowLupin::Do(), DK_PotatoSeed::Do(), WinterBarleyStrigling::Do(), BEPotatoesSpring::Do(), FI_OCaraway1::Do(), FI_OFabaBean::Do(), DE_BushFruitPerm::Do(), DE_Maize::Do(), NLGrassGrazed1::Do(), FI_GrasslandSilagePerennial1::Do(), FI_OSpringOats::Do(), FI_OSpringRape::Do(), FI_OSpringWheat::Do(), FI_OTurnipRape::Do(), FR_SpringBarley::Do(), DE_MaizeSilage::Do(), DE_OAsparagusEstablishedPlantation::Do(), DK_SetAside_SummerMow::Do(), OSpringBarleyPigs::Do(), DK_PotatoIndustry::Do(), FI_GrasslandPasturePerennial1::Do(), FI_GrasslandPasturePerennial2::Do(), FI_OSpringBarley_Fodder::Do(), FR_SpringOats::Do(), NLPotatoesSpring::Do(), PTRyegrass::Do(), WinterBarley::Do(), FI_GrasslandSilagePerennial2::Do(), DK_OOrchCherry::Do(), PLWinterRye::Do(), DE_SpringBarley::Do(), FI_FeedingGround::Do(), FI_TurnipRape::Do(), DK_OBushFruit_Perm1::Do(), FR_Sorghum::Do(), DK_OSpringFodderGrass::Do(), BEPotatoes::Do(), FI_GrasslandSilageAnnual::Do(), DE_AsparagusEstablishedPlantation::Do(), FR_Maize::Do(), FR_Maize_Silage::Do(), DK_OCloverGrassGrazed3::Do(), DK_OWinterWheat_CC::Do(), PLMaize::Do(), DK_OCloverGrassGrazed1::Do(), DK_OCloverGrassGrazed2::Do(), DK_OWinterWheat::Do(), NLPotatoes::Do(), PLMaizeSilage::Do(), PLSpringBarley::Do(), FI_FabaBean::Do(), FI_OWinterRye::Do(), FI_SpringRape::Do(), FR_WinterTriticale::Do(), NLTulips::Do(), FI_SpringBarley_Malt::Do(), DE_Legumes::Do(), FR_Sunflower::Do(), PLWinterTriticale::Do(), SE_SpringBarley::Do(), PTCloverGrassGrazed1::Do(), DE_Peas::Do(), FI_Caraway1::Do(), FI_OWinterWheat::Do(), DE_OWinterRye::Do(), DK_OOrchPear::Do(), DE_OTriticale::Do(), DK_OWinterFodderGrass::Do(), DE_WinterRye::Do(), DK_CloverGrassGrazed3::Do(), FI_SpringWheat::Do(), FI_SprSpringBarley_Fodder::Do(), DK_OWinterCloverGrassGrazedSown::Do(), PLBeet::Do(), DK_OOrchApple::Do(), DK_OOrchardCrop_Perm::Do(), DK_OOrchOther::Do(), PLWinterBarley::Do(), DE_OWinterBarley::Do(), PLWinterWheat::Do(), DK_CloverGrassGrazed2::Do(), FI_SpringOats::Do(), DE_Carrots::Do(), PLSpringWheat::Do(), PLWinterWheatLate::Do(), FI_SpringBarley_Fodder::Do(), PTPermanentGrassGrazed::Do(), PLPotatoes::Do(), SE_WinterRape_Seed::Do(), DK_BushFruit_Perm1::Do(), FR_SpringWheat::Do(), DE_Cabbage::Do(), DE_Oats::Do(), SE_WinterWheat::Do(), DE_WinterBarley::Do(), DE_SpringRye::Do(), DK_SeedGrassRye_Spring::Do(), PLWinterRape::Do(), PTVineyards::Do(), FI_WinterWheat::Do(), DE_GrasslandSilageAnnual::Do(), FR_WinterBarley::Do(), DK_BushFruit_Perm2::Do(), IRSpringBarley::Do(), IRSpringOats::Do(), IRWinterBarley::Do(), IRWinterOats::Do(), FR_Grassland::Do(), DE_Triticale::Do(), FI_WinterRye::Do(), DE_WinterWheatLate::Do(), IRSpringWheat::Do(), FR_WinterWheat::Do(), DE_WinterWheat::Do(), FR_WinterRape::Do(), FR_Potatoes::Do(), IRWinterWheat::Do(), DE_WinterRape::Do(), DE_Orchard::Do(), DK_SeedGrassFescue_Spring::Do(), WinterWheat::Do(), DE_SugarBeet::Do(), DK_OrchCherry::Do(), IRGrassland_no_reseed::Do(), DE_Potatoes::Do(), DK_OrchPear::Do(), DK_OrchOther::Do(), DK_OrchApple::Do(), DK_OrchardCrop_Perm::Do(), DE_PotatoesIndustry::Do(), DE_OOrchard::Do(), IRGrassland_reseed::Do(), ITOrchard::Do(), DK_OChristmasTrees_Perm::Do(), ITOOrchard::Do(), DK_ChristmasTrees_Perm::Do(), Vole_Population_Manager::DoFirst(), FarmManager::DumpFarmrefs(), SkTerritories::DumpMapGraphics(), Landscape::DumpMapGraphics(), Landscape::DumpMapInfoByArea(), PesticideMap::DumpPMap(), Configurator::DumpSymbols(), Landscape::DumpTreatCounters(), Skylark_Clutch::EndStep(), Landscape::EventDump(), Landscape::EventDumpPesticides(), Landscape::EventtypeToString(), Configurator::ExtractString(), Farm::FarmActions(), Landscape::FarmtypeToString(), Probe_Data::FileAppendOutput(), FarmManager::FindClosestFarm(), FarmManager::FindClosestFarmOpenness(), FarmManager::FindClosestFarmOpennessProb(), FarmManager::FindClosestFarmOpennessProbNearRoostIsBest(), FarmManager::FindClosestFarmOpennessProbSmallIsBest(), FarmManager::FindFarmWithOpenness(), FarmManager::FindFarmWithRandom(), Skylark_Population_Manager::FledgelingProbeOutput(), Landscape::ForceArea(), RasterMap::Get(), probability_distribution::Get(), GeneticMaterial1616::GetAllele(), FarmManager::GetCropMgtPlansIndex(), FarmManager::GetFarmCentroid(), FarmManager::GetFarmNoLookupIndex(), FarmManager::GetFarmPtr(), CropRotation::GetFirstCrop(), THare_Population_Manager::GetInterference(), CropRotation::GetNextCrop(), GetProbeInput_ini(), FarmManager::GetRenumberedFarmRef(), Landscape::GISASCII_Output(), Landscape::GrainDump(), Landscape::IncTreatCounter(), RasterMap::Init(), TrapLineMap::Init(), Vole_Population_Manager::Init(), Osmia_Female::Init(), THare_Population_Manager::Init(), Farm::InitiateManagement(), Osmia_Nest_Manager::InitOsmiaBeeNesting(), Beetle_Egg_List::InternalPesticideHandlingAndResponse(), Beetle_Larvae::InternalPesticideHandlingAndResponse(), Beetle_Pupae::InternalPesticideHandlingAndResponse(), Beetle_Adult::InternalPesticideHandlingAndResponse(), Landscape::Landscape(), Landscape::NewElement(), Vole_JuvenileMale::OnFarmEvent(), Vole_JuvenileFemale::OnFarmEvent(), Probe_Data::OpenFile(), Probe_Data::OpenForAppendToFile(), Vole_Population_Manager::OpenSexRatiosProbe(), SubPopulation_Population_Manager::openSubpopulationBaseProbeFile(), Skylark_Population_Manager::OpenTheBreedingPairsProbe(), Skylark_Population_Manager::OpenTheBreedingSuccessProbe(), Population_Manager::OpenTheMonthlyRipleysOutputProbe(), Population_Manager::OpenTheReallyBigProbe(), Population_Manager::OpenTheRipleysOutputProbe(), Configurator::ParseCfgLine(), PlantGrowthData::PlantGrowthData(), poecilusCupreus_tole_movemap_init(), PollenNectarDevelopmentData::PollenNectarDevelopmentData(), Landscape::PolysDump(), Landscape::PolysRenumber(), Landscape::PolysValidate(), Landscape::PolytypeToString(), SkTerritories::PreFillQualGrid(), SkTerritories::PreProcessLandscape2(), FarmManager::Print_FarmerAttributes(), PesticideTable::PrintFTable(), PesticideTable::PrintHTable(), PesticideTable::PrintITable(), FarmManager::PrintLocationAndArea(), probability_distribution::probability_distribution(), RasterMap::RasterMap(), VegElement::ReadBugPercentageFile(), FarmManager::ReadCropManagementNorms(), FarmManager::ReadCropYieldReturns(), FarmManager::ReadFarmerAttributes(), FarmManager::ReadFarmFunctionsCB(), PollenNectarDevelopmentData::ReadFlowerNumberCrop(), Landscape::ReadFlowerSpeciesComp(), Landscape::ReadPolys1(), Landscape::ReadPolys2(), Farm::ReadRotation(), Configurator::ReadSymbols(), Weather::readWeatherFile(), Weather::readWeatherFileHourly(), Pesticide::ReducePlantPesticide(), Farm::RemoveField(), Landscape::RemoveSmallPolygons(), Population_Manager::Run(), Pesticide::SavePPM(), CfgInt::set(), CfgFloat::set(), GeneticMaterial1616::SetAllele(), Configurator::SetCfgArrayDouble(), Configurator::SetCfgArrayDoubleCsv(), Configurator::SetCfgArrayInt(), Configurator::SetCfgArrayIntCsv(), Configurator::SetCfgBool(), Configurator::SetCfgFloat(), Configurator::SetCfgFunction(), Configurator::SetCfgGatekeeper(), Configurator::SetCfgInt(), Configurator::SetCfgStr(), PlantGrowthData::SetVegNum(), spider_tole_movemap_init_Erigone(), spider_tole_movemap_init_Oedothorax(), Skylark_Female::st_Finding_Territory(), Skylark_Female::st_Laying(), Skylark_Female::st_MakingNest(), Crop::StartUpCrop(), Beetle_Egg_List::Step(), Beetle_Larvae::Step(), Beetle_Adult::Step(), Configurator::StoreFromConfig(), Calendar::SunRiseTime(), Calendar::SunSetTime(), Landscape::SupplyMonthName(), FarmManager::TranslateCropCodes(), LE_TypeClass::TranslateEleTypes(), LE_TypeClass::TranslateEleTypesFromString(), FarmManager::TranslateVegCodes(), LE_TypeClass::TranslateVegTypes(), UserDefinedFarm::UserDefinedFarm(), Landscape::VegDump(), PlantGrowthData::VegTypeToCurveNum(), Landscape::VegtypeToString(), vole_tole_assess_barrier(), vole_tole_move_quality(), vole_toletoc_asses_habitat_score(), Landscape::Warn(), Weather::Weather(), and probability_distribution::~probability_distribution().

◆ Warn() [3/4]

void MapErrorMsg::Warn ( std::string  a_msg1,
double  a_num 
)
138 {
139  FILE * EFile;
140  time_t aclock;
141  tm* newtime;
142  time( &aclock ); // Get time in seconds.
143  newtime=localtime( &aclock ); // Convert time to struct tm form.
144  // Print local time as a string.
145 
146  EFile=fopen(m_warnfile.c_str(), "a+" );
147  if ( !EFile ) {
148  fprintf(stderr, "MapErrorMsg::Warn(): Unable to open file"
149  " for error messages: %s\n", m_warnfile.c_str() );
150  exit(1);
151  }
152 
153  fprintf( EFile, "%s *****\n%s %g\n",
154  asctime(newtime), a_msg1.c_str(), a_num );
155  fflush( EFile );
156  fclose( EFile );
157  exit(0);
158 }

◆ Warn() [4/4]

void MapErrorMsg::Warn ( std::string  a_msg1,
std::string  a_msg2 
)
116 {
117  FILE * EFile;
118  time_t aclock;
119  tm* newtime;
120  time( &aclock ); // Get time in seconds.
121  newtime=localtime( &aclock ); // Convert time to struct tm form.
122  // Print local time as a string.
123 
124  EFile=fopen(m_warnfile.c_str(), "a+" );
125  if ( !EFile ) {
126  fprintf(stderr, "MapErrorMsg::Warn(): Unable to open file"
127  " for error messages: %s\n", m_warnfile.c_str() );
128  exit(1);
129  }
130 
131  fprintf( EFile, "%s *****\n%s %s\n",
132  asctime(newtime), a_msg1.c_str(), a_msg2.c_str() );
133  fflush( EFile );
134  fclose( EFile );
135 }

◆ WarnAddInfo() [1/2]

void MapErrorMsg::WarnAddInfo ( MapErrorState  a_level,
std::string  a_add1,
double  a_num 
)
182 {
183  if (a_level > m_level) return;
184  ofstream *EFile;
185  time_t aclock;
186  tm* newtime;
187  time(&aclock); // Get time in seconds.
188  newtime = localtime(&aclock); // Convert time to struct tm form.
189  // Print local time as a string.
190 
191  EFile = new ofstream(m_warnfile.c_str(), ios::app);
192  if (!EFile->is_open()) {
193  fprintf(stderr, "MapErrorMsg::Warn(): Unable to open file"
194  " for error messages: %s\n", m_warnfile.c_str());
195  exit(1);
196  }
197  (*EFile) << asctime(newtime)<<" *****\t"<<a_add1.c_str() << a_num << endl;
198  EFile->close();
199  delete EFile;
200 }

◆ WarnAddInfo() [2/2]

void MapErrorMsg::WarnAddInfo ( MapErrorState  a_level,
std::string  a_add1,
std::string  a_add2 
)
161 {
162  FILE * EFile;
163  time_t aclock;
164  tm* newtime;
165  time(&aclock); // Get time in seconds.
166  newtime = localtime(&aclock); // Convert time to struct tm form.
167  // Print local time as a string.
168 
169  if (a_level > m_level) return;
170  EFile = fopen(m_warnfile.c_str(), "a+");
171  if (!EFile) {
172  fprintf(stderr, "MapErrorMsg::Warn(): Unable to open file"
173  " for error messages: %s\n", m_warnfile.c_str());
174  exit(1);
175  }
176  fprintf(EFile, "%s *****\t%s%s\n", asctime(newtime), a_add1.c_str(), a_add2.c_str());
177  fflush(EFile);
178  fclose(EFile);
179 }

Referenced by VegElement::DoDevelopment(), g_init_random_seed_fnc(), RasterMap::Get(), RasterMap::Init(), Farm::InvIntPartition(), Landscape::Landscape(), Configurator::ParseCfgLine(), and Configurator::ShowIdType().

Member Data Documentation

◆ m_level

MapErrorState MapErrorMsg::m_level

◆ m_warnfile

std::string MapErrorMsg::m_warnfile

The documentation for this class was generated from the following files:
MapErrorMsg::m_level
MapErrorState m_level
Definition: MapErrorMsg.h:47
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
WARN_ALL
Definition: MapErrorMsg.h:40
MapErrorMsg::m_warnfile
std::string m_warnfile
Definition: MapErrorMsg.h:48
WARN_BUG
Definition: MapErrorMsg.h:34