- Allow RS485 to work when wires are swapped
authorJoseph Coffland <joseph@cauldrondevelopment.com>
Fri, 16 Feb 2018 00:14:33 +0000 (16:14 -0800)
committerJoseph Coffland <joseph@cauldrondevelopment.com>
Fri, 16 Feb 2018 00:14:33 +0000 (16:14 -0800)
 - Allow setting VFD ID
 - Only show relavant spindle config items
 - More robust video camera reset
 - Added help page
 - Allow upgrade with out Internet
 - Limit power fault reporting
 - Added load over temp, load limiting and motor overload power faults

29 files changed:
CHANGELOG.md
Makefile
setup.py
src/avr/src/huanyang.c
src/jade/index.jade
src/jade/templates/admin-view.jade
src/jade/templates/axis-control.jade
src/jade/templates/console.jade
src/jade/templates/control-view.jade
src/jade/templates/estop.jade
src/jade/templates/gcode-view.jade
src/jade/templates/help-view.jade [new file with mode: 0644]
src/jade/templates/indicators.jade
src/jade/templates/io-view.jade
src/jade/templates/message.jade
src/jade/templates/motor-view.jade
src/jade/templates/templated-input.jade
src/jade/templates/tool-view.jade
src/js/admin-view.js
src/js/app.js
src/js/control-view.js
src/js/tool-view.js
src/pwr/config.h
src/pwr/main.c
src/py/bbctrl/AVR.py
src/py/bbctrl/Cmd.py
src/py/bbctrl/Pwr.py
src/py/bbctrl/Web.py
src/resources/config-template.json

index b215cbd2b4ac26daae034e933ed388d5ef92e547..9d508babb25ba9bba41e53c03d2bd88f259a729d 100644 (file)
@@ -9,6 +9,14 @@ Buildbotics CNC Controller Firmware Change Log
  - Added helful info to Video tab
  - Changed "Console" tab to "Messages"
  - Removed spin up/down velocity options, they don't do anything
+ - Allow RS485 to work when wires are swapped
+ - Allow setting VFD ID
+ - Only show relavant spindle config items
+ - More robust video camera reset
+ - Added help page
+ - Allow upgrade with out Internet
+ - Limit power fault reporting
+ - Added load over temp, load limiting and motor overload power faults
 
 ## v0.3.6
  - Set max_usb_current=1 in /boot/config.txt from installer #103
index b10db0a8482c0a995b0484f83e5eab5a0e945c08..ca67c03aa7579ddd2c060c48456400053dd917d2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -36,6 +36,10 @@ ifndef HOST
 HOST=bbctrl.local
 endif
 
+ifndef PASSWORD
+PASSWORD=buildbotics
+endif
+
 ifndef DEST
 DEST=mnt
 endif
@@ -81,7 +85,7 @@ publish: pkg
 
 update: pkg
        http_proxy= curl -i -X PUT -H "Content-Type: multipart/form-data" \
-         -F "firmware=@dist/$(PKG_NAME).tar.bz2" \
+         -F "firmware=@dist/$(PKG_NAME).tar.bz2" -F "password=$(PASSWORD)" \
          http://$(HOST)/api/firmware/update
 
 mount:
index fa0e3aeafaa8b6330b3c14c074d7170fa5e3b397..561b52b7223f76944bf8c9c19c26c2093d14653c 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -28,6 +28,7 @@ setup(
         'scripts/update-bbctrl',
         'scripts/upgrade-bbctrl',
         'scripts/sethostname',
+        'scripts/reset-video',
         ],
     install_requires = 'tornado sockjs-tornado pyserial pyudev smbus2'.split(),
     zip_safe = False,
index 9cd3e0a1e76c2a143536fb7b70e137644677fbf1..0bd5d3539dbcb3d86e12c1c96d34a918b96e74c8 100644 (file)
@@ -491,6 +491,10 @@ void hy_rtc_callback() {
                      sent, received, ha.response_length);
       }
 
+      // Try changing pin polarity
+      PINCTRL_PIN(RS485_RO_PIN) ^= PORT_INVEN_bm;
+      PINCTRL_PIN(RS485_DI_PIN) ^= PORT_INVEN_bm;
+
       hy_reset();
     }
   }
index d79b422aabc5e7438d808cfa9a818a52b6927378..9aa0f08d58199f873efd99db4dcc1b8166a31b59 100644 (file)
@@ -1,29 +1,29 @@
-////////////////////////////////////////////////////////////////////////////////
-//                                                                            //
-//               This file is part of the Buildbotics firmware.               //
-//                                                                            //
-//                 Copyright (c) 2015 - 2018, Buildbotics LLC                 //
-//                            All rights reserved.                            //
-//                                                                            //
-//    This file ("the software") is free software: you can redistribute it    //
-//    and/or modify it under the terms of the GNU General Public License,     //
-//     version 2 as published by the Free Software Foundation. You should     //
-//     have received a copy of the GNU General Public License, version 2      //
-//    along with the software. If not, see <http://www.gnu.org/licenses/>.    //
-//                                                                            //
-//    The software is distributed in the hope that it will be useful, but     //
-//         WITHOUT ANY WARRANTY; without even the implied warranty of         //
-//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
-//              Lesser General Public License for more details.               //
-//                                                                            //
-//      You should have received a copy of the GNU Lesser General Public      //
-//               License along with the software.  If not, see                //
-//                      <http://www.gnu.org/licenses/>.                       //
-//                                                                            //
-//               For information regarding this software email:               //
-//                 "Joseph Coffland" <joseph@buildbotics.com>                 //
-//                                                                            //
-////////////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////
+//-                                                                           //
+//-              This file is part of the Buildbotics firmware.               //
+//-                                                                           //
+//-                Copyright (c) 2015 - 2018, Buildbotics LLC                 //
+//-                           All rights reserved.                            //
+//-                                                                           //
+//-   This file ("the software") is free software: you can redistribute it    //
+//-   and/or modify it under the terms of the GNU General Public License,     //
+//-    version 2 as published by the Free Software Foundation. You should     //
+//-    have received a copy of the GNU General Public License, version 2      //
+//-   along with the software. If not, see <http://www.gnu.org/licenses/>.    //
+//-                                                                           //
+//-   The software is distributed in the hope that it will be useful, but     //
+//-        WITHOUT ANY WARRANTY; without even the implied warranty of         //
+//-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
+//-             Lesser General Public License for more details.               //
+//-                                                                           //
+//-     You should have received a copy of the GNU Lesser General Public      //
+//-              License along with the software.  If not, see                //
+//-                     <http://www.gnu.org/licenses/>.                       //
+//-                                                                           //
+//-              For information regarding this software email:               //
+//-                "Joseph Coffland" <joseph@buildbotics.com>                 //
+//-                                                                           //
+//-/////////////////////////////////////////////////////////////////////////////
 
 include ../../build/hashes.jade
 
@@ -82,6 +82,9 @@ html(lang="en")
             li.pure-menu-heading
               a.pure-menu-link(href="#admin") Admin
 
+            li.pure-menu-heading
+              a.pure-menu-link(href="#help") Help
+
       #main
         .header
           .header-content
@@ -138,6 +141,20 @@ html(lang="en")
         button.pure-button.pure-button-primary(@click="upgrade_confirmed")
           | Upgrade
 
+    message(:show.sync="confirmUpload")
+      h3(slot="header") Upload Firmware?
+      div(slot="body")
+        p Are you sure you want to upload firmware <em>{{firmwareName}}</em>?
+
+        p.pure-control-group
+          label(for="pass") Password
+          input(name="pass", v-model="password", type="password")
+
+      div(slot="footer")
+        button.pure-button(@click="confirmUpload=false") Cancel
+        button.pure-button.pure-button-primary(@click="upload_confirmed")
+          | Upload
+
     message(:show.sync="firmwareUpgrading")
       h3(slot="header") Firmware upgrading
       p(slot="body") Please wait...
