Exemplo n.º 1
0
        /// <summary>
        /// Carry out the block model import
        /// </summary>
        /// <param name="SelectedBMFile"></param>
        /// <param name="SelectedFormatBMFile"></param>
        /// <param name="importMap"></param>
        /// <param name="blockRawFileReader"></param>
        /// <returns></returns>
        internal bool DoBMImport(string SelectedBMFile, string SelectedFormatBMFile, ImportDataMap importMap, RawFileReader blockRawFileReader, string XODBProjectID, string modelAlias)
        {
            BaseImportTools bit = new BaseImportTools();
            int cxColumnID = importMap.GetColumnIDMappedTo("CentroidX");
            int cyColumnID = importMap.GetColumnIDMappedTo("CentroidY");
            int czColumnID = importMap.GetColumnIDMappedTo("CentroidZ");
            
            ColumnStats xOrigin = blockRawFileReader.GetDimensions(cxColumnID);
            ColumnStats yOrigin = blockRawFileReader.GetDimensions(cyColumnID);
            ColumnStats zOrigin = blockRawFileReader.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, XODBProjectID, modelAlias, authorGuid, ConnectionString);
            return true;
        }
Exemplo n.º 2
0
        public void ResetUI(){
            
            blockRawFileReader = new RawFileReader();
            ModelColumnDefinitions columnDefs = new ModelColumnDefinitions();
            lastestImportUpdateStatus = null;
            SelectedFormatFile = "";
            LabelLoadedFile.Content = "no file loaded";
            //currentDBFieldsMetaInfo = new List<ColumnMetaInfo>();
            MapConfigTable.ResetView();
            ImportDataPreview.ResetData();
            this.SelectedImportType = -1;
            ReSetRibbonEnabledStatus(true);

        }
Exemplo n.º 3
0
        internal ModelImportStatus DoCollarImport(string SelectedFile, string SelectedFormatBMFile, ImportDataMap importMap, RawFileReader blockRawFileReader, Guid XODBProjectID, bool overwrite)
        {
          
            
            BaseImportTools bit = new BaseImportTools();
            // get the current collar names in this project
            List<CollarInfo> existingHoles = this.GetHolesForProject(XODBProjectID);


            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, XODBProjectID, ConnectionString, existingHoleNames, overwrite);
            return mos;
            
        }
Exemplo n.º 4
0
        internal ModelImportStatus DoLithoImport(string SelectedFile, string SelectedFormatFile, ImportDataMap importMap, RawFileReader blockRawFileReader, Guid XODBProjectID, 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, XODBProjectID, ConnectionString, numLines, doOverwrite, checkForDuplicates);
            return mos;
        }