Exemple #1
0
        private void LoadLASTextDataForPreview(string inputFilename)
        {
            IOResults ares = new IOResults();

            List<ColumnMetaInfo> mandatoryColumns = new List<ColumnMetaInfo>();
            List<ColumnMetaInfo> optionalColumns = new List<ColumnMetaInfo>();

            List<ColumnMetaInfo> dbFields = GetGeophysicsFieldsFromNKD();
            foreach (ColumnMetaInfo s in dbFields)
            {
                mandatoryColumns.Add(s);
            }


            // talk to the database to get the column names 

            ImportDataPreview.SetMandatoryMappingColumns(mandatoryColumns);
            ImportDataPreview.SetOptionalMappingColumns(optionalColumns);
            ImportDataPreview.SetPreviewType("MODEL");

            bool firstLineIsHeader = true;
            var rawFileReader = new RawFileReader((inputFilename.ToLower().IndexOf(".csv") > -1) ? ',' : '\t');
            List<RawDataRow> dt = rawFileReader.LoadRawDataForPreview(inputFilename, ares);
            ImportDataPreview.ResetTable(dt, firstLineIsHeader);

        }
Exemple #2
0
        private void LoadGeophysiscsTextDataForPreview(string inputFilename)
        {
            IOResults ares = new IOResults();

            List<ColumnMetaInfo> dbFields = GetGeophysicsFieldsFromNKD();
            // talk to the database to get the column names 

            ImportDataPreview.SetMandatoryMappingColumns(dbFields);
            ImportDataPreview.SetPreviewType("GEOPHYISCS");

            bool firstLineIsHeader = true;

            if (inputFilename.ToLower().EndsWith("las"))
            {
                LASFileReader lfr = new LASFileReader();
                int errCode = 0;
                LASFile fl = lfr.ReadLASFile(inputFilename, 0, out errCode);

                List<RawDataRow> dt = new List<RawDataRow>();
                RawDataRow rdh = new RawDataRow();
                rdh.dataItems = new List<string>();
                rdh.dataItems.Add("Depth");
                foreach (string ss in fl.columnHeaders)
                {
                    rdh.dataItems.Add(ss);
                }

                dt.Add(rdh);
                foreach (LASDataRow ldr in fl.dataRows)
                {
                    RawDataRow rd = new RawDataRow();
                    rd.dataItems.Add("" + ldr.depth);
                    foreach (double d in ldr.rowData)
                    {
                        rd.dataItems.Add("" + d);
                    }
                    dt.Add(rd);
                }

                ImportDataPreview.ResetTable(dt, true);

            }
            else
            {
                var rawFileReader = new RawFileReader(',');
                List<RawDataRow> dt = rawFileReader.LoadRawDataForPreview(inputFilename, ares);
                ImportDataPreview.ResetTable(dt, firstLineIsHeader);

            }
        }
Exemple #3
0
        private void LoadFileForPreview(string fileToLoad)
        {
            IOResults ares = new IOResults();

            bool firstLineIsHeader = true;// (bool)dataEntryForm.checkBoxModelFirstRowHeader.IsChecked;
            var rawFileReader = new RawFileReader((fileToLoad.ToLower().IndexOf(".csv") > -1) ? ',' : '\t');
            List<RawDataRow> dt = rawFileReader.LoadRawDataForPreview(fileToLoad, ares);
            rawFileReader.PerformColumnLoad(fileToLoad, ares, rawFileReader.MaxCols, firstLineIsHeader, workerLoadData);
            string ss = rawFileReader.GetColumnStats();
            List<string> res = rawFileReader.DetermineColumnDataTypes();
            columnDefs = new ModelColumnDefinitions();
            // collect column assignments here
            rawFileReader.SetColumnDefinitions(columnDefs);
        }
Exemple #4
0
        private void LoadTextDataForPreview(string inputFilename)
        {
            IOResults ares = new IOResults();
            // talk to the database to get the column names 
            List<ColumnMetaInfo> dbFields = null;
            if (SelectedImportType == GeneralParameters.BLOCKMODEL)
            {
                dbFields = bmDBFields;
            }
            else if (SelectedImportType == GeneralParameters.COLLAR)
            {
                dbFields = collarDBFields;
            }
            else if (SelectedImportType == GeneralParameters.ASSAY)
            {
                dbFields = assayDBFields;
            }
            else if (SelectedImportType == GeneralParameters.COAL_QUALITY)
            {
                dbFields = coalQualityDBFields;
            }
            else if (SelectedImportType == GeneralParameters.SURVEY)
            {
                dbFields = surveyDBFields;
            }
            else if (SelectedImportType == GeneralParameters.LITHO)
            {
                dbFields = lithoDBFields;
            }
            else
            {

            }
            ImportDataPreview.SetMandatoryMappingColumns(dbFields);
            ImportDataPreview.SetPreviewType("MODEL");

            bool firstLineIsHeader = true;
            var rawFileReader = new RawFileReader((SelectedFile.ToLower().IndexOf(".csv") > -1) ? ',' : '\t');
            List<RawDataRow> dt = rawFileReader.LoadRawDataForPreview(inputFilename, ares);
            if (inputFilename.ToLower().EndsWith("las"))
            {
                ImportDataPreview.ResetTable(dt, false);

            }
            else
            {
                ImportDataPreview.ResetTable(dt, firstLineIsHeader);

            }
        }