Example #1
0
        private WellAllocation WellAllocationFromRow(DataRow r)
        {
            WellAllocation alloc = new WellAllocation();

            alloc.OperativeDate = Convert.ToDateTime(r["DATE"]);
            var dbOil   = r["OIL"];   // In bbls
            var dbGas   = r["GAS"];   // In Mscf
            var dbWater = r["WATER"]; // In bbls
            var dUptime = r["UPTIME"];

            alloc.Oil_Bbls      = DBNull.Value.Equals(dbOil) ? 0.0 : double.Parse(dbOil.ToString());
            alloc.Gas_Mscf      = DBNull.Value.Equals(dbGas) ? 0.0 : double.Parse(dbGas.ToString());
            alloc.Water_Bbls    = DBNull.Value.Equals(dbWater) ? 0.0 : double.Parse(dbWater.ToString());
            alloc.EffectiveTime = DBNull.Value.Equals(dUptime) ? 0.0 : double.Parse(dUptime.ToString());

            return(alloc);
        }
Example #2
0
        private void ImportObservedData()
        {
            WellRoot        wellRoot        = WellRoot.Get(PetrelProject.PrimaryProject);
            ObservedDataSet observedDataSet = EnsureDailyDataSet();
            IProgress       p = PetrelLogger.NewProgress(0, wellRoot.BoreholeCollection.Count, ProgressType.Cancelable, Cursors.WaitCursor);

            using (p)
            {
                p.SetProgressText("Importing well allocations...");
                foreach (var well in wellRoot.BoreholeCollection)
                {
                    var allocations = WellAllocation.Broker(frequency).GetAll(well.UWI, start, end);
                    ImportObservedDataForWell(well, allocations, observedDataSet);
                    p.ProgressStatus = p.ProgressStatus + 1;
                }
            }
        }