index 6786923165fdf457d3fb63eb945545698139420c..236e7a4850ebd4f61752a4aa2d8b073c15288740 100644 (file)
@@ -1,29 +1,29 @@
-////////////////////////////////////////////////////////////////////////////////
-//                                                                            //
-//               This file is part of the Buildbotics firmware.               //
-//                                                                            //
-//                 Copyright (c) 2015 - 2018, Buildbotics LLC                 //
-//                            All rights reserved.                            //
-//                                                                            //
-//    This file ("the software") is free software: you can redistribute it    //
-//    and/or modify it under the terms of the GNU General Public License,     //
-//     version 2 as published by the Free Software Foundation. You should     //
-//     have received a copy of the GNU General Public License, version 2      //
-//    along with the software. If not, see <http://www.gnu.org/licenses/>.    //
-//                                                                            //
-//    The software is distributed in the hope that it will be useful, but     //
-//         WITHOUT ANY WARRANTY; without even the implied warranty of         //
-//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
-//              Lesser General Public License for more details.               //
-//                                                                            //
-//      You should have received a copy of the GNU Lesser General Public      //
-//               License along with the software.  If not, see                //
-//                      <http://www.gnu.org/licenses/>.                       //
-//                                                                            //
-//               For information regarding this software email:               //
-//                 "Joseph Coffland" <joseph@buildbotics.com>                 //
-//                                                                            //
-////////////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////
+//-                                                                           //
+//-              This file is part of the Buildbotics firmware.               //
+//-                                                                           //
+//-                Copyright (c) 2015 - 2018, Buildbotics LLC                 //
+//-                           All rights reserved.                            //
+//-                                                                           //
+//-   This file ("the software") is free software: you can redistribute it    //
+//-   and/or modify it under the terms of the GNU General Public License,     //
+//-    version 2 as published by the Free Software Foundation. You should     //
+//-    have received a copy of the GNU General Public License, version 2      //
+//-   along with the software. If not, see <http://www.gnu.org/licenses/>.    //
+//-                                                                           //
+//-   The software is distributed in the hope that it will be useful, but     //
+//-        WITHOUT ANY WARRANTY; without even the implied warranty of         //
+//-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
+//-             Lesser General Public License for more details.               //
+//-                                                                           //
+//-     You should have received a copy of the GNU Lesser General Public      //
+//-              License along with the software.  If not, see                //
+//-                     <http://www.gnu.org/licenses/>.                       //
+//-                                                                           //
+//-              For information regarding this software email:               //
+//-                "Joseph Coffland" <joseph@buildbotics.com>                 //
+//-                                                                           //
+//-/////////////////////////////////////////////////////////////////////////////
 
 script#admin-view-template(type="text/x-template")
   #admin
@@ -79,6 +79,9 @@ script#admin-view-template(type="text/x-template")
     h2 Firmware
     button.pure-button.pure-button-primary(@click="check") Check
     button.pure-button.pure-button-primary(@click="upgrade") Upgrade
