|
@@ -1,6 +1,5 @@
|
|
package de.tu_darmstadt.tk.SmartHomeNetworkSim.view.popups;
|
|
package de.tu_darmstadt.tk.SmartHomeNetworkSim.view.popups;
|
|
|
|
|
|
-import java.awt.print.Paper;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.Iterator;
|
|
import java.util.Iterator;
|
|
import java.util.LinkedList;
|
|
import java.util.LinkedList;
|
|
@@ -249,13 +248,11 @@ public class MenuBarNetworkExamples extends JMenu{
|
|
B.addLink(link);
|
|
B.addLink(link);
|
|
C.addLink(link);
|
|
C.addLink(link);
|
|
|
|
|
|
- Port a = new Port(A, (short) 1);
|
|
|
|
|
|
+ Port a = new Port(A, (short) 1, 68);
|
|
a.setLastTrigger(0);
|
|
a.setLastTrigger(0);
|
|
- a.setTriggerInterval(68);
|
|
|
|
a.setStatus(Port.SENDING);
|
|
a.setStatus(Port.SENDING);
|
|
A.addPort(a);
|
|
A.addPort(a);
|
|
- Port b = new Port(B, (short) 2);
|
|
|
|
- b.setTriggerInterval(102);
|
|
|
|
|
|
+ Port b = new Port(B, (short) 2, 102);
|
|
b.setStatus(Port.SENDING);
|
|
b.setStatus(Port.SENDING);
|
|
B.addPort(b);
|
|
B.addPort(b);
|
|
|
|
|
|
@@ -285,9 +282,8 @@ public class MenuBarNetworkExamples extends JMenu{
|
|
broker.setY((int)(Math.random()*settingsController.getWidth()-2*settingsController.getDeviceVisualizationRadius())+settingsController.getDeviceVisualizationRadius());
|
|
broker.setY((int)(Math.random()*settingsController.getWidth()-2*settingsController.getDeviceVisualizationRadius())+settingsController.getDeviceVisualizationRadius());
|
|
networkController.addSmartDevice(broker);
|
|
networkController.addSmartDevice(broker);
|
|
|
|
|
|
- Port brokerPort = new Port(broker, (short) 0);
|
|
|
|
|
|
+ Port brokerPort = new Port(broker, (short) 0, 987);
|
|
brokerPort.setLastTrigger(0);
|
|
brokerPort.setLastTrigger(0);
|
|
- brokerPort.setTriggerInterval(987);
|
|
|
|
brokerPort.setStatus(Port.OPEN);
|
|
brokerPort.setStatus(Port.OPEN);
|
|
broker.addPort(brokerPort);
|
|
broker.addPort(brokerPort);
|
|
|
|
|
|
@@ -316,9 +312,8 @@ public class MenuBarNetworkExamples extends JMenu{
|
|
link.addDevice(A);
|
|
link.addDevice(A);
|
|
A.addLink(link);
|
|
A.addLink(link);
|
|
|
|
|
|
- aP = new Port(A,((short) (3*i+1)));
|
|
|
|
|
|
+ aP = new Port(A,((short) (3*i+1)),100+(int)(Math.random()*900));
|
|
aP.setLastTrigger(0);
|
|
aP.setLastTrigger(0);
|
|
- aP.setTriggerInterval(100+(int)(Math.random()*900));
|
|
|
|
aP.setJitter((short) (Math.random()*50));
|
|
aP.setJitter((short) (Math.random()*50));
|
|
aP.setStatus(Port.SENDING);
|
|
aP.setStatus(Port.SENDING);
|
|
aP.setConnection(con);
|
|
aP.setConnection(con);
|
|
@@ -337,9 +332,8 @@ public class MenuBarNetworkExamples extends JMenu{
|
|
link.addDevice(A1);
|
|
link.addDevice(A1);
|
|
A1.addLink(link);
|
|
A1.addLink(link);
|
|
|
|
|
|
- a1P = new Port(A1,((short) (3*i+1)));
|
|
|
|
|
|
+ a1P = new Port(A1,((short) (3*i+1)),100+(int)(Math.random()*900));
|
|
a1P.setLastTrigger(0);
|
|
a1P.setLastTrigger(0);
|
|
- a1P.setTriggerInterval(100+(int)(Math.random()*900));
|
|
|
|
a1P.setJitter((short) (Math.random()*50));
|
|
a1P.setJitter((short) (Math.random()*50));
|
|
a1P.setStatus(Port.SENDING);
|
|
a1P.setStatus(Port.SENDING);
|
|
a1P.setConnection(con);
|
|
a1P.setConnection(con);
|
|
@@ -358,9 +352,8 @@ public class MenuBarNetworkExamples extends JMenu{
|
|
link.addDevice(A2);
|
|
link.addDevice(A2);
|
|
A2.addLink(link);
|
|
A2.addLink(link);
|
|
|
|
|
|
- a2P = new Port(A2,((short) (3*i+1)));
|
|
|
|
|
|
+ a2P = new Port(A2,((short) (3*i+1)),100+(int)(Math.random()*900));
|
|
a2P.setLastTrigger(0);
|
|
a2P.setLastTrigger(0);
|
|
- a2P.setTriggerInterval(100+(int)(Math.random()*900));
|
|
|
|
a2P.setJitter((short) (Math.random()*50));
|
|
a2P.setJitter((short) (Math.random()*50));
|
|
a2P.setStatus(Port.SENDING);
|
|
a2P.setStatus(Port.SENDING);
|
|
a2P.setConnection(con);
|
|
a2P.setConnection(con);
|
|
@@ -380,9 +373,8 @@ public class MenuBarNetworkExamples extends JMenu{
|
|
link.addDevice(B);
|
|
link.addDevice(B);
|
|
B.addLink(link);
|
|
B.addLink(link);
|
|
|
|
|
|
- bP = new Port(B,((short) (3*i+2)));
|
|
|
|
|
|
+ bP = new Port(B,((short) (3*i+2)),10+(int)(Math.random()*190));
|
|
bP.setLastTrigger(0);
|
|
bP.setLastTrigger(0);
|
|
- bP.setTriggerInterval(10+(int)(Math.random()*190));
|
|
|
|
bP.setJitter((short) (Math.random()*50));
|
|
bP.setJitter((short) (Math.random()*50));
|
|
bP.setStatus(Port.SENDING);
|
|
bP.setStatus(Port.SENDING);
|
|
bP.setConnection(con);
|
|
bP.setConnection(con);
|
|
@@ -399,9 +391,8 @@ public class MenuBarNetworkExamples extends JMenu{
|
|
link.addDevice(C);
|
|
link.addDevice(C);
|
|
C.addLink(link);
|
|
C.addLink(link);
|
|
|
|
|
|
- cP = new Port(C,((short) (3*i+1)));
|
|
|
|
|
|
+ cP = new Port(C,((short) (3*i+1)), 50+(int)(Math.random()*450));
|
|
cP.setLastTrigger(0);
|
|
cP.setLastTrigger(0);
|
|
- cP.setTriggerInterval(50+(int)(Math.random()*450));
|
|
|
|
cP.setJitter((short) (Math.random()*50));
|
|
cP.setJitter((short) (Math.random()*50));
|
|
cP.setStatus(Port.SENDING);
|
|
cP.setStatus(Port.SENDING);
|
|
cP.setConnection(con);
|
|
cP.setConnection(con);
|
|
@@ -445,8 +436,7 @@ public class MenuBarNetworkExamples extends JMenu{
|
|
inetAcces.setName("Cloud Access");
|
|
inetAcces.setName("Cloud Access");
|
|
networkController.addConnectionToLink(inetAcces, wifi);
|
|
networkController.addConnectionToLink(inetAcces, wifi);
|
|
inetAcces.setProtocol(new SimpleProtocol());
|
|
inetAcces.setProtocol(new SimpleProtocol());
|
|
- Port pRouter = new Port(router, (short)80, 1000L);
|
|
|
|
- pRouter.setTriggerInterval(-500L);
|
|
|
|
|
|
+ Port pRouter = new Port(router, (short)80, 500L);
|
|
networkController.addDeviceToConnectionAndProtocol(pRouter, inetAcces, 0);
|
|
networkController.addDeviceToConnectionAndProtocol(pRouter, inetAcces, 0);
|
|
Port pZigBee = new Port(zigBeeRouter, (short)80, 1000L);
|
|
Port pZigBee = new Port(zigBeeRouter, (short)80, 1000L);
|
|
networkController.addDeviceToConnectionAndProtocol(pRouter, inetAcces, 0);
|
|
networkController.addDeviceToConnectionAndProtocol(pRouter, inetAcces, 0);
|
|
@@ -477,10 +467,9 @@ public class MenuBarNetworkExamples extends JMenu{
|
|
floatSensor.setFSmin(15.0f);
|
|
floatSensor.setFSmin(15.0f);
|
|
floatSensor.setFSmax(32.0f);
|
|
floatSensor.setFSmax(32.0f);
|
|
networkController.addSmartDevice(floatSensor);
|
|
networkController.addSmartDevice(floatSensor);
|
|
- Port pFloatSensor = new Port(floatSensor, (short)1883);
|
|
|
|
|
|
+ Port pFloatSensor = new Port(floatSensor, (short)1883, 15000);
|
|
pFloatSensor.setStatus(Port.SENDING);
|
|
pFloatSensor.setStatus(Port.SENDING);
|
|
pFloatSensor.setLastTrigger(-357L);
|
|
pFloatSensor.setLastTrigger(-357L);
|
|
- pFloatSensor.setTriggerInterval(15000);//15sek
|
|
|
|
networkController.addDeviceToConnectionAndProtocol(pFloatSensor, mqtt,1);
|
|
networkController.addDeviceToConnectionAndProtocol(pFloatSensor, mqtt,1);
|
|
|
|
|
|
|
|
|