Ejemplo n.º 1
0
        public List <WellAllocation> GetAll(string uwi, DateTime start, DateTime end)
        {
            List <WellAllocation> allocations = new List <WellAllocation>();
            WebImporterWrapper    wi          = new WebImporterWrapper(dcInfo);

            try
            {
                DataTable dt;
                if (frequency == Frequency.Daily)
                {
                    dt = wi.LoadDailyProduction(uwi);
                }
                else
                {
                    dt = wi.LoadMonthlyProduction(uwi);
                }
                foreach (DataRow dr in dt.Rows)
                {
                    var w = this.WellAllocationFromRow(dr);
                    allocations.Add(w);
                }
            }
            catch (Exception e)
            {
                PetrelLogger.InfoOutputWindow("Failed to load wells: " + e.ToString());
            }
            return(allocations);
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            WebImporterWrapper wi = new WebImporterWrapper(this.WebServerTextBox.Text, this.WebServerUTextBox.Text, this.WebServerPTextBox.Text);

            if (wi.TestWebServer())
            {
                MessageBox.Show("Successfully connected to eFieldpro web server.", "Fieldpro connector");
            }
            else
            {
                MessageBox.Show("Failed to connect to eFieldpro web server.", "Fieldpro connector");
            }
        }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            WellRoot           wellRoot     = WellRoot.Get(PetrelProject.PrimaryProject);
            BoreholeCollection boreholeColl = wellRoot.BoreholeCollection;
            string             WellTextData = "";
            string             TrajTextData = "";

            foreach (Borehole bh in boreholeColl)
            {
                bool bok = false;
                foreach (object itemChecked in WellsList.CheckedItems)
                {
                    if (itemChecked.ToString() == bh.Name)
                    {
                        bok = true;
                        break;
                    }
                }
                if (!bok)
                {
                    continue;
                }
                PetrelLogger.InfoOutputWindow("Loading: " + bh.Name);
                Well w = WellsImporter.Borehole2Well(bh);
                WellTextData += w.Serialize() + Environment.NewLine;

                IEnumerable <TrajectoryRecord> ie = bh.Trajectory.Records;
                foreach (TrajectoryRecord r in ie)
                {
                    WellTrajectory t = new WellTrajectory(r);
                    TrajTextData += t.Serialize(bh.Name) + Environment.NewLine;
                }
            }
            if (!string.IsNullOrEmpty(WellTextData))
            {
                string datafile = System.IO.Path.GetTempPath() + "petrelwells.txt";
                System.IO.File.WriteAllText(datafile, Well.TxtHeader + Environment.NewLine + WellTextData);
                WebImporterWrapper wi = new WebImporterWrapper(WebConfiguration.Current);
                int id = wi.UploadWells(datafile);
            }
            if (!string.IsNullOrEmpty(TrajTextData))
            {
                string datafile = System.IO.Path.GetTempPath() + "petreltraj.txt";
                System.IO.File.WriteAllText(datafile, WellTrajectory.TxtHeader + Environment.NewLine + TrajTextData);
                WebImporterWrapper wi = new WebImporterWrapper(WebConfiguration.Current);
                int id = wi.UploadTraj(datafile);
            }
        }
Ejemplo n.º 4
0
        public List <Well> GetAll()
        {
            List <Well>        wells = new List <Well>();
            WebImporterWrapper wi    = new WebImporterWrapper(dcInfo);

            try
            {
                DataTable dt = wi.LoadWells();
                foreach (DataRow dr in dt.Rows)
                {
                    var w = this.WellFromRow(dr);
                    wells.Add(w);
                }
            }
            catch (Exception e)
            {
                PetrelLogger.InfoOutputWindow("Failed to load wells: " + e.ToString());
            }
            return(wells);
        }