示例#1
0
        void Init()
        {
            Global global = Global.getInstance();
            //Console.Out.WriteLine("Program Starts...");
            try
            {
                MODOrganization.GenerateNodes();
                MODOrganization.GenerateOrganizations();
                MODOrganization.GenerateNodePositionsAllRandom();
                MODEventManager handler = new MODEventManager();
                handler.LoadEvents(false);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Console.WriteLine(ex.StackTrace);
            }

            global.mainForm = (MainForm)this;
            inited = true;
        }
示例#2
0
        private void generateReaderMotionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MODGlobal global = (MODGlobal)Global.getInstance();
            MoveForm f = new MoveForm();
            f.nodeNum = global.readerNum;
            DialogResult r = f.ShowDialog();
            if (f.ok != true)
                return;
            int nodeCount = (int)(global.readerNum * f.nodeRatio);
            double nodeSpeed = f.nodeSpeed;
            int eventCount = f.eventCount;
            bool clear = f.clear;
            string filename = f.filename;
            EventGenerator generator = new EventGenerator();

            if(global.eventsFileName != filename)
                File.Copy(global.eventsFileName, filename, true);
            if (clear)
                generator.ClearEvents(filename, "MOV");
            generator.GenerateRandomObjectMotionEvents(true, nodeSpeed, eventCount, nodeCount, NodeType.READER, filename);
            MODEventManager manager = new MODEventManager();
            manager.LoadEvents(clear);
            if (f.outputAsDefault)
                global.eventsFileName = f.filename;
            MessageBox.Show("Done");
        }