예제 #1
0
        protected virtual void DispatchResource(Earthquake quake, string incidentData, string facilityData, string outputFolder)
        {
            _dispatcher = new Dispatcher();
            _dispatcher.OutputFolder = outputFolder;
            if (_dispatcher.Setup(quake, facilityData, incidentData))
            {
                RefugeeSiteCol siteCol = GetSiteCol();
                _dispatcher.SetReportName(siteCol);
                RepositoryCol repoCol = GetRepoCol();

                SupplyNetwork supplyNetwork = new SupplyNetwork();
                supplyNetwork.SetLocations(siteCol, repoCol, _dispatcher.RoadNetwork);
                supplyNetwork.Init(_dispatcher.GetRoutesClass());

                foreach (var site in siteCol.Sites)
                {
                    supplyNetwork.SupplyResource(site);
                }
                _dispatcher.StoreResult(supplyNetwork.Routes, repoCol, siteCol);
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
            }
            else
            {
                this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            }
        }
        protected override void DispatchResource(Earthquake quake, string incidentData, string facilityData, string outputFolder)
        {
            _dispatcher = new Dispatcher();
            _dispatcher.OutputFolder = outputFolder;
            if (_dispatcher.Setup(quake, facilityData, incidentData))
            {
                _dispatcher.SetReportName("燃气抢修组");

                //RefugeeSiteCol siteCol = GetSiteCol();
                //RepositoryCol repoCol = GetRepoCol();

                SupplyNetwork supplyNetwork = new SupplyNetwork();
                supplyNetwork.Init(_dispatcher.GetRoutesClass());

                //车
                RepositoryCol repoCol = new RepositoryCol();
                repoCol.Setup(_dispatcher.RepoFeatureClass, RepositoryCol.GasCarField);
                RefugeeSiteGasCarCol siteCol = new RefugeeSiteGasCarCol();
                siteCol.Setup(_dispatcher);

                supplyNetwork.SetLocations(siteCol, repoCol, _dispatcher.RoadNetwork);

                foreach (var site in siteCol.Sites)
                {
                    supplyNetwork.SupplyResource(site);
                }

                //人
                repoCol = new RepositoryCol();
                repoCol.Setup(_dispatcher.RepoFeatureClass, RepositoryCol.GasManField);
                RefugeeSiteGasManCol siteManCol = new RefugeeSiteGasManCol();
                siteManCol.Setup(_dispatcher);

                supplyNetwork.SetLocations(siteManCol, repoCol, _dispatcher.RoadNetwork);

                try
                {
                    foreach (var site in siteCol.Sites)
                    {
                        supplyNetwork.SupplyResource(site);
                    }
                }
                catch (Exception ex)
                {
                }
                _dispatcher.StoreResult(supplyNetwork.Routes, repoCol, siteCol);
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
            }
            else
            {
                this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            }
        }