Example #1
0
 public override void CompositeOutput(MFOutputPackage mfout)
 {
     if (ILPFCB > 0)
     {
         var mf       = Owner as Modflow;
         var cbc_info = (from info in mf.NameManager.MasterList where info.FID == this.ILPFCB select info).First();
         cbc_info.Name = CBCPackage.CBCName;
         var CBC = new CBCPackage()
         {
             Owner       = mf,
             Parent      = mfout,
             PackageInfo = cbc_info,
             FileName    = cbc_info.FileName
         };
         CBC.Initialize();
         var FlowField = new VelocityPackage()
         {
             Owner       = mf,
             CBCPackage  = CBC,
             PackageInfo = cbc_info,
             Parent      = mfout
         };
         FlowField.Initialize();
     }
 }
Example #2
0
 public override void Add(IPackage pck)
 {
     if (!this.Packages.Keys.Contains(pck.Name))
     {
         var pckinfo = pck.PackageInfo;
         pckinfo.FID           = this.NameManager.NextFID();
         pckinfo.FileName      = string.Format("{0}{1}{2}", InputDic, Project.Name, pckinfo.FileExtension);
         pckinfo.WorkDirectory = this.WorkDirectory;
         pck.FileName          = pckinfo.FileName;
         pck.Owner             = this;
         pck.Clear();
         pck.Initialize();
         pck.New();
         Packages.Add(pck.Name, pck);
         NameManager.Add(pckinfo);
         MFOutputPackage mfout = this.Select(MFOutputPackage.PackageName) as MFOutputPackage;
         (pck as IMFPackage).CompositeOutput(mfout);
         if (this.Owner != null)
         {
             Owner.OnPackageAdded(pck);
         }
         else
         {
             this.OnPackageAdded(pck);
         }
     }
 }
Example #3
0
        private void LoadPackages(ICancelProgressHandler progress)
        {
            MFOutputPackage mfout = new MFOutputPackage()
            {
                Owner = this
            };

            AddInSilence(mfout);

            foreach (var pck in Packages.Values)
            {
                if (pck is IMFPackage)
                {
                    try
                    {
                        if (pck.State != ModelObjectState.Ready)
                        {
                            pck.Clear();
                            pck.Initialize();
                            var loaded = pck.Load(progress);
                            if (loaded)
                            {
                                (pck as IMFPackage).CompositeOutput(mfout);
                                pck.AfterLoad();
                                // progress.Progress("Modflow", 1, "\t" + pck.Name + " loaded");
                            }
                            else
                            {
                                //var msg = string.Format("\tFailed to load {0}. Error message: {1}", pck.Name, pck.Message);
                                //progress.Progress("Modflow", 1, msg);
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        var msg = string.Format("\tFailed to load {0}. Error message: {1}", pck.Name, ex.Message);
                        progress.Progress("Modflow", 1, msg);
                    }
                }
            }
            var oc = (Packages[OCPackage.PackageName] as OCPackage);

            oc.CompositeOutput(mfout);
            mfout.Initialize();
        }
Example #4
0
        public override void CompositeOutput(MFOutputPackage mfout)
        {
            var mf = Owner as Modflow;

            if (this.HEAD_SAVE_UNIT > 0)
            {
                var fhd_info = (from pck in mf.NameManager.MasterList where pck.FID == this.HEAD_SAVE_UNIT select pck).First();
                fhd_info.Name = FHDPackage.PackageName;

                var FHD = new FHDPackage()
                {
                    Owner       = mf,
                    Parent      = this,
                    PackageInfo = fhd_info,
                    FileName    = fhd_info.FileName
                };
                mfout.Children.Add(FHD);
            }
        }
Example #5
0
        public override void CompositeOutput(MFOutputPackage mfout)
        {
            var mf = Owner as Modflow;

            if (this.OutputFIDs != null && this.OutputFIDs[7] > 0)
            {
                var sfr_info = (from info in mf.NameManager.MasterList where info.FID == this.OutputFIDs[7] select info).First();
                // sfr_info.ModuleName = SFRPackage.PackageName;
                var sfr_out = new SubOutputPackage()
                {
                    Owner       = mf,
                    PackageInfo = sfr_info,
                    FileName    = sfr_info.FileName,
                    Parent      = mfout
                };
                sfr_out.Initialize();
                // sfr_out.Scan();
            }
        }
Example #6
0
        public override void CompositeOutput(MFOutputPackage mfout)
        {
            var mf = Owner as Modflow;

            if (this.IUHOBSV > 0)
            {
                var pck_info = (from info in mf.NameManager.MasterList where info.FID == this.IUHOBSV select info).First();
                pck_info.ModuleName = HOBOutputPackage.PackageName;

                var hob_out = new HOBOutputPackage()
                {
                    Owner       = mf,
                    Parent      = this,
                    PackageInfo = pck_info,
                    FileName    = pck_info.FileName
                };
                hob_out.Initialize();
                mfout.Children.Add(hob_out);
            }
        }
Example #7
0
        public override bool New(ICancelProgressHandler progress)
        {
            bool            succ  = true;
            MFOutputPackage mfout = new MFOutputPackage()
            {
                Owner = this
            };

            AddInSilence(mfout);

            var list_info = _MFNameManager.GetList(100, Project.Name);

            _MFNameManager.Add(list_info);
            foreach (var pck in ModflowService.SupportedPackages)
            {
                if (pck.IsMandatory && pck is IMFPackage)
                {
                    var pckinfo = pck.PackageInfo;
                    pckinfo.FID           = _MFNameManager.NextFID();
                    pckinfo.FileName      = string.Format("{0}{1}{2}", InputDic, Project.Name, pckinfo.FileExtension);
                    pckinfo.WorkDirectory = this.WorkDirectory;
                    //must be called here
                    _MFNameManager.Add(pck.PackageInfo);
                    pck.FileName = pckinfo.FileName;
                    pck.Owner    = this;
                    pck.Clear();
                    pck.Initialize();
                    pck.New();
                    AddInSilence(pck);
                }
            }
            foreach (var pck in Packages.Values)
            {
                if (pck is IMFPackage)
                {
                    (pck as IMFPackage).CompositeOutput(mfout);
                }
            }
            mfout.Initialize();
            return(succ);
        }
Example #8
0
        public override void CompositeOutput(MFOutputPackage mfout)
        {
            var mf = Owner as Modflow;

            if (mf.Packages.Keys.Contains(LakePackage.PackageName))
            {
                LAKOutputPackage lake_out = new LAKOutputPackage()
                {
                    Owner  = mf,
                    Parent = mf.Packages[LakePackage.PackageName]
                };
                lake_out.Initialize();
                var uids = from vv in this.GagingInfo[0, "1", ":"] where vv < 0 select vv;
                foreach (var uid in uids)
                {
                    var finfo = (from info in mf.NameManager.MasterList where info.FID == -uid select info).First();
                    lake_out.OutputFilesInfo.Add(finfo);
                }
                mfout.Children.Add(lake_out);
            }
        }
Example #9
0
        public override void CompositeOutput(MFOutputPackage mfout)
        {
            var cbc = mfout.SelectChild(CBCPackage.CBCName);

            this.IWELCB = cbc.PackageInfo.FID;
        }
Example #10
0
 public virtual void CompositeOutput(MFOutputPackage mfout)
 {
 }