예제 #1
0
 public override bool Load(ICancelProgressHandler progress)
 {
     _ProgressHandler = progress;
     if (File.Exists(FileName))
     {
         try
         {
             FHDFile fhd = new FHDFile(FileName, Owner.Grid as IRegularGrid);
             fhd.DataCube        = this.DataCube;
             fhd.Variables       = this.Variables;
             fhd.MaxTimeStep     = this.MaxTimeStep;
             fhd.NumTimeStep     = this.NumTimeStep;
             fhd.IsLoadDepth     = LoadAsDepth;
             fhd.Loading        += fhd_Loading;
             fhd.DataCubeLoaded += fhd_DataCubeLoaded;
             //TODO: require modifcation
             fhd.LoadDataCube();
             return(true);
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }
 public override bool Load(int var_index, ICancelProgressHandler progress)
 {
     _ProgressHandler = progress;
     if (File.Exists(FileName))
     {
         var grid = Owner.Grid as MFGrid;
         if (DataCube == null || DataCube.Size[1] != StepsToLoad)
         {
             DataCube = new DataCube <float>(Variables.Length, StepsToLoad, grid.ActiveCellCount)
             {
                 Name           = "vert_dis",
                 TimeBrowsable  = true,
                 AllowTableEdit = false
             };
         }
         DataCube.Topology = (this.Grid as RegularGrid).Topology;
         FHDFile fhd = new FHDFile(FileName, grid);
         fhd.Variables       = this.Variables;
         fhd.Variables       = this.Variables;
         fhd.MaxTimeStep     = this.MaxTimeStep;
         fhd.NumTimeStep     = this.NumTimeStep;
         fhd.DataCube        = this.DataCube;
         fhd.Loading        += fhd_Loading;
         fhd.DataCubeLoaded += fhd_DataCubeLoaded;
         fhd.LoadFailed     += fhd_LoadFailed;
         fhd.LoadVertDis(var_index);
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #3
0
        public override bool Load(int var_index, ICancelProgressHandler progress)
        {
            _ProgressHandler = progress;
            var list = TimeService.GetIOTimeFromFile((Owner as Modflow).IOLogFile);

            if (list.Count > 0)
            {
                TimeService.IOTimeline = list;
                NumTimeStep            = list.Count;
            }
            if (File.Exists(LocalFileName))
            {
                try
                {
                    var grid = Owner.Grid as MFGrid;
                    if (DataCube == null || DataCube.Size[1] != StepsToLoad)
                    {
                        DataCube = new DataCube <float>(Variables.Length, StepsToLoad, grid.ActiveCellCount, true)
                        {
                            Name           = "FHD",
                            TimeBrowsable  = true,
                            AllowTableEdit = false
                        };
                        DataCube.Variables = this.Variables;
                    }
                    DataCube.Topology  = (this.Grid as RegularGrid).Topology;
                    DataCube.DateTimes = this.TimeService.IOTimeline.Take(StepsToLoad).ToArray();
                    FHDFile fhd = new FHDFile(LocalFileName, grid);
                    fhd.Variables       = this.Variables;
                    fhd.MaxTimeStep     = this.StepsToLoad;
                    fhd.NumTimeStep     = this.NumTimeStep;
                    fhd.DataCube        = this.DataCube;
                    fhd.IsLoadDepth     = LoadAsDepth;
                    fhd.Loading        += fhd_Loading;
                    fhd.DataCubeLoaded += fhd_DataCubeLoaded;
                    fhd.LoadFailed     += fhd_LoadFailed;
                    fhd.LoadDataCube(var_index);
                    return(true);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                    OnLoadFailed(ex.Message, progress);
                    return(false);
                }
            }
            else
            {
                OnLoadFailed("The file does not exist: " + LocalFileName, progress);
                return(false);
            }
        }
        public override bool Scan()
        {
            var grid = Owner.Grid as MFGrid;
            var vv   = new string[grid.ActualLayerCount + 1];

            vv[0] = "Total subsidence";
            for (int ll = 1; ll <= grid.ActualLayerCount; ll++)
            {
                vv[ll] = string.Format("Layer {0} Vert Disp", ll);
            }
            FHDFile fhd = new FHDFile(FileName, Owner.Grid as IRegularGrid);

            fhd.Scan();
            this.NumTimeStep = fhd.NumTimeStep;
            Variables        = vv;

            _StartLoading = TimeService.Start;
            MaxTimeStep   = NumTimeStep;
            return(true);
        }
 public override bool Load(ICancelProgressHandler progress)
 {
     _ProgressHandler = progress;
     if (File.Exists(FileName))
     {
         FHDFile fhd = new FHDFile(FileName, Owner.Grid as IRegularGrid);
         fhd.DataCube        = this.DataCube;
         fhd.Variables       = this.Variables;
         fhd.MaxTimeStep     = this.MaxTimeStep;
         fhd.NumTimeStep     = this.NumTimeStep;
         fhd.Loading        += fhd_Loading;
         fhd.DataCubeLoaded += fhd_DataCubeLoaded;
         fhd.LoadFailed     += fhd_LoadFailed;
         //TODO: require modifcation
         fhd.LoadDataCube();
         return(true);
     }
     else
     {
         return(false);
     }
 }