Exemplo n.º 1
0
        public string ToStringSDR <T>() where T : IFormatSDR
        {
            string sdrString = string.Empty;

            var properties = this.GetType().GetProperties();

            foreach (PropertyInfo property in properties)
            {
                var    attributes    = property.GetCustomAttributes(typeof(T), false);
                int    numChar       = (int)((T)attributes[0]).GetValue();
                string propertyValue = (string)property.GetValue(this, null);
                if (property.Name == "Version")
                {
                    if (typeof(FormatSDR33).Equals(typeof(T)))
                    {
                        propertyValue = "SDR33 V04-04.02 ";
                    }
                    else if (typeof(FormatSDR20).Equals(typeof(T)))
                    {
                        propertyValue = "SDR20V03-05     ";
                    }
                }
                sdrString += DataSDR.Format(propertyValue, numChar);
            }

            return(sdrString += "1");
        }
Exemplo n.º 2
0
        public string ToStringSDR <T>() where T : IFormatSDR
        {
            string sdrString = string.Empty;

            var properties = this.GetType().GetProperties();

            foreach (PropertyInfo property in properties)
            {
                var    attributes    = property.GetCustomAttributes(typeof(T), false);
                int    numChar       = (int)((T)attributes[0]).GetValue();
                string propertyValue = (string)property.GetValue(this, null);
                sdrString += DataSDR.Format(propertyValue, numChar);
            }

            return(sdrString);
        }
Exemplo n.º 3
0
        public static void ToText(LandParcel parcel, string pathExport, ExportFileFormat formatExport)
        {
            string txtData = "#Parcel_" + parcel.FindInfo("SC").Value;

            if (formatExport == ExportFileFormat.NXYZC)
            {
                txtData += "\r\n# NumberPoint; Northing; Easting ; Elevation; Code";
            }
            else if (formatExport == ExportFileFormat.NYXZC)
            {
                txtData += "\r\n# NumberPoint; Easting;  Northing; Elevation; Code";
            }
            else if (formatExport == ExportFileFormat.CREDO_DAT_TOP)
            {
                //txtData += "\r\n# NumberPoint; Code;  Northing; Easting; Elevation; ???";
            }

            int index = 0;

            foreach (AcGe.Point2d point in parcel.Points)
            {
                index++;

                if (formatExport == ExportFileFormat.NXYZC)
                {
                    txtData += "\r\n" + index.ToString("0000") + "; " +
                               point.Y.ToString("0.000").Replace(",", ".") + "; " +
                               point.X.ToString("0.000").Replace(",", ".") + "; 0.000; точка_межі";
                }
                else if (formatExport == ExportFileFormat.NYXZC)
                {
                    txtData += "\r\n" + index.ToString("0000") + "; " +
                               point.X.ToString("0.000").Replace(",", ".") + "; " +
                               point.Y.ToString("0.000").Replace(",", ".") + "; 0.000; точка_межі";
                }
                else if (formatExport == ExportFileFormat.CREDO_DAT_TOP)
                {
                    txtData += "\r\n" + DataSDR.Format(index.ToString(), 8, AlignmentText.ToLeft) + " 001 " +
                               DataSDR.Format(point.Y.ToString("0.000").Replace(",", "."), 12, AlignmentText.ToRight) + " " +
                               DataSDR.Format(point.X.ToString("0.000").Replace(",", "."), 12, AlignmentText.ToRight) + " " +
                               DataSDR.Format(("0.000"), 12, AlignmentText.ToRight) + " " + "   0";
                }
            }

            SaveFile(txtData, pathExport);
        }
Exemplo n.º 4
0
        public static void ToSDR(LandParcel parcel, string pathExport, ExportFileFormat formatExport)
        {
            DataSDR sdr = new DataSDR();

            HeaderRecordSDR hrSDR = new HeaderRecordSDR();

            sdr.Recording.Add(hrSDR);

            JobRecordSDR jrSDR = new JobRecordSDR();

            jrSDR.JobName = "Parcel_" + parcel.FindInfo("SC").Value;
            sdr.Recording.Add(jrSDR);

            int    index   = 0;
            string sdrData = "";

            foreach (AcGe.Point2d point in parcel.Points)
            {
                index++;
                CoordinatesRecordSDR crSDR =
                    new CoordinatesRecordSDR(
                        index.ToString(),
                        new AcGe.Point3d(new AcGe.Plane(), point),
                        parcel.FindInfo("SC").Value);
                sdr.Recording.Add(crSDR);

                if (formatExport == ExportFileFormat.SDR20)
                {
                    sdrData = sdr.ToStringSDR <FormatSDR20>();
                }
                else if (formatExport == ExportFileFormat.SDR33)
                {
                    sdrData = sdr.ToStringSDR <FormatSDR33>();
                }
            }

            SaveFile(sdrData, pathExport);
        }
Exemplo n.º 5
0
        public string ToStringSDR <T>() where T : IFormatSDR
        {
            string sdrString = string.Empty;

            var properties = this.GetType().GetProperties();

            foreach (PropertyInfo property in properties)
            {
                var    attributes    = property.GetCustomAttributes(typeof(T), false);
                int    numChar       = (int)((T)attributes[0]).GetValue();
                string propertyValue = (string)property.GetValue(this, null);
                string propertyName  = (string)property.Name;
                if (propertyName == "NamePoint")
                {
                    sdrString += DataSDR.Format(propertyValue, numChar, AlignmentText.ToRight);
                }
                else
                {
                    sdrString += DataSDR.Format(propertyValue, numChar, AlignmentText.ToLeft);
                }
            }

            return(sdrString);
        }