void Init() { //Console.Out.WriteLine("Program Starts..."); Global global = Global.getInstance(); PrivacyOrganization.GenerateNodes(); PrivacyOrganization.GenerateOrganizations(); PrivacyOrganization.GenerateNodePositionsAllRandom(); PrivacyOrganization.GenerateObjectPositionsAllRandom(); PrivacyEventManager handler = new PrivacyEventManager(); handler.LoadEvents(false); //IOTReader.SetReaderTypes(); global.mainForm = (MainForm)this; inited = true; }
private void generateReaderMotionToolStripMenuItem_Click(object sender, EventArgs e) { PrivacyGlobal global = (PrivacyGlobal)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); PrivacyEventManager manager = new PrivacyEventManager(); manager.LoadEvents(true); MessageBox.Show("Done"); }