Пример #1
0
        public static string ToNewMapnumber50W(string oldMapnumber50W)
        {
            if (!OldMapnumberCheck.Check50W(oldMapnumber50W))
            {
                return("");
            }
            var temp   = oldMapnumber50W.Split('-');
            var new100 = temp[0] + temp[1].PadLeft(2, '0');
            var chrStr = temp[2];

            if (chrStr.Length != 1)
            {
                return("");
            }
            var x = OldMapnumber.ChangeABCDabcdTo1234(chrStr[0]);

            if (x <= 0)
            {
                return("");
            }
            var new50R = ToNew50WRow(x);
            var new50C = ToNew50WColumn(x);

            return(new100 + "B" + new50R.ToString().PadLeft(3, '0') + new50C.ToString().PadLeft(3, '0'));
        }
Пример #2
0
        public static string ToNewMapnumber2_5W(string oldMapnumber2_5W)
        {
            if (!OldMapnumberCheck.Check2_5W(oldMapnumber2_5W))
            {
                return("");
            }
            var temp   = oldMapnumber2_5W.Split('-');
            var new100 = temp[0] + temp[1].PadLeft(2, '0');
            var sub10W = temp[2];

            if (!int.TryParse(sub10W, out int x))
            {
                return("");
            }
            var new10R = ToNew10WRow(x);
            var new10C = ToNew10WColumn(x);
            var chrStr = temp[3];

            if (chrStr.Length != 1)
            {
                return("");
            }
            var sub5W   = OldMapnumber.ChangeABCDabcdTo1234(chrStr[0]);
            var new5R   = ToNew5WRow(sub5W, new10R);
            var new5C   = ToNew5WColumn(sub5W, new10C);
            var sub2_5W = int.Parse(temp[4]);
            var new2_5R = ToNew2_5WRow(sub2_5W, new5R);
            var new2_5C = ToNew2_5WColumn(sub2_5W, new5C);
            var new2    = new100 + "F" + new2_5R.ToString().PadLeft(3, '0') + new2_5C.ToString().PadLeft(3, '0');

            return(new2);
        }
Пример #3
0
        public static string ToNewMapnumber5K(string oldMapnumber5K)
        {
            if (!OldMapnumberCheck.Check5K(oldMapnumber5K))
            {
                return("");
            }
            var temp   = oldMapnumber5K.Split('-');
            var new100 = temp[0] + temp[1].PadLeft(2, '0');
            var sub10W = temp[2];

            if (!int.TryParse(sub10W, out int x))
            {
                return("");
            }
            var new10R  = ToNew10WRow(x);
            var new10C  = ToNew10WColumn(x);
            var sub1W   = temp[3];
            var subTemp = sub1W.Split(new char[] { '(', ')' }, StringSplitOptions.RemoveEmptyEntries);

            if (!int.TryParse(subTemp[0], out int k))
            {
                return("");
            }
            var new1R   = ToNew1WRow(k, new10R);
            var new1C   = ToNew1WColumn(k, new10C);
            var sub0_5W = temp[4];
            var chrStr  = temp[4];

            if (chrStr.Length != 1)
            {
                return("");
            }
            var l       = OldMapnumber.ChangeABCDabcdTo1234(chrStr[0]);
            var new0_5R = ToNew5KRow(l, new1R);
            var new0_5C = ToNew5KColumn(l, new1C);

            return(new100 + "H" + new0_5R.ToString().PadLeft(3, '0') + new0_5C.ToString().PadLeft(3, '0'));
        }