|
@@ -17,6 +17,7 @@ import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.Model;
|
|
|
import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.Packet;
|
|
|
import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.PacketCollector;
|
|
|
import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.Port;
|
|
|
+import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.PrecisionLink;
|
|
|
import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.Protocol;
|
|
|
import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.SmartDevice;
|
|
|
import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.protocols.MQTT_protocol;
|
|
@@ -74,6 +75,7 @@ public class Main {
|
|
|
//initializeTest();
|
|
|
//initializeMQTTTest();
|
|
|
//initializeUserStudy();
|
|
|
+ initializePerformanceTest();
|
|
|
//Test packetCapture
|
|
|
//sim.getPacketCaptureController().addPacketCollector(new PacketCollector(new SimplePacketSniffer()));
|
|
|
v = new MainFrame(controller);
|
|
@@ -84,11 +86,40 @@ public class Main {
|
|
|
//testPackageCollection();
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ private static void initializePerformanceTest(){
|
|
|
+ SmartDevice tic = new SmartDevice("Tic");
|
|
|
+ tic.setX(100);
|
|
|
+ tic.setY(100);
|
|
|
+ SmartDevice toc = new SmartDevice("Toc");
|
|
|
+ toc.setX(100);
|
|
|
+ toc.setY(250);
|
|
|
+ c.addSmartDevice(tic);
|
|
|
+ c.addSmartDevice(toc);
|
|
|
+
|
|
|
+ Link l = new PrecisionLink("Channel");
|
|
|
+ c.addLink(l);
|
|
|
+ c.addLinkToDevice(l, tic);
|
|
|
+ c.addLinkToDevice(l, toc);
|
|
|
+
|
|
|
+ Port ticP = new Port(tic, (short)2, 200, (short)0, 0, (short)0);
|
|
|
+ Port tocP = new Port(toc, (short)3, 200, (short)0, -100, (short)0);
|
|
|
+ tic.addPort(ticP);
|
|
|
+ toc.addPort(tocP);
|
|
|
+
|
|
|
+ Connection con = new ConnectionPrecision(l, new SimpleProtocol());
|
|
|
+ c.addConnection(con);
|
|
|
+ c.addConnectionToLink(con, l);
|
|
|
+ c.addDeviceToConnectionAndProtocol(ticP, con, 0);
|
|
|
+ c.addDeviceToConnectionAndProtocol(tocP, con, 1);
|
|
|
+ sim.setCurrentTime(-1);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Initializes a basic test Network, which contains a few SmartDevices, one Link and one Connection
|
|
|
*/
|
|
|
- //@SuppressWarnings("unused")
|
|
|
- public static void initializeUserStudy(){
|
|
|
+ @SuppressWarnings("unused")
|
|
|
+ private static void initializeUserStudy(){
|
|
|
/**
|
|
|
* Preset one SmartDevice
|
|
|
*/
|