Example #1
0
        static void Main(string[] args)
        {
            Application.Init();

            Network myNetwork = new Network();

            myNetwork.AddDevices(NetworkGenerator.GenerateDevices(State.MaxDevices));

            var plot = new CPlot();

            State.SetDelegate(plot.AddCountPackets);

            MainWindow window = new MainWindow(plot);

            Logger.SetLogger(window.GetListStore());

            window.SetDelegateStartStopFunction(Protocol.StartStopGenerateOutgoingTraffic);

            GLib.Timeout.Add(100, delegate {
                Protocol.RunIteration(myNetwork);
                return(true);
            });


            window.ShowAll();

            Application.Run();


            //NetworkGenerator.GenerateConnectedLinks(myNetwork.GetDevices());
            //myNetwork.GenerateGraphFile();
        }
Example #2
0
        static void Main(string[] args) {

			Application.Init();

            Network myNetwork = new Network();

			myNetwork.AddDevices(NetworkGenerator.GenerateDevices(State.MaxDevices));

			var plot = new CPlot();

			State.SetDelegate(plot.AddCountPackets);

			MainWindow window = new MainWindow(plot);

			Logger.SetLogger(window.GetListStore());

			window.SetDelegateStartStopFunction(Protocol.StartStopGenerateOutgoingTraffic);

			GLib.Timeout.Add(100, delegate {
				Protocol.RunIteration(myNetwork);	
				return true;
			});


			window.ShowAll();
		
			Application.Run();


			//NetworkGenerator.GenerateConnectedLinks(myNetwork.GetDevices());
            //myNetwork.GenerateGraphFile();

        }
Example #3
0
        public MainWindow(CPlot pPlot) : base("AIS Model")
        {
            logWindow = new LogWindow();
            logWindow.ShowAll();

            this.DeleteEvent += (o, args) => {
                args.RetVal = true;
                Application.Quit();
            };

            this.SetSizeRequest(700, 500);

            VBox vbox1 = new VBox(false, 0);

            vbox1.PackStart(pPlot.GetPlotView(), true, false, 0);

            Button showLogButton = new Button("Log");

            showLogButton.Clicked += (object sender, EventArgs e) => {
                logWindow.ShowAll();
            };

            vbox1.PackStart(showLogButton, false, false, 0);

            Button startStopButton = new Button("Run");

            startStopButton.Clicked += (object sender, EventArgs e) => {
                if (startStopButton.Label == "Run")
                {
                    startStopButton.Label = "Stop";
                }
                else
                {
                    startStopButton.Label = "Run";
                }
                StartStopFunction();
            };
            vbox1.PackStart(startStopButton, false, false, 0);
            this.Add(vbox1);
        }
Example #4
0
		public MainWindow(CPlot pPlot) : base("AIS Model")
		{
						
			logWindow = new LogWindow();
			logWindow.ShowAll();

			this.DeleteEvent += (o, args) => {
				args.RetVal = true;
				Application.Quit();
			};

			this.SetSizeRequest(700, 500);

			VBox vbox1 = new VBox(false, 0);

			vbox1.PackStart(pPlot.GetPlotView(), true, false, 0);

			Button showLogButton = new Button("Log");

			showLogButton.Clicked += (object sender, EventArgs e) => {
				
				logWindow.ShowAll();
			};

			vbox1.PackStart(showLogButton, false, false, 0);

			Button startStopButton = new Button("Run");
			startStopButton.Clicked += (object sender, EventArgs e) => {
				if(startStopButton.Label == "Run") {
					startStopButton.Label = "Stop";
				} else {
					startStopButton.Label = "Run";
				}
				StartStopFunction();
			};
			vbox1.PackStart(startStopButton, false, false, 0);
			this.Add(vbox1);

		}