Exemplo n.º 1
0
        /// <summary>Gibt einen CADdy formatierten String zurück</summary>
        /// <param name="settings"></param>
        /// <returns></returns>
        public String getCADdyFormatString(Settings settings)
        {
            String result = new String(' ', 255);
            String temp   = ClassStringTools.lSetFull(_punktnummer, settings.PointName_Length, " ");

            ClassStringTools.overrideSubStr(ref result, temp, settings.PointName_Start - 1, settings.PointName_Length);

            temp = ClassStringTools.rSetFull(ClassConverters.ToString(this._rechtswert, settings.Decimalseperator, "", settings.Koord_RW_E_Decimals, settings.Koord_RW_E_Decimals, false), settings.Koord_RW_E_Length, " ");
            ClassStringTools.overrideSubStr(ref result, temp, settings.Koord_RW_E_Start - 1, settings.Koord_RW_E_Length);

            temp = ClassStringTools.rSetFull(ClassConverters.ToString(this._hochwert, settings.Decimalseperator, "", settings.Koord_HW_N_Decimals, settings.Koord_HW_N_Decimals, false), settings.Koord_HW_N_Length, " ");
            ClassStringTools.overrideSubStr(ref result, temp, settings.Koord_HW_N_Start - 1, settings.Koord_HW_N_Length);

            temp = ClassStringTools.rSetFull(ClassConverters.ToString(this._hoehe, settings.Decimalseperator, "", settings.Koord_Elev_Decimals, settings.Koord_Elev_Decimals, false), settings.Koord_Elev_Length, " ");
            ClassStringTools.overrideSubStr(ref result, temp, settings.Koord_Elev_Start - 1, settings.Koord_Elev_Length);

            temp = ClassStringTools.lSetFull(_code, settings.Koord_Code_Length, " ");
            ClassStringTools.overrideSubStr(ref result, temp, settings.Koord_Code_Start - 1, settings.Koord_Code_Length);

            if (!ClassStringTools.IsNullOrWhiteSpace(_bemerkung))
            {
                temp = ClassStringTools.lSetFull(_bemerkung, settings.Koord_Descript_Length, " ");
                ClassStringTools.overrideSubStr(ref result, temp, settings.Koord_Descript_Start - 1, settings.Koord_Descript_Length);
            }
            return(result.TrimEnd(' '));
        }
Exemplo n.º 2
0
        /// <summary>Gibt einen CADdy formatierten String zurück</summary>
        /// <param name="settings"></param>
        /// <returns></returns>
        public String getCADdyFormatString(Settings settings)
        {
            String result = new String(' ', 255);
            String temp   = ClassStringTools.lSetFull(Zielpunkt, settings.PointName_Length, " ");

            ClassStringTools.overrideSubStr(ref result, temp, settings.PointName_Start - 1, settings.PointName_Length);

            temp = ClassStringTools.rSetFull(ClassConverters.ToString(this.Hz, settings.Decimalseperator, "", settings.Messd_Hz_Decimals, settings.Messd_Hz_Decimals, false), settings.Messd_Hz_Length, " ");
            ClassStringTools.overrideSubStr(ref result, temp, settings.Messd_Hz_Start - 1, settings.Messd_Hz_Length);

            temp = ClassStringTools.rSetFull(ClassConverters.ToString(this.S, settings.Decimalseperator, "", settings.Messd_S_Decimals, settings.Messd_S_Decimals, false), settings.Messd_S_Length, " ");
            ClassStringTools.overrideSubStr(ref result, temp, settings.Messd_S_Start - 1, settings.Messd_S_Length);

            temp = ClassStringTools.rSetFull(ClassConverters.ToString(this.V, settings.Decimalseperator, "", settings.Messd_V_Decimals, settings.Messd_V_Decimals, false), settings.Messd_V_Length, " ");
            ClassStringTools.overrideSubStr(ref result, temp, settings.Messd_V_Start - 1, settings.Messd_V_Length);

            temp = ClassStringTools.rSetFull(ClassConverters.ToString(this.D, settings.Decimalseperator, "", settings.Messd_D_Decimals, settings.Messd_D_Decimals, false), settings.Messd_D_Length, " ");
            ClassStringTools.overrideSubStr(ref result, temp, settings.Messd_D_Start - 1, settings.Messd_D_Length);

            temp = ClassStringTools.lSetFull(Code, settings.Messd_Code_Length, " ");
            ClassStringTools.overrideSubStr(ref result, temp, settings.Messd_Code_Start - 1, settings.Messd_Code_Length);

            if (!ClassStringTools.IsNullOrWhiteSpace(Bemerkung))
            {
                temp = ClassStringTools.lSetFull(Bemerkung, settings.Messd_Descript_Length, " ");
                ClassStringTools.overrideSubStr(ref result, temp, settings.Messd_Descript_Start - 1, settings.Messd_Descript_Length);
            }
            return(result.TrimEnd(' '));
        }