private static WitsmlLogs CreateLogQuery(CreateLogJob job, WitsmlWellbore targetWellbore) { var indexType = job.LogObject.IndexCurve == IndexType.Depth.ToString() ? IndexType.Depth : IndexType.Time; var unit = indexType == IndexType.Depth ? DepthUnit.Meter.ToString() : Unit.TimeUnit.ToString(); return(new WitsmlLogs { Logs = new WitsmlLog { UidWell = targetWellbore.UidWell, NameWell = targetWellbore.NameWell, UidWellbore = targetWellbore.Uid, NameWellbore = targetWellbore.Name, Uid = job.LogObject.Uid, Name = job.LogObject.Name, IndexType = indexType == IndexType.Depth ? WitsmlLog.WITSML_INDEX_TYPE_MD : WitsmlLog.WITSML_INDEX_TYPE_DATE_TIME, IndexCurve = new WitsmlIndexCurve() { Value = indexType.ToString() }, LogCurveInfo = new WitsmlLogCurveInfo { Uid = Guid.NewGuid().ToString(), Mnemonic = indexType.ToString(), Unit = unit, TypeLogData = indexType == IndexType.Depth ? WitsmlLogCurveInfo.LOG_DATA_TYPE_DOUBLE : WitsmlLogCurveInfo.LOG_DATA_TYPE_DATETIME }.AsSingletonList() }.AsSingletonList() }); }
private void ShowDetailsOfWellbore() { listViewDetail.Items.Clear(); listViewDetail.BeginUpdate(); foreach (var wellbore in wellbores) { if (wellbore.getId() == listViewWellbore.SelectedItems[0].SubItems[1].Text) { selectedWellbore = wellbore; ListViewItem item = new ListViewItem(); item.Text = "Name"; ListViewItem.ListViewSubItem subitem = new ListViewItem.ListViewSubItem(); subitem.Text = wellbore.getName(); item.SubItems.Add(subitem); listViewDetail.Items.Add(item); item = new ListViewItem(); item.Text = "Kickoff time"; subitem = new ListViewItem.ListViewSubItem(); subitem.Text = wellbore.getKickoffTime().ToString(); item.SubItems.Add(subitem); listViewDetail.Items.Add(item); } } listViewDetail.EndUpdate(); }
private static WitsmlLogs CreateCopyLogQuery(WitsmlLog log, WitsmlWellbore targetWellbore) { log.UidWell = targetWellbore.UidWell; log.NameWell = targetWellbore.NameWell; log.UidWellbore = targetWellbore.Uid; log.NameWellbore = targetWellbore.Name; log.CommonData.ItemState = string.IsNullOrEmpty(log.CommonData.ItemState) ? null : log.CommonData.ItemState; log.CommonData.SourceName = string.IsNullOrEmpty(log.CommonData.SourceName) ? null : log.CommonData.SourceName; log.LogData.Data = new List <WitsmlData>(); var copyLogQuery = new WitsmlLogs { Logs = new List <WitsmlLog> { log } }; return(copyLogQuery); }
private static WitsmlTrajectories CreateCopyTrajectoryQuery(WitsmlTrajectory trajectory, WitsmlWellbore targetWellbore) { trajectory.UidWell = targetWellbore.UidWell; trajectory.NameWell = targetWellbore.NameWell; trajectory.UidWellbore = targetWellbore.Uid; trajectory.NameWellbore = targetWellbore.Name; trajectory.CustomData ??= new WitsmlCustomData(); trajectory.CommonData.ItemState = string.IsNullOrEmpty(trajectory.CommonData.ItemState) ? null : trajectory.CommonData.ItemState; trajectory.CommonData.SourceName = string.IsNullOrEmpty(trajectory.CommonData.SourceName) ? null : trajectory.CommonData.SourceName; var copyTrajectoryQuery = new WitsmlTrajectories { Trajectories = new List <WitsmlTrajectory> { trajectory } }; return(copyTrajectoryQuery); }
public static WitsmlWellbores UpdateWitsmlWellbore(Wellbore wellbore) { var witsmlWellbore = new WitsmlWellbore { Uid = wellbore.Uid, UidWell = wellbore.WellUid }; if (!string.IsNullOrEmpty(wellbore.Name)) { witsmlWellbore.Name = wellbore.Name; } if (!string.IsNullOrEmpty(wellbore.Number)) { witsmlWellbore.Number = wellbore.Number; } if (!string.IsNullOrEmpty(wellbore.SuffixAPI)) { witsmlWellbore.SuffixAPI = wellbore.SuffixAPI; } if (!string.IsNullOrEmpty(wellbore.NumGovt)) { witsmlWellbore.NumGovt = wellbore.NumGovt; } if (wellbore.DTimeKickoff != null) { witsmlWellbore.DTimKickoff = ((DateTime)wellbore.DTimeKickoff).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.fffZ"); } if (wellbore.Md != null) { witsmlWellbore.Md = new WitsmlMeasuredDepthCoord { Uom = wellbore.Md.Uom, Value = wellbore.Md.Value.ToString(CultureInfo.InvariantCulture) } } ; if (wellbore.Tvd != null) { witsmlWellbore.Tvd = new WitsmlWellVerticalDepthCoord { Uom = wellbore.Tvd.Uom, Value = wellbore.Tvd.Value.ToString(CultureInfo.InvariantCulture) } } ; if (wellbore.MdKickoff != null) { witsmlWellbore.MdKickoff = new WitsmlMeasuredDepthCoord { Uom = wellbore.MdKickoff.Uom, Value = wellbore.MdKickoff.Value.ToString(CultureInfo.InvariantCulture) } } ; if (wellbore.TvdKickoff != null) { witsmlWellbore.TvdKickoff = new WitsmlWellVerticalDepthCoord { Uom = wellbore.TvdKickoff.Uom, Value = wellbore.TvdKickoff.Value.ToString(CultureInfo.InvariantCulture) } } ; if (wellbore.MdPlanned != null) { witsmlWellbore.MdPlanned = new WitsmlMeasuredDepthCoord { Uom = wellbore.MdPlanned.Uom, Value = wellbore.MdPlanned.Value.ToString(CultureInfo.InvariantCulture) } } ; if (wellbore.TvdPlanned != null) { witsmlWellbore.TvdPlanned = new WitsmlWellVerticalDepthCoord { Uom = wellbore.TvdPlanned.Uom, Value = wellbore.TvdPlanned.Value.ToString(CultureInfo.InvariantCulture) } } ; if (wellbore.MdSubSeaPlanned != null) { witsmlWellbore.MdSubSeaPlanned = new WitsmlMeasuredDepthCoord { Uom = wellbore.MdSubSeaPlanned.Uom, Value = wellbore.MdSubSeaPlanned.Value.ToString(CultureInfo.InvariantCulture) } } ; if (wellbore.TvdSubSeaPlanned != null) { witsmlWellbore.TvdSubSeaPlanned = new WitsmlWellVerticalDepthCoord { Uom = wellbore.TvdSubSeaPlanned.Uom, Value = wellbore.TvdSubSeaPlanned.Value.ToString(CultureInfo.InvariantCulture) } } ; if (wellbore.DayTarget != null) { witsmlWellbore.DayTarget = new WitsmlDayMeasure { Uom = wellbore.DayTarget.Uom, Value = wellbore.DayTarget.Value.ToString(CultureInfo.InvariantCulture) } } ; return(new WitsmlWellbores { Wellbores = witsmlWellbore.AsSingletonList() }); }