コード例 #1
0
        /// <summary>
        /// 16進数文字列→その他文字列変換処理
        /// </summary>
        public void ConvertHexStringToOtherString()
        {
            uint workdata;

            // 数値変換
            workdata = Convert.ToUInt32(HexString, 16);

            // 基数変換
            DecString = Convert.ToString(workdata, 10);
            BinString = Convert.ToString(workdata, 2);
            BinString = BinString.PadLeft(BinString_MaxDigit, '0');
        }
コード例 #2
0
        /// <summary>
        /// 設定データ→設定数値変換処理
        /// </summary>
        public void ConvertSettingsToString()
        {
            uint workdata = 0;

            // 各設定値を設定して、数値変換する
            if (DACSelectData == DACSelectData_VOUT1)
            {
                workdata |= DACSelectData_Bit_VOUT1;
            }
            else if (DACSelectData == DACSelectData_VOUT2)
            {
                workdata |= DACSelectData_Bit_VOUT2;
            }
            else if (DACSelectData == DACSelectData_VOUT3)
            {
                workdata |= DACSelectData_Bit_VOUT3;
            }
            else if (DACSelectData == DACSelectData_VOUT4)
            {
                workdata |= DACSelectData_Bit_VOUT4;
            }
            else if (DACSelectData == DACSelectData_VOUT5)
            {
                workdata |= DACSelectData_Bit_VOUT5;
            }
            else if (DACSelectData == DACSelectData_VOUT6)
            {
                workdata |= DACSelectData_Bit_VOUT6;
            }
            else if (DACSelectData == DACSelectData_VOUT7)
            {
                workdata |= DACSelectData_Bit_VOUT7;
            }
            else if (DACSelectData == DACSelectData_VOUT8)
            {
                workdata |= DACSelectData_Bit_VOUT8;
            }
            else
            {
                ;
            }

            workdata |= Convert.ToUInt32(DACData, 10);

            HexString = Convert.ToString(workdata, 16);
            HexString = HexString.PadLeft(HexString_MaxDigit, '0');
            DecString = Convert.ToString(workdata, 10);
            BinString = Convert.ToString(workdata, 2);
            BinString = BinString.PadLeft(BinString_MaxDigit, '0');
        }