List of commits:
Subject Hash Author Date (UTC)
Test case 2 9ea6eadbd85dde0e9522068718092b1f0e9b49f0 Jan Allersma 2017-10-29 22:37:57
Added threading. 4540fe1669c9e145e613edf2459031e7bec500ea Jan Allersma 2017-10-29 20:47:49
Code for testing 16/10/17. Use simulatie/rabbit/combination.py mainly. c5e87d7fe5abbcd3316b1538a0d647fd23faa59f Jan Allersma 2017-10-15 19:13:23
Added more paths. Some of them are WIP. 03ad1039e22bd1ebd301bda99e78f38239a15077 Jan Allersma 2017-09-21 14:40:44
Added paths... 5561d21918f048a40ca9686112638a48805917e3 Jan Allersma 2017-09-21 13:06:43
Added first paths of crossroad. Also added reference of crossroad. 43a5ddf291e38b47bad02a92af58839d86f9d449 Jan Allersma 2017-09-21 12:21:53
Added first paths of crossroad. Also added reference of crossroad. bb687a8152231d0c89fed827baefcfbf067be90c Jan Allersma 2017-09-21 12:21:11
Fixed typo. db82c84f8d834e62cb37333ff973ddc54af5372f Jan Allersma 2017-09-20 20:51:15
RabbitMQ test.First attempt. 876d29c668f5e027a820f3ff48a6ca080fc530c2 Jan Allersma 2017-09-19 13:47:31
Initial commit 6a565c61a3337232d0e7a136ffb2f49b431c2a40 Jan Allersma 2017-09-11 06:52:38
Commit 9ea6eadbd85dde0e9522068718092b1f0e9b49f0 - Test case 2
Author: Jan Allersma
Author date (UTC): 2017-10-29 22:37
Committer name: Jan Allersma
Committer date (UTC): 2017-10-29 22:37
Parent(s): 4540fe1669c9e145e613edf2459031e7bec500ea
Signer:
Signing key:
Signing status: N
Tree: 97bfb17895f6a78cd3b9ada4b5a81905b75a0c79
File Lines added Lines deleted
simulatie/rabbit/connection.py 17 14
simulatie/rabbit/traffic.py 33 0
File simulatie/rabbit/connection.py renamed from simulatie/rabbit/combination.py (similarity 66%) (mode: 100644) (index f8dfbfa..0ff3b76)
1 #!/usr/bin/env python
2
3 1 import pika import pika
4 2 import model import model
3 import threading
5 4
6 5 creds = pika.PlainCredentials(model.uname, model.passwd) creds = pika.PlainCredentials(model.uname, model.passwd)
7 6 connection = pika.BlockingConnection(pika.ConnectionParameters(host=model.host, virtual_host=model.vhost, credentials=creds)) connection = pika.BlockingConnection(pika.ConnectionParameters(host=model.host, virtual_host=model.vhost, credentials=creds))
 
... ... channel.exchange_declare(
12 11 exchange_type='direct' exchange_type='direct'
13 12 ) )
14 13
15 channel.basic_publish (
16 exchange='1234',
17 routing_key=model.vhost,
18 body='Simulator ' + model.vhost
19 )
20
21 print('Msg sent.')
22
23 14 result = channel.queue_declare(exclusive=True) result = channel.queue_declare(exclusive=True)
24 15 queuename = result.method.queue queuename = result.method.queue
25 16
 
... ... channel.basic_consume (
38 29 no_ack=True no_ack=True
39 30 ) )
40 31
41 print('Waiting for a sign..')
42 channel.start_consuming()
43
44 #connection.close()
32 def sendMsg(msg):
33 channel.basic_publish (
34 exchange='1234',
35 routing_key=model.vhost,
36 body=msg
37 )
38 print('Msg sent.')
39
40 def listen():
41 print('Waiting for a sign..')
42 channel.start_consuming()
43
44 thread = threading.Thread(target=listen)
45 thread.setDaemon(True)
46 thread.start()
47 thread.join(0)
File simulatie/rabbit/traffic.py added (mode: 100644) (index 0000000..2fabb42)
1 import json
2 import time
3 import sys
4
5 import connection
6
7 # lights = [[id, amountOfCars, DirRequests]]
8 lights = [
9 [101, 0, None]
10 ]
11
12 msg = ''
13
14 def update(index, amountOfCars, dirRequests):
15 lights[index][1] = amountOfCars
16 lights[index][2] = dirRequests
17
18 msg = json.dumps({
19 "TrafficUpdate": {
20 "LightId": lights[index][0],
21 "Count": lights[index][1],
22 "DirectionRequests": lights[index][2]
23 }
24 }, sort_keys=True, indent=4, separators=(',',': '))
25
26 connection.sendMsg(msg)
27
28 update(0, 1, None)
29 time.sleep(5)
30 update(0, 0, None)
31
32 raw_input()
33 sys.exit()
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/kapstok/NHL-SoftDev

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/kapstok/NHL-SoftDev

Clone this repository using git:
git clone git://git.rocketgit.com/user/kapstok/NHL-SoftDev

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main