Пример #1
0
        public static Grid Read(BinaryReader reader)
        {
            byte version = reader.ReadByte();

            switch (version)
            {
            case Version0:
            {
                string      title = reader.ReadString();
                SpecGrid    sg    = SpecGrid.Read(reader);
                Coord       c     = Coord.Read(reader);
                Zcorn       z     = Zcorn.Read(reader);
                Actnum      a     = Actnum.Read(reader);
                int         np    = reader.ReadInt32();
                List <Prop> ps    = new List <Prop>();
                for (int p = 0; p < np; ++p)
                {
                    ps.Add(Prop.Read(reader));
                }
                int            nw = reader.ReadInt32();
                List <Compdat> ws = new List <Compdat>();
                for (int w = 0; w < nw; ++w)
                {
                    ws.Add(Compdat.Read(reader));
                }
                return(new Grid(title, sg, c, z, a, ps, ws));
            }

            default:
                return(new Grid());
            }
        }
Пример #2
0
 void Clear()
 {
     SpecGrid = new SpecGrid();
     //MapAxes = new MapAxes();
     Coord  = new Coord();
     Zcorn  = new Zcorn();
     Actnum = new Actnum();
     Props  = new List <Prop>();
     Title  = "Grid_" + (Namber++).ToString();
     Wells  = new List <Compdat>();
 }
Пример #3
0
 void Init(string title, SpecGrid sg, Coord c, Zcorn z, Actnum a, List <Prop> ps, List <Compdat> ws)
 {
     Clear();
     Title    = title;
     SpecGrid = sg;
     Coord    = c;
     Zcorn    = z;
     Actnum   = a;
     Props    = ps;
     Wells    = ws;
 }
Пример #4
0
        public bool Read(string file, FileType type)
        {
            SpecGrid = new SpecGrid(file, type);
            MapAxes ma = new MapAxes(file, type);

            Coord  = new Coord(SpecGrid, ma, file, type);
            Zcorn  = new Zcorn(SpecGrid, file, type);
            Actnum = new Actnum(SpecGrid, file, type);
            if (Specified())
            {
                return(true);
            }
            Clear();
            return(false);
        }
Пример #5
0
 public void Write(BinaryWriter writer)
 {
     writer.Write(Version0);
     writer.Write(Title);
     SpecGrid.Write(writer);
     Coord.Write(writer);
     Zcorn.Write(writer);
     Actnum.Write(writer);
     writer.Write(Props.Count);
     foreach (Prop p in Props)
     {
         p.Write(writer);
     }
     writer.Write(Wells.Count);
     foreach (Compdat well in Wells)
     {
         well.Write(writer);
     }
 }
Пример #6
0
 public Grid(string title, SpecGrid sg, Coord c, Zcorn z, Actnum a, List <Prop> ps, List <Compdat> ws)
 {
     Init(title, sg, c, z, a, ps, ws);
 }
Пример #7
0
        /*
         * public Cell GlobalCell(int i, int j, int k)
         * {
         *  //float[,] matrix = MapAxes.Matrix();
         *  Cell cell = new Cell();
         *  cell.Act = Actnum.Values[i, j, k];
         *  cell.Corners[0] = Coord.GlobalPillar(i + 0, j + 0).Point3D(Zcorn.Items[i, j, k].Corners[0]);
         *  cell.Corners[1] = Coord.GlobalPillar(i + 1, j + 0).Point3D(Zcorn.Items[i, j, k].Corners[1]);
         *  cell.Corners[2] = Coord.GlobalPillar(i + 0, j + 1).Point3D(Zcorn.Items[i, j, k].Corners[2]);
         *  cell.Corners[3] = Coord.GlobalPillar(i + 1, j + 1).Point3D(Zcorn.Items[i, j, k].Corners[3]);
         *  cell.Corners[4] = Coord.GlobalPillar(i + 0, j + 0).Point3D(Zcorn.Items[i, j, k].Corners[4]);
         *  cell.Corners[5] = Coord.GlobalPillar(i + 1, j + 0).Point3D(Zcorn.Items[i, j, k].Corners[5]);
         *  cell.Corners[6] = Coord.GlobalPillar(i + 0, j + 1).Point3D(Zcorn.Items[i, j, k].Corners[6]);
         *  cell.Corners[7] = Coord.GlobalPillar(i + 1, j + 1).Point3D(Zcorn.Items[i, j, k].Corners[7]);
         *  return cell;
         * }
         */



        public bool Specified()
        {
            return(SpecGrid.Specified() && Coord.Specified() && Zcorn.Specified() && Actnum.Specified());
        }