private async Task <IActionResult> addLoggerLayout101(ge_data data, string [] lines) { dbConnectDetails cd = await getConnectDetails(data.projectId, gINTTables.DB_DATA_TYPE); if (cd == null) { return(NotFound()); } int gINTProjectID = cd.ProjectId; string POINT_ID = "PointId"; string MOND_ID = "Monitoring Id"; string WATER_DEPTH = "Water Depth"; string DATE_TIME = "DateTime"; measurement mm = dict_measurement[WATER_DEPTH]; string[] header = lines[0].Split(","); int colPOINT_ID = header.findColumn(POINT_ID); int colMOND_ID = header.findColumn(MOND_ID); int colDATE_TIME = header.findColumn(DATE_TIME); int colWATER_DEPTH = header.findColumn(WATER_DEPTH); int row_start = 1; int col_start = colDATE_TIME + 1; for (int i = row_start; i < lines.Length; i++) { string[] line = lines[i].Split(","); try { var newMOND = new MOND(); newMOND.gINTProjectID = gINTProjectID; newMOND.PointID = line[colPOINT_ID]; newMOND.ItemKey = line[colMOND_ID]; MONG.sqlWhere("gINTProjectID=" + gINTProjectID + " and PointID='" + newMOND.PointID + "' and ItemKey='" + newMOND.ItemKey + "'"); MONG.getDataTable(); if (!MONG.EOF()) { DataRow row = MONG.FirstRow(); newMOND.MONG_DIS = Convert.ToDouble(row["MONG_DIS"]); } newMOND.DateTime = Convert.ToDateTime(line[colDATE_TIME]); newMOND.MOND_RDNG = line[colWATER_DEPTH]; newMOND.MOND_TYPE = mm.Type; newMOND.MOND_NAME = mm.Name; newMOND.MOND_UNIT = mm.Units; AddMOND(newMOND, true); } catch (Exception e) { Console.Write(e.Message); } } return(Ok()); }
private int AddDip(MONG mg, LTM_Survey_Data survey) { // Water depth below gl (m) if (survey.depth_gwl_bgl != null) { MOND md = NewMOND(mg, survey); md.MOND_TYPE = "WDEP"; md.MOND_RDNG = Convert.ToString(survey.depth_gwl_bgl); md.MOND_UNIT = "m"; md.MOND_INST = "Dipmeter:" + survey.dip_instr; md.MOND_REM = survey.dip_com; MOND.Add(md); } // Water depth if dry if (survey.dip_check == "dry") { MOND md = NewMOND(mg, survey); md.MOND_TYPE = "WDEP"; md.MOND_RDNG = "Dry"; md.MOND_UNIT = "m"; md.MOND_INST = "Dipmeter:" + survey.dip_instr; md.MOND_REM = survey.dip_com; MOND.Add(md); } // Water depth if null and dip required and offset if (survey.depth_gwl_bgl == null && survey.dip_req == "yes" && survey.dip_datum_offset != null) { MOND md = NewMOND(mg, survey); md.MOND_TYPE = "WDEP"; md.MOND_RDNG = "Dry"; md.MOND_UNIT = "m"; md.MOND_INST = "Dipmeter:" + survey.dip_instr; md.MOND_REM = survey.dip_com; MOND.Add(md); } // Depth to base of installation (m) if (survey.depth_install_bgl != null && survey.dip_datum_offset != null) { MOND md = NewMOND(mg, survey); md.MOND_TYPE = "DBSE"; md.MOND_RDNG = Convert.ToString(survey.depth_install_bgl); md.MOND_NAME = "Depth to base of installation"; md.MOND_UNIT = "m"; md.MOND_INST = survey.dip_instr; MOND.Add(md); } return(0); }
private MOND NewMOND(MONG mg, LTM_Survey_Data survey, LTM_Survey_Data_Repeat repeat) { int round = convertToInt16(survey.mon_rd_nb, "R", -999); MOND md = new MOND { ge_source = "esri_survey_repeat", ge_otherId = Convert.ToString(repeat.globalid), gINTProjectID = mg.gINTProjectID, PointID = mg.PointID, ItemKey = mg.ItemKey, MONG_DIS = mg.MONG_DIS, RND_REF = String.Format("{0:00}", round), MOND_REF = String.Format("Round {0:00} Seconds {1:00}", round, repeat.elapse_t), }; return(md); }
private MOND NewMOND(MONG mg, LTM_Survey_Data survey) { int round = convertToInt16(survey.mon_rd_nb, "R", -999); MOND md = new MOND { ge_source = "esri_survey", ge_otherId = Convert.ToString(survey.globalid), gINTProjectID = mg.gINTProjectID, PointID = mg.PointID, ItemKey = mg.ItemKey, MONG_DIS = mg.MONG_DIS, RND_REF = String.Format("{0:00}", round), MOND_REF = String.Format("Round {0:00}", round), DateTime = gINTDateTime(survey.time1_getDT()) }; return(md); }
private Boolean AddMOND(MOND newMOND, Boolean ReplaceExisting) { DataRow row = null; if (ReplaceExisting == true) { MOND.sqlWhere("gINTProjectID=" + newMOND.gINTProjectID + " and PointID='" + newMOND.PointID + "' and MONG_DIS=" + newMOND.MONG_DIS + " and ItemKey='" + newMOND.ItemKey + "' and DateTime=" + newMOND.DateTimeFormated(DATE_FORMAT, "'") + " and MOND_TYPE='" + newMOND.MOND_TYPE + "'"); MOND.getDataTable(); if (!MOND.EOF()) { row = MOND.FirstRow(); } } if (row == null) { MOND.Reset(); row = MOND.NewRow(); } row["gINTProjectID"] = newMOND.gINTProjectID; row["PointID"] = newMOND.PointID; row["MOND_REF"] = newMOND.MOND_REF; row["ItemKey"] = newMOND.ItemKey; row["MONG_DIS"] = newMOND.MONG_DIS; row["DateTime"] = newMOND.DateTime; row["MOND_TYPE"] = newMOND.MOND_TYPE; row["MOND_RDNG"] = newMOND.MOND_RDNG; row["MOND_NAME"] = newMOND.MOND_NAME; row["MOND_UNIT"] = newMOND.MOND_UNIT; row["MOND_REM"] = newMOND.MOND_REM; row["MOND_CONT"] = newMOND.MOND_CONT; row["FILE_FSET"] = newMOND.FILE_FSET; MOND.Update(); return(true); }
private List <MOND> getMONDDuplicatesForDeletion(List <MOND> existMOND, List <MOND> newMOND) { List <MOND> deleteMOND = new List <MOND>(); foreach (MOND newM in newMOND) { var existM = existMOND.Where(m => m.PointID == newM.PointID && m.MONG_DIS == newM.MONG_DIS && m.DateTime == newM.DateTime && m.MOND_TYPE == newM.MOND_TYPE && m.ge_source == newM.ge_source && m.ge_otherId == newM.ge_otherId) .OrderBy(m => m.GintRecID) .ToList <MOND>(); if (existM == null) { continue; } if (existM.Count > 1) { // remove all elements except the last gINTRecID item for (int i = 0; i < existM.Count - 1; i++) { MOND delM = existM.ElementAt(i); deleteMOND.Add(delM); } } } if (deleteMOND.Count() > 0) { return(deleteMOND); } return(null); }
private int AddGas(MONG mg, LTM_Survey_Data survey) { // Peak Gas flow if (survey.gas_flow_peak != null) { MOND md = NewMOND(mg, survey); md.MOND_TYPE = "GFLOP"; md.MOND_RDNG = Convert.ToString(survey.gas_flow_peak); md.MOND_NAME = "Peak gas flow rate"; md.MOND_UNIT = "l/h"; md.MOND_INST = survey.dip_instr; MOND.Add(md); } // Steady Gas flow if (survey.gas_flow_steady != null) { MOND md = NewMOND(mg, survey); md.MOND_TYPE = "GFLOS"; md.MOND_RDNG = Convert.ToString(survey.gas_flow_steady); md.MOND_NAME = "Steady gas flow rate"; md.MOND_UNIT = "l/h"; md.MOND_INST = survey.dip_instr; MOND.Add(md); } // Atmosperic Temperature (°C) if (survey.atmo_temp != null) { MOND md = NewMOND(mg, survey); md.MOND_TYPE = "TEMP"; md.MOND_RDNG = Convert.ToString(survey.atmo_temp); md.MOND_NAME = "Atmospheric temperature"; md.MOND_UNIT = "Deg C"; md.MOND_INST = survey.gas_instr; MOND.Add(md); } // Atmospheric pressure (mbar) if (survey.atmo_pressure != null) { MOND md = NewMOND(mg, survey); md.MOND_TYPE = "BAR"; md.MOND_RDNG = Convert.ToString(survey.atmo_pressure); md.MOND_NAME = "Atmospheric pressure"; md.MOND_UNIT = "mbar"; md.MOND_INST = survey.gas_instr; MOND.Add(md); } // Differential borehole pressure (mbar) if (survey.Diff_BH_pressure != null) { MOND md = NewMOND(mg, survey); md.MOND_TYPE = "GPRS"; md.MOND_RDNG = Convert.ToString(survey.Diff_BH_pressure); md.MOND_NAME = "Differential pressure"; md.MOND_UNIT = "mbar"; md.MOND_INST = survey.gas_instr; MOND.Add(md); } DateTime survey_startDT = gINTDateTime(survey.time1_getDT()).Value; List <LTM_Survey_Data_Repeat> repeat = Survey_Repeat_Data.FindAll(r => r.parentglobalid == survey.globalid); foreach (LTM_Survey_Data_Repeat survey2 in repeat) { if (survey2.elapse_t == null) { continue; } int elapsed = survey2.elapse_t.Value; //DateTime dt = survey_start.Value.AddSeconds(elapsed); DateTime dt = survey_startDT.AddSeconds(elapsed); // Gas flow (l/h) if (survey2.gas_flow_t != null) { MOND md = NewMOND(mg, survey, survey2); md.MOND_TYPE = "GFLO"; md.MOND_RDNG = Convert.ToString(survey2.gas_flow_t); md.MOND_NAME = "Gas flow rate"; md.MOND_UNIT = "l/h"; md.MOND_INST = survey.gas_instr; md.DateTime = dt; MOND.Add(md); } // Methane reading Limit CH4 LEL (%) if (survey2.CH4_lel_t != null) { MOND md = NewMOND(mg, survey, survey2); md.MOND_TYPE = "GM"; md.MOND_RDNG = Convert.ToString(survey2.CH4_lel_t); md.MOND_NAME = "Methane as percentage of LEL (Lower Explosive Limit)"; md.MOND_UNIT = "%vol"; md.MOND_INST = survey.gas_instr; md.DateTime = dt; MOND.Add(md); } // Methane reading CH4 (% v/v) if (survey2.CH4_t != null) { MOND md = NewMOND(mg, survey, survey2); md.MOND_TYPE = "TGM"; md.MOND_RDNG = Convert.ToString(survey2.CH4_t); md.MOND_NAME = "Total Methane"; md.MOND_UNIT = "%vol"; md.MOND_INST = survey.gas_instr; md.DateTime = dt; MOND.Add(md); } // Carbon Dioxide reading CO2 (% v/v) if (survey2.CO2_t != null) { MOND md = NewMOND(mg, survey, survey2); md.MOND_TYPE = "GCD"; md.MOND_RDNG = Convert.ToString(survey2.CO2_t); md.MOND_NAME = "Carbon Dioxide"; md.MOND_UNIT = "%vol"; md.MOND_INST = survey.gas_instr; md.DateTime = dt; MOND.Add(md); } //Oxygen Reading O2 (% v/v) if (survey2.O2_t != null) { MOND md = NewMOND(mg, survey, survey2); md.MOND_TYPE = "GOX"; md.MOND_RDNG = Convert.ToString(survey2.O2_t); md.MOND_NAME = "Oxygen"; md.MOND_UNIT = "%vol"; md.MOND_INST = survey.gas_instr; md.DateTime = dt; MOND.Add(md); } //Hydrogen Sulphide H2S (ppm) if (survey2.H2S_t != null) { MOND md = NewMOND(mg, survey, survey2); md.MOND_TYPE = "HYS"; md.MOND_RDNG = Convert.ToString(survey2.H2S_t); md.MOND_NAME = "Hydrogen Sulphide"; md.MOND_UNIT = "ppm"; md.MOND_INST = survey.gas_instr; md.DateTime = dt; MOND.Add(md); } //Carbon Monoxide Readings CO (ppm) if (survey2.CO_t != null) { MOND md = NewMOND(mg, survey, survey2); md.MOND_TYPE = "GCO"; md.MOND_RDNG = Convert.ToString(survey2.CO_t); md.MOND_NAME = "Carbon Monoxide"; md.MOND_UNIT = "ppm"; md.MOND_INST = survey.gas_instr; md.DateTime = dt; MOND.Add(md); } //Photo Ionisations PID (ppm) if (survey2.PID_t != null) { MOND md = NewMOND(mg, survey, survey2); md.MOND_TYPE = "PID"; md.MOND_RDNG = Convert.ToString(survey2.PID_t); md.MOND_NAME = "Photoionization Detector"; md.MOND_UNIT = "ppm"; md.MOND_INST = survey.PID_instr; md.DateTime = dt; MOND.Add(md); } // VOC (ppm) if (survey2.voc_t != null) { MOND md = NewMOND(mg, survey, survey2); md.MOND_TYPE = "VOC"; md.MOND_RDNG = Convert.ToString(survey2.voc_t); md.MOND_NAME = "Volatile Organic Compounds"; md.MOND_UNIT = "ppm"; md.MOND_INST = survey.gas_instr; md.DateTime = dt; MOND.Add(md); } } return(0); }
private int AddPurge(MONG mg, LTM_Survey_Data survey) { // PH if (survey.ph != null) { MOND md = NewMOND(mg, survey); md.MOND_TYPE = "PH"; md.MOND_RDNG = Convert.ToString(survey.ph); md.MOND_UNIT = "PH"; md.MOND_INST = survey.gas_instr; MOND.Add(md); } //Redox Potential if (survey.redox_potential != null) { MOND md = NewMOND(mg, survey); md.MOND_TYPE = "RDX"; md.MOND_RDNG = Convert.ToString(survey.redox_potential); md.MOND_UNIT = "mV"; md.MOND_INST = survey.gas_instr; MOND.Add(md); } //Redox Potential from eh field if (survey.eh != null) { MOND md = NewMOND(mg, survey); md.MOND_TYPE = "RDX"; md.MOND_RDNG = Convert.ToString(survey.eh); md.MOND_NAME = "Redox Potential"; md.MOND_UNIT = "mV"; md.MOND_INST = survey.gas_instr; MOND.Add(md); } // Electrical Conductivity if (survey.conductivity != null) { MOND md = NewMOND(mg, survey); md.MOND_TYPE = "EC"; md.MOND_RDNG = Convert.ToString(survey.conductivity); md.MOND_NAME = "Electrical Conductivity"; md.MOND_UNIT = "uS/cm"; md.MOND_INST = survey.gas_instr; MOND.Add(md); } //Temperature (°C) if (survey.temperature != null) { MOND md = NewMOND(mg, survey); md.MOND_TYPE = "DOWNTEMP"; md.MOND_RDNG = Convert.ToString(survey.temperature); md.MOND_NAME = "Downhole temperature"; md.MOND_UNIT = "Deg C"; md.MOND_INST = survey.gas_instr; MOND.Add(md); } //Dissolved oxygen (mg/l) if (survey.dissolved_oxy != null) { MOND md = NewMOND(mg, survey); md.MOND_TYPE = "DO"; md.MOND_RDNG = Convert.ToString(survey.dissolved_oxy); md.MOND_NAME = "Dissolved Oxygen"; md.MOND_UNIT = "mg/l"; md.MOND_INST = survey.gas_instr; MOND.Add(md); } return(0); }
public async Task <IActionResult> ReadFeature(Guid projectId, string dataset, string addId = "", string format = "view", Boolean save = false) { if (projectId == null) { return(NotFound()); } if (String.IsNullOrEmpty(dataset)) { return(NotFound()); } var _project = await _context.ge_project .Include(p => p.group) .SingleOrDefaultAsync(m => m.Id == projectId); if (_project == null) { return(NotFound()); } if (_project.esriConnectId == null) { return(RedirectToPageMessage(msgCODE.ESRI_NO_VALID_CONNECTION)); } ge_data _data = new ge_data(); _data.project = _project; var user = GetUserAsync().Result; if (user != null) { int IsDownloadAllowed = _context.IsOperationAllowed(Constants.DownloadOperationName, _project.group, _project, _data); Boolean CanUserDownload = _context.DoesUserHaveOperation(Constants.DownloadOperationName, _project, user.Id); int IsCreateAllowed = _context.IsOperationAllowed(Constants.CreateOperationName, _project.group, _project, _data); Boolean CanUserCreate = _context.DoesUserHaveOperation(Constants.CreateOperationName, _project, user.Id); if (IsDownloadAllowed != geOPSResp.Allowed) { return(RedirectToPageMessage(msgCODE.DATA_DOWNLOAD_PROHIBITED)); } if (!CanUserDownload) { return(RedirectToPageMessage(msgCODE.DATA_DOWNLOAD_USER_PROHIBITED)); } if (IsCreateAllowed != geOPSResp.Allowed) { return(RedirectToPageMessage(msgCODE.DATA_CREATE_PROHIBITED)); } if (!CanUserCreate) { return(RedirectToPageMessage(msgCODE.DATA_CREATE_USER_PROHIBITED)); } } var cs = await new ge_dataController(_context, _authorizationService, _userManager, _env, _ge_config).getDataAsClass <EsriConnectionSettings>(_project.esriConnectId.Value); if (cs == null) { return(RedirectToPageMessage(msgCODE.ESRI_NO_VALID_CONNECTION)); } EsriDataSet ds = cs.datasets.Find(d => d.Name == dataset); String table1 = ds.tables[0]; String table2 = ds.tables[1]; string where = ""; int page_size = 250; var t1 = await new ge_esriController(_context, _authorizationService, _userManager, _env, _ge_config).getFeatures(projectId, table1, where, page_size ); Survey_Data = new List <LTM_Survey_Data>(); Survey_Geom = new List <EsriGeometry>(); foreach (string s1 in (string[])t1.Value) { var survey_data = JsonConvert.DeserializeObject <esriFeature <LTM_Survey_Data> >(s1); var survey_resp = LoadFeature(survey_data.features); } var t2 = await new ge_esriController(_context, _authorizationService, _userManager, _env, _ge_config).getFeatures(projectId, table2, where, page_size ); Survey_Repeat_Data = new List <LTM_Survey_Data_Repeat>(); foreach (string s1 in (string[])t2.Value) { var survey_repeat = JsonConvert.DeserializeObject <esriFeature <LTM_Survey_Data_Repeat> >(s1); var repeat_resp = LoadFeature(survey_repeat.features); } if (addId != "") { Guid Id = new Guid(addId); var FeatureAdd = await new ge_dataController(_context, _authorizationService, _userManager, _env, _ge_config).getDataAsClass <Additional_LTM_Survey_Data>(Id, "json"); if (FeatureAdd != null) { Survey_Data_Add = FeatureAdd.Feature_Adds; } } Merge_Survey_Data_Add(); var mond_resp = await AddMOND(_project); ViewData["FeatureStatus"] = "Features not written to MOND table"; if (save == true) { List <MOND> existingMOND; var resp = await new ge_gINTController(_context, _authorizationService, _userManager, _env, _ge_config ).getMOND(_project.Id, null, null, null, "ge_source in ('esri_survey','esri_survey_repeat')", ""); var okResult = resp as OkObjectResult; if (okResult.StatusCode == 200) { existingMOND = okResult.Value as List <MOND>; if (existingMOND != null) { var deleteMOND = getMONDForDeletion(existingMOND, MOND); if (deleteMOND != null) { int[] s = deleteMOND.Select(m => m.GintRecID).ToArray(); var delMOND_resp = await new ge_gINTController(_context, _authorizationService, _userManager, _env, _ge_config ).deleteMOND(_project.Id, s); } } } var saveMOND_resp = await new ge_gINTController(_context, _authorizationService, _userManager, _env, _ge_config ).Upload(_project.Id, MOND, "ge_source in ('esri_survey','esri_survey_repeat')"); ViewData["FeatureStatus"] = $"Features attributes({saveMOND_resp}) written to MOND table"; var saveMONV_resp = await new ge_gINTController(_context, _authorizationService, _userManager, _env, _ge_config ).Upload(_project.Id, MONV); ViewData["FeatureStatus"] = $"Features attributes({saveMONV_resp}) written to MONV table"; } List <MOND> ordered = MOND.OrderBy(e => e.DateTime).ToList(); MOND = ordered; if (format == "json") { return(Json(MOND)); } return(View("ViewMOND", MOND)); }
public async Task DeleteRecord(MOND record) { _unitOfWork.MOND.Remove(record); await _unitOfWork.CommitAsync(); }
public async Task UpdateRecord(MOND recordToBeUpdated, MOND record) { var rec = await _unitOfWork.MOND.GetByIdAsync(recordToBeUpdated.GintRecID); await _unitOfWork.CommitAsync(); }
public async Task CreateRecord(MOND newRecord) { await _unitOfWork.MOND.AddAsync(newRecord); await _unitOfWork.CommitAsync(); }
private MOND NewMOND(MONG mg, ge_log_reading read, string instrument_name, string round_ref, string mond_type, string mond_rem, string mond_ref, string value_name, string mond_name, string units, string format, float?GL, string ge_source) { string value = null; string format2 = "{0:" + format + "}"; if (read.NotDry == ge_log_constants.ISNOTDRY) { float?reading = read.getValue(value_name); if (reading != null) { value = String.Format(format2, reading); if (mond_type == "WLEV") { value = String.Format(format2, GL.Value - reading); } } } if (read.NotDry == ge_log_constants.ISDRY) { value = "Dry"; } if (!String.IsNullOrEmpty(read.Remark)) { mond_rem += " " + read.Remark; } if (String.IsNullOrEmpty(value)) { return(null); } MOND md = new MOND { gINTProjectID = mg.gINTProjectID, PointID = mg.PointID, ItemKey = mg.ItemKey, MONG_DIS = mg.MONG_DIS, MOND_TYPE = mond_type, MOND_REF = mond_ref, DateTime = read.ReadingDateTime, MOND_UNIT = units, MOND_RDNG = value, MOND_INST = instrument_name, MOND_NAME = mond_name, MOND_REM = mond_rem, RND_REF = round_ref, ge_source = ge_source, ge_otherId = read.Id.ToString() }; return(md); }
private async Task <List <MOND> > createMOND(ge_log_file log_file, int page_size, int page, string round_ref, DateTime?fromDT, DateTime?toDT, string ge_source = "ge_flow", Boolean addWLEV = true) { // Find borehole in point table of gint database string holeId = log_file.getBoreHoleId(); if (holeId == "") { return(null); // BadRequest ($"Borehole ref not provided"); } POINT pt = await GetPointByHoleId(holeId); if (pt == null) { return(null);// return BadRequest ($"Borehole ref {holeId} not found in {project.name}"); } List <MONG> mgs = await GetParentsByHoleId(holeId); // Find monitoring point in mong table of gint database float probe_depth = log_file.getProbeDepth(); if (probe_depth == 0) { return(null); // return BadRequest ($"No probe depth provided for borehole ref {holeId} not found in {project.name}"); } MONG mg = null; string formatMATCH = "{0:00.0}"; if (mgs.Count == 1) { mg = mgs.FirstOrDefault(); } else { foreach (MONG m in mgs) { if (m.MONG_DIS != null) { if (String.Format(formatMATCH, m.MONG_DIS.Value) == String.Format(formatMATCH, probe_depth)) { mg = m; break; } } } } if (mg == null) { return(null); // return BadRequest ($"No installations in borehole ref {holeId} have a probe depth of {probe_depth} in {project.name}"); } // Add all readings to new items in List<MOND> List <MOND> MOND = new List <MOND>(); string device_name = log_file.getDeviceName(); float?gl = null; if (pt.Elevation != null) { gl = Convert.ToSingle(pt.Elevation.Value); } if (gl == null && pt.LOCA_GL != null) { gl = Convert.ToSingle(pt.LOCA_GL.Value); } // int round_no = getInt32(round_ref); string mond_rem_suffix = ""; string mond_ref = ""; if (ge_source == "ge_flow") { mond_rem_suffix = " flow meter reading"; } if (ge_source == "ge_logger") { mond_rem_suffix = " datalogger reading"; } List <ge_log_reading> readings2 = log_file.getIncludeReadingsPage(fromDT, toDT, page_size, page); foreach (ge_log_reading reading in readings2) { foreach (value_header vh in log_file.field_headers) { if (ge_source == "ge_flow") { mond_ref = String.Format("Round {0} Seconds {1:00}", round_ref, reading.Duration); } if (vh.id == "WDEPTH" && vh.units == "m") { // Add MOND WDEP record MOND md = NewMOND(mg, reading, device_name, round_ref, "WDEP", mg.MONG_TYPE + mond_rem_suffix, mond_ref, vh.db_name, "Water Depth", vh.units, vh.format, null, ge_source); if (md != null) { MOND.Add(md); } if (gl != null && addWLEV == true) { // Add MOND WLEV record MOND md2 = NewMOND(mg, reading, device_name, round_ref, "WLEV", mg.MONG_TYPE + mond_rem_suffix, mond_ref, vh.db_name, "Water Level", vh.units, vh.format, gl, ge_source); if (md2 != null) { MOND.Add(md2); } } } if (vh.id == "PH") { // Add MOND Potential Hydrogen MOND md = NewMOND(mg, reading, device_name, round_ref, "PH", mg.MONG_TYPE + mond_rem_suffix, mond_ref, vh.db_name, "", vh.units, vh.format, null, ge_source); if (md != null) { MOND.Add(md); } } if (vh.id == "DO" && vh.units == "mg/l") { // Add MOND Disolved Oxygen MOND md = NewMOND(mg, reading, device_name, round_ref, "DO", mg.MONG_TYPE + mond_rem_suffix, mond_ref, vh.db_name, "Dissolved Oxygen", vh.units, vh.format, null, ge_source); if (md != null) { MOND.Add(md); } } // if ((vh.id == "AEC" && vh.units == "μS/cm") | // (vh.id == "AEC" & vh.units == "mS/cm")) { // // Add MOND Electrical Conductivity // MOND md = NewMOND (mg, reading, device_name, round_ref, "AEC", mg.MONG_TYPE + mond_rem_suffix, mond_ref, vh.db_name, "Actual Electrical Conductivity", vh.units, vh.format, null, ge_source); // if (md!=null) MOND.Add (md); // } //if (vh.id == "AEC" && (vh.units == "μS/cm" || vh.units == "mS/cm")) { if (vh.id == "AEC") { // Add MOND Electrical Conductivity MOND md = NewMOND(mg, reading, device_name, round_ref, "AEC", mg.MONG_TYPE + mond_rem_suffix, mond_ref, vh.db_name, "Actual Electrical Conductivity", vh.units, vh.format, null, ge_source); if (md != null) { MOND.Add(md); } } // if ((vh.id == "EC" && vh.units == "μS/cm")) { if ((vh.id == "EC")) { // Add MOND Electrical Conductivity MOND md = NewMOND(mg, reading, device_name, round_ref, "EC", mg.MONG_TYPE + mond_rem_suffix, mond_ref, vh.db_name, "Electrical Conductivity", vh.units, vh.format, null, ge_source); if (md != null) { MOND.Add(md); } } if (vh.id == "SAL" && vh.units == "g/cm3") { // Add MOND Salinity record MOND md = NewMOND(mg, reading, device_name, round_ref, "SAL", mg.MONG_TYPE + mond_rem_suffix, mond_ref, vh.db_name, "Salinity", vh.units, vh.format, null, ge_source); if (md != null) { MOND.Add(md); } } if (vh.id == "TEMP" && vh.units == "Deg C") { // Add MOND Temp record MOND md = NewMOND(mg, reading, device_name, round_ref, "DOWNTEMP", mg.MONG_TYPE + mond_rem_suffix, mond_ref, vh.db_name, "Downhole Temperature", vh.units, vh.format, null, ge_source); MOND.Add(md); } if (vh.id == "RDX" && vh.units == "mV") { // Add MOND Redox Salinity record MOND md = NewMOND(mg, reading, device_name, round_ref, "RDX", mg.MONG_TYPE + mond_rem_suffix, mond_ref, vh.db_name, "Redox Potential", vh.units, vh.format, null, ge_source); if (md != null) { MOND.Add(md); } } if (vh.id == "TURB" && vh.units == "NTU") { // Add MOND Salinity record MOND md = NewMOND(mg, reading, device_name, round_ref, "TURB", mg.MONG_TYPE + mond_rem_suffix, mond_ref, vh.db_name, "Turbity", vh.units, vh.format, null, ge_source); if (md != null) { MOND.Add(md); } } } } return(MOND); }
} // Editor, esriFieldTypeString, Editor, sqlTypeOther, 128 public int AddGas(MONG mg, LTM_Survey_Data2 survey, LTM_Survey_Data_Repeat2 survey2, List <MOND> MOND) { DateTime survey_startDT = gINTDateTime(survey.date1_getDT()).Value; if (survey2.elapse_t == null) { return(0); } int elapsed = survey2.elapse_t.Value; //DateTime dt = survey_start.Value.AddSeconds(elapsed); DateTime dt = survey_startDT.AddSeconds(elapsed); if (survey.gas_repeat_tstart != null) { dt = gINTDateTime(survey.gas_repeat_tstart_getDT()).Value.AddSeconds(elapsed); } // Gas flow (l/h) // if (survey2.gas_flow_t != null) { // MOND md = NewMOND(mg, survey, survey2); // md.MOND_TYPE = "GFLO"; // md.MOND_RDNG = Convert.ToString(survey2.gas_flow_t); // md.MOND_NAME = "Gas flow rate"; // md.MOND_UNIT = "l/h"; // md.MOND_INST = survey.gas_instr; // md.DateTime = dt; // MOND.Add(md); // } // Methane reading Limit CH4 LEL (%) if (survey2.CH4_lel_t != null) { MOND md = NewMOND(mg, survey, survey2); md.MOND_TYPE = "GM"; md.MOND_RDNG = Convert.ToString(survey2.CH4_lel_t); md.MOND_NAME = "Methane as percentage of LEL (Lower Explosive Limit)"; md.MOND_UNIT = "%vol"; md.MOND_INST = IfOther(survey.gas_instr, survey.gas_instr_other); md.DateTime = dt; MOND.Add(md); } // Methane reading CH4 (% v/v) if (survey2.CH4_t != null) { MOND md = NewMOND(mg, survey, survey2); md.MOND_TYPE = "TGM"; md.MOND_RDNG = Convert.ToString(survey2.CH4_t); md.MOND_NAME = "Total Methane"; md.MOND_UNIT = "%vol"; md.MOND_INST = IfOther(survey.gas_instr, survey.gas_instr_other); md.DateTime = dt; MOND.Add(md); } // Carbon Dioxide reading CO2 (% v/v) if (survey2.CO2_t != null) { MOND md = NewMOND(mg, survey, survey2); md.MOND_TYPE = "GCD"; md.MOND_RDNG = Convert.ToString(survey2.CO2_t); md.MOND_NAME = "Carbon Dioxide"; md.MOND_UNIT = "%vol"; md.MOND_INST = IfOther(survey.gas_instr, survey.gas_instr_other); md.DateTime = dt; MOND.Add(md); } //Oxygen Reading O2 (% v/v) if (survey2.O2_t != null) { MOND md = NewMOND(mg, survey, survey2); md.MOND_TYPE = "GOX"; md.MOND_RDNG = Convert.ToString(survey2.O2_t); md.MOND_NAME = "Oxygen"; md.MOND_UNIT = "%vol"; md.MOND_INST = IfOther(survey.gas_instr, survey.gas_instr_other); md.DateTime = dt; MOND.Add(md); } //Hydrogen Sulphide H2S (ppm) if (survey2.H2S_t != null) { MOND md = NewMOND(mg, survey, survey2); md.MOND_TYPE = "HYS"; md.MOND_RDNG = Convert.ToString(survey2.H2S_t); md.MOND_NAME = "Hydrogen Sulphide"; md.MOND_UNIT = "ppm"; md.MOND_INST = IfOther(survey.gas_instr, survey.gas_instr_other); md.DateTime = dt; MOND.Add(md); } //Carbon Monoxide Readings CO (ppm) if (survey2.CO_t != null) { MOND md = NewMOND(mg, survey, survey2); md.MOND_TYPE = "GCO"; md.MOND_RDNG = Convert.ToString(survey2.CO_t); md.MOND_NAME = "Carbon Monoxide"; md.MOND_UNIT = "ppm"; md.MOND_INST = IfOther(survey.gas_instr, survey.gas_instr_other); md.DateTime = dt; MOND.Add(md); } return(0); }