Beispiel #1
0
        void Init()
        {
            //Console.Out.WriteLine("Program Starts...");
            Global global = Global.getInstance();
            HFOrganization.GenerateNodes();
            HFOrganization.GenerateOrganizations();
            HFOrganization.GenerateNodePositionsAllRandom();
            HFEventManager handler = new HFEventManager();
            handler.LoadEvents(false);
            //HFReader.AddDefaultForwardStrategy();

            global.mainForm = (MainForm)this;
            inited = true;
        }
Beispiel #2
0
        private void generateReaderMotionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            HFGlobal global = (HFGlobal)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();

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