+    label.pure-button.pure-button-primary.file-upload
+      input(type="file", accept=".tar.bz2", @change="upload")
+      | Upload
 
     p
       input(type="checkbox", v-model="autoCheckUpgrade",
index a498089feab78f92cf292894669e632be8abca1f..83be91992df36fc0edf201340dcb0ae6d915cbf2 100644 (file)
@@ -1,29 +1,29 @@
-////////////////////////////////////////////////////////////////////////////////
-//                                                                            //
-//               This file is part of the Buildbotics firmware.               //
-//                                                                            //
-//                 Copyright (c) 2015 - 2018, Buildbotics LLC                 //
-//                            All rights reserved.                            //
-//                                                                            //
-//    This file ("the software") is free software: you can redistribute it    //
-//    and/or modify it under the terms of the GNU General Public License,     //
-//     version 2 as published by the Free Software Foundation. You should     //
-//     have received a copy of the GNU General Public License, version 2      //
-//    along with the software. If not, see <http://www.gnu.org/licenses/>.    //
-//                                                                            //
-//    The software is distributed in the hope that it will be useful, but     //
-//         WITHOUT ANY WARRANTY; without even the implied warranty of         //
-//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
-//              Lesser General Public License for more details.               //
-//                                                                            //
-//      You should have received a copy of the GNU Lesser General Public      //
-//               License along with the software.  If not, see                //
-//                      <http://www.gnu.org/licenses/>.                       //
-//                                                                            //
-//               For information regarding this software email:               //
-//                 "Joseph Coffland" <joseph@buildbotics.com>                 //
-//                                                                            //
-////////////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////
+//-                                                                           //
+//-              This file is part of the Buildbotics firmware.               //
+//-                                                                           //
+//-                Copyright (c) 2015 - 2018, Buildbotics LLC                 //
+//-                           All rights reserved.                            //
+//-                                                                           //
+//-   This file ("the software") is free software: you can redistribute it    //
+//-   and/or modify it under the terms of the GNU General Public License,     //
+//-    version 2 as published by the Free Software Foundation. You should     //
+//-    have received a copy of the GNU General Public License, version 2      //
+//-   along with the software. If not, see <http://www.gnu.org/licenses/>.    //
+//-                                                                           //
+//-   The software is distributed in the hope that it will be useful, but     //
+//-        WITHOUT ANY WARRANTY; without even the implied warranty of         //
+//-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
+//-             Lesser General Public License for more details.               //
+//-                                                                           //
+//-     You should have received a copy of the GNU Lesser General Public      //
+//-              License along with the software.  If not, see                //
+//-                     <http://www.gnu.org/licenses/>.                       //
+//-                                                                           //
+//-              For information regarding this software email:               //
+//-                "Joseph Coffland" <joseph@buildbotics.com>                 //
+//-                                                                           //
+//-/////////////////////////////////////////////////////////////////////////////
 
 script#axis-control-template(type="text/x-template")
   svg(xmlns="http://www.w3.org/2000/svg",
index aa0ba5e98a8c9291c5db4b8a83c0d4ac8a8f4d7d..57993fd5aed5d426881203e6a65b152fcba7ad38 100644 (file)
@@ -1,29 +1,29 @@
-////////////////////////////////////////////////////////////////////////////////
-//                                                                            //
-//               This file is part of the Buildbotics firmware.               //
-//                                                                            //
-//                 Copyright (c) 2015 - 2018, Buildbotics LLC                 //
-//                            All rights reserved.                            //
-//                                                                            //
-//    This file ("the software") is free software: you can redistribute it    //
-//    and/or modify it under the terms of the GNU General Public License,     //
-//     version 2 as published by the Free Software Foundation. You should     //
-//     have received a copy of the GNU General Public License, version 2      //
-//    along with the software. If not, see <http://www.gnu.org/licenses/>.    //
-//                                                                            //
-//    The software is distributed in the hope that it will be useful, but     //
-//         WITHOUT ANY WARRANTY; without even the implied warranty of         //
-//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
-//              Lesser General Public License for more details.               //
-//                                                                            //
-//      You should have received a copy of the GNU Lesser General Public      //
-//               License along with the software.  If not, see                //
-//                      <http://www.gnu.org/licenses/>.                       //
-//                                                                            //
-//               For information regarding this software email:               //
-//                 "Joseph Coffland" <joseph@buildbotics.com>                 //
-//                                                                            //
-////////////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////
+//-                                                                           //
+//-              This file is part of the Buildbotics firmware.               //
+//-                                                                           //
+//-                Copyright (c) 2015 - 2018, Buildbotics LLC                 //
+//-                           All rights reserved.                            //
+//-                                                                           //
+//-   This file ("the software") is free software: you can redistribute it    //
+//-   and/or modify it under the terms of the GNU General Public License,     //
+//-    version 2 as published by the Free Software Foundation. You should     //
+//-    have received a copy of the GNU General Public License, version 2      //
+//-   along with the software. If not, see <http://www.gnu.org/licenses/>.    //
+//-                                                                           //
+//-   The software is distributed in the hope that it will be useful, but     //
+//-        WITHOUT ANY WARRANTY; without even the implied warranty of         //
+//-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
+//-             Lesser General Public License for more details.               //
+//-                                                                           //
+//-     You should have received a copy of the GNU Lesser General Public      //
+//-              License along with the software.  If not, see                //
+//-                     <http://www.gnu.org/licenses/>.                       //
+//-                                                                           //
+//-              For information regarding this software email:               //
+//-                "Joseph Coffland" <joseph@buildbotics.com>                 //
+//-                                                                           //
+//-/////////////////////////////////////////////////////////////////////////////
 
 script#console-template(type="text/x-template")
   .console
index fdacd5cfd1a26a93c0727f07b636909728d0622e..d867a52613e2397146cd5b7d80d5e0ef89ebd5f5 100644 (file)
@@ -1,29 +1,29 @@
-////////////////////////////////////////////////////////////////////////////////
-//                                                                            //
-//               This file is part of the Buildbotics firmware.               //
-//                                                                            //
-//                 Copyright (c) 2015 - 2018, Buildbotics LLC                 //
-//                            All rights reserved.                            //
-//                                                                            //
-//    This file ("the software") is free software: you can redistribute it    //
-//    and/or modify it under the terms of the GNU General Public License,     //
-//     version 2 as published by the Free Software Foundation. You should     //
-//     have received a copy of the GNU General Public License, version 2      //
-//    along with the software. If not, see <http://www.gnu.org/licenses/>.    //
-//                                                                            //
-//    The software is distributed in the hope that it will be useful, but     //
-//         WITHOUT ANY WARRANTY; without even the implied warranty of         //
-//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
-//              Lesser General Public License for more details.               //
-//                                                                            //
-//      You should have received a copy of the GNU Lesser General Public      //
-//               License along with the software.  If not, see                //
-//                      <http://www.gnu.org/licenses/>.                       //
-//                                                                            //
-//               For information regarding this software email:               //
-//                 "Joseph Coffland" <joseph@buildbotics.com>                 //
-//                                                                            //
-////////////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////
+//-                                                                           //
+//-              This file is part of the Buildbotics firmware.               //
+//-                                                                           //
+//-                Copyright (c) 2015 - 2018, Buildbotics LLC                 //
+//-                           All rights reserved.                            //
+//-                                                                           //
+//-   This file ("the software") is free software: you can redistribute it    //
+//-   and/or modify it under the terms of the GNU General Public License,     //
+//-    version 2 as published by the Free Software Foundation. You should     //
+//-    have received a copy of the GNU General Public License, version 2      //
+//-   along with the software. If not, see <http://www.gnu.org/licenses/>.    //
+//-                                                                           //
+//-   The software is distributed in the hope that it will be useful, but     //
+//-        WITHOUT ANY WARRANTY; without even the implied warranty of         //
+//-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
+//-             Lesser General Public License for more details.               //
+//-                                                                           //
+//-     You should have received a copy of the GNU Lesser General Public      //
+//-              License along with the software.  If not, see                //
+//-                     <http://www.gnu.org/licenses/>.                       //
+//-                                                                           //
+//-              For information regarding this software email:               //
+//-                "Joseph Coffland" <joseph@buildbotics.com>                 //
+//-                                                                           //
+//-/////////////////////////////////////////////////////////////////////////////
 
 script#control-view-template(type="text/x-template")
   #control
@@ -275,7 +275,7 @@ script#control-view-template(type="text/x-template")
 
       section#content6.tab-content
         .video
-          img.reload(src="/images/reload.png", @click="load_video",
+          img.reload(src="/images/reload.png", @click="reload_video",
             title="Reload video")
           img.mjpeg(:src="video_url")
 
index 748eb9e98e073307321f032486cb480f2e2285c2..472c72c2c8af5d1a9d2367239d47b21f8edad796 100644 (file)
@@ -1,29 +1,29 @@
-////////////////////////////////////////////////////////////////////////////////
-//                                                                            //
-//               This file is part of the Buildbotics firmware.               //
-//                                                                            //
-//                 Copyright (c) 2015 - 2018, Buildbotics LLC                 //
-//                            All rights reserved.                            //
-//                                                                            //
-//    This file ("the software") is free software: you can redistribute it    //
-//    and/or modify it under the terms of the GNU General Public License,     //
-//     version 2 as published by the Free Software Foundation. You should     //
-//     have received a copy of the GNU General Public License, version 2      //
-//    along with the software. If not, see <http://www.gnu.org/licenses/>.    //
-//                                                                            //
-//    The software is distributed in the hope that it will be useful, but     //
-//         WITHOUT ANY WARRANTY; without even the implied warranty of         //
-//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
-//              Lesser General Public License for more details.               //
-//                                                                            //
-//      You should have received a copy of the GNU Lesser General Public      //
-//               License along with the software.  If not, see                //
-//                      <http://www.gnu.org/licenses/>.                       //
-//                                                                            //
-//               For information regarding this software email:               //
-//                 "Joseph Coffland" <joseph@buildbotics.com>                 //
-//                                                                            //
-////////////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////
+//-                                                                           //
+//-              This file is part of the Buildbotics firmware.               //
+//-                                                                           //
+//-                Copyright (c) 2015 - 2018, Buildbotics LLC                 //
+//-                           All rights reserved.                            //
+//-                                                                           //
+//-   This file ("the software") is free software: you can redistribute it    //
+//-   and/or modify it under the terms of the GNU General Public License,     //
+//-    version 2 as published by the Free Software Foundation. You should     //
+//-    have received a copy of the GNU General Public License, version 2      //
+//-   along with the software. If not, see <http://www.gnu.org/licenses/>.    //
+//-                                                                           //
+//-   The software is distributed in the hope that it will be useful, but     //
+//-        WITHOUT ANY WARRANTY; without even the implied warranty of         //
+//-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
+//-             Lesser General Public License for more details.               //
+//-                                                                           //
+//-     You should have received a copy of the GNU Lesser General Public      //
+//-              License along with the software.  If not, see                //
+//-                     <http://www.gnu.org/licenses/>.                       //
+//-                                                                           //
+//-              For information regarding this software email:               //
+//-                "Joseph Coffland" <joseph@buildbotics.com>                 //
+//-                                                                           //
+//-/////////////////////////////////////////////////////////////////////////////
 
 script#estop-template(type="text/x-template")
   svg(version="1.1", xmlns:svg="http://www.w3.org/2000/svg",
index e40075616adbf57981246e77ea7ac4b57c7f631e..edea72b1830e928aaf9f963f89479039f70e86d0 100644 (file)
@@ -1,29 +1,29 @@
-////////////////////////////////////////////////////////////////////////////////
-//                                                                            //
-//               This file is part of the Buildbotics firmware.               //
-//                                                                            //
-//                 Copyright (c) 2015 - 2018, Buildbotics LLC                 //
-//                            All rights reserved.                            //
-//                                                                            //
-//    This file ("the software") is free software: you can redistribute it    //
-//    and/or modify it under the terms of the GNU General Public License,     //
-//     version 2 as published by the Free Software Foundation. You should     //
-//     have received a copy of the GNU General Public License, version 2      //
-//    along with the software. If not, see <http://www.gnu.org/licenses/>.    //
-//                                                                            //
-//    The software is distributed in the hope that it will be useful, but     //
-//         WITHOUT ANY WARRANTY; without even the implied warranty of         //
-//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
-//              Lesser General Public License for more details.               //
-//                                                                            //
-//      You should have received a copy of the GNU Lesser General Public      //
-//               License along with the software.  If not, see                //
-//                      <http://www.gnu.org/licenses/>.                       //
-//                                                                            //
-//               For information regarding this software email:               //
-//                 "Joseph Coffland" <joseph@buildbotics.com>                 //
-//                                                                            //
-////////////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////
+//-                                                                           //
+//-              This file is part of the Buildbotics firmware.               //
+//-                                                                           //
+//-                Copyright (c) 2015 - 2018, Buildbotics LLC                 //
+//-                           All rights reserved.                            //
+//-                                                                           //
+//-   This file ("the software") is free software: you can redistribute it    //
+//-   and/or modify it under the terms of the GNU General Public License,     //
+//-    version 2 as published by the Free Software Foundation. You should     //
+//-    have received a copy of the GNU General Public License, version 2      //
+//-   along with the software. If not, see <http://www.gnu.org/licenses/>.    //
+//-                                                                           //
+//-   The software is distributed in the hope that it will be useful, but     //
+//-        WITHOUT ANY WARRANTY; without even the implied warranty of         //
+//-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
+//-             Lesser General Public License for more details.               //
+//-                                                                           //
+//-     You should have received a copy of the GNU Lesser General Public      //
+//-              License along with the software.  If not, see                //
+//-                     <http://www.gnu.org/licenses/>.                       //
+//-                                                                           //
+//-              For information regarding this software email:               //
+//-                "Joseph Coffland" <joseph@buildbotics.com>                 //
+//-                                                                           //
+//-/////////////////////////////////////////////////////////////////////////////
 
 script#gcode-view-template(type="text/x-template")
   #gcode
diff --git a/src/jade/templates/help-view.jade b/src/jade/templates/help-view.jade
new file mode 100644 (file)
index 0000000..76a1092
--- /dev/null
@@ -0,0 +1,42 @@
+//-/////////////////////////////////////////////////////////////////////////////
+//-                                                                           //
+//-              This file is part of the Buildbotics firmware.               //
+//-                                                                           //
+//-                Copyright (c) 2015 - 2018, Buildbotics LLC                 //
+//-                           All rights reserved.                            //
+//-                                                                           //
+//-   This file ("the software") is free software: you can redistribute it    //
+//-   and/or modify it under the terms of the GNU General Public License,     //
+//-    version 2 as published by the Free Software Foundation. You should     //
+//-    have received a copy of the GNU General Public License, version 2      //
+//-   along with the software. If not, see <http://www.gnu.org/licenses/>.    //
+//-                                                                           //
+//-   The software is distributed in the hope that it will be useful, but     //
+//-        WITHOUT ANY WARRANTY; without even the implied warranty of         //
+//-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
+//-             Lesser General Public License for more details.               //
+//-                                                                           //
+//-     You should have received a copy of the GNU Lesser General Public      //
+//-              License along with the software.  If not, see                //
+//-                     <http://www.gnu.org/licenses/>.                       //
+//-                                                                           //
+//-              For information regarding this software email:               //
+//-                "Joseph Coffland" <joseph@buildbotics.com>                 //
+//-                                                                           //
+//-/////////////////////////////////////////////////////////////////////////////
+
+script#help-view-template(type="text/x-template")
+  #help
+    h2 User Manual
+    p
+      | You can find a detailed user manual at <a
+      | href="http://docs.buildbotics.com" target="_blank"
+      | >docs.buildbotics.com</a>.
+
+    h2 Discussion Forum
+    p
+      | If you're having trouble or just want to chat with other Buildbotics
+      | CNC controller owners, head over to the Buildbotics forum at
+      | <a href="http://forum.buildbotics.com" target="_blank"
+      | >forum.buildbotics.com</a>.  Register on the site and post a message.
+      | We'll be happy to help.
index 174e0cee50ac1ebd67dd1a0baa32e86fcf66e4c3..1231d92960ad426a48bea6671a50cd2f4d40164e 100644 (file)
@@ -1,29 +1,29 @@
-////////////////////////////////////////////////////////////////////////////////
-//                                                                            //
-//               This file is part of the Buildbotics firmware.               //
-//                                                                            //
-//                 Copyright (c) 2015 - 2018, Buildbotics LLC                 //
-//                            All rights reserved.                            //
-//                                                                            //
-//    This file ("the software") is free software: you can redistribute it    //
-//    and/or modify it under the terms of the GNU General Public License,     //
-//     version 2 as published by the Free Software Foundation. You should     //
-//     have received a copy of the GNU General Public License, version 2      //
-//    along with the software. If not, see <http://www.gnu.org/licenses/>.    //
-//                                                                            //
-//    The software is distributed in the hope that it will be useful, but     //
-//         WITHOUT ANY WARRANTY; without even the implied warranty of         //
-//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
-//              Lesser General Public License for more details.               //
-//                                                                            //
-//      You should have received a copy of the GNU Lesser General Public      //
-//               License along with the software.  If not, see                //
-//                      <http://www.gnu.org/licenses/>.                       //
-//                                                                            //
-//               For information regarding this software email:               //
-//                 "Joseph Coffland" <joseph@buildbotics.com>                 //
-//                                                                            //
-////////////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////
+//-                                                                           //
+//-              This file is part of the Buildbotics firmware.               //
+//-                                                                           //
+//-                Copyright (c) 2015 - 2018, Buildbotics LLC                 //
+//-                           All rights reserved.                            //
+//-                                                                           //
+//-   This file ("the software") is free software: you can redistribute it    //
+//-   and/or modify it under the terms of the GNU General Public License,     //
+//-    version 2 as published by the Free Software Foundation. You should     //
+//-    have received a copy of the GNU General Public License, version 2      //
+//-   along with the software. If not, see <http://www.gnu.org/licenses/>.    //
+//-                                                                           //
+//-   The software is distributed in the hope that it will be useful, but     //
+//-        WITHOUT ANY WARRANTY; without even the implied warranty of         //
+//-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
+//-             Lesser General Public License for more details.               //
+//-                                                                           //
+//-     You should have received a copy of the GNU Lesser General Public      //
+//-              License along with the software.  If not, see                //
+//-                     <http://www.gnu.org/licenses/>.                       //
+//-                                                                           //
+//-              For information regarding this software email:               //
+//-                "Joseph Coffland" <joseph@buildbotics.com>                 //
+//-                                                                           //
+//-/////////////////////////////////////////////////////////////////////////////
 
 script#indicators-template(type="text/x-template")
   .indicators
index 60dc9be933bd0e64b74d798d758074209d656316..e433fe3c5cf969c0074ae810cf07c9e61606933d 100644 (file)
@@ -1,29 +1,29 @@
-////////////////////////////////////////////////////////////////////////////////
-//                                                                            //
-//               This file is part of the Buildbotics firmware.               //
-//                                                                            //
-//                 Copyright (c) 2015 - 2018, Buildbotics LLC                 //
-//                            All rights reserved.                            //
-//                                                                            //
-//    This file ("the software") is free software: you can redistribute it    //
-//    and/or modify it under the terms of the GNU General Public License,     //
-//     version 2 as published by the Free Software Foundation. You should     //
-//     have received a copy of the GNU General Public License, version 2      //
-//    along with the software. If not, see <http://www.gnu.org/licenses/>.    //
-//                                                                            //
-//    The software is distributed in the hope that it will be useful, but     //
-//         WITHOUT ANY WARRANTY; without even the implied warranty of         //
-//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
-//              Lesser General Public License for more details.               //
-//                                                                            //
-//      You should have received a copy of the GNU Lesser General Public      //
-//               License along with the software.  If not, see                //
-//                      <http://www.gnu.org/licenses/>.                       //
-//                                                                            //
-//               For information regarding this software email:               //
-//                 "Joseph Coffland" <joseph@buildbotics.com>                 //
-//                                                                            //
-////////////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////
+//-                                                                           //
+//-              This file is part of the Buildbotics firmware.               //
+//-                                                                           //
+//-                Copyright (c) 2015 - 2018, Buildbotics LLC                 //
+//-                           All rights reserved.                            //
+//-                                                                           //
+//-   This file ("the software") is free software: you can redistribute it    //
+//-   and/or modify it under the terms of the GNU General Public License,     //
+//-    version 2 as published by the Free Software Foundation. You should     //
+//-    have received a copy of the GNU General Public License, version 2      //
+//-   along with the software. If not, see <http://www.gnu.org/licenses/>.    //
+//-                                                                           //
+//-   The software is distributed in the hope that it will be useful, but     //
+//-        WITHOUT ANY WARRANTY; without even the implied warranty of         //
+//-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
+//-             Lesser General Public License for more details.               //
+//-                                                                           //
+//-     You should have received a copy of the GNU Lesser General Public      //
+//-              License along with the software.  If not, see                //
+//-                     <http://www.gnu.org/licenses/>.                       //
+//-                                                                           //
+//-              For information regarding this software email:               //
+//-                "Joseph Coffland" <joseph@buildbotics.com>                 //
+//-                                                                           //
+//-/////////////////////////////////////////////////////////////////////////////
 
 script#io-view-template(type="text/x-template")
   #io
index c4f85956fa65d64c3fd055e859aad483ab78bbd9..dcaf93cc9d4de8c4122e4f79048c67571ca29d12 100644 (file)
@@ -1,29 +1,29 @@
-////////////////////////////////////////////////////////////////////////////////
-//                                                                            //
-//               This file is part of the Buildbotics firmware.               //
-//                                                                            //
-//                 Copyright (c) 2015 - 2018, Buildbotics LLC                 //
-//                            All rights reserved.                            //
-//                                                                            //
-//    This file ("the software") is free software: you can redistribute it    //
-//    and/or modify it under the terms of the GNU General Public License,     //
-//     version 2 as published by the Free Software Foundation. You should     //
-//     have received a copy of the GNU General Public License, version 2      //
-//    along with the software. If not, see <http://www.gnu.org/licenses/>.    //
-//                                                                            //
-//    The software is distributed in the hope that it will be useful, but     //
-//         WITHOUT ANY WARRANTY; without even the implied warranty of         //
-//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
-//              Lesser General Public License for more details.               //
-//                                                                            //
-//      You should have received a copy of the GNU Lesser General Public      //
-//               License along with the software.  If not, see                //
-//                      <http://www.gnu.org/licenses/>.                       //
-//                                                                            //
-//               For information regarding this software email:               //
-//                 "Joseph Coffland" <joseph@buildbotics.com>                 //
-//                                                                            //
-////////////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////
+//-                                                                           //
+//-              This file is part of the Buildbotics firmware.               //
+//-                                                                           //
+//-                Copyright (c) 2015 - 2018, Buildbotics LLC                 //
+//-                           All rights reserved.                            //
+//-                                                                           //
+//-   This file ("the software") is free software: you can redistribute it    //
+//-   and/or modify it under the terms of the GNU General Public License,     //
+//-    version 2 as published by the Free Software Foundation. You should     //
+//-    have received a copy of the GNU General Public License, version 2      //
+//-   along with the software. If not, see <http://www.gnu.org/licenses/>.    //
+//-                                                                           //
+//-   The software is distributed in the hope that it will be useful, but     //
+//-        WITHOUT ANY WARRANTY; without even the implied warranty of         //
+//-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
+//-             Lesser General Public License for more details.               //
+//-                                                                           //
+//-     You should have received a copy of the GNU Lesser General Public      //
+//-              License along with the software.  If not, see                //
+//-                     <http://www.gnu.org/licenses/>.                       //
+//-                                                                           //
+//-              For information regarding this software email:               //
+//-                "Joseph Coffland" <joseph@buildbotics.com>                 //
+//-                                                                           //
+//-/////////////////////////////////////////////////////////////////////////////
 
 script#message-template(type="text/x-template")
   .modal-mask(v-show="show", transition="modal")
index 0d117701107e69bdc4ba6f5a31439bd767903dac..4b083fe3029d7b37c69834edba93212403b5e0c3 100644 (file)
@@ -1,29 +1,29 @@
-////////////////////////////////////////////////////////////////////////////////
-//                                                                            //
-//               This file is part of the Buildbotics firmware.               //
-//                                                                            //
-//                 Copyright (c) 2015 - 2018, Buildbotics LLC                 //
-//                            All rights reserved.                            //
-//                                                                            //
-//    This file ("the software") is free software: you can redistribute it    //
-//    and/or modify it under the terms of the GNU General Public License,     //
-//     version 2 as published by the Free Software Foundation. You should     //
-//     have received a copy of the GNU General Public License, version 2      //
-//    along with the software. If not, see <http://www.gnu.org/licenses/>.    //
-//                                                                            //
-//    The software is distributed in the hope that it will be useful, but     //
-//         WITHOUT ANY WARRANTY; without even the implied warranty of         //
-//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
-//              Lesser General Public License for more details.               //
-//                                                                            //
-//      You should have received a copy of the GNU Lesser General Public      //
-//               License along with the software.  If not, see                //
-//                      <http://www.gnu.org/licenses/>.                       //
-//                                                                            //
-//               For information regarding this software email:               //
-//                 "Joseph Coffland" <joseph@buildbotics.com>                 //
-//                                                                            //
-////////////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////
+//-                                                                           //
+//-              This file is part of the Buildbotics firmware.               //
+//-                                                                           //
+//-                Copyright (c) 2015 - 2018, Buildbotics LLC                 //
+//-                           All rights reserved.                            //
+//-                                                                           //
+//-   This file ("the software") is free software: you can redistribute it    //
+//-   and/or modify it under the terms of the GNU General Public License,     //
+//-    version 2 as published by the Free Software Foundation. You should     //
+//-    have received a copy of the GNU General Public License, version 2      //
+//-   along with the software. If not, see <http://www.gnu.org/licenses/>.    //
+//-                                                                           //
+//-   The software is distributed in the hope that it will be useful, but     //
+//-        WITHOUT ANY WARRANTY; without even the implied warranty of         //
+//-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
+//-             Lesser General Public License for more details.               //
+//-                                                                           //
+//-     You should have received a copy of the GNU Lesser General Public      //
+//-              License along with the software.  If not, see                //
+//-                     <http://www.gnu.org/licenses/>.                       //
+//-                                                                           //
+//-              For information regarding this software email:               //
+//-                "Joseph Coffland" <joseph@buildbotics.com>                 //
+//-                                                                           //
+//-/////////////////////////////////////////////////////////////////////////////
 
 script#motor-view-template(type="text/x-template")
   #motor
index 1fee3d10d4ee411a079a43f0ca22c8add4e5d81a..5ab1f72c50a9edc854360414a3f71b256111278b 100644 (file)
@@ -1,33 +1,33 @@
-////////////////////////////////////////////////////////////////////////////////
-//                                                                            //
-//               This file is part of the Buildbotics firmware.               //
-//                                                                            //
-//                 Copyright (c) 2015 - 2018, Buildbotics LLC                 //
-//                            All rights reserved.                            //
-//                                                                            //
-//    This file ("the software") is free software: you can redistribute it    //
-//    and/or modify it under the terms of the GNU General Public License,     //
-//     version 2 as published by the Free Software Foundation. You should     //
-//     have received a copy of the GNU General Public License, version 2      //
-//    along with the software. If not, see <http://www.gnu.org/licenses/>.    //
-//                                                                            //
-//    The software is distributed in the hope that it will be useful, but     //
-//         WITHOUT ANY WARRANTY; without even the implied warranty of         //
-//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
-//              Lesser General Public License for more details.               //
-//                                                                            //
-//      You should have received a copy of the GNU Lesser General Public      //
-//               License along with the software.  If not, see                //
-//                      <http://www.gnu.org/licenses/>.                       //
-//                                                                            //
-//               For information regarding this software email:               //
-//                 "Joseph Coffland" <joseph@buildbotics.com>                 //
-//                                                                            //
-////////////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////
+//-                                                                           //
+//-              This file is part of the Buildbotics firmware.               //
+//-                                                                           //
+//-                Copyright (c) 2015 - 2018, Buildbotics LLC                 //
+//-                           All rights reserved.                            //
+//-                                                                           //
+//-   This file ("the software") is free software: you can redistribute it    //
+//-   and/or modify it under the terms of the GNU General Public License,     //
+//-    version 2 as published by the Free Software Foundation. You should     //
+//-    have received a copy of the GNU General Public License, version 2      //
+//-   along with the software. If not, see <http://www.gnu.org/licenses/>.    //
+//-                                                                           //
+//-   The software is distributed in the hope that it will be useful, but     //
+//-        WITHOUT ANY WARRANTY; without even the implied warranty of         //
+//-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
+//-             Lesser General Public License for more details.               //
+//-                                                                           //
+//-     You should have received a copy of the GNU Lesser General Public      //
+//-              License along with the software.  If not, see                //
+//-                     <http://www.gnu.org/licenses/>.                       //
+//-                                                                           //
+//-              For information regarding this software email:               //
+//-                "Joseph Coffland" <joseph@buildbotics.com>                 //
+//-                                                                           //
+//-/////////////////////////////////////////////////////////////////////////////
 
 script#templated-input-template(type="text/x-template")
   .pure-control-group(class="tmpl-input-{{name}}",
-    title="Default {{template.default}} {{template.unit}}")
+    title="Default {{template.default}} {{template.unit || ''}}")
     label(:for="name") {{name}}
 
     select(v-if="template.type == 'enum' || template.values", v-model="model",
index 304d21a4267e0f74e6914173f5fbf1564a1bc3f5..c28debba48fa1e85b38cba0d897ee9dd2a7368af 100644 (file)
@@ -1,35 +1,50 @@
-////////////////////////////////////////////////////////////////////////////////
-//                                                                            //
-//               This file is part of the Buildbotics firmware.               //
-//                                                                            //
-//                 Copyright (c) 2015 - 2018, Buildbotics LLC                 //
-//                            All rights reserved.                            //
-//                                                                            //
-//    This file ("the software") is free software: you can redistribute it    //
-//    and/or modify it under the terms of the GNU General Public License,     //
-//     version 2 as published by the Free Software Foundation. You should     //
-//     have received a copy of the GNU General Public License, version 2      //
-//    along with the software. If not, see <http://www.gnu.org/licenses/>.    //
-//                                                                            //
-//    The software is distributed in the hope that it will be useful, but     //
-//         WITHOUT ANY WARRANTY; without even the implied warranty of         //
-//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
-//              Lesser General Public License for more details.               //
-//                                                                            //
-//      You should have received a copy of the GNU Lesser General Public      //
-//               License along with the software.  If not, see                //
-//                      <http://www.gnu.org/licenses/>.                       //
-//                                                                            //
-//               For information regarding this software email:               //
-//                 "Joseph Coffland" <joseph@buildbotics.com>                 //
-//                                                                            //
-////////////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////
+//-                                                                           //
+//-              This file is part of the Buildbotics firmware.               //
+//-                                                                           //
+//-                Copyright (c) 2015 - 2018, Buildbotics LLC                 //
+//-                           All rights reserved.                            //
+//-                                                                           //
+//-   This file ("the software") is free software: you can redistribute it    //
+//-   and/or modify it under the terms of the GNU General Public License,     //
+//-    version 2 as published by the Free Software Foundation. You should     //
+//-    have received a copy of the GNU General Public License, version 2      //
+//-   along with the software. If not, see <http://www.gnu.org/licenses/>.    //
+//-                                                                           //
+//-   The software is distributed in the hope that it will be useful, but     //
+//-        WITHOUT ANY WARRANTY; without even the implied warranty of         //
+//-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
+//-             Lesser General Public License for more details.               //
+//-                                                                           //
+//-     You should have received a copy of the GNU Lesser General Public      //
+//-              License along with the software.  If not, see                //
+//-                     <http://www.gnu.org/licenses/>.                       //
+//-                                                                           //
+//-              For information regarding this software email:               //
+//-                "Joseph Coffland" <joseph@buildbotics.com>                 //
+//-                                                                           //
+//-/////////////////////////////////////////////////////////////////////////////
 
 script#tool-view-template(type="text/x-template")
   #tool
-    h1 Spindle Configuration
+    h1 Tool Configuration
 
     form.pure-form.pure-form-aligned
       fieldset
         templated-input(v-for="templ in template.tool", :name="$key",
           :model.sync="tool[$key]", :template="templ")
+
+    div(v-if="tool['spindle-type'] == 'PWM'")
+      h2 PWM Spindle
+      form.pure-form.pure-form-aligned
+        fieldset
+          templated-input(v-for="templ in template['pwm-spindle']",
+            :name="$key", :model.sync="pwmSpindle[$key]", :template="templ")
+
+    div(v-if="tool['spindle-type'] == 'HUANYANG'")
+      h2 Huanyang VFD Spindle
+      form.pure-form.pure-form-aligned
+        fieldset
+          templated-input(v-for="templ in template['huanyang-spindle']",
+            :name="$key", :model.sync="huanyangSpindle[$key]",
+            :template="templ")
index 3b117a987f628921fa6e0003731a977e1445926c..d8fc91bdf19b38ede1ee8a3e476127a62f5b5d2d 100644 (file)
@@ -189,6 +189,13 @@ module.exports = {
     upgrade: function () {this.$dispatch('upgrade')},
 
 
+    upload: function (e) {
+      var files = e.target.files || e.dataTransfer.files;
+      if (!files.length) return;
+      this.$dispatch('upload', files[0]);
+    },
+
+
     change_auto_check_upgrade: function () {
       this.config.admin['auto-check-upgrade'] = this.autoCheckUpgrade;
       this.$dispatch('config-changed');
index c3e25a869d605d207ffd0f4b4048a3ad78b29381..ac15dc6690c6c79588503e7faadb5e38a3d24693 100644 (file)
@@ -65,8 +65,10 @@ module.exports = new Vue({
       errorShow: false,
       errorMessage: '',
       confirmUpgrade: false,
+      confirmUpload: false,
       firmwareUpgrading: false,
       checkedUpgrade: false,
+      firmwareName: '',
       latestVersion: '',
       password: ''
     }
@@ -81,7 +83,8 @@ module.exports = new Vue({
     'tool-view': require('./tool-view'),
     'io-view': require('./io-view'),
     'gcode-view': require('./gcode-view'),
-    'admin-view': require('./admin-view')
+    'admin-view': require('./admin-view'),
+    'help-view': {template: '#help-view-template'}
   },
 
 
@@ -123,6 +126,14 @@ module.exports = new Vue({
     },
 
 
+    upload: function (firmware) {
+      this.firmware = firmware;
+      this.firmwareName = firmware.name;
+      this.password = '';
+      this.confirmUpload = true;
+    },
+
+
     error: function (msg) {
       // Honor user error blocking
       if (Date.now() - this.errorTimeoutStart < this.errorTimeout * 1000)
@@ -169,6 +180,30 @@ module.exports = new Vue({
     },
 
 
+    upload_confirmed: function () {
+      this.confirmUpload = false;
+
+      var form = new FormData();
+      form.append('firmware', this.firmware);
+      if (this.password) form.append('password', this.password);
+
+      $.ajax({
+        url: '/api/firmware/update',
+        type: 'PUT',
+        data: form,
+        cache: false,
+        contentType: false,
+        processData: false
+
+      }).success(function () {
+        this.firmwareUpgrading = true;
+
+      }.bind(this)).error(function () {
+        alert('Invalid password or bad firmware');
+      }.bind(this))
+    },
+
+
     show_upgrade: function () {
       if (!this.latestVersion) return false;
       return compare_versions(this.config.version, this.latestVersion) < 0;
index fd08f0bb19c9e5ae464ba35f6f52fcf364d39f13..52b375618204132b7d87728c6d31a8784fc87700 100644 (file)
@@ -387,6 +387,16 @@ module.exports = {
     load_video: function () {
       this.video_url = '//' + document.location.hostname + ':8000/stream/0?=' +
         Math.random();
+    },
+
+
+    reload_video: function () {
+      if (typeof this.lastVideoReset != 'undefined' &&
+          Date.now() - this.lastVideoReset < 15000) return;
+
+      this.lastVideoReset = Date.now();
+      api.put('video/reload');
+      setTimeout(this.load_video, 4000);
     }
   }
 }
index 2df05e42e741594c04ff81105241e69bac14b1d5..122babdc6e993061d2bef070b2d075d8e5c75f94 100644 (file)
@@ -35,7 +35,9 @@ module.exports = {
 
   data: function () {
     return {
-      tool: {}
+      tool: {},
+      pwmSpindle: {},
+      huanyangSpindle: {}
     }
   },
 
@@ -48,14 +50,13 @@ module.exports = {
   },
 
 
-  ready: function () {
-    this.update();
-  },
+  ready: function () {this.update()},
 
 
   methods: {
     update: function () {
       Vue.nextTick(function () {
+        // Tool
         if (this.config.hasOwnProperty('tool'))
           this.tool = this.config.tool;
 
@@ -63,6 +64,24 @@ module.exports = {
         for (var key in template)
           if (!this.tool.hasOwnProperty(key))
             this.$set('tool["' + key + '"]', template[key].default);
+
+        // PWM
+        if (this.config.hasOwnProperty('pwm-spindle'))
+          this.pwmSpindle = this.config['pwm-spindle'];
+
+        template = this.template['pwm-spindle'];
+        for (key in template)
+          if (!this.pwmSpindle.hasOwnProperty(key))
+            this.$set('pwmSpindle["' + key + '"]', template[key].default);
+
+        // Huanyang
+        if (this.config.hasOwnProperty('huanyang-spindle'))
+          this.huanyangSpindle = this.config['huanyang-spindle'];
+
+        template = this.template['huanyang-spindle'];
+        for (key in template)
+          if (!this.huanyangSpindle.hasOwnProperty(key))
+            this.$set('huanyangSpindle["' + key + '"]', template[key].default);
       }.bind(this));
     }
   }
index f17a78fbe9b1a65a5e22becccb94737a06f3adf5..740065dca824ffbefed60bdf45f2c77f26c6e18b 100644 (file)
@@ -80,6 +80,9 @@ enum {
 #define VOLTAGE_MIN 11
 #define VOLTAGE_MAX 39
 #define CURRENT_MAX 25
+#define LOAD_CURRENT_MAX 10.5
+#define CURRENT_OVERTEMP 14 // Should read ~21A but over 11.86A is faulty
+#define LOAD_LIMIT_TICKS 10
 #define VOLTAGE_SETTLE_COUNT 5
 #define VOLTAGE_SETTLE_PERIOD 20 // ms
 #define VOLTAGE_SETTLE_TOLERANCE 0.01
@@ -125,4 +128,14 @@ enum {
   OVER_CURRENT_FLAG      = 1 << 2,
   MEASUREMENT_ERROR_FLAG = 1 << 3,
   SHUNT_OVERLOAD_FLAG    = 1 << 4,
+  MOTOR_OVERLOAD_FLAG    = 1 << 5,
+
+  // Non fatal
+  LOAD1_OVERTEMP_FLAG    = 1 << 6,
+  LOAD2_OVERTEMP_FLAG    = 1 << 7,
+  LOAD1_LIMITING_FLAG    = 1 << 8,
+  LOAD2_LIMITING_FLAG    = 1 << 9,
 };
+
+
+#define FATAL_FLAG_MASK ((1 << 6) - 1)
index 3323281a21510063474f964ad6157870aabf0a5b..42eae1d14db07d946a8766efbcd2c4e5433e7af8 100644 (file)
 #include <stdbool.h>
 
 
+typedef struct {
+  regs_t reg;
+  uint8_t pin;
+  uint8_t limit;
+  uint8_t count;
+  bool shutdown;
+} load_t;
+
+load_t loads[2] = {
+  {LOAD1_REG, LOAD1_PIN, 0, 0, false},
+  {LOAD2_REG, LOAD2_PIN, 0, 0, false},
+};
+
+
 static const uint8_t ch_schedule[] = {
   TEMP_ADC, VOUT_ADC,
   VIN_ADC,  VOUT_ADC,
@@ -49,6 +63,7 @@ static const uint8_t ch_schedule[] = {
 
 static volatile uint16_t regs[NUM_REGS] = {0};
 static volatile uint64_t time = 0; // ms
+static volatile bool motor_overload = false;
 static volatile bool shunt_overload = false;
 static volatile float shunt_ms_power = 0;
 static volatile float vnom = 0;
@@ -161,8 +176,44 @@ static void measure_nominal_voltage() {
 }
 
 
+static void check_load(load_t *load) {
+  if (load->shutdown) return;
+
+  // Check overtemp
+  if (CURRENT_OVERTEMP * 100 < regs[load->reg]) {
+    IO_PORT_CLR(load->pin); // Lo
+    IO_DDR_SET(load->pin);  // Output
+    load->shutdown = true;
+  }
+
+  // Check and adjust limit
+  if (LOAD_CURRENT_MAX * 100 < regs[load->reg]) {
+    if (load->limit < LOAD_LIMIT_TICKS) load->limit++;
+  } else if (load->limit) load->limit--;
+}
+
+
+void limit_load(load_t *load) {
+  if (load->shutdown) return;
+
+  // Limit
+  if (load->count < load->limit) {
+    IO_PORT_CLR(load->pin); // Lo
+    IO_DDR_SET(load->pin);  // Output
+
+  } else IO_DDR_CLR(load->pin); // Float
+
+  if (++load->count == LOAD_LIMIT_TICKS) load->count = 0;
+}
+
+
 ISR(TIMER0_OVF_vect) {
   static uint8_t tick = 0;
+
+  // Calling these too fast disrupts the I2C bus
+  if ((tick & 3) == 0) limit_load(&loads[0]);
+  if ((tick & 3) == 2) limit_load(&loads[1]);
+
   if (++tick == 31) {
     time++;
     tick = 0;
@@ -197,10 +248,23 @@ static void read_conversion(uint8_t ch) {
   case TEMP_ADC: regs[TEMP_REG]  = data; break; // in Kelvin
   case VIN_ADC:  regs[VIN_REG]   = convert_voltage(data); break;
   case VOUT_ADC: regs[VOUT_REG]  = convert_voltage(data); break;
-  case CS1_ADC:  regs[MOTOR_REG] = convert_current(data); break;
-  case CS2_ADC:  regs[VDD_REG]   = convert_current(data); break;
-  case CS3_ADC:  regs[LOAD2_REG] = convert_current(data); break;
-  case CS4_ADC:  regs[LOAD1_REG] = convert_current(data); break;
+
+  case CS1_ADC:
+    regs[MOTOR_REG] = convert_current(data);
+    if (CURRENT_OVERTEMP * 100 < regs[MOTOR_REG]) motor_overload = true;
+    break;
+
+  case CS2_ADC: regs[VDD_REG] = convert_current(data); break;
+
+  case CS3_ADC:
+    regs[LOAD2_REG] = convert_current(data);
+    check_load(&loads[1]);
+    break;
+
+  case CS4_ADC:
+    regs[LOAD1_REG] = convert_current(data);
+    check_load(&loads[0]);
+    break;
   }
 }
 
@@ -320,12 +384,12 @@ static void shutdown(uint16_t flags) {
   TCCR0B = TCCR1B = 0;
 
   // Disable outputs
-  IO_DDR_CLR(SHUNT_PIN);
-  IO_DDR_CLR(MOTOR_PIN);
-  IO_PORT_CLR(LOAD1_PIN);
-  IO_PORT_CLR(LOAD2_PIN);
-  IO_DDR_SET(LOAD1_PIN);
-  IO_DDR_SET(LOAD2_PIN);
+  IO_DDR_CLR(SHUNT_PIN);  // Input
+  IO_DDR_CLR(MOTOR_PIN);  // Input
+  IO_PORT_CLR(LOAD1_PIN); // Lo
+  IO_PORT_CLR(LOAD2_PIN); // Lo
+  IO_DDR_SET(LOAD1_PIN);  // Output
+  IO_DDR_SET(LOAD2_PIN);  // Output
 
   while (true) continue;
 }
@@ -367,8 +431,13 @@ int main() {
     if (VOLTAGE_MAX < vin || VOLTAGE_MAX < vout) flags |= OVER_VOLTAGE_FLAG;
     if (CURRENT_MAX < get_total_current()) flags |= OVER_CURRENT_FLAG;
     if (shunt_overload) flags |= SHUNT_OVERLOAD_FLAG;
+    if (motor_overload) flags |= MOTOR_OVERLOAD_FLAG;
+    if (loads[0].shutdown) flags |= LOAD1_OVERTEMP_FLAG;
+    if (loads[1].shutdown) flags |= LOAD2_OVERTEMP_FLAG;
+    if (loads[0].limit) flags |= LOAD1_LIMITING_FLAG;
+    if (loads[1].limit) flags |= LOAD2_LIMITING_FLAG;
 
-    if (flags) shutdown(flags);
+    if (flags & FATAL_FLAG_MASK) shutdown(flags);
   }
 
   return 0;
index a82bb1cb5cd7e44e298681730e456a402ec94bce..af607413bbc5572d0222302e74903108b36c1d7d 100644 (file)
@@ -87,6 +87,7 @@ class AVR():
                                     ctrl.ioloop.READ)
 
         self.i2c_addr = ctrl.args.avr_addr
+        self._queue_command(Cmd.REBOOT)
 
 
     def _is_busy(self): return self.ctrl.planner.is_running()
@@ -216,6 +217,20 @@ class AVR():
 
                     continue
 
+                # AVR logging
+                if 'msg' in msg:
+                    level = msg.get('level', 'info')
+                    if 'where' in msg: extra = {'where': msg}
+                    else: extra = None
+                    msg = msg['msg']
+
+                    if level == 'info': log.info(msg, extra)
+                    elif level == 'debug': log.debug(msg, extra)
+                    elif level == 'warning': log.warning(msg, extra)
+                    elif level == 'error': log.error(msg, extra)
+
+                    continue
+
                 update.update(msg)
 
         if update:
@@ -261,11 +276,10 @@ class AVR():
                 row += 1
 
         # Show tool, units, feed and speed
-        # TODO Units not in state
-        if 't' in update: self.lcd_page.text('%2uT' % update['t'], 6, 1)
-        if 'u' in update: self.lcd_page.text('%-6s' % update['u'], 0, 1)
-        if 'f' in update: self.lcd_page.text('%8uF' % update['f'], 0, 2)
-        if 's' in update: self.lcd_page.text('%8dS' % update['s'], 0, 3)
+        if 'tool'  in update: self.lcd_page.text('%2uT' % update['tool'],  6, 1)
+        if 'units' in update: self.lcd_page.text('%-6s' % update['units'], 0, 1)
+        if 'feed'  in update: self.lcd_page.text('%8uF' % update['feed'],  0, 2)
+        if 'speed' in update: self.lcd_page.text('%8dS' % update['speed'], 0, 3)
 
 
     def connect(self):
index d502b30fc21ca6f326f1a8bf12721d3c27e0a0da..9eb623ca0ee93bd7e4bf7b19b2ab40a20abc9503 100644 (file)
@@ -34,19 +34,26 @@ import logging
 
 log = logging.getLogger('Cmd')
 
-# TODO, sync this up with AVR code
-SET      = '$'
-SET_SYNC = '#'
-SEEK     = 's'
-LINE     = 'l'
-REPORT   = 'r'
-PAUSE    = 'P'
-UNPAUSE  = 'U'
-ESTOP    = 'E'
-CLEAR    = 'C'
-FLUSH    = 'F'
-STEP     = 'S'
-RESUME   = 'c'
+# Keep this in sync with AVR code command.def
+SET       = '$'
+SET_SYNC  = '#'
+SEEK      = 's'
+LINE      = 'l'
+DWELL     = 'd'
+OUTPUT    = 'o'
+OPT_PAUSE = 'p'
+PAUSE     = 'P'
+UNPAUSE   = 'U'
+JOG       = 'j'
+REPORT    = 'r'
+REBOOT    = 'R'
+RESUME    = 'c'
+ESTOP     = 'E'
+CLEAR     = 'C'
+STEP      = 'S'
+FLUSH     = 'F'
+DUMP      = 'D'
+HELP      = 'h'
 
 SEEK_ACTIVE = 1 << 0
 SEEK_ERROR  = 1 << 1
index ff55298cc45279da2929d84f4d41ca5710a1eab1..30798ec08a9e55c8e6b365de9b9a71c7f136c11b 100644 (file)
@@ -42,11 +42,17 @@ LOAD2_REG       = 5
 VDD_REG         = 6
 FLAGS_REG       = 7
 
+# Must be kept in sync with pwr firmware
 UNDER_VOLTAGE_FLAG     = 1 << 0
 OVER_VOLTAGE_FLAG      = 1 << 1
 OVER_CURRENT_FLAG      = 1 << 2
 MEASUREMENT_ERROR_FLAG = 1 << 3
 SHUNT_OVERLOAD_FLAG    = 1 << 4
+MOTOR_OVERLOAD_FLAG    = 1 << 5
+LOAD1_OVERTEMP_FLAG    = 1 << 6
+LOAD2_OVERTEMP_FLAG    = 1 << 7
+LOAD1_LIMITING_FLAG    = 1 << 8
+LOAD2_LIMITING_FLAG    = 1 << 9
 
 reg_names = 'temp vin vout motor load1 load2 vdd pwr_flags'.split()
 
@@ -65,19 +71,49 @@ class Pwr():
     def get_reg(self, i): return self.regs[i]
 
 
+    def check_fault(self, var, status):
+        status = bool(status)
+
+        if status != self.ctrl.state.get(var, False):
+            self.ctrl.state.set(var, status)
+            if status: return True
+
+        return False
+
+
     def error(self):
         flags = self.regs[FLAGS_REG]
-        errors = []
 
-        # Decode error flags
-        if flags & UNDER_VOLTAGE_FLAG:     errors.append('under voltage')
-        if flags & OVER_VOLTAGE_FLAG:      errors.append('over voltage')
-        if flags & OVER_CURRENT_FLAG:      errors.append('over current')
-        if flags & MEASUREMENT_ERROR_FLAG: errors.append('measurement error')
-        if flags & SHUNT_OVERLOAD_FLAG:    errors.append('shunt overload')
+        if self.check_fault('under_voltage', flags & UNDER_VOLTAGE_FLAG):
+            log.error('Device under voltage')
+
+        if self.check_fault('over_voltage', flags & OVER_VOLTAGE_FLAG):
+            log.error('Device over voltage')
+
+        if self.check_fault('over_current', flags & OVER_CURRENT_FLAG):
+            log.error('Device total current limit exceeded')
+
+        if self.check_fault('measurement_error',
+                            flags & MEASUREMENT_ERROR_FLAG):
+            log.error('Power measurement error')
+
+        if self.check_fault('shunt_overload', flags & SHUNT_OVERLOAD_FLAG):
+            log.error('Power shunt overload')
+
+        if self.check_fault('motor_overload', flags & MOTOR_OVERLOAD_FLAG):
+            log.error('Motor power overload')
+
+        if self.check_fault('load1_overtemp', flags & LOAD1_OVERTEMP_FLAG):
+            log.error('Load 1 over temperature shutdown')
+
+        if self.check_fault('load2_overtemp', flags & LOAD2_OVERTEMP_FLAG):
+            log.error('Load 2 over temperature shutdown')
+
+        if self.check_fault('load1_limiting', flags & LOAD1_LIMITING_FLAG):
+            log.warning('Load 1 limiting active')
 
-        # Report errors
-        if errors: log.error('Power fault: ' + ', '.join(errors))
+        if self.check_fault('load2_limiting', flags & LOAD2_LIMITING_FLAG):
+            log.warning('Load 2 limiting active')
 
 
     def _update(self):
index 2d358d9c9c0178ee720f6c35955600c95dc03dcf..c6c2f00d46080d4307d04230776d60a92b7c46f3 100644 (file)
@@ -36,6 +36,7 @@ import shutil
 import tarfile
 import subprocess
 import socket
+import time
 from tornado.web import HTTPError
 
 import bbctrl
@@ -152,9 +153,13 @@ class FirmwareUpdateHandler(bbctrl.APIHandler):
 
 
     def put_ok(self):
-        # Only allow this function in dev mode
-        if not os.path.exists('/etc/bbctrl-dev-mode'):
-            raise HTTPError(403, 'Not in dev mode')
+        if not 'password' in self.request.arguments:
+            raise HTTPError(401, 'Missing "password"')
+
+        if not 'firmware' in self.request.files:
+            raise HTTPError(401, 'Missing "firmware"')
+
+        check_password(self.request.arguments['password'][0])
 
         firmware = self.request.files['firmware'][0]
 
@@ -234,6 +239,10 @@ class JogHandler(bbctrl.APIHandler):
     def put_ok(self): self.ctrl.avr.jog(self.json)
 
 
+class VideoReloadHandler(bbctrl.APIHandler):
+    def put_ok(self): subprocess.Popen('reset-video').wait()
+
+
 # Base class for Web Socket connections
 class ClientConnection(object):
     def __init__(self, ctrl):
@@ -325,6 +334,7 @@ class Web(tornado.web.Application):
             (r'/api/override/feed/([\d.]+)', OverrideFeedHandler),
             (r'/api/override/speed/([\d.]+)', OverrideSpeedHandler),
             (r'/api/jog', JogHandler),
+            (r'/api/video/reload', VideoReloadHandler),
             (r'/(.*)', StaticFileHandler,
              {'path': bbctrl.get_resource('http/'),
               "default_filename": "index.html"}),
index bd76c719d8fa3186a73039af25bf0921b4839d0b..bb3533392ec6d264b028b38f50a22f0b5edcfe43 100644 (file)
       "default": "false",
       "code": "sr"
     },
+    "tool-enable-mode": {
+      "type": "enum",
+      "values": ["disabled", "lo-hi", "hi-lo", "tri-lo", "tri-hi", "lo-tri",
+                 "hi-tri"],
+      "default": "lo-hi",
+      "code": "eom"
+    },
+    "tool-direction-mode": {
+      "type": "enum",
+      "values": ["disabled", "lo-hi", "hi-lo", "tri-lo", "tri-hi", "lo-tri",
+                 "hi-tri"],
+      "default": "lo-hi",
+      "code": "dom"
+    }
+  },
+
+  "huanyang-spindle": {
+    "bus-id": {
+      "type": "int",
+      "default": "1",
+      "code": "hi"
+    }
+  },
+
+  "pwm-spindle": {
     "max-spin": {
       "type": "float",
       "unit": "RPM",
       "default": 0,
       "code": "sm"
     },
-    "spin-min-duty": {
+    "pwm-inverted": {
+      "type": "bool",
+      "default": "false",
+      "code": "pi"
+    },
+    "pwm-min-duty": {
       "type": "float",
       "unit": "%",
       "min": 0,
       "default": 1,
       "code": "nd"
     },
-    "spin-max-duty": {
+    "pwm-max-duty": {
       "type": "float",
       "unit": "%",
       "min": 0,
       "max": 65535,
       "default": 1000,
       "code": "sf"
-    },
-    "pwm-inverted": {
-      "type": "bool",
-      "default": "false",
-      "code": "pi"
-    },
-    "tool-enable-mode": {
-      "type": "enum",
-      "values": ["disabled", "lo-hi", "hi-lo", "tri-lo", "tri-hi", "lo-tri",
-                 "hi-tri"],
-      "default": "lo-hi",
-      "code": "eom"
-    },
-    "tool-direction-mode": {
-      "type": "enum",
-      "values": ["disabled", "lo-hi", "hi-lo", "tri-lo", "tri-hi", "lo-tri",
-                 "hi-tri"],
-      "default": "lo-hi",
-      "code": "dom"
     }
   },