Beispiel #1
0
        public static string getIFA_BITMAP(ref string msg)
        {
            string bitmap = "";

            for (int i = 0; i < 2; i++)
            {
                for (int x = 0; x < 4; x++)
                {
                    int ihex = int.Parse(msg.Substring(x * 4, 4), NumberStyles.AllowHexSpecifier);
                    bitmap += ISOGenericFunction.ConvertNumber2Base(2, ihex).PadLeft(16, '0');
                }
                msg = msg.Substring(16, msg.Length - 16);
                if (!(bitmap.Substring(0, 1).Equals("1")))
                {
                    i = 2;
                }
            }
            return(bitmap);
        }
Beispiel #2
0
        private static string setIFA_BITMAP(Hashtable field, ISOFieldAttribute iXWork)
        {
            string r  = "";
            string rs = "";
            IDictionaryEnumerator en = field.GetEnumerator();
            bool ign = en.MoveNext(); ign = en.MoveNext();             //start from bit 2
            int  i = 2; bool Bitmap2nd = false;

            while (en.MoveNext())
            {
                if ((bool)field[i])
                {
                    r += "1";
                    if (i > 64)
                    {
                        Bitmap2nd = true;
                    }
                }
                else
                {
                    r += "0";
                }
                i++;
            }
            if (Bitmap2nd)
            {
                r = "1" + r;
            }
            else
            {
                r = "0" + r;
                r = r.Substring(0, 64);
            }
            for (int e = 0; e < r.Length / 16; e++)
            {
                rs += ISOGenericFunction.ConvertBinary2Hex(r.Substring(e * 16, 16));
            }
            return(rs);
        }