This repository is a NodeJS Web Application that allows users to visualize online Heep Devices, define relational vertices, and directly control devices functionality.
- In the command prompt in the HeepDev/Frontend/Web directory, run
>>npm install - run
>>npm run bs - Open up
localhost:3001in your browser to view the Heep Device Dashboard
To open the page from another computer, enter '[IP_ADDRESS]:3001' from within the browser on a second computer or tablet'
Heep is a strong believer in unit testing our code! Pull Requests are expected to contain parallel unit testing so that our codebase grows safely. This codebase uses Mocha as a unit testing platform. Testable *.js functions should be accompanied by a *.test.js file, which Mocha will automatically run during tests. For further info on mocha, check out their documentation.
- From the HeepDev/Frontend/Web directory, run
>> npm run tests - Test results will be displayed in the terminal
-
- To check equality on objects, use
assert.deepEqual()
- To check equality on objects, use
To build new tests, the syntax in javascript syntax is simple:
import assert from 'assert'
import * as generalUtils from './generalUtilities'
describe('generalUtils', () => {
describe('nameVertex', () => {
it('Names a Vertex with numeric IDs', () => {
var vertex = {
txDeviceID: 1,
rxDeviceID: 2,
txControlID: 3,
rxControlID: 4,
rxIP: '10.0.0.1'
};
assert.equal('1.3->2.4', generalUtils.nameVertex(vertex));
})
})
})
If you would like to take advantage of hot-reloading for expedited development, then:
- In the command prompt in the HeepDev/Frontend/Web directory, run
>>npm install - run
>>npm run bs - run
>>npm run dev - open up
localhost:8080\srcin your browser to view the Heep Device Portal - Anytime you save changes to the source code, the changes should immediately display on port 8080!
- Drag the card from the icon or title bar
- The position should be persistent across browsers/devices
- Use either the slider or the on/off button to send values to that control on the device
- Define the output control by clicking on the red dot next to the desired output
- Define the input control by clicking on the green dot next to the desired input
- If adding multiple vertex that originate from the same output, you only need to click that output once
- Hover over the vertex line until it becomes red
- Click - the vertex has now been unprogrammed.