Esempio n. 1
0
        void Init()
        {
            IOTGlobal global = (IOTGlobal)Global.getInstance();
            //Console.Out.WriteLine("Program Starts...");
            try
            {
                IOTOrganization.GenerateNodes();
                IOTOrganization.GenerateOrganizations();
                IOTOrganization.GenerateNodePositionsAllRandom();
                global.trustManager = global.trustManagerConstructor();
                IOTEventManager handler = new IOTEventManager();
                handler.LoadEvents(false);
                IOTReader.SetReaderTypes();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Console.WriteLine(ex.StackTrace);
            }

            global.mainForm = (MainForm)this;
            inited = true;
        }
Esempio n. 2
0
        void Init()
        {
            //Console.Out.WriteLine("Program Starts...");
            Global global = Global.getInstance();
            IOTOrganization.GenerateNodes();
            IOTOrganization.GenerateOrganizations();
            IOTOrganization.GenerateNodePositionsAllRandom();
            ((IOTGlobal)global).trustManager = ((IOTGlobal)global).trustManagerConstructor();
            IOTEventManager handler = new IOTEventManager();
            handler.LoadEvents(false);
            IOTReader.SetReaderTypes();
            Reader.AddDefaultForwardStrategy();

            global.mainForm = (MainForm)this;
            inited = true;
        }
Esempio n. 3
0
 private void generateReaderMotionToolStripMenuItem_Click(object sender, EventArgs e)
 {
     IOTGlobal global = (IOTGlobal)Global.getInstance();
     MoveForm f = new MoveForm();
     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;
     EventGenerator generator = new EventGenerator();
     if (clear)
         generator.ClearEvents(global.eventsFileName, "MOV");
     generator.GenerateRandomObjectMotionEvents(true, nodeSpeed, eventCount, nodeCount, NodeType.READER, global.eventsFileName);
     IOTEventManager manager = new IOTEventManager();
     manager.LoadEvents(clear);
     MessageBox.Show("Done");
 }