예제 #1
0
        /// <summary>
        /// Method is called when <see cref="IMike1DController.ControllerEvent"/> is triggered.
        /// </summary>
        private void CatchmentUrbanSnowPlowingControllerEvent(object sender, ControllerEventArgs e)
        {
            // Listen for Prepared event (i.e. model is ready to run)
            if (e.State == ControllerState.Prepared)
            {
                Mike1DController controller = (Mike1DController)sender;

                // Find all urban catchments, loop over all catchments
                foreach (ICatchment catchment in controller.Mike1DData.RainfallRunoffData.Catchments)
                {
                    // Check if it is an urban catchment
                    if (catchment is CatchmentAbstractUrban)
                    {
                        CatchmentAbstractUrban catchmentAbstractUrban = catchment as CatchmentAbstractUrban;
                        // Check if snow-module is enabled.
                        if (catchmentAbstractUrban.UseSnowModule)
                        {
                            // Set up plowing for urban catchment
                            UrbanCatchmentPlowing urbanCatchmentPlowing = new UrbanCatchmentPlowing(catchmentAbstractUrban);
                            catchment.PostTimeStepEvent += urbanCatchmentPlowing.Plowing;
                        }
                    }
                }
            }
        }
예제 #2
0
            public UrbanCatchmentPlowing(CatchmentAbstractUrban urbanCatchment)
            {
                _urbanCatchment = urbanCatchment;
                _lastPlowed     = DateTime.MinValue;

                if (_urbanCatchment is CatchmentKinematicWave)
                {
                    // Circumventing dry-jumping when there is snow on the catchment
                    CatchmentKinematicWave catchmentKinematicWave = (CatchmentKinematicWave)_urbanCatchment;
                    _timeStepDry = catchmentKinematicWave.TimeStepDry;
                }
            }