Example #1
0
 internal int GetPesticideIndex(HowLeakyEngineModule_Pesticide pest)
 {
     try
     {
         if (PesticideModules != null)
         {
             return(PesticideModules.IndexOf(pest));
         }
     }
     catch (Exception ex)
     {
         throw ErrorLogger.CreateException(ex);
     }
     return(0);
 }
Example #2
0
 //This function is called from the constructor - only need to call it once per HowLeaky Instance.
 public void BuildOutputDefinitions(string timeseriescsv, Dictionary <string, OutputAttributes> remapdict)
 {
     try
     {
         Definitions = new List <HowLeakyOutputDefinition>();
         if (ClimateModule != null)
         {
             LoadDefaultDefinitions(GetOutputProp(ClimateModule), "ClimateModule", remapdict);
         }
         if (SoilModule != null)
         {
             LoadDefaultDefinitions(GetOutputProp(SoilModule), "SoilModule", remapdict);
         }
         if (IrrigationModule != null)
         {
             LoadDefaultDefinitions(GetOutputProp(IrrigationModule), "IrrigationModule", remapdict);
         }
         if (PhosphorusModule != null)
         {
             LoadDefaultDefinitions(GetOutputProp(PhosphorusModule), "PhosphorusModule", remapdict);
         }
         if (NitrateModule != null)
         {
             LoadDefaultDefinitions(GetOutputProp(NitrateModule), "NitrateModule", remapdict);
         }
         if (SolutesModule != null)
         {
             LoadDefaultDefinitions(GetOutputProp(SolutesModule), "SolutesModule", remapdict);
         }
         if (VegetationModules != null && VegetationModules.Count > 0)
         {
             foreach (var veg in VegetationModules)
             {
                 LoadDefaultDefinitions2(GetOutputProp(veg), "VegetationModule", veg.GetName(), VegetationModules.IndexOf(veg), remapdict);
             }
         }
         if (PesticideModules != null && PesticideModules.Count > 0)
         {
             foreach (var pest in PesticideModules)
             {
                 LoadDefaultDefinitions2(GetOutputProp(pest), "PesticideModule", pest.GetName(), PesticideModules.IndexOf(pest), remapdict);
             }
         }
         if (TillageModules != null && TillageModules.Count > 0)
         {
             foreach (var till in TillageModules)
             {
                 LoadDefaultDefinitions2(GetOutputProp(till), "TillageModule", till.InputModel.Name, TillageModules.IndexOf(till), remapdict);
             }
         }
         SelectTimeSeries(timeseriescsv);
         AssignDelegates();
     }
     catch (Exception ex)
     {
         throw ErrorLogger.CreateException(ex);
     }
 }