Skip to content

Commit

Permalink
Merge pull request #4 from Team6083/develop
Browse files Browse the repository at this point in the history
Fix installer
  • Loading branch information
kennhung authored Aug 24, 2018
2 parents f6c0ef9 + ed593a5 commit 69d2d6c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
15 changes: 9 additions & 6 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ const electron = require('electron');
const wpilib_NT = require('wpilib-nt-client');
const client = new wpilib_NT.Client();


if(require('electron-squirrel-startup')) return;

// The client will try to reconnect after 1 second
client.setReconnectDelay(1000)

Expand Down Expand Up @@ -129,22 +132,22 @@ function startNTconnect() {
let NtAddress = ["172.22.11.2", "10.60.83.2", "roborio-6083-frc.local", "127.0.0.1"]

NtAddress.forEach(function (host) {
tcpp.probe(host, 1735, function(err, available) {
if(available){
tcpp.probe(host, 1735, function (err, available) {
if (available) {
console.log(host);
targetHost = host;
}
});
});

setTimeout(function(){
if(targetHost == ""){
setTimeout(function () {
if (targetHost == "") {
startNTconnect();
}
else{
else {
connectToNT(targetHost);
}
},5000);
}, 5000);
}

function connectToNT(address, port) {
Expand Down
12 changes: 9 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"bootstrap": "^4.1.3",
"canvas-gauges": "^2.1.5",
"d3": "^5.6.0",
"electron-squirrel-startup": "^1.0.0",
"jquery": "^3.3.1",
"popper.js": "^1.12.9",
"tcp-ping": "^0.1.1",
Expand Down

0 comments on commit 69d2d6c

Please sign in to comment.