Пример #1
0
        /// <summary>
        /// Runs the RINGS algorithm on a small directory.
        /// </summary>
        /// <param name="args"></param>
        public static void t4Main(string[] args)
        {
            string t = "<drive name = \"C:\">\n" +
                       "<directory name = \"d0\"> </directory>" +
                       "<directory name = \"d0\"> </directory>" +
                       "<directory name = \"d1\">Unauthorized</directory>" +
                       "<directory name = \"d2\"><file name = \"file2\"></file><directory name = \"file3\"></directory></directory>" +
                       "</drive>";


            Tag r = XMLReaderToTree.extractTreeFromXML(XmlReader.Create(new StringReader(t)));

            printTagAndChildren(r, 0);

            Console.ReadKey();
            CircleNode layout = RINGS.MakeLayout(r, 350);

            Console.WriteLine("Circles:");
            Circle tempC;

            Console.ReadKey();
            RINGSForm f = (new RINGSForm(700, 700));

            f.Show();
            f.DrawAllCircles(layout);
            Console.ReadKey();
            //Console.WriteLine("Saving image");
            //f.Refresh();
            //f.drawToFile(@"C:\Users\Emad\Desktop\fileSystem.png");
            Console.ReadKey();
        }
Пример #2
0
        public static void t6Main(String[] args)
        {
            Tag r = XMLReaderToTree.extractDirectory(
                @"C:\Users\Emad\Dropbox\DTU\Bachelor projekt\report\file-systems\many-equal-files.xml", "");

            //printTagAndChildren(r, 0);
            int drawingSize = 100;

            Console.WriteLine("Loaded tree.");
            CircleNode layout = RINGS.MakeLayout(r, drawingSize);

            Console.WriteLine("Created layout.");

            RINGSForm f = new RINGSForm(drawingSize * 2, drawingSize * 2);

            f.Show();
            f.DrawAllCircles(layout);
            f.drawToFile(@"C:\Users\Emad\Dropbox\DTU\Bachelor projekt\report\file-systems\many-equal-files" + "-master.png");
            Console.ReadLine();
        }
Пример #3
0
        /// <summary>
        /// Loads the system creenshot and runs the RINGS algorithm, saving the result
        /// in a PNG file.
        /// </summary>
        /// <param name="args"></param>
        public static void t5Main(string[] args)
        {
            Tag r = XMLReaderToTree.extractDirectory(
                @"C:\Users\Emad\Dropbox\DTU\Bachelor projekt\File system screenshots\FS SS 15-03-16.xml", "");

            //printTagAndChildren(r, 0);
            int drawingSize = 8000;

            Console.WriteLine("Loaded tree.");
            CircleNode layout = RINGS.MakeLayout(r, drawingSize);

            Console.WriteLine("Created layout.");

            RINGSForm f = new RINGSForm(drawingSize * 2, drawingSize * 2);

            f.Show();
            f.DrawAllCircles(layout);
            f.drawToFile(@"C:\Users\Emad\Dropbox\DTU\Bachelor projekt\File system screenshots\FS SS 15-03-16.png");
            Console.ReadLine();
        }