Skip to content

Commit 99d2f0d

Browse files
committed
updated stuff
1 parent aa9cae9 commit 99d2f0d

File tree

9 files changed

+51
-32
lines changed

9 files changed

+51
-32
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Structure of the project
2222
* The program that serializes the sensor data from the arduino into x,y coordinates is found in the <b>client</b> folder.<br>
2323
* The webapp that streams the board data to the website in real time can be found in the <b>webapp</b> folder.
2424

25+
The README.md in each folder will explain how to set up the project.
26+
2527
Technical Details:
2628
=========
2729
A chalk-holder is attached to two strings, each connected over a pulley to a weight. The weights sit in static equilibrium, so they serve the purpose of keeping the string taut without negatively interfering with the writer.

client/README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
String2string client application
22
=========
33

4-
Interfaces with the chalkboard and arduino
4+
Interfaces with the chalkboard and arduino
5+
6+
Requirements
7+
=========
8+
* must have Python 3
9+
* must have pyserial
10+
* preferably run it on a linux machine
11+
12+
Running the app
13+
=========
14+
<b>Must</b> set the webserver ip address in client.py.
15+
16+
To run the program:
17+
```
18+
python client.py
19+
```

client/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python
22
import string2string.string2string as s2s
33

4+
#EDIT THE FOLLOWING LINE
45
client = s2s.Client('string2string.mybluemix.net')
56
#client = s2s.Client('hackcooper.cloudapp.net')
67

webapp/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ npm install
1616
bower install
1717
sass public/css/main.scss > public/css/main.css
1818
```
19-
also must edit the settings in public/js/app.js and set the $rootScope.baseUrl to the address of the webserver
19+
also <b>must</b> edit the settings in public/js/app.js and set the $rootScope.baseUrl to the address of the webserver
20+
This will enable the websockets to connect to the correct server.
2021

2122
to run server:
2223
```

webapp/public/js/app.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ var app = angular.module('smartboard', [
77
'ngRoute',
88
'http-auth-interceptor',
99
'ui.bootstrap',
10-
'controllers.test'
10+
'controllers.board'
1111
]);
1212

1313
function configApp($routeProvider, $locationProvider) {
1414
$routeProvider
1515
.when('/', {
16-
templateUrl: 'partials/test.html',
17-
controller: 'TestCtrl'
16+
templateUrl: 'partials/board.html',
17+
controller: 'BoardCtrl'
1818
})
1919
.otherwise({
2020
redirectTo: '/'
@@ -29,5 +29,6 @@ app.config([
2929
]);
3030

3131
app.run(['$rootScope', function($rootScope) {
32+
//EDIT THIS URL TO POINT TO YOUR SERVER
3233
$rootScope.baseUrl = 'hackcooper.cloudapp.net';
3334
}]);
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
var test = angular.module('controllers.test', ['snap']);
1+
var board = angular.module('controllers.board', ['snap']);
22

3-
function Test($rootScope, $scope, $http) {
3+
function Board($rootScope, $scope, $http) {
44
var canvas = $('#chalkboard')[0];
55
canvas.width = canvas.offsetWidth;
66
canvas.height = canvas.offsetHeight;
@@ -178,5 +178,5 @@ function Test($rootScope, $scope, $http) {
178178
}
179179
}
180180

181-
test.controller('TestCtrl', ['$rootScope', '$scope', '$http', Test]);
181+
test.controller('BoardCtrl', ['$rootScope', '$scope', '$http', Board]);
182182

webapp/views/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@
4343
<script src="bower_components/angular-snap/angular-snap.js" type="text/javascript" charset="utf-8"></script>
4444
<script src="js/vendor/curve_calc.min.js"></script><!-- must be included before board.js! -->
4545
<script src="js/app.js"></script>
46-
<script src="js/controllers/test.js"></script>
46+
<script src="js/controllers/board.js"></script>
4747
</body>
4848
</html>

webapp/views/partials/board.html

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,22 @@
1-
<canvas id="chalkboard"></canvas>
1+
<div class="nav navbar navbar-default navbar-fixed-top">
2+
<ul class="nav navbar-nav">
3+
<li role="presentation"><a snap-toggle="">Toggle Sidebar</a></li>
4+
<li role="presentation"><a ng-click="downloadBoard()">Download Board</a></li>
5+
</ul>
6+
</div>
7+
8+
<snap-drawer>
9+
<div id="displacedDiv">
10+
<h3>Image Logs:</h3>
11+
<ul>
12+
<li ng-repeat="elem in cachedBoardIds">
13+
<a ng-click="downloadCachedBoard(elem)">{{elem}}</a>
14+
</li>
15+
</ul>
16+
</div>
17+
</snap-drawer>
18+
<snap-content snap-options="{touchToDrag:false,tapToClose:false}">
19+
<div id="canvasDiv">
20+
<canvas id="chalkboard"></canvas>
21+
</div>
22+
</snap-content>

webapp/views/partials/test.html

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)