/// <summary> /// Carry out the block model import /// </summary> /// <param name="SelectedBMFile"></param> /// <param name="SelectedFormatBMFile"></param> /// <param name="importMap"></param> /// <param name="rawFileReader"></param> /// <returns></returns> internal bool DoBMImport(string SelectedBMFile, string SelectedFormatBMFile, ImportDataMap importMap, RawFileReader rawFileReader, string NKDProjectID, string modelAlias) { BaseImportTools bit = new BaseImportTools(); int cxColumnID = importMap.GetColumnIDMappedTo("CentroidX"); int cyColumnID = importMap.GetColumnIDMappedTo("CentroidY"); int czColumnID = importMap.GetColumnIDMappedTo("CentroidZ"); ColumnStats xOrigin = rawFileReader.GetDimensions(cxColumnID); ColumnStats yOrigin = rawFileReader.GetDimensions(cyColumnID); ColumnStats zOrigin = rawFileReader.GetDimensions(czColumnID); int approxNumLines = xOrigin.count; Stream bmFileStream = new FileStream(SelectedBMFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); // Stream bmFileStream = new FileStream(SelectedBMFile, FileMode.Open); ModelImportStatus mos = new ModelImportStatus(); Guid newModelGuid = Guid.NewGuid(); Guid authorGuid = new Guid(); List<string> status = bit.PerformBMImport(mos, newModelGuid, bmFileStream, null, importMap, xOrigin.min, yOrigin.min, zOrigin.min, backgroundWorker, approxNumLines, NKDProjectID, modelAlias, authorGuid, ConnectionString); return true; }
internal ModelImportStatus DoCollarImport(string SelectedFile, string SelectedFormatBMFile, ImportDataMap importMap, RawFileReader rawFileReader, Guid NKDProjectID, bool overwrite) { BaseImportTools bit = new BaseImportTools(); // get the current collar names in this project List<CollarInfo> existingHoles = this.GetHolesForProject(NKDProjectID); List<string> existingHoleNames = new List<string>(); foreach (CollarInfo ci in existingHoles) { existingHoleNames.Add(ci.Name); } ModelImportStatus mos = new ModelImportStatus(); Stream fileStream = new FileStream(SelectedFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); //Stream fileStream = new FileStream(SelectedFile, FileMode.Open); bit.PerformCollarImport(mos, fileStream, null, importMap, this.backgroundWorker, NKDProjectID, ConnectionString, existingHoleNames, overwrite); return mos; }
internal ModelImportStatus DoLithoImport(string SelectedFile, string SelectedFormatFile, ImportDataMap importMap, RawFileReader rawFileReader, Guid NKDProjectID, bool doOverwrite, bool checkForDuplicates) { BaseImportTools bit = new BaseImportTools(); ModelImportStatus mos = new ModelImportStatus(); GeneralFileInfo gfi = new GeneralFileInfo(); gfi.GeneralFileStats(SelectedFile); int numLines = gfi.numLines; //Stream fileStream = new FileStream(SelectedFile, FileMode.Open); Stream fileStream = new FileStream(SelectedFile, FileMode.Open, FileAccess.Read , FileShare.ReadWrite); bit.PerformLithoImport(mos, fileStream, null, importMap, this.backgroundWorker, NKDProjectID, ConnectionString, numLines, doOverwrite, checkForDuplicates); return mos; }
internal int GetNKDVersion() { BaseImportTools bit = new BaseImportTools(); return bit.GetNKDVersion(connectionString); }
internal List<CollarInfo> GetHolesForProject(Guid currentSelectedProject) { BaseImportTools bit = new BaseImportTools(); List<CollarInfo> collarNameList = bit.FindCollarsInProject(currentSelectedProject); return collarNameList; }
internal Dictionary<Guid, string> GetProjectList() { BaseImportTools bit = new BaseImportTools(); return bit.GetProjectsList(); }
private List<ColumnMetaInfo> GetLithoFieldsFromNKD() { BaseImportTools bit = new BaseImportTools(); List<ColumnMetaInfo> ls = bit.GetLithoColumns(CommandDirector.ConnectionString); return ls; }
private List<ColumnMetaInfo> GetGeophysicsFieldsFromNKD() { BaseImportTools bit = new BaseImportTools(); List<ColumnMetaInfo> ls = bit.GetGeophysicsColumns(); return ls; }
//------------------------- /// <summary> /// initiate a connection to the database to collect fieldnames from he block model table /// </summary> private List<ColumnMetaInfo> GetBMFieldsFromNKD() { BaseImportTools bit = new BaseImportTools(); List<string> ls = bit.GetBMColumns(); List<ColumnMetaInfo> cmi = new List<ColumnMetaInfo>(); foreach (string s in ls) { cmi.Add(new ColumnMetaInfo() { columnName = s, hasFK = false, isMandatory = true }); } return cmi; }