Пример #1
0
    public void OnPrepare()
    {
        Util.Debug("\r\nPREPARE=%s", Today.ToString("d/M/yyyy"));
        Util.Debug("       =%i", Today.DayOfYear);

        foreach (Organ1 Organ in Organ1s)
        {
            Organ.OnPrepare();
        }

        NStress.DoPlantNStress();
        RadiationPartitioning.DoRadiationPartition();
        foreach (Organ1 Organ in Organ1s)
        {
            Organ.DoPotentialRUE();
        }

        // Calculate Plant Water Demand
        double SWDemandMaxFactor = EOCropFactor * EO;

        foreach (Organ1 Organ in Organ1s)
        {
            Organ.DoSWDemand(SWDemandMaxFactor);
        }

        DoNDemandEstimate();

        // PUBLISH NewPotentialGrowth event.
        NewPotentialGrowthType NewPotentialGrowthData = new NewPotentialGrowthType();

        NewPotentialGrowthData.frgr = (float)Math.Min(Math.Min(TempStress.Value, NStress.Photo),
                                                      Math.Min(SWStress.OxygenDeficitPhoto, 1.0 /*PStress.Photo*/));    // FIXME
        NewPotentialGrowthData.sender = Name;
        NewPotentialGrowth.Invoke(NewPotentialGrowthData);
        Util.Debug("NewPotentialGrowth.frgr=%f", NewPotentialGrowthData.frgr);
        //Prepare_p();   // FIXME
    }