From 87d7455c775f8d8fb22e1c7f8200b5000107f0be Mon Sep 17 00:00:00 2001 From: Joseph Coffland Date: Wed, 27 May 2020 16:28:34 -0700 Subject: [PATCH] Fix occasional 'Plan Failed' when saving config, Fix motor step alignment when changing motor parameters like microsteping, Stall detect homing, Improved voltage spike clamping time, pwr version, Allow changing rapid-auto-off and dynamic-power in VFD mode, Update license and copyright, removed no longer valid TinyG credit. --- CHANGELOG.md | 10 +- CODE_TAG | 34 +- LICENSE | 666 ++++++++++------------- README.md | 19 + package.json | 2 +- src/avr/README.md | 19 + src/avr/data_usage.py | 34 +- src/avr/emu/src/avr/eeprom.h | 40 +- src/avr/emu/src/avr/interrupt.h | 40 +- src/avr/emu/src/avr/io.h | 40 +- src/avr/emu/src/avr/pgmspace.h | 40 +- src/avr/emu/src/avr/wdt.h | 40 +- src/avr/emu/src/emu.c | 40 +- src/avr/emu/src/util/atomic.h | 40 +- src/avr/emu/src/util/crc16.h | 40 +- src/avr/emu/src/util/delay.h | 40 +- src/avr/src/SCurve.cpp | 35 +- src/avr/src/SCurve.h | 34 +- src/avr/src/analog.c | 34 +- src/avr/src/analog.h | 34 +- src/avr/src/axis.c | 34 +- src/avr/src/axis.h | 34 +- src/avr/src/base64.c | 34 +- src/avr/src/base64.h | 34 +- src/avr/src/command.c | 34 +- src/avr/src/command.def | 34 +- src/avr/src/command.h | 34 +- src/avr/src/commands.c | 34 +- src/avr/src/config.h | 38 +- src/avr/src/cpp_magic.h | 34 +- src/avr/src/drv8711.c | 261 +++++---- src/avr/src/drv8711.h | 49 +- src/avr/src/emu.h | 34 +- src/avr/src/estop.c | 34 +- src/avr/src/estop.h | 34 +- src/avr/src/exec.c | 44 +- src/avr/src/exec.h | 34 +- src/avr/src/hardware.c | 34 +- src/avr/src/hardware.h | 34 +- src/avr/src/huanyang.c | 34 +- src/avr/src/huanyang.h | 34 +- src/avr/src/i2c.c | 34 +- src/avr/src/i2c.h | 34 +- src/avr/src/io.c | 34 +- src/avr/src/io.h | 34 +- src/avr/src/jog.c | 34 +- src/avr/src/jog.h | 34 +- src/avr/src/lcd.c | 34 +- src/avr/src/lcd.h | 34 +- src/avr/src/line.c | 34 +- src/avr/src/main.c | 36 +- src/avr/src/messages.def | 34 +- src/avr/src/modbus.c | 34 +- src/avr/src/modbus.h | 34 +- src/avr/src/motor.c | 91 ++-- src/avr/src/motor.h | 37 +- src/avr/src/outputs.c | 34 +- src/avr/src/outputs.h | 34 +- src/avr/src/pgmspace.h | 34 +- src/avr/src/pins.c | 34 +- src/avr/src/pins.h | 34 +- src/avr/src/pwm.c | 34 +- src/avr/src/pwm.h | 34 +- src/avr/src/report.c | 34 +- src/avr/src/report.h | 34 +- src/avr/src/ringbuf.def | 34 +- src/avr/src/rtc.c | 34 +- src/avr/src/rtc.h | 34 +- src/avr/src/seek.c | 90 ++- src/avr/src/seek.h | 35 +- src/avr/src/spindle.c | 34 +- src/avr/src/spindle.h | 34 +- src/avr/src/state.c | 34 +- src/avr/src/state.h | 34 +- src/avr/src/status.c | 34 +- src/avr/src/status.h | 34 +- src/avr/src/stepper.c | 34 +- src/avr/src/stepper.h | 34 +- src/avr/src/switch.c | 41 +- src/avr/src/switch.h | 35 +- src/avr/src/type.c | 34 +- src/avr/src/type.def | 34 +- src/avr/src/type.h | 34 +- src/avr/src/usart.c | 34 +- src/avr/src/usart.h | 34 +- src/avr/src/util.c | 34 +- src/avr/src/util.h | 34 +- src/avr/src/vars.c | 34 +- src/avr/src/vars.def | 43 +- src/avr/src/vars.h | 34 +- src/avr/src/vfd_spindle.c | 34 +- src/avr/src/vfd_spindle.h | 34 +- src/avr/step-test/plot_velocity.py | 32 +- src/avr/step-test/step-test.c | 34 +- src/bbserial/bbserial.c | 34 +- src/boot/src/boot.c | 34 +- src/boot/src/boot.h | 34 +- src/boot/src/sp_driver.h | 34 +- src/jig/src/config.h | 34 +- src/jig/src/encoder.c | 34 +- src/jig/src/encoder.h | 34 +- src/jig/src/main.c | 34 +- src/jig/src/pins.c | 34 +- src/jig/src/pins.h | 34 +- src/jig/src/ringbuf.def | 34 +- src/jig/src/rtc.c | 34 +- src/jig/src/rtc.h | 34 +- src/jig/src/usart.c | 34 +- src/jig/src/usart.h | 34 +- src/js/admin-general-view.js | 34 +- src/js/admin-network-view.js | 34 +- src/js/api.js | 34 +- src/js/app.js | 36 +- src/js/axis-control.js | 34 +- src/js/axis-vars.js | 34 +- src/js/chart-view.js | 108 ++++ src/js/console.js | 34 +- src/js/control-view.js | 34 +- src/js/cookie.js | 42 +- src/js/gcode-viewer.js | 34 +- src/js/indicators.js | 34 +- src/js/io-indicator.js | 34 +- src/js/io-view.js | 34 +- src/js/main.js | 34 +- src/js/message.js | 34 +- src/js/modbus-reg.js | 34 +- src/js/modbus.js | 34 +- src/js/motor-view.js | 77 ++- src/js/orbit.js | 27 + src/js/path-viewer.js | 42 +- src/js/settings-view.js | 34 +- src/js/sock.js | 34 +- src/js/templated-input.js | 34 +- src/js/tool-view.js | 34 +- src/js/unit-value.js | 34 +- src/pug/index.pug | 41 +- src/pug/templates/admin-general-view.pug | 34 +- src/pug/templates/admin-network-view.pug | 34 +- src/pug/templates/axis-control.pug | 34 +- src/pug/templates/chart-view.pug | 30 + src/pug/templates/cheat-sheet-view.pug | 34 +- src/pug/templates/console.pug | 34 +- src/pug/templates/control-view.pug | 34 +- src/pug/templates/estop.pug | 34 +- src/pug/templates/gcode-viewer.pug | 34 +- src/pug/templates/help-view.pug | 34 +- src/pug/templates/indicators.pug | 34 +- src/pug/templates/io-indicator.pug | 34 +- src/pug/templates/io-view.pug | 34 +- src/pug/templates/license-view.pug | 57 ++ src/pug/templates/message.pug | 34 +- src/pug/templates/modbus-reg-view.pug | 34 +- src/pug/templates/motor-view.pug | 45 +- src/pug/templates/path-viewer.pug | 34 +- src/pug/templates/settings-view.pug | 27 + src/pug/templates/templated-input.pug | 34 +- src/pug/templates/tool-view.pug | 34 +- src/pwr/config.h | 36 +- src/pwr/main.c | 49 +- src/pwr/pins.c | 34 +- src/pwr/pins.h | 34 +- src/py/bbctrl/APIHandler.py | 34 +- src/py/bbctrl/AVR.py | 34 +- src/py/bbctrl/AVREmu.py | 34 +- src/py/bbctrl/Camera.py | 35 +- src/py/bbctrl/Cmd.py | 36 +- src/py/bbctrl/Comm.py | 34 +- src/py/bbctrl/CommandQueue.py | 34 +- src/py/bbctrl/Config.py | 34 +- src/py/bbctrl/Ctrl.py | 34 +- src/py/bbctrl/FileHandler.py | 34 +- src/py/bbctrl/I2C.py | 34 +- src/py/bbctrl/IOLoop.py | 34 +- src/py/bbctrl/IPLCDPage.py | 34 +- src/py/bbctrl/Jog.py | 34 +- src/py/bbctrl/LCD.py | 34 +- src/py/bbctrl/Log.py | 34 +- src/py/bbctrl/Mach.py | 45 +- src/py/bbctrl/MainLCDPage.py | 34 +- src/py/bbctrl/MonitorTemp.py | 34 +- src/py/bbctrl/ObjGraph.py | 27 + src/py/bbctrl/Planner.py | 34 +- src/py/bbctrl/Preplanner.py | 36 +- src/py/bbctrl/Pwr.py | 34 +- src/py/bbctrl/RequestHandler.py | 34 +- src/py/bbctrl/State.py | 50 +- src/py/bbctrl/Web.py | 34 +- src/py/bbctrl/__init__.py | 34 +- src/py/bbctrl/plan.py | 34 +- src/py/bbctrl/v4l2.py | 27 + src/py/inevent/AbsAxisScaling.py | 34 +- src/py/inevent/Constants.py | 34 +- src/py/inevent/Event.py | 34 +- src/py/inevent/EventHandler.py | 34 +- src/py/inevent/EventState.py | 34 +- src/py/inevent/EventStream.py | 34 +- src/py/inevent/FindDevices.py | 34 +- src/py/inevent/InEvent.py | 34 +- src/py/inevent/JogHandler.py | 34 +- src/py/inevent/Keys.py | 34 +- src/py/inevent/__init__.py | 34 +- src/py/inevent/ioctl.py | 34 +- src/py/lcd/__init__.py | 34 +- src/py/lcd/splash.py | 34 +- src/resources/config-template.json | 78 ++- src/static/js/chart-2.9.3.min.js | 7 + src/static/js/chart.bundle-2.9.3.min.js | 7 + src/stylus/style.styl | 32 +- 208 files changed, 4412 insertions(+), 3832 deletions(-) create mode 100644 src/js/chart-view.js create mode 100644 src/pug/templates/chart-view.pug create mode 100644 src/pug/templates/license-view.pug mode change 100755 => 100644 src/py/bbctrl/Camera.py mode change 100755 => 100644 src/py/bbctrl/Cmd.py mode change 100755 => 100644 src/py/bbctrl/ObjGraph.py mode change 100755 => 100644 src/py/bbctrl/plan.py create mode 100644 src/static/js/chart-2.9.3.min.js create mode 100644 src/static/js/chart.bundle-2.9.3.min.js diff --git a/CHANGELOG.md b/CHANGELOG.md index e1fcc84..77a6144 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,13 @@ Buildbotics CNC Controller Firmware Changelog ============================================= ## v0.4.15 - - Set GCode variables #5400 and #<_tool>. - - Added #<_timestamp> GCode variable. + - Set GCode variables ``#5400`` and ``#<_tool>``. + - Added ``#<_timestamp>`` GCode variable. - Print program start, stop and end with timestamp. + - Fix occasional "Plan Failed" when saving config. + - Fix motor step alignment when changing motor parameters like microsteping. + - Stall detect homing. + - Improved voltage spike clamping time. ## v0.4.14 - Handle file uploads with '#' or '?' in the name. @@ -25,7 +29,7 @@ Buildbotics CNC Controller Firmware Changelog ## v0.4.12 - Segments straddle arc in linearization. - - Control max-arc-error with GCode var. + - Control ``max-arc-error`` with GCode var. - Implemented path modes G61, G61.1 & G64 with naive CAM and basic blending. - Log GCode messages to "Messages" tab. - Acknowledging a message on one browser clears it for all. diff --git a/CODE_TAG b/CODE_TAG index d36ffb0..218f12e 100644 --- a/CODE_TAG +++ b/CODE_TAG @@ -1,22 +1,22 @@ - This file is part of the Buildbotics firmware. +This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. +Copyright (c) 2015 - 2020, 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 . +This Source describes Open Hardware and is licensed under the +CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products +using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). +This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED +WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS +FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable +conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . +Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" +As per CERN-OHL-S v2 section 4, should You produce hardware based on +these sources, You must maintain the Source Location clearly visible on +the external case of the CNC Controller or other product you make using +this Source. + +For more information, email info@buildbotics.com diff --git a/LICENSE b/LICENSE index ac86d6d..114486f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,377 +1,289 @@ -The Buildbotics firmware ("the software") is free software: you can -redistribute it and/or modify it under the terms of the GNU General -Public License, version 2 (with out any licensing exceptions) as -published by the Free Software Foundation. See the full license terms -below. - -*********************************************************************** - -Substantial effort was made to give credit to all authors of this -software and of the works it was derived from and to adhere to the -terms of the applicable license agreements. If you belive any -mistakes have been made in this regard please contact Joseph Coffland -. - -Portions of this software are copyrighted by the following entities: - - Copyright (c) 2015 - 2016 Buildbotics LLC - Copyright (c) 2014 Thomas Nixon, Jonathan Heathcote (cpp_magic.h) - All rights reserved. - -Each source code file lists the entities which claim copyright to -parts of those files. - -Much of this software was originally written by Alden S. Hart, Jr. and -Robert Giseburt as part of the TinyG project. The TinyG project was -in turn derived from grbl/marlin firmwares. All of the original code -has been reformatted and cleaned up to fit our coding standards. -Functionality in many areas has been substantially modified. - -The original TinyG firmware is licensed under the GPL v2 and includes -an exception which allows use of the source code by non-GPLed -libraires and potentially executables linked to those libraries. The -TinyG project's license did not specify that this exception must be -offered in derived works, therefore this software's license DOES NOT -offer any exceptions to the GPL v2 license. - -*********************************************************************** - - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. +CERN Open Hardware Licence Version 2 - Strongly Reciprocal + + +Preamble + +CERN has developed this licence to promote collaboration among +hardware designers and to provide a legal tool which supports the +freedom to use, study, modify, share and distribute hardware designs +and products based on those designs. Version 2 of the CERN Open +Hardware Licence comes in three variants: CERN-OHL-P (permissive); and +two reciprocal licences: CERN-OHL-W (weakly reciprocal) and this +licence, CERN-OHL-S (strongly reciprocal). + +The CERN-OHL-S is copyright CERN 2020. Anyone is welcome to use it, in +unmodified form only. + +Use of this Licence does not imply any endorsement by CERN of any +Licensor or their designs nor does it imply any involvement by CERN in +their development. + + +1 Definitions + + 1.1 'Licence' means this CERN-OHL-S. + + 1.2 'Compatible Licence' means + + a) any earlier version of the CERN Open Hardware licence, or + + b) any version of the CERN-OHL-S, or + + c) any licence which permits You to treat the Source to which + it applies as licensed under CERN-OHL-S provided that on + Conveyance of any such Source, or any associated Product You + treat the Source in question as being licensed under + CERN-OHL-S. + + 1.3 'Source' means information such as design materials or digital + code which can be applied to Make or test a Product or to + prepare a Product for use, Conveyance or sale, regardless of its + medium or how it is expressed. It may include Notices. + + 1.4 'Covered Source' means Source that is explicitly made available + under this Licence. + + 1.5 'Product' means any device, component, work or physical object, + whether in finished or intermediate form, arising from the use, + application or processing of Covered Source. + + 1.6 'Make' means to create or configure something, whether by + manufacture, assembly, compiling, loading or applying Covered + Source or another Product or otherwise. + + 1.7 'Available Component' means any part, sub-assembly, library or + code which: + + a) is licensed to You as Complete Source under a Compatible + Licence; or + + b) is available, at the time a Product or the Source containing + it is first Conveyed, to You and any other prospective + licensees + + i) as a physical part with sufficient rights and + information (including any configuration and + programming files and information about its + characteristics and interfaces) to enable it either to + be Made itself, or to be sourced and used to Make the + Product; or + ii) as part of the normal distribution of a tool used to + design or Make the Product. + + 1.8 'Complete Source' means the set of all Source necessary to Make + a Product, in the preferred form for making modifications, + including necessary installation and interfacing information + both for the Product, and for any included Available Components. + If the format is proprietary, it must also be made available in + a format (if the proprietary tool can create it) which is + viewable with a tool available to potential licensees and + licensed under a licence approved by the Free Software + Foundation or the Open Source Initiative. Complete Source need + not include the Source of any Available Component, provided that + You include in the Complete Source sufficient information to + enable a recipient to Make or source and use the Available + Component to Make the Product. + + 1.9 'Source Location' means a location where a Licensor has placed + Covered Source, and which that Licensor reasonably believes will + remain easily accessible for at least three years for anyone to + obtain a digital copy. + + 1.10 'Notice' means copyright, acknowledgement and trademark notices, + Source Location references, modification notices (subsection + 3.3(b)) and all notices that refer to this Licence and to the + disclaimer of warranties that are included in the Covered + Source. + + 1.11 'Licensee' or 'You' means any person exercising rights under + this Licence. + + 1.12 'Licensor' means a natural or legal person who creates or + modifies Covered Source. A person may be a Licensee and a + Licensor at the same time. + + 1.13 'Convey' means to communicate to the public or distribute. + + +2 Applicability + + 2.1 This Licence governs the use, copying, modification, Conveying + of Covered Source and Products, and the Making of Products. By + exercising any right granted under this Licence, You irrevocably + accept these terms and conditions. + + 2.2 This Licence is granted by the Licensor directly to You, and + shall apply worldwide and without limitation in time. + + 2.3 You shall not attempt to restrict by contract or otherwise the + rights granted under this Licence to other Licensees. + + 2.4 This Licence is not intended to restrict fair use, fair dealing, + or any other similar right. + + +3 Copying, modifying and Conveying Covered Source + + 3.1 You may copy and Convey verbatim copies of Covered Source, in + any medium, provided You retain all Notices. + + 3.2 You may modify Covered Source, other than Notices, provided that + You irrevocably undertake to make that modified Covered Source + available from a Source Location should You Convey a Product in + circumstances where the recipient does not otherwise receive a + copy of the modified Covered Source. In each case subsection 3.3 + shall apply. + + You may only delete Notices if they are no longer applicable to + the corresponding Covered Source as modified by You and You may + add additional Notices applicable to Your modifications. + Including Covered Source in a larger work is modifying the + Covered Source, and the larger work becomes modified Covered + Source. + + 3.3 You may Convey modified Covered Source (with the effect that You + shall also become a Licensor) provided that You: + + a) retain Notices as required in subsection 3.2; + + b) add a Notice to the modified Covered Source stating that You + have modified it, with the date and brief description of how + You have modified it; + + c) add a Source Location Notice for the modified Covered Source + if You Convey in circumstances where the recipient does not + otherwise receive a copy of the modified Covered Source; and + + d) license the modified Covered Source under the terms and + conditions of this Licence (or, as set out in subsection + 8.3, a later version, if permitted by the licence of the + original Covered Source). Such modified Covered Source must + be licensed as a whole, but excluding Available Components + contained in it, which remain licensed under their own + applicable licences. + + +4 Making and Conveying Products + +You may Make Products, and/or Convey them, provided that You either +provide each recipient with a copy of the Complete Source or ensure +that each recipient is notified of the Source Location of the Complete +Source. That Complete Source is Covered Source, and You must +accordingly satisfy Your obligations set out in subsection 3.3. If +specified in a Notice, the Product must visibly and securely display +the Source Location on it or its packaging or documentation in the +manner specified in that Notice. + + +5 Research and Development + +You may Convey Covered Source, modified Covered Source or Products to +a legal entity carrying out development, testing or quality assurance +work on Your behalf provided that the work is performed on terms which +prevent the entity from both using the Source or Products for its own +internal purposes and Conveying the Source or Products or any +modifications to them to any person other than You. Any modifications +made by the entity shall be deemed to be made by You pursuant to +subsection 3.2. + + +6 DISCLAIMER AND LIABILITY + + 6.1 DISCLAIMER OF WARRANTY -- The Covered Source and any Products + are provided 'as is' and any express or implied warranties, + including, but not limited to, implied warranties of + merchantability, of satisfactory quality, non-infringement of + third party rights, and fitness for a particular purpose or use + are disclaimed in respect of any Source or Product to the + maximum extent permitted by law. The Licensor makes no + representation that any Source or Product does not or will not + infringe any patent, copyright, trade secret or other + proprietary right. The entire risk as to the use, quality, and + performance of any Source or Product shall be with You and not + the Licensor. This disclaimer of warranty is an essential part + of this Licence and a condition for the grant of any rights + granted under this Licence. + + 6.2 EXCLUSION AND LIMITATION OF LIABILITY -- The Licensor shall, to + the maximum extent permitted by law, have no liability for + direct, indirect, special, incidental, consequential, exemplary, + punitive or other damages of any character including, without + limitation, procurement of substitute goods or services, loss of + use, data or profits, or business interruption, however caused + and on any theory of contract, warranty, tort (including + negligence), product liability or otherwise, arising in any way + in relation to the Covered Source, modified Covered Source + and/or the Making or Conveyance of a Product, even if advised of + the possibility of such damages, and You shall hold the + Licensor(s) free and harmless from any liability, costs, + damages, fees and expenses, including claims by third parties, + in relation to such use. + + +7 Patents + + 7.1 Subject to the terms and conditions of this Licence, each + Licensor hereby grants to You a perpetual, worldwide, + non-exclusive, no-charge, royalty-free, irrevocable (except as + stated in subsections 7.2 and 8.4) patent license to Make, have + Made, use, offer to sell, sell, import, and otherwise transfer + the Covered Source and Products, where such licence applies only + to those patent claims licensable by such Licensor that are + necessarily infringed by exercising rights under the Covered + Source as Conveyed by that Licensor. + + 7.2 If You institute patent litigation against any entity (including + a cross-claim or counterclaim in a lawsuit) alleging that the + Covered Source or a Product constitutes direct or contributory + patent infringement, or You seek any declaration that a patent + licensed to You under this Licence is invalid or unenforceable + then any rights granted to You under this Licence shall + terminate as of the date such process is initiated. + + +8 General + + 8.1 If any provisions of this Licence are or subsequently become + invalid or unenforceable for any reason, the remaining + provisions shall remain effective. + + 8.2 You shall not use any of the name (including acronyms and + abbreviations), image, or logo by which the Licensor or CERN is + known, except where needed to comply with section 3, or where + the use is otherwise allowed by law. Any such permitted use + shall be factual and shall not be made so as to suggest any kind + of endorsement or implication of involvement by the Licensor or + its personnel. + + 8.3 CERN may publish updated versions and variants of this Licence + which it considers to be in the spirit of this version, but may + differ in detail to address new problems or concerns. New + versions will be published with a unique version number and a + variant identifier specifying the variant. If the Licensor has + specified that a given variant applies to the Covered Source + without specifying a version, You may treat that Covered Source + as being released under any version of the CERN-OHL with that + variant. If no variant is specified, the Covered Source shall be + treated as being released under CERN-OHL-S. The Licensor may + also specify that the Covered Source is subject to a specific + version of the CERN-OHL or any later version in which case You + may apply this or any later version of CERN-OHL with the same + variant identifier published by CERN. + + 8.4 This Licence shall terminate with immediate effect if You fail + to comply with any of its terms and conditions. + + 8.5 However, if You cease all breaches of this Licence, then Your + Licence from any Licensor is reinstated unless such Licensor has + terminated this Licence by giving You, while You remain in + breach, a notice specifying the breach and requiring You to cure + it within 30 days, and You have failed to come into compliance + in all material respects by the end of the 30 day period. Should + You repeat the breach after receipt of a cure notice and + subsequent reinstatement, this Licence will terminate + immediately and permanently. Section 6 shall continue to apply + after any termination. + + 8.6 This Licence shall not be enforceable except by a Licensor + acting as such, and third party beneficiary rights are + specifically excluded. diff --git a/README.md b/README.md index 345ab24..cb8270f 100644 --- a/README.md +++ b/README.md @@ -60,3 +60,22 @@ On a Debian Linux (9.6.0 stable) system: The resulting package will be a ``.tar.bz2`` file in ``dist``. See the [development guide](docs/development.md) for more information. + +## License +Copyright Buildbotics LLC 2016-2020. + +This source describes Open Hardware and is licensed under the CERN-OHL-S v2 + +You may redistribute and modify this documentation and make products +using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). +This documentation is distributed WITHOUT ANY EXPRESS OR IMPLIED +WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY +AND FITNESS FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 +for applicable conditions. + +Source location: https://github.com/buildbotics + +As per CERN-OHL-S v2 section 4, should You produce hardware based on +these sources, You must maintain the Source Location clearly visible on +the external case of the CNC Controller or other product you make using +this documentation. diff --git a/package.json b/package.json index a0fa55c..c7bbe66 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.4.15", "homepage": "http://buildbotics.com/", "repository": "https://github.com/buildbotics/bbctrl-firmware", - "license": "GPL-3.0+", + "license": "CERN-OHL-S v2", "dependencies": { "jshint": "", "browserify": "", diff --git a/src/avr/README.md b/src/avr/README.md index 97f5eb0..33b5a61 100644 --- a/src/avr/README.md +++ b/src/avr/README.md @@ -16,3 +16,22 @@ Other make commands are: * **read_fuses** - Read and print AVR fuse bytes * **clean** - Remove build files * **tidy** - Remove backup files + +# License +Copyright Buildbotics LLC 2016-2020. + +This source describes Open Hardware and is licensed under the CERN-OHL-S v2 + +You may redistribute and modify this documentation and make products +using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). +This documentation is distributed WITHOUT ANY EXPRESS OR IMPLIED +WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY +AND FITNESS FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 +for applicable conditions. + +Source location: https://github.com/buildbotics + +As per CERN-OHL-S v2 section 4, should You produce hardware based on +these sources, You must maintain the Source Location clearly visible on +the external case of the CNC Controller or other product you make using +this documentation. diff --git a/src/avr/data_usage.py b/src/avr/data_usage.py index 27863ec..508c396 100644 --- a/src/avr/data_usage.py +++ b/src/avr/data_usage.py @@ -2,28 +2,28 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/avr/emu/src/avr/eeprom.h b/src/avr/emu/src/avr/eeprom.h index bafb8b0..7ccd159 100644 --- a/src/avr/emu/src/avr/eeprom.h +++ b/src/avr/emu/src/avr/eeprom.h @@ -2,26 +2,26 @@ 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 . - - 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 - . - - For information regarding this software email: - "Joseph Coffland" + Copyright (c) 2015 - 2020, Buildbotics LLC, All rights reserved. + + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. + + You may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. + + Source location: https://github.com/buildbotics + + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/emu/src/avr/interrupt.h b/src/avr/emu/src/avr/interrupt.h index 10fd67b..88b6f21 100644 --- a/src/avr/emu/src/avr/interrupt.h +++ b/src/avr/emu/src/avr/interrupt.h @@ -2,26 +2,26 @@ 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 . - - 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 - . - - For information regarding this software email: - "Joseph Coffland" + Copyright (c) 2015 - 2020, Buildbotics LLC, All rights reserved. + + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. + + You may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. + + Source location: https://github.com/buildbotics + + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/emu/src/avr/io.h b/src/avr/emu/src/avr/io.h index 3d0e145..e065259 100644 --- a/src/avr/emu/src/avr/io.h +++ b/src/avr/emu/src/avr/io.h @@ -2,26 +2,26 @@ 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 . - - 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 - . - - For information regarding this software email: - "Joseph Coffland" + Copyright (c) 2015 - 2020, Buildbotics LLC, All rights reserved. + + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. + + You may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. + + Source location: https://github.com/buildbotics + + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/emu/src/avr/pgmspace.h b/src/avr/emu/src/avr/pgmspace.h index 5377eb9..4f7e025 100644 --- a/src/avr/emu/src/avr/pgmspace.h +++ b/src/avr/emu/src/avr/pgmspace.h @@ -2,26 +2,26 @@ 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 . - - 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 - . - - For information regarding this software email: - "Joseph Coffland" + Copyright (c) 2015 - 2020, Buildbotics LLC, All rights reserved. + + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. + + You may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. + + Source location: https://github.com/buildbotics + + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/emu/src/avr/wdt.h b/src/avr/emu/src/avr/wdt.h index bcf6f99..814bfa5 100644 --- a/src/avr/emu/src/avr/wdt.h +++ b/src/avr/emu/src/avr/wdt.h @@ -2,26 +2,26 @@ 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 . - - 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 - . - - For information regarding this software email: - "Joseph Coffland" + Copyright (c) 2015 - 2020, Buildbotics LLC, All rights reserved. + + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. + + You may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. + + Source location: https://github.com/buildbotics + + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/emu/src/emu.c b/src/avr/emu/src/emu.c index a0b06a5..6f9a76d 100644 --- a/src/avr/emu/src/emu.c +++ b/src/avr/emu/src/emu.c @@ -2,26 +2,26 @@ 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 . - - 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 - . - - For information regarding this software email: - "Joseph Coffland" + Copyright (c) 2015 - 2020, Buildbotics LLC, All rights reserved. + + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. + + You may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. + + Source location: https://github.com/buildbotics + + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/emu/src/util/atomic.h b/src/avr/emu/src/util/atomic.h index 86dab20..cfab012 100644 --- a/src/avr/emu/src/util/atomic.h +++ b/src/avr/emu/src/util/atomic.h @@ -2,26 +2,26 @@ 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 . - - 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 - . - - For information regarding this software email: - "Joseph Coffland" + Copyright (c) 2015 - 2020, Buildbotics LLC, All rights reserved. + + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. + + You may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. + + Source location: https://github.com/buildbotics + + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/emu/src/util/crc16.h b/src/avr/emu/src/util/crc16.h index e343874..ba38083 100644 --- a/src/avr/emu/src/util/crc16.h +++ b/src/avr/emu/src/util/crc16.h @@ -2,26 +2,26 @@ 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 . - - 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 - . - - For information regarding this software email: - "Joseph Coffland" + Copyright (c) 2015 - 2020, Buildbotics LLC, All rights reserved. + + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. + + You may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. + + Source location: https://github.com/buildbotics + + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/emu/src/util/delay.h b/src/avr/emu/src/util/delay.h index e67c76a..0891384 100644 --- a/src/avr/emu/src/util/delay.h +++ b/src/avr/emu/src/util/delay.h @@ -2,26 +2,26 @@ 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 . - - 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 - . - - For information regarding this software email: - "Joseph Coffland" + Copyright (c) 2015 - 2020, Buildbotics LLC, All rights reserved. + + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. + + You may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. + + Source location: https://github.com/buildbotics + + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/SCurve.cpp b/src/avr/src/SCurve.cpp index 73bbe30..2e63896 100644 --- a/src/avr/src/SCurve.cpp +++ b/src/avr/src/SCurve.cpp @@ -1,30 +1,29 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. -\******************************************************************************/ + For more information, email info@buildbotics.com +\******************************************************************************/ #include "SCurve.h" diff --git a/src/avr/src/SCurve.h b/src/avr/src/SCurve.h index d48786a..d59688e 100644 --- a/src/avr/src/SCurve.h +++ b/src/avr/src/SCurve.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/analog.c b/src/avr/src/analog.c index 918f4fa..6300a0b 100644 --- a/src/avr/src/analog.c +++ b/src/avr/src/analog.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/analog.h b/src/avr/src/analog.h index 6aaf592..365d20e 100644 --- a/src/avr/src/analog.h +++ b/src/avr/src/analog.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/axis.c b/src/avr/src/axis.c index 1f891f5..9757d40 100644 --- a/src/avr/src/axis.c +++ b/src/avr/src/axis.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/axis.h b/src/avr/src/axis.h index 50aae9b..0c36dc9 100644 --- a/src/avr/src/axis.h +++ b/src/avr/src/axis.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/base64.c b/src/avr/src/base64.c index e6bbe99..722910c 100644 --- a/src/avr/src/base64.c +++ b/src/avr/src/base64.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/base64.h b/src/avr/src/base64.h index ed6e6a6..d6a9ce2 100644 --- a/src/avr/src/base64.h +++ b/src/avr/src/base64.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/command.c b/src/avr/src/command.c index 916c388..212de99 100644 --- a/src/avr/src/command.c +++ b/src/avr/src/command.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/command.def b/src/avr/src/command.def index c413a90..d6d301d 100644 --- a/src/avr/src/command.def +++ b/src/avr/src/command.def @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/command.h b/src/avr/src/command.h index 24fa928..bdfe806 100644 --- a/src/avr/src/command.h +++ b/src/avr/src/command.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/commands.c b/src/avr/src/commands.c index 8796b09..2339b94 100644 --- a/src/avr/src/commands.c +++ b/src/avr/src/commands.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/config.h b/src/avr/src/config.h index 2a379e0..ca41557 100644 --- a/src/avr/src/config.h +++ b/src/avr/src/config.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ @@ -157,12 +157,10 @@ enum { DRV8711_DRIVE_TDRIVEN_500 | \ DRV8711_DRIVE_OCPDEG_1 | \ DRV8711_DRIVE_OCPTH_500) -#define DRV8711_TORQUE DRV8711_TORQUE_SMPLTH_50 // NOTE, Datasheet suggests 850ns DTIME with the optional gate resistor // installed. See page 30 section 8.1.2 of DRV8711 datasheet. #define DRV8711_CTRL (DRV8711_CTRL_ISGAIN_5 | \ - DRV8711_CTRL_DTIME_850 | \ - DRV8711_CTRL_EXSTALL_bm) + DRV8711_CTRL_DTIME_850) // RS485 settings diff --git a/src/avr/src/cpp_magic.h b/src/avr/src/cpp_magic.h index f677c1a..33674cd 100644 --- a/src/avr/src/cpp_magic.h +++ b/src/avr/src/cpp_magic.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/drv8711.c b/src/avr/src/drv8711.c index bd89138..770b506 100644 --- a/src/avr/src/drv8711.c +++ b/src/avr/src/drv8711.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ @@ -30,19 +30,14 @@ #include "stepper.h" #include "switch.h" #include "estop.h" +#include "exec.h" +#include "motor.h" #include #include -#include -#include -#include -#include - #define DRIVERS MOTORS - - #define DRV8711_WORD_BYTE_PTR(WORD, LOW) (((uint8_t *)&(WORD)) + !(LOW)) @@ -71,7 +66,6 @@ typedef struct { typedef struct { uint8_t cs_pin; - switch_id_t stall_sw; uint8_t status; uint16_t flags; @@ -81,24 +75,31 @@ typedef struct { drv8711_state_t state; current_t drive; current_t idle; - uint16_t stall_vdiv; - uint8_t stall_thresh; + uint16_t last_torque_reg; uint8_t microstep; - stall_callback_t stall_cb; - - uint8_t last_torque; uint8_t last_microstep; + struct { + uint16_t reg; + uint16_t last_reg; + bool detect; + uint16_t samp_time; + float velocity; + current_t current; + uint16_t microstep; + uint16_t save_microstep; + } stall; + spi_state_t spi_state; } drv8711_driver_t; static drv8711_driver_t drivers[DRIVERS] = { - {.cs_pin = SPI_CS_0_PIN, .stall_sw = SW_STALL_0}, - {.cs_pin = SPI_CS_1_PIN, .stall_sw = SW_STALL_1}, - {.cs_pin = SPI_CS_2_PIN, .stall_sw = SW_STALL_2}, - {.cs_pin = SPI_CS_3_PIN, .stall_sw = SW_STALL_3}, + {.cs_pin = SPI_CS_0_PIN}, + {.cs_pin = SPI_CS_1_PIN}, + {.cs_pin = SPI_CS_2_PIN}, + {.cs_pin = SPI_CS_3_PIN}, }; @@ -115,6 +116,22 @@ typedef struct { static spi_t spi = {0}; +static uint8_t _microsteps(uint16_t msteps) { + switch (msteps) { + case 1: return DRV8711_CTRL_MODE_1; + case 2: return DRV8711_CTRL_MODE_2; + case 4: return DRV8711_CTRL_MODE_4; + case 8: return DRV8711_CTRL_MODE_8; + case 16: return DRV8711_CTRL_MODE_16; + case 32: return DRV8711_CTRL_MODE_32; + case 64: return DRV8711_CTRL_MODE_64; + case 128: return DRV8711_CTRL_MODE_128; + case 256: return DRV8711_CTRL_MODE_256; + } + return 0xff; // Invalid +} + + static void _current_set(current_t *c, float current) { const float gain = DRV8711_CTRL_GAIN(DRV8711_CTRL); const float max_current = CURRENT_SENSE_REF / (CURRENT_SENSE_RESISTOR * gain); @@ -141,7 +158,8 @@ static float _driver_get_current(drv8711_driver_t *drv) { switch (drv->state) { case DRV8711_IDLE: return drv->idle.current; - case DRV8711_ACTIVE: return drv->drive.current; + case DRV8711_ACTIVE: + return drv->stall.detect ? drv->stall.current.current : drv->drive.current; default: return 0; // Off } } @@ -152,11 +170,29 @@ static uint8_t _driver_get_torque(drv8711_driver_t *drv) { switch (drv->state) { case DRV8711_IDLE: return drv->idle.torque; - case DRV8711_ACTIVE: return drv->drive.torque; + case DRV8711_ACTIVE: + return drv->stall.detect ? drv->stall.current.torque : drv->drive.torque; default: return 0; // Off } } +static uint16_t _driver_get_torque_reg(drv8711_driver_t *drv) { + uint16_t reg; + + switch (drv->stall.samp_time) { + case 100: reg = DRV8711_TORQUE_SMPLTH_100; break; + case 200: reg = DRV8711_TORQUE_SMPLTH_200; break; + case 300: reg = DRV8711_TORQUE_SMPLTH_300; break; + case 400: reg = DRV8711_TORQUE_SMPLTH_400; break; + case 600: reg = DRV8711_TORQUE_SMPLTH_600; break; + case 800: reg = DRV8711_TORQUE_SMPLTH_800; break; + case 1000: reg = DRV8711_TORQUE_SMPLTH_1000; break; + default: reg = DRV8711_TORQUE_SMPLTH_50; break; + } + + return reg | _driver_get_torque(drv); +} + static uint16_t _driver_spi_command(drv8711_driver_t *drv) { switch (drv->spi_state) { @@ -165,23 +201,22 @@ static uint16_t _driver_spi_command(drv8711_driver_t *drv) { case SS_WRITE_DECAY: return DRV8711_WRITE(DRV8711_DECAY_REG, DRV8711_DECAY); case SS_WRITE_STALL: { - uint16_t reg = drv->stall_thresh | DRV8711_STALL_SDCNT_2 | drv->stall_vdiv; - return DRV8711_WRITE(DRV8711_STALL_REG, reg); + drv->stall.last_reg = drv->stall.reg; + return DRV8711_WRITE(DRV8711_STALL_REG, drv->stall.reg); } case SS_WRITE_DRIVE: return DRV8711_WRITE(DRV8711_DRIVE_REG, DRV8711_DRIVE); case SS_WRITE_TORQUE: - drv->last_torque = _driver_get_torque(drv); - return DRV8711_WRITE(DRV8711_TORQUE_REG, DRV8711_TORQUE | drv->last_torque); + drv->last_torque_reg = _driver_get_torque_reg(drv); + return DRV8711_WRITE(DRV8711_TORQUE_REG, drv->last_torque_reg); case SS_WRITE_CTRL: { // NOTE, we disable the driver if it's not active. The chip gets hot // idling with the driver enabled. bool enable = _driver_get_torque(drv); drv->last_microstep = drv->microstep; - return DRV8711_WRITE(DRV8711_CTRL_REG, DRV8711_CTRL | - (drv->microstep << 3) | + return DRV8711_WRITE(DRV8711_CTRL_REG, DRV8711_CTRL | drv->microstep | (enable ? DRV8711_CTRL_ENBL_bm : 0)); } @@ -235,7 +270,9 @@ static spi_state_t _driver_spi_next(drv8711_driver_t *drv) { case SS_READ_STATUS: if (drv->reset_flags) return SS_CLEAR_STATUS; - if (drv->last_torque != _driver_get_torque(drv)) return SS_WRITE_TORQUE; + if (drv->stall.last_reg != drv->stall.reg) return SS_WRITE_STALL; + if (drv->last_torque_reg != _driver_get_torque_reg(drv)) + return SS_WRITE_TORQUE; if (drv->last_microstep != drv->microstep) return SS_WRITE_CTRL; // Fall through @@ -301,26 +338,6 @@ static void _spi_send() { ISR(SPIC_INT_vect) {_spi_send();} -static void _stall_change(int driver, bool stalled) { - drivers[driver].stalled = stalled; - - // Call stall callback - if (stalled && drivers[driver].stall_cb) - drivers[driver].stall_cb(driver); -} - - -static void _stall_switch_cb(switch_id_t sw, bool active) { - switch (sw) { - case SW_STALL_0: _stall_change(0, active); break; - case SW_STALL_1: _stall_change(1, active); break; - case SW_STALL_2: _stall_change(2, active); break; - case SW_STALL_3: _stall_change(3, active); break; - default: break; - } -} - - static void _motor_fault_switch_cb(switch_id_t sw, bool active) { motor_fault = active; } @@ -346,10 +363,6 @@ void drv8711_init() { OUTSET_PIN(cs_pin); // High DIRSET_PIN(cs_pin); // Output - switch_id_t stall_sw = drivers[i].stall_sw; - switch_set_type(stall_sw, SW_NORMALLY_OPEN); - switch_set_callback(stall_sw, _stall_switch_cb); - drivers[i].reset_flags = true; // Reset flags once on startup } @@ -367,12 +380,6 @@ void drv8711_init() { } -drv8711_state_t drv8711_get_state(int driver) { - if (driver < 0 || DRIVERS <= driver) return DRV8711_DISABLED; - return drivers[driver].state; -} - - void drv8711_set_state(int driver, drv8711_state_t state) { if (driver < 0 || DRIVERS <= driver) return; drivers[driver].state = state; @@ -381,18 +388,47 @@ void drv8711_set_state(int driver, drv8711_state_t state) { void drv8711_set_microsteps(int driver, uint16_t msteps) { if (driver < 0 || DRIVERS <= driver) return; - switch (msteps) { - case 1: case 2: case 4: case 8: case 16: case 32: case 64: case 128: case 256: - break; - default: return; // Invalid - } + uint8_t microstep = _microsteps(msteps); + if (microstep == 0xff) return; // Invalid - drivers[driver].microstep = round(logf(msteps) / logf(2)); + drivers[driver].microstep = microstep; } -void drv8711_set_stall_callback(int driver, stall_callback_t cb) { - drivers[driver].stall_cb = cb; +void drv8711_set_stalled(int driver, bool stalled) { + if (driver < 0 || DRIVERS <= driver) return; + drivers[driver].stalled = stalled; +} + + +void drv8711_set_stall_detect(int driver, bool enable) { + if (driver < 0 || DRIVERS <= driver) return; + drv8711_driver_t *drv = &drivers[driver]; + + drv->stall.detect = enable; + + if (enable) { + drv->stall.save_microstep = motor_get_microstep(driver); + motor_set_microstep(driver, drv->stall.microstep); + + } else { + motor_set_microstep(driver, drv->stall.save_microstep); + motor_set_step_output(driver, true); + } +} + + +bool drv8711_detect_stall(int driver) { + if (driver < 0 || DRIVERS <= driver) return false; + drv8711_driver_t *drv = &drivers[driver]; + + bool stalled = + drv->stall.detect && drv->stall.velocity <= exec_get_velocity(); + + if (stalled) motor_set_step_output(driver, false); + if (stalled) drv->stall.velocity = exec_get_velocity(); + + return stalled; } @@ -444,15 +480,10 @@ bool get_driver_stalled(int driver) {return drivers[driver].stalled;} float get_stall_volts(int driver) { if (driver < 0 || DRIVERS <= driver) return 0; - float vdiv; - switch (drivers[driver].stall_vdiv) { - case DRV8711_STALL_VDIV_4: vdiv = 4; break; - case DRV8711_STALL_VDIV_8: vdiv = 8; break; - case DRV8711_STALL_VDIV_16: vdiv = 16; break; - default: vdiv = 32; break; - } + float vdiv = DRV8711_STALL_VDIV(drivers[driver].stall.reg); + float thresh = DRV8711_STALL_THRESH(drivers[driver].stall.reg); - return 1.8 / 256 * vdiv * drivers[driver].stall_thresh; + return vdiv * thresh; } @@ -479,6 +510,54 @@ void set_stall_volts(int driver, float volts) { else thresh = 255; } - drivers[driver].stall_vdiv = vdiv; - drivers[driver].stall_thresh = thresh; + drivers[driver].stall.reg = thresh | DRV8711_STALL_SDCNT_2 | vdiv; +} + + +uint16_t get_stall_samp_time(int driver) { + if (driver < 0 || DRIVERS <= driver) return 0; + return drivers[driver].stall.samp_time; +} + + +void set_stall_samp_time(int driver, uint16_t value) { + if (driver < 0 || DRIVERS <= driver) return; + drivers[driver].stall.samp_time = value; +} + + +float get_stall_current(int driver) { + if (driver < 0 || DRIVERS <= driver) return 0; + return drivers[driver].stall.current.current; +} + + +void set_stall_current(int driver, float value) { + if (driver < 0 || DRIVERS <= driver) return; + if (MAX_CURRENT < value) value = MAX_CURRENT; + _current_set(&drivers[driver].stall.current, value); +} + + +uint16_t get_stall_microstep(int driver) { + if (driver < 0 || DRIVERS <= driver) return 0; + return drivers[driver].stall.microstep; +} + + +void set_stall_microstep(int driver, uint16_t microstep) { + if (driver < 0 || DRIVERS <= driver) return; + drivers[driver].stall.microstep = microstep; +} + + +float get_stall_velocity(int driver) { + if (driver < 0 || DRIVERS <= driver) return 0; + return drivers[driver].stall.velocity / VELOCITY_MULTIPLIER; +} + + +void set_stall_velocity(int driver, float velocity) { + if (driver < 0 || DRIVERS <= driver) return; + drivers[driver].stall.velocity = velocity * VELOCITY_MULTIPLIER; } diff --git a/src/avr/src/drv8711.h b/src/avr/src/drv8711.h index 78c3859..4c82418 100644 --- a/src/avr/src/drv8711.h +++ b/src/avr/src/drv8711.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ @@ -170,6 +170,15 @@ enum { (DRV8711_CTRL_GET_GAIN(CTRL) == DRV8711_CTRL_ISGAIN_10 ? 10 : \ (DRV8711_CTRL_GET_GAIN(CTRL) == DRV8711_CTRL_ISGAIN_20 ? 20 : 40))) +#define DRV8711_CTRL_VDIV_BM (3 << 10) +#define DRV8711_STALL_GET_VDIV(STALL) ((STALL) & DRV8711_CTRL_VDIV_BM) +#define DRV8711_STALL_VDIV(STALL) \ + (DRV8711_STALL_GET_VDIV(STALL) == DRV8711_STALL_VDIV_4 ? 4 : \ + (DRV8711_STALL_GET_VDIV(STALL) == DRV8711_STALL_VDIV_8 ? 8 : \ + (DRV8711_STALL_GET_VDIV(STALL) == DRV8711_STALL_VDIV_16 ? 16 : 32))) + +#define DRV8711_STALL_THRESH(STALL) ((0xff & (STALL)) * 1.8 / 256) + typedef enum { DRV8711_DISABLED, @@ -182,7 +191,9 @@ typedef void (*stall_callback_t)(int driver); void drv8711_init(); -drv8711_state_t drv8711_get_state(int driver); +void drv8711_remap_switches(); void drv8711_set_state(int driver, drv8711_state_t state); void drv8711_set_microsteps(int driver, uint16_t msteps); -void drv8711_set_stall_callback(int driver, stall_callback_t cb); +void drv8711_set_stalled(int driver, bool stalled); +void drv8711_set_stall_detect(int driver, bool enable); +bool drv8711_detect_stall(int driver); diff --git a/src/avr/src/emu.h b/src/avr/src/emu.h index cb3d605..ad8dfd8 100644 --- a/src/avr/src/emu.h +++ b/src/avr/src/emu.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/estop.c b/src/avr/src/estop.c index 1e9bacb..94ded19 100644 --- a/src/avr/src/estop.c +++ b/src/avr/src/estop.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/estop.h b/src/avr/src/estop.h index 652f5c0..7ba8d50 100644 --- a/src/avr/src/estop.h +++ b/src/avr/src/estop.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/exec.c b/src/avr/src/exec.c index e5f6fe0..e43c73f 100644 --- a/src/avr/src/exec.c +++ b/src/avr/src/exec.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ @@ -66,19 +66,9 @@ static struct { } ex; -static void _limit_switch_cb(switch_id_t sw, bool active) { - if (sw == seek_get_switch()) return; - if (ex.velocity && active) estop_trigger(STAT_ESTOP_SWITCH); -} - - void exec_init() { memset(&ex, 0, sizeof(ex)); ex.feed_override = 1; // TODO implement feed override - - // Set callback for limit switches - for (int sw = SW_MIN_0; sw <= SW_MAX_3; sw++) - switch_set_callback((switch_id_t)sw, _limit_switch_cb); } diff --git a/src/avr/src/exec.h b/src/avr/src/exec.h index af238cd..e6f139a 100644 --- a/src/avr/src/exec.h +++ b/src/avr/src/exec.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/hardware.c b/src/avr/src/hardware.c index ec18f75..d635c37 100644 --- a/src/avr/src/hardware.c +++ b/src/avr/src/hardware.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/hardware.h b/src/avr/src/hardware.h index e2be012..f2a4672 100644 --- a/src/avr/src/hardware.h +++ b/src/avr/src/hardware.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/huanyang.c b/src/avr/src/huanyang.c index 26481e1..bcdc526 100644 --- a/src/avr/src/huanyang.c +++ b/src/avr/src/huanyang.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/huanyang.h b/src/avr/src/huanyang.h index ccad449..73d3856 100644 --- a/src/avr/src/huanyang.h +++ b/src/avr/src/huanyang.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/i2c.c b/src/avr/src/i2c.c index d115a1b..eefc736 100644 --- a/src/avr/src/i2c.c +++ b/src/avr/src/i2c.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/i2c.h b/src/avr/src/i2c.h index 7cd55ca..f9c7bdf 100644 --- a/src/avr/src/i2c.h +++ b/src/avr/src/i2c.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/io.c b/src/avr/src/io.c index 94ffcda..d24120f 100644 --- a/src/avr/src/io.c +++ b/src/avr/src/io.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/io.h b/src/avr/src/io.h index 1f8948b..cf18a6e 100644 --- a/src/avr/src/io.h +++ b/src/avr/src/io.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/jog.c b/src/avr/src/jog.c index 64df035..cfd84c7 100644 --- a/src/avr/src/jog.c +++ b/src/avr/src/jog.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/jog.h b/src/avr/src/jog.h index ea093ab..ee6b510 100644 --- a/src/avr/src/jog.h +++ b/src/avr/src/jog.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/lcd.c b/src/avr/src/lcd.c index 7802eb4..4417881 100644 --- a/src/avr/src/lcd.c +++ b/src/avr/src/lcd.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/lcd.h b/src/avr/src/lcd.h index b7369f0..3d092d3 100644 --- a/src/avr/src/lcd.h +++ b/src/avr/src/lcd.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/line.c b/src/avr/src/line.c index 132c14f..f824983 100644 --- a/src/avr/src/line.c +++ b/src/avr/src/line.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/main.c b/src/avr/src/main.c index 21a7296..76a845c 100644 --- a/src/avr/src/main.c +++ b/src/avr/src/main.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ @@ -44,6 +44,7 @@ #include "io.h" #include "exec.h" #include "state.h" +#include "seek.h" #include "emu.h" #include @@ -78,6 +79,7 @@ int main(int argc, char *argv[]) { stepper_init(); // steppers motor_init(); // motors exec_init(); // motion exec + seek_init(); // seeking moves vars_init(); // configuration variables command_init(); // command queue diff --git a/src/avr/src/messages.def b/src/avr/src/messages.def index 2f9aa33..7323514 100644 --- a/src/avr/src/messages.def +++ b/src/avr/src/messages.def @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/modbus.c b/src/avr/src/modbus.c index 2e63c1e..5678211 100644 --- a/src/avr/src/modbus.c +++ b/src/avr/src/modbus.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/modbus.h b/src/avr/src/modbus.h index 89b2cbb..1b41800 100644 --- a/src/avr/src/modbus.h +++ b/src/avr/src/modbus.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/motor.c b/src/avr/src/motor.c index 4cc5191..ec29875 100644 --- a/src/avr/src/motor.c +++ b/src/avr/src/motor.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ @@ -121,10 +121,16 @@ static motor_t motors[MOTORS] = { static uint8_t _dummy; +static void _reset_encoder(int motor) { + motor_set_position(motor, exec_get_axis_position(motors[motor].axis)); +} + + static void _update_config(int motor) { motor_t *m = &motors[motor]; m->steps_per_unit = 360.0 * m->microsteps / m->travel_rev / m->step_angle; + _reset_encoder(motor); } @@ -176,6 +182,27 @@ bool motor_is_enabled(int motor) {return motors[motor].enabled;} int motor_get_axis(int motor) {return motors[motor].axis;} +uint16_t motor_get_microstep(int motor) {return motors[motor].microsteps;} + + +void motor_set_microstep(int motor, uint16_t value) { + switch (value) { + case 1: case 2: case 4: case 8: case 16: case 32: case 64: case 128: case 256: + break; + default: return; + } + + if (motors[motor].slave) return; + + for (int m = motor; m < MOTORS; m++) + if (motors[m].axis == motors[motor].axis) { + motors[m].microsteps = value; + _update_config(m); + drv8711_set_microsteps(m, value); + } +} + + static int32_t _position_to_steps(int motor, float position) { return (int32_t)round(position * motors[motor].steps_per_unit); } @@ -196,6 +223,14 @@ float motor_get_soft_limit(int motor, bool min) { bool motor_get_homed(int motor) {return motors[motor].homed;} +void motor_set_step_output(int motor, bool enabled) { + motor_t *m = &motors[motor]; + + if (enabled) DIRSET_PIN(m->step_pin); // Output + else DIRCLR_PIN(m->step_pin); // Input +} + + static void _update_power(int motor) { motor_t *m = &motors[motor]; @@ -268,7 +303,7 @@ void motor_load_move(int motor) { m.dma->TRFCNT = 0xffff; m.dma->CTRLA |= DMA_CH_ENABLE_bm; - // To avoid causing couter wrap around, it is important to start the clock + // To avoid causing counter wrap around, it is important to start the clock // before setting PERBUF. If PERBUF is set before the clock is started PER // updates immediately and possibly mid step. @@ -386,24 +421,11 @@ void set_travel(int motor, float value) { } -uint16_t get_microstep(int motor) {return motors[motor].microsteps;} +uint16_t get_microstep(int motor) {return motor_get_microstep(motor);} void set_microstep(int motor, uint16_t value) { - switch (value) { - case 1: case 2: case 4: case 8: case 16: case 32: case 64: case 128: case 256: - break; - default: return; - } - - if (motors[motor].slave) return; - - for (int m = motor; m < MOTORS; m++) - if (motors[m].axis == motors[motor].axis) { - motors[m].microsteps = value; - _update_config(m); - drv8711_set_microsteps(m, value); - } + motor_set_microstep(motor, value); } @@ -415,8 +437,7 @@ void set_motor_axis(int motor, uint8_t axis) { motors[motor].axis = axis; axis_map_motors(); - // Reset encoder - motor_set_position(motor, exec_get_axis_position(axis)); + _reset_encoder(motor); // Check if this is now a slave motor motors[motor].slave = false; diff --git a/src/avr/src/motor.h b/src/avr/src/motor.h index 0940cd2..4c78516 100644 --- a/src/avr/src/motor.h +++ b/src/avr/src/motor.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ @@ -46,9 +46,12 @@ void motor_init(); bool motor_is_enabled(int motor); int motor_get_axis(int motor); +uint16_t motor_get_microstep(int motor); +void motor_set_microstep(int motor, uint16_t value); void motor_set_position(int motor, float position); float motor_get_soft_limit(int motor, bool min); bool motor_get_homed(int motor); +void motor_set_step_output(int motor, bool enabled); stat_t motor_rtc_callback(); diff --git a/src/avr/src/outputs.c b/src/avr/src/outputs.c index f989ec7..cc2605f 100644 --- a/src/avr/src/outputs.c +++ b/src/avr/src/outputs.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/outputs.h b/src/avr/src/outputs.h index e0f6636..4b39aed 100644 --- a/src/avr/src/outputs.h +++ b/src/avr/src/outputs.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/pgmspace.h b/src/avr/src/pgmspace.h index 9d7f25f..3ca71da 100644 --- a/src/avr/src/pgmspace.h +++ b/src/avr/src/pgmspace.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/pins.c b/src/avr/src/pins.c index 65782fd..f68afdd 100644 --- a/src/avr/src/pins.c +++ b/src/avr/src/pins.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/pins.h b/src/avr/src/pins.h index 6d6cd8b..3841666 100644 --- a/src/avr/src/pins.h +++ b/src/avr/src/pins.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/pwm.c b/src/avr/src/pwm.c index 1659964..64818de 100644 --- a/src/avr/src/pwm.c +++ b/src/avr/src/pwm.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/pwm.h b/src/avr/src/pwm.h index 23c723b..3d8200e 100644 --- a/src/avr/src/pwm.h +++ b/src/avr/src/pwm.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/report.c b/src/avr/src/report.c index 5e9d032..3306a16 100644 --- a/src/avr/src/report.c +++ b/src/avr/src/report.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/report.h b/src/avr/src/report.h index 4a7dcff..3d42559 100644 --- a/src/avr/src/report.h +++ b/src/avr/src/report.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/ringbuf.def b/src/avr/src/ringbuf.def index 1f4bad9..ca8b159 100644 --- a/src/avr/src/ringbuf.def +++ b/src/avr/src/ringbuf.def @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/rtc.c b/src/avr/src/rtc.c index 8020895..1b1faf6 100644 --- a/src/avr/src/rtc.c +++ b/src/avr/src/rtc.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/rtc.h b/src/avr/src/rtc.h index 6313ae9..98e0774 100644 --- a/src/avr/src/rtc.h +++ b/src/avr/src/rtc.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/seek.c b/src/avr/src/seek.c index 5dc6aa4..2c4b624 100644 --- a/src/avr/src/seek.c +++ b/src/avr/src/seek.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ @@ -32,6 +32,9 @@ #include "estop.h" #include "util.h" #include "state.h" +#include "exec.h" +#include "stepper.h" +#include "drv8711.h" #include @@ -53,6 +56,33 @@ typedef struct { static seek_t seek = {false, SW_INVALID, 0}; +static bool _is_stall_switch(int sw) { + return SW_STALL_0 <= sw && sw <= SW_STALL_3; +} + + +static int _switch_motor(int sw) {return sw - SW_STALL_0;} + + + +static void _switch_cb(switch_id_t sw, bool active) { + if (_is_stall_switch(sw)) drv8711_set_stalled(_switch_motor(sw), active); + + if (sw != seek_get_switch() && !_is_stall_switch(sw) && + exec_get_velocity() && active) + estop_trigger(STAT_ESTOP_SWITCH); +} + + +void seek_init() { + for (int sw = SW_MIN_0; sw <= SW_STALL_3; sw++) { + if (_is_stall_switch(sw)) + switch_set_type((switch_id_t)sw, SW_NORMALLY_OPEN); + switch_set_callback((switch_id_t)sw, _switch_cb); + } +} + + switch_id_t seek_get_switch() {return seek.active ? seek.sw : SW_INVALID;} @@ -60,8 +90,10 @@ bool seek_switch_found() { if (!seek.active) return false; bool inactive = !(seek.flags & SEEK_ACTIVE); + bool found = switch_is_active(seek.sw) ^ inactive; + bool stall_sw = _is_stall_switch(seek.sw); - if (switch_is_active(seek.sw) ^ inactive) { + if (found && (!stall_sw || drv8711_detect_stall(_switch_motor(seek.sw)))) { seek.flags |= SEEK_FOUND; return true; } @@ -70,17 +102,26 @@ bool seek_switch_found() { } +static void _done() { + if (!seek.active) return; + seek.active = false; + + if (_is_stall_switch(seek.sw)) + drv8711_set_stall_detect(_switch_motor(seek.sw), false); +} + + void seek_end() { if (!seek.active) return; if (!(SEEK_FOUND & seek.flags) && (SEEK_ERROR & seek.flags)) estop_trigger(STAT_SEEK_NOT_FOUND); - seek.active = false; + _done(); } -void seek_cancel() {seek.active = false;} +void seek_cancel() {_done();} // Command callbacks @@ -100,4 +141,11 @@ stat_t command_seek(char *cmd) { unsigned command_seek_size() {return sizeof(seek_t);} -void command_seek_exec(void *data) {seek = *(seek_t *)data;} + + +void command_seek_exec(void *data) { + seek = *(seek_t *)data; + + if (_is_stall_switch(seek.sw)) + drv8711_set_stall_detect(_switch_motor(seek.sw), true); +} diff --git a/src/avr/src/seek.h b/src/avr/src/seek.h index baa133c..c54501f 100644 --- a/src/avr/src/seek.h +++ b/src/avr/src/seek.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ @@ -32,6 +32,7 @@ #include +void seek_init(); switch_id_t seek_get_switch(); bool seek_switch_found(); void seek_end(); diff --git a/src/avr/src/spindle.c b/src/avr/src/spindle.c index cd39a88..41c2875 100644 --- a/src/avr/src/spindle.c +++ b/src/avr/src/spindle.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/spindle.h b/src/avr/src/spindle.h index 4728631..0b01476 100644 --- a/src/avr/src/spindle.h +++ b/src/avr/src/spindle.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/state.c b/src/avr/src/state.c index e94069c..946cae3 100644 --- a/src/avr/src/state.c +++ b/src/avr/src/state.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/state.h b/src/avr/src/state.h index d3488ab..d5f5cfd 100644 --- a/src/avr/src/state.h +++ b/src/avr/src/state.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/status.c b/src/avr/src/status.c index 4279637..9891eb5 100644 --- a/src/avr/src/status.c +++ b/src/avr/src/status.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/status.h b/src/avr/src/status.h index d363a1d..c487e19 100644 --- a/src/avr/src/status.h +++ b/src/avr/src/status.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/stepper.c b/src/avr/src/stepper.c index 68453f7..79af77d 100644 --- a/src/avr/src/stepper.c +++ b/src/avr/src/stepper.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/stepper.h b/src/avr/src/stepper.h index d365e34..43afe29 100644 --- a/src/avr/src/stepper.h +++ b/src/avr/src/stepper.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/switch.c b/src/avr/src/switch.c index 6994b15..b54cfc6 100644 --- a/src/avr/src/switch.c +++ b/src/avr/src/switch.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ @@ -144,10 +144,17 @@ void switch_set_type(switch_id_t sw, switch_type_t type) { void switch_set_callback(switch_id_t sw, switch_callback_t cb) { + if (sw < 0 || num_switches <= sw) return; switches[sw].cb = cb; } +switch_callback_t switch_get_callback(switch_id_t sw) { + if (sw < 0 || num_switches <= sw) return 0; + return switches[sw].cb; +} + + // Var callbacks uint8_t get_min_sw_mode(int index) {return switch_get_type(MIN_SWITCH(index));} diff --git a/src/avr/src/switch.h b/src/avr/src/switch.h index fb3a9d7..dcce456 100644 --- a/src/avr/src/switch.h +++ b/src/avr/src/switch.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ @@ -70,3 +70,4 @@ bool switch_is_enabled(switch_id_t sw); switch_type_t switch_get_type(switch_id_t sw); void switch_set_type(switch_id_t sw, switch_type_t type); void switch_set_callback(switch_id_t sw, switch_callback_t cb); +switch_callback_t switch_get_callback(switch_id_t sw); diff --git a/src/avr/src/type.c b/src/avr/src/type.c index 272e1f6..9b701c8 100644 --- a/src/avr/src/type.c +++ b/src/avr/src/type.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/type.def b/src/avr/src/type.def index 5f350fa..08ae821 100644 --- a/src/avr/src/type.def +++ b/src/avr/src/type.def @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/type.h b/src/avr/src/type.h index 322ebd6..e2af695 100644 --- a/src/avr/src/type.h +++ b/src/avr/src/type.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/usart.c b/src/avr/src/usart.c index d035c0e..0838c0c 100644 --- a/src/avr/src/usart.c +++ b/src/avr/src/usart.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/usart.h b/src/avr/src/usart.h index b59f4ed..384ce32 100644 --- a/src/avr/src/usart.h +++ b/src/avr/src/usart.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/util.c b/src/avr/src/util.c index 61137fe..56b8292 100644 --- a/src/avr/src/util.c +++ b/src/avr/src/util.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/util.h b/src/avr/src/util.h index 300fb1a..58142db 100644 --- a/src/avr/src/util.h +++ b/src/avr/src/util.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/vars.c b/src/avr/src/vars.c index 244ae08..49edef4 100644 --- a/src/avr/src/vars.c +++ b/src/avr/src/vars.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/vars.def b/src/avr/src/vars.def index 3c8a6ee..a462cb7 100644 --- a/src/avr/src/vars.def +++ b/src/avr/src/vars.def @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ @@ -54,11 +54,16 @@ VAR(homed, h, b8, MOTORS, 1, 1) // Motor homed status VAR(active_current, ac, f32, MOTORS, 0, 0) // Motor current now VAR(driver_flags, df, u16, MOTORS, 1, 1) // Motor driver flags -VAR(driver_stalled, sl, b8, MOTORS, 0, 0) // Motor driver status -VAR(stall_volts, tv, f32, MOTORS, 1, 0) // Motor BEMF threshold voltage VAR(encoder, en, s32, MOTORS, 0, 0) // Motor encoder VAR(error, ee, s32, MOTORS, 0, 0) // Motor position error +VAR(stall_current, tc, f32, MOTORS, 1, 1) // Stall detect current +VAR(stall_microstep, lm, u16, MOTORS, 1, 1) // Stall detect microsteps +VAR(driver_stalled, sl, b8, MOTORS, 0, 1) // Motor stall status +VAR(stall_volts, tv, f32, MOTORS, 1, 1) // Motor BEMF threshold voltage +VAR(stall_velocity, sv, f32, MOTORS, 1, 1) // Stall velocity +VAR(stall_samp_time, sp, u16, MOTORS, 1, 1) // Stall sample time + VAR(motor_fault, fa, b8, 0, 0, 1) // Motor fault status // Switches diff --git a/src/avr/src/vars.h b/src/avr/src/vars.h index 949f5aa..b55210e 100644 --- a/src/avr/src/vars.h +++ b/src/avr/src/vars.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/vfd_spindle.c b/src/avr/src/vfd_spindle.c index fb247fe..82bd422 100644 --- a/src/avr/src/vfd_spindle.c +++ b/src/avr/src/vfd_spindle.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/src/vfd_spindle.h b/src/avr/src/vfd_spindle.h index 1bfc3d9..978b539 100644 --- a/src/avr/src/vfd_spindle.h +++ b/src/avr/src/vfd_spindle.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/avr/step-test/plot_velocity.py b/src/avr/step-test/plot_velocity.py index 2006faf..40279e8 100644 --- a/src/avr/step-test/plot_velocity.py +++ b/src/avr/step-test/plot_velocity.py @@ -4,26 +4,26 @@ # # # This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/avr/step-test/step-test.c b/src/avr/step-test/step-test.c index db267bf..837f41d 100644 --- a/src/avr/step-test/step-test.c +++ b/src/avr/step-test/step-test.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/bbserial/bbserial.c b/src/bbserial/bbserial.c index 0c00d5d..1c5a536 100644 --- a/src/bbserial/bbserial.c +++ b/src/bbserial/bbserial.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2019, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/boot/src/boot.c b/src/boot/src/boot.c index 5137617..577aca1 100644 --- a/src/boot/src/boot.c +++ b/src/boot/src/boot.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/boot/src/boot.h b/src/boot/src/boot.h index def2d06..88ffcbb 100644 --- a/src/boot/src/boot.h +++ b/src/boot/src/boot.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/boot/src/sp_driver.h b/src/boot/src/sp_driver.h index 0cb9180..080bffa 100644 --- a/src/boot/src/sp_driver.h +++ b/src/boot/src/sp_driver.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/jig/src/config.h b/src/jig/src/config.h index ae699d0..e968218 100644 --- a/src/jig/src/config.h +++ b/src/jig/src/config.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/jig/src/encoder.c b/src/jig/src/encoder.c index 3ef3004..0fcbc14 100644 --- a/src/jig/src/encoder.c +++ b/src/jig/src/encoder.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/jig/src/encoder.h b/src/jig/src/encoder.h index 1153b7b..05f45fb 100644 --- a/src/jig/src/encoder.h +++ b/src/jig/src/encoder.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/jig/src/main.c b/src/jig/src/main.c index 3397475..afe1e4d 100644 --- a/src/jig/src/main.c +++ b/src/jig/src/main.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/jig/src/pins.c b/src/jig/src/pins.c index 65782fd..f68afdd 100644 --- a/src/jig/src/pins.c +++ b/src/jig/src/pins.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/jig/src/pins.h b/src/jig/src/pins.h index 49ae19e..f155efc 100644 --- a/src/jig/src/pins.h +++ b/src/jig/src/pins.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/jig/src/ringbuf.def b/src/jig/src/ringbuf.def index 5717a6d..0f4fb6f 100644 --- a/src/jig/src/ringbuf.def +++ b/src/jig/src/ringbuf.def @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/jig/src/rtc.c b/src/jig/src/rtc.c index 9ec4d3c..6bde7a8 100644 --- a/src/jig/src/rtc.c +++ b/src/jig/src/rtc.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/jig/src/rtc.h b/src/jig/src/rtc.h index 6313ae9..98e0774 100644 --- a/src/jig/src/rtc.h +++ b/src/jig/src/rtc.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/jig/src/usart.c b/src/jig/src/usart.c index 38e723e..1cf2b07 100644 --- a/src/jig/src/usart.c +++ b/src/jig/src/usart.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/jig/src/usart.h b/src/jig/src/usart.h index 1c95f1c..3e1a039 100644 --- a/src/jig/src/usart.h +++ b/src/jig/src/usart.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/js/admin-general-view.js b/src/js/admin-general-view.js index 6c5d5fc..20d3336 100644 --- a/src/js/admin-general-view.js +++ b/src/js/admin-general-view.js @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/js/admin-network-view.js b/src/js/admin-network-view.js index 1dae7b2..4bc71cb 100644 --- a/src/js/admin-network-view.js +++ b/src/js/admin-network-view.js @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/js/api.js b/src/js/api.js index 8c07a02..4808512 100644 --- a/src/js/api.js +++ b/src/js/api.js @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/js/app.js b/src/js/app.js index 7d22d76..45133bf 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ @@ -127,11 +127,13 @@ module.exports = new Vue({ 'control-view': require('./control-view'), 'settings-view': require('./settings-view'), 'motor-view': require('./motor-view'), + 'chart-view': require('./chart-view'), 'tool-view': require('./tool-view'), 'io-view': require('./io-view'), 'admin-general-view': require('./admin-general-view'), 'admin-network-view': require('./admin-network-view'), 'help-view': {template: '#help-view-template'}, + 'license-view': {template: '#license-view-template'}, 'cheat-sheet-view': { template: '#cheat-sheet-view-template', data: function () {return {showUnimplemented: false}} diff --git a/src/js/axis-control.js b/src/js/axis-control.js index e13c5cf..0f17b40 100644 --- a/src/js/axis-control.js +++ b/src/js/axis-control.js @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/js/axis-vars.js b/src/js/axis-vars.js index bf2096b..de1d502 100644 --- a/src/js/axis-vars.js +++ b/src/js/axis-vars.js @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/js/chart-view.js b/src/js/chart-view.js new file mode 100644 index 0000000..de0ee16 --- /dev/null +++ b/src/js/chart-view.js @@ -0,0 +1,108 @@ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2020, Buildbotics LLC, All rights reserved. + + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. + + You may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. + + Source location: https://github.com/buildbotics + + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com + +\******************************************************************************/ + +'use strict' + + +module.exports = { + template: '#chart-view-template', + props: ['config', 'template', 'state'], + + + data: function () { + return { + v: [], + s: [], + } + }, + + + ready: function () { + var options = { + title: {display: true}, + legend: {display: false}, + animation: {duration: 100}, + + scales: { + xAxes: [{ + type: 'time', + time: { + unit: 'hour', + displayFormats: {hour: 'MMM Do, H:00'} + } + }], + + yAxes: [{ + ticks: { + beginAtZero: true, + callback: function (value) { + return value.toLocaleString(); + } + } + }] + } + } + + this.chart = new Chart(this.$els.chart, { + type: 'line', + data: {datasets: [ + { + lineTension: 0, + pointRadius: 0, + data: this.v + + }, { + backgroundColor: '#ff0000', + lineTension: 0, + pointRadius: 0, + data: this.s + } + ]}, + options: options + }) + + + setInterval(function () { + this.add(this.state.v, this.state['0sl']); + }.bind(this), 125) + }, + + + methods: { + add: function (v, s) { + var t = new Date(); + + this.v.unshift({x: t, y: v}); + this.s.unshift({x: t, y: s}); + + if (40 < this.v.length) this.v.length = 40; + if (40 < this.s.length) this.s.length = 40; + + if (this.chart != undefined) this.chart.update(); + } + } +} diff --git a/src/js/console.js b/src/js/console.js index 5607bba..7867f71 100644 --- a/src/js/console.js +++ b/src/js/console.js @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/js/control-view.js b/src/js/control-view.js index c893650..4d78306 100644 --- a/src/js/control-view.js +++ b/src/js/control-view.js @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/js/cookie.js b/src/js/cookie.js index 6244436..4ba5c02 100644 --- a/src/js/cookie.js +++ b/src/js/cookie.js @@ -1,25 +1,27 @@ /******************************************************************************\ - Copyright 2018. Buildbotics LLC - All Rights Reserved. - - For information regarding this software email: - Joseph Coffland - joseph@buildbotics.com - - This software is free software: you clan redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation, either version 2.1 of - the License, or (at your option) any later version. - - This 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 C! library. If not, see - . + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2020, Buildbotics LLC, All rights reserved. + + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. + + You may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. + + Source location: https://github.com/buildbotics + + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/js/gcode-viewer.js b/src/js/gcode-viewer.js index 658382c..52d6aae 100644 --- a/src/js/gcode-viewer.js +++ b/src/js/gcode-viewer.js @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/js/indicators.js b/src/js/indicators.js index 0285784..a9882a7 100644 --- a/src/js/indicators.js +++ b/src/js/indicators.js @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/js/io-indicator.js b/src/js/io-indicator.js index 1803661..aa72ee0 100644 --- a/src/js/io-indicator.js +++ b/src/js/io-indicator.js @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/js/io-view.js b/src/js/io-view.js index 1cbdc49..344f177 100644 --- a/src/js/io-view.js +++ b/src/js/io-view.js @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/js/main.js b/src/js/main.js index d369409..9b88e31 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/js/message.js b/src/js/message.js index a720511..23a6c75 100644 --- a/src/js/message.js +++ b/src/js/message.js @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/js/modbus-reg.js b/src/js/modbus-reg.js index 224f22e..45799bf 100644 --- a/src/js/modbus-reg.js +++ b/src/js/modbus-reg.js @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/js/modbus.js b/src/js/modbus.js index 83a7504..75a3e43 100644 --- a/src/js/modbus.js +++ b/src/js/modbus.js @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/js/motor-view.js b/src/js/motor-view.js index 8ec1188..7120b85 100644 --- a/src/js/motor-view.js +++ b/src/js/motor-view.js @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ @@ -79,7 +79,36 @@ module.exports = { }, - milPerStep: function () {return this.umPerStep / 25.4} + milPerStep: function () {return this.umPerStep / 25.4}, + + + invalidStallVelocity: function () { + if (!this.motor['homing-mode'].startsWith('stall-')) return false; + return this.maxStallVelocity < this.motor['search-velocity']; + }, + + + stallRPM: function () { + var v = this.motor['search-velocity']; + return 1000 * v / this.motor['travel-per-rev']; + }, + + + maxStallVelocity: function () { + var maxRate = 900000 / this.motor['stall-sample-time']; + var ustep = this.motor['stall-microstep']; + var angle = this.motor['step-angle']; + var travel = this.motor['travel-per-rev']; + var maxStall = maxRate * 60 / 360 / 1000 * angle / ustep * travel; + + return 1 * maxStall.toFixed(3); + }, + + + stallUStepPerSec: function () { + var ustep = this.motor['stall-microstep']; + return this.stallRPM * this.stepsPerRev * ustep / 60; + } }, @@ -90,10 +119,22 @@ module.exports = { if (this.invalidMaxVelocity) this.$set('motor["max-velocity"]', this.maxMaxVelocity); + // Limit stall-velocity + if (this.invalidStallVelocity) + this.$set('motor["search-velocity"]', this.maxStallVelocity); + this.$dispatch('config-changed'); }.bind(this)) return false; } + }, + + + methods: { + show: function (name, templ) { + if (templ.hmodes == undefined) return true; + return templ.hmodes.indexOf(this.motor['homing-mode']) != -1; + } } } diff --git a/src/js/orbit.js b/src/js/orbit.js index 45c5768..eb62316 100644 --- a/src/js/orbit.js +++ b/src/js/orbit.js @@ -1,3 +1,30 @@ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2020, Buildbotics LLC, All rights reserved. + + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. + + You may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. + + Source location: https://github.com/buildbotics + + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com + +\******************************************************************************/ + /** * @author qiao / https://github.com/qiao * @author mrdoob / http://mrdoob.com diff --git a/src/js/path-viewer.js b/src/js/path-viewer.js index 3cd1d01..b654503 100644 --- a/src/js/path-viewer.js +++ b/src/js/path-viewer.js @@ -1,25 +1,27 @@ /******************************************************************************\ - Copyright 2018. Buildbotics LLC - All Rights Reserved. - - For information regarding this software email: - Joseph Coffland - joseph@buildbotics.com - - This software is free software: you clan redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation, either version 2.1 of - the License, or (at your option) any later version. - - This 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 C! library. If not, see - . + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2020, Buildbotics LLC, All rights reserved. + + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. + + You may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. + + Source location: https://github.com/buildbotics + + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/js/settings-view.js b/src/js/settings-view.js index 599aea8..dd99124 100644 --- a/src/js/settings-view.js +++ b/src/js/settings-view.js @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/js/sock.js b/src/js/sock.js index 5c274cd..6350997 100644 --- a/src/js/sock.js +++ b/src/js/sock.js @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/js/templated-input.js b/src/js/templated-input.js index 32d80eb..d47b544 100644 --- a/src/js/templated-input.js +++ b/src/js/templated-input.js @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/js/tool-view.js b/src/js/tool-view.js index 958205d..5975fc6 100644 --- a/src/js/tool-view.js +++ b/src/js/tool-view.js @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/js/unit-value.js b/src/js/unit-value.js index d4d6ee0..d064eaa 100644 --- a/src/js/unit-value.js +++ b/src/js/unit-value.js @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/pug/index.pug b/src/pug/index.pug index 04e7f87..3eff62f 100644 --- a/src/pug/index.pug +++ b/src/pug/index.pug @@ -1,27 +1,27 @@ //-///////////////////////////////////////////////////////////////////////////// //- // -//- This file is part of the Buildbotics firmware. // +//- This file is part of the Buildbotics firmware. // //- // -//- Copyright (c) 2015 - 2018, Buildbotics LLC // -//- All rights reserved. // +//- Copyright (c) 2015 - 2020, 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 . // +//- This Source describes Open Hardware and is licensed under the // +//- CERN-OHL-S v2. // //- // -//- 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 may redistribute and modify this Source and make products // +//- using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). // +//- This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED // +//- WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS // +//- FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable // +//- conditions. // //- // -//- You should have received a copy of the GNU Lesser General Public // -//- License along with the software. If not, see // -//- . // +//- Source location: https://github.com/buildbotics // //- // -//- For information regarding this software email: // -//- "Joseph Coffland" // +//- As per CERN-OHL-S v2 section 4, should You produce hardware based on // +//- these sources, You must maintain the Source Location clearly visible on // +//- the external case of the CNC Controller or other product you make using // +//- this Source. // +//- // +//- For more information, email info@buildbotics.com // //- // //-///////////////////////////////////////////////////////////////////////////// @@ -87,6 +87,9 @@ html(lang="en") li.pure-menu-heading a.pure-menu-link(href="#help") Help + li.pure-menu-heading + a.pure-menu-link(href="#license") License + #main .header .header-content @@ -105,6 +108,8 @@ html(lang="en") | Upgrade to v{{latestVersion}} .fa.fa-check(v-if="!show_upgrade() && latestVersion", title="Firmware up to date") + .copyright Copyright © 2015 - 2020, Buildbotics LLC + .estop(:class="{active: state.es}") estop(@click="estop") @@ -210,5 +215,7 @@ html(lang="en") script: include ../static/js/sockjs.min.js script: include ../static/js/clusterize.min.js script: include ../static/js/three.min.js + script: include ../static/js/chart-2.9.3.min.js + script: include ../static/js/chart.bundle-2.9.3.min.js script: include:browserify ../js/main.js script: include ../static/js/ui.js diff --git a/src/pug/templates/admin-general-view.pug b/src/pug/templates/admin-general-view.pug index 4dc9bae..ac82ba1 100644 --- a/src/pug/templates/admin-general-view.pug +++ b/src/pug/templates/admin-general-view.pug @@ -1,27 +1,27 @@ //-///////////////////////////////////////////////////////////////////////////// //- // -//- This file is part of the Buildbotics firmware. // +//- This file is part of the Buildbotics firmware. // //- // -//- Copyright (c) 2015 - 2018, Buildbotics LLC // -//- All rights reserved. // +//- Copyright (c) 2015 - 2020, 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 . // +//- This Source describes Open Hardware and is licensed under the // +//- CERN-OHL-S v2. // //- // -//- 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 may redistribute and modify this Source and make products // +//- using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). // +//- This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED // +//- WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS // +//- FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable // +//- conditions. // //- // -//- You should have received a copy of the GNU Lesser General Public // -//- License along with the software. If not, see // -//- . // +//- Source location: https://github.com/buildbotics // //- // -//- For information regarding this software email: // -//- "Joseph Coffland" // +//- As per CERN-OHL-S v2 section 4, should You produce hardware based on // +//- these sources, You must maintain the Source Location clearly visible on // +//- the external case of the CNC Controller or other product you make using // +//- this Source. // +//- // +//- For more information, email info@buildbotics.com // //- // //-///////////////////////////////////////////////////////////////////////////// diff --git a/src/pug/templates/admin-network-view.pug b/src/pug/templates/admin-network-view.pug index a1c328a..eba3370 100644 --- a/src/pug/templates/admin-network-view.pug +++ b/src/pug/templates/admin-network-view.pug @@ -1,27 +1,27 @@ //-///////////////////////////////////////////////////////////////////////////// //- // -//- This file is part of the Buildbotics firmware. // +//- This file is part of the Buildbotics firmware. // //- // -//- Copyright (c) 2015 - 2018, Buildbotics LLC // -//- All rights reserved. // +//- Copyright (c) 2015 - 2020, 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 . // +//- This Source describes Open Hardware and is licensed under the // +//- CERN-OHL-S v2. // //- // -//- 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 may redistribute and modify this Source and make products // +//- using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). // +//- This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED // +//- WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS // +//- FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable // +//- conditions. // //- // -//- You should have received a copy of the GNU Lesser General Public // -//- License along with the software. If not, see // -//- . // +//- Source location: https://github.com/buildbotics // //- // -//- For information regarding this software email: // -//- "Joseph Coffland" // +//- As per CERN-OHL-S v2 section 4, should You produce hardware based on // +//- these sources, You must maintain the Source Location clearly visible on // +//- the external case of the CNC Controller or other product you make using // +//- this Source. // +//- // +//- For more information, email info@buildbotics.com // //- // //-///////////////////////////////////////////////////////////////////////////// diff --git a/src/pug/templates/axis-control.pug b/src/pug/templates/axis-control.pug index 6246a97..639db19 100644 --- a/src/pug/templates/axis-control.pug +++ b/src/pug/templates/axis-control.pug @@ -1,27 +1,27 @@ //-///////////////////////////////////////////////////////////////////////////// //- // -//- This file is part of the Buildbotics firmware. // +//- This file is part of the Buildbotics firmware. // //- // -//- Copyright (c) 2015 - 2018, Buildbotics LLC // -//- All rights reserved. // +//- Copyright (c) 2015 - 2020, 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 . // +//- This Source describes Open Hardware and is licensed under the // +//- CERN-OHL-S v2. // //- // -//- 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 may redistribute and modify this Source and make products // +//- using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). // +//- This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED // +//- WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS // +//- FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable // +//- conditions. // //- // -//- You should have received a copy of the GNU Lesser General Public // -//- License along with the software. If not, see // -//- . // +//- Source location: https://github.com/buildbotics // //- // -//- For information regarding this software email: // -//- "Joseph Coffland" // +//- As per CERN-OHL-S v2 section 4, should You produce hardware based on // +//- these sources, You must maintain the Source Location clearly visible on // +//- the external case of the CNC Controller or other product you make using // +//- this Source. // +//- // +//- For more information, email info@buildbotics.com // //- // //-///////////////////////////////////////////////////////////////////////////// diff --git a/src/pug/templates/chart-view.pug b/src/pug/templates/chart-view.pug new file mode 100644 index 0000000..b909b03 --- /dev/null +++ b/src/pug/templates/chart-view.pug @@ -0,0 +1,30 @@ +//-///////////////////////////////////////////////////////////////////////////// +//- // +//- This file is part of the Buildbotics firmware. // +//- // +//- Copyright (c) 2015 - 2020, Buildbotics LLC, All rights reserved. // +//- // +//- This Source describes Open Hardware and is licensed under the // +//- CERN-OHL-S v2. // +//- // +//- You may redistribute and modify this Source and make products // +//- using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). // +//- This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED // +//- WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS // +//- FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable // +//- conditions. // +//- // +//- Source location: https://github.com/buildbotics // +//- // +//- As per CERN-OHL-S v2 section 4, should You produce hardware based on // +//- these sources, You must maintain the Source Location clearly visible on // +//- the external case of the CNC Controller or other product you make using // +//- this Source. // +//- // +//- For more information, email info@buildbotics.com // +//- // +//-///////////////////////////////////////////////////////////////////////////// + +script#chart-view-template(type="text/x-template") + div + canvas(v-el:chart, width="400", height="300") diff --git a/src/pug/templates/cheat-sheet-view.pug b/src/pug/templates/cheat-sheet-view.pug index 4f63351..f834952 100644 --- a/src/pug/templates/cheat-sheet-view.pug +++ b/src/pug/templates/cheat-sheet-view.pug @@ -1,27 +1,27 @@ //-///////////////////////////////////////////////////////////////////////////// //- // -//- This file is part of the Buildbotics firmware. // +//- This file is part of the Buildbotics firmware. // //- // -//- Copyright (c) 2015 - 2018, Buildbotics LLC // -//- All rights reserved. // +//- Copyright (c) 2015 - 2020, 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 . // +//- This Source describes Open Hardware and is licensed under the // +//- CERN-OHL-S v2. // //- // -//- 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 may redistribute and modify this Source and make products // +//- using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). // +//- This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED // +//- WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS // +//- FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable // +//- conditions. // //- // -//- You should have received a copy of the GNU Lesser General Public // -//- License along with the software. If not, see // -//- . // +//- Source location: https://github.com/buildbotics // //- // -//- For information regarding this software email: // -//- "Joseph Coffland" // +//- As per CERN-OHL-S v2 section 4, should You produce hardware based on // +//- these sources, You must maintain the Source Location clearly visible on // +//- the external case of the CNC Controller or other product you make using // +//- this Source. // +//- // +//- For more information, email info@buildbotics.com // //- // //-///////////////////////////////////////////////////////////////////////////// diff --git a/src/pug/templates/console.pug b/src/pug/templates/console.pug index bc8df6c..b899dd1 100644 --- a/src/pug/templates/console.pug +++ b/src/pug/templates/console.pug @@ -1,27 +1,27 @@ //-///////////////////////////////////////////////////////////////////////////// //- // -//- This file is part of the Buildbotics firmware. // +//- This file is part of the Buildbotics firmware. // //- // -//- Copyright (c) 2015 - 2018, Buildbotics LLC // -//- All rights reserved. // +//- Copyright (c) 2015 - 2020, 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 . // +//- This Source describes Open Hardware and is licensed under the // +//- CERN-OHL-S v2. // //- // -//- 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 may redistribute and modify this Source and make products // +//- using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). // +//- This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED // +//- WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS // +//- FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable // +//- conditions. // //- // -//- You should have received a copy of the GNU Lesser General Public // -//- License along with the software. If not, see // -//- . // +//- Source location: https://github.com/buildbotics // //- // -//- For information regarding this software email: // -//- "Joseph Coffland" // +//- As per CERN-OHL-S v2 section 4, should You produce hardware based on // +//- these sources, You must maintain the Source Location clearly visible on // +//- the external case of the CNC Controller or other product you make using // +//- this Source. // +//- // +//- For more information, email info@buildbotics.com // //- // //-///////////////////////////////////////////////////////////////////////////// diff --git a/src/pug/templates/control-view.pug b/src/pug/templates/control-view.pug index 7aaa7ec..5355d21 100644 --- a/src/pug/templates/control-view.pug +++ b/src/pug/templates/control-view.pug @@ -1,27 +1,27 @@ //-///////////////////////////////////////////////////////////////////////////// //- // -//- This file is part of the Buildbotics firmware. // +//- This file is part of the Buildbotics firmware. // //- // -//- Copyright (c) 2015 - 2018, Buildbotics LLC // -//- All rights reserved. // +//- Copyright (c) 2015 - 2020, 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 . // +//- This Source describes Open Hardware and is licensed under the // +//- CERN-OHL-S v2. // //- // -//- 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 may redistribute and modify this Source and make products // +//- using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). // +//- This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED // +//- WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS // +//- FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable // +//- conditions. // //- // -//- You should have received a copy of the GNU Lesser General Public // -//- License along with the software. If not, see // -//- . // +//- Source location: https://github.com/buildbotics // //- // -//- For information regarding this software email: // -//- "Joseph Coffland" // +//- As per CERN-OHL-S v2 section 4, should You produce hardware based on // +//- these sources, You must maintain the Source Location clearly visible on // +//- the external case of the CNC Controller or other product you make using // +//- this Source. // +//- // +//- For more information, email info@buildbotics.com // //- // //-///////////////////////////////////////////////////////////////////////////// diff --git a/src/pug/templates/estop.pug b/src/pug/templates/estop.pug index 2af3df0..350d55e 100644 --- a/src/pug/templates/estop.pug +++ b/src/pug/templates/estop.pug @@ -1,27 +1,27 @@ //-///////////////////////////////////////////////////////////////////////////// //- // -//- This file is part of the Buildbotics firmware. // +//- This file is part of the Buildbotics firmware. // //- // -//- Copyright (c) 2015 - 2018, Buildbotics LLC // -//- All rights reserved. // +//- Copyright (c) 2015 - 2020, 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 . // +//- This Source describes Open Hardware and is licensed under the // +//- CERN-OHL-S v2. // //- // -//- 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 may redistribute and modify this Source and make products // +//- using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). // +//- This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED // +//- WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS // +//- FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable // +//- conditions. // //- // -//- You should have received a copy of the GNU Lesser General Public // -//- License along with the software. If not, see // -//- . // +//- Source location: https://github.com/buildbotics // //- // -//- For information regarding this software email: // -//- "Joseph Coffland" // +//- As per CERN-OHL-S v2 section 4, should You produce hardware based on // +//- these sources, You must maintain the Source Location clearly visible on // +//- the external case of the CNC Controller or other product you make using // +//- this Source. // +//- // +//- For more information, email info@buildbotics.com // //- // //-///////////////////////////////////////////////////////////////////////////// diff --git a/src/pug/templates/gcode-viewer.pug b/src/pug/templates/gcode-viewer.pug index 4a00617..271bb68 100644 --- a/src/pug/templates/gcode-viewer.pug +++ b/src/pug/templates/gcode-viewer.pug @@ -1,27 +1,27 @@ //-///////////////////////////////////////////////////////////////////////////// //- // -//- This file is part of the Buildbotics firmware. // +//- This file is part of the Buildbotics firmware. // //- // -//- Copyright (c) 2015 - 2018, Buildbotics LLC // -//- All rights reserved. // +//- Copyright (c) 2015 - 2020, 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 . // +//- This Source describes Open Hardware and is licensed under the // +//- CERN-OHL-S v2. // //- // -//- 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 may redistribute and modify this Source and make products // +//- using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). // +//- This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED // +//- WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS // +//- FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable // +//- conditions. // //- // -//- You should have received a copy of the GNU Lesser General Public // -//- License along with the software. If not, see // -//- . // +//- Source location: https://github.com/buildbotics // //- // -//- For information regarding this software email: // -//- "Joseph Coffland" // +//- As per CERN-OHL-S v2 section 4, should You produce hardware based on // +//- these sources, You must maintain the Source Location clearly visible on // +//- the external case of the CNC Controller or other product you make using // +//- this Source. // +//- // +//- For more information, email info@buildbotics.com // //- // //-///////////////////////////////////////////////////////////////////////////// diff --git a/src/pug/templates/help-view.pug b/src/pug/templates/help-view.pug index c2c2107..22ec872 100644 --- a/src/pug/templates/help-view.pug +++ b/src/pug/templates/help-view.pug @@ -1,27 +1,27 @@ //-///////////////////////////////////////////////////////////////////////////// //- // -//- This file is part of the Buildbotics firmware. // +//- This file is part of the Buildbotics firmware. // //- // -//- Copyright (c) 2015 - 2018, Buildbotics LLC // -//- All rights reserved. // +//- Copyright (c) 2015 - 2020, 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 . // +//- This Source describes Open Hardware and is licensed under the // +//- CERN-OHL-S v2. // //- // -//- 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 may redistribute and modify this Source and make products // +//- using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). // +//- This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED // +//- WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS // +//- FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable // +//- conditions. // //- // -//- You should have received a copy of the GNU Lesser General Public // -//- License along with the software. If not, see // -//- . // +//- Source location: https://github.com/buildbotics // //- // -//- For information regarding this software email: // -//- "Joseph Coffland" // +//- As per CERN-OHL-S v2 section 4, should You produce hardware based on // +//- these sources, You must maintain the Source Location clearly visible on // +//- the external case of the CNC Controller or other product you make using // +//- this Source. // +//- // +//- For more information, email info@buildbotics.com // //- // //-///////////////////////////////////////////////////////////////////////////// diff --git a/src/pug/templates/indicators.pug b/src/pug/templates/indicators.pug index 8414680..6910257 100644 --- a/src/pug/templates/indicators.pug +++ b/src/pug/templates/indicators.pug @@ -1,27 +1,27 @@ //-///////////////////////////////////////////////////////////////////////////// //- // -//- This file is part of the Buildbotics firmware. // +//- This file is part of the Buildbotics firmware. // //- // -//- Copyright (c) 2015 - 2018, Buildbotics LLC // -//- All rights reserved. // +//- Copyright (c) 2015 - 2020, 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 . // +//- This Source describes Open Hardware and is licensed under the // +//- CERN-OHL-S v2. // //- // -//- 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 may redistribute and modify this Source and make products // +//- using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). // +//- This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED // +//- WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS // +//- FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable // +//- conditions. // //- // -//- You should have received a copy of the GNU Lesser General Public // -//- License along with the software. If not, see // -//- . // +//- Source location: https://github.com/buildbotics // //- // -//- For information regarding this software email: // -//- "Joseph Coffland" // +//- As per CERN-OHL-S v2 section 4, should You produce hardware based on // +//- these sources, You must maintain the Source Location clearly visible on // +//- the external case of the CNC Controller or other product you make using // +//- this Source. // +//- // +//- For more information, email info@buildbotics.com // //- // //-///////////////////////////////////////////////////////////////////////////// diff --git a/src/pug/templates/io-indicator.pug b/src/pug/templates/io-indicator.pug index 8baf875..5f4016b 100644 --- a/src/pug/templates/io-indicator.pug +++ b/src/pug/templates/io-indicator.pug @@ -1,27 +1,27 @@ //-///////////////////////////////////////////////////////////////////////////// //- // -//- This file is part of the Buildbotics firmware. // +//- This file is part of the Buildbotics firmware. // //- // -//- Copyright (c) 2015 - 2018, Buildbotics LLC // -//- All rights reserved. // +//- Copyright (c) 2015 - 2020, 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 . // +//- This Source describes Open Hardware and is licensed under the // +//- CERN-OHL-S v2. // //- // -//- 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 may redistribute and modify this Source and make products // +//- using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). // +//- This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED // +//- WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS // +//- FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable // +//- conditions. // //- // -//- You should have received a copy of the GNU Lesser General Public // -//- License along with the software. If not, see // -//- . // +//- Source location: https://github.com/buildbotics // //- // -//- For information regarding this software email: // -//- "Joseph Coffland" // +//- As per CERN-OHL-S v2 section 4, should You produce hardware based on // +//- these sources, You must maintain the Source Location clearly visible on // +//- the external case of the CNC Controller or other product you make using // +//- this Source. // +//- // +//- For more information, email info@buildbotics.com // //- // //-///////////////////////////////////////////////////////////////////////////// diff --git a/src/pug/templates/io-view.pug b/src/pug/templates/io-view.pug index ffb3800..705aa2c 100644 --- a/src/pug/templates/io-view.pug +++ b/src/pug/templates/io-view.pug @@ -1,27 +1,27 @@ //-///////////////////////////////////////////////////////////////////////////// //- // -//- This file is part of the Buildbotics firmware. // +//- This file is part of the Buildbotics firmware. // //- // -//- Copyright (c) 2015 - 2018, Buildbotics LLC // -//- All rights reserved. // +//- Copyright (c) 2015 - 2020, 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 . // +//- This Source describes Open Hardware and is licensed under the // +//- CERN-OHL-S v2. // //- // -//- 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 may redistribute and modify this Source and make products // +//- using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). // +//- This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED // +//- WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS // +//- FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable // +//- conditions. // //- // -//- You should have received a copy of the GNU Lesser General Public // -//- License along with the software. If not, see // -//- . // +//- Source location: https://github.com/buildbotics // //- // -//- For information regarding this software email: // -//- "Joseph Coffland" // +//- As per CERN-OHL-S v2 section 4, should You produce hardware based on // +//- these sources, You must maintain the Source Location clearly visible on // +//- the external case of the CNC Controller or other product you make using // +//- this Source. // +//- // +//- For more information, email info@buildbotics.com // //- // //-///////////////////////////////////////////////////////////////////////////// diff --git a/src/pug/templates/license-view.pug b/src/pug/templates/license-view.pug new file mode 100644 index 0000000..7b49ec2 --- /dev/null +++ b/src/pug/templates/license-view.pug @@ -0,0 +1,57 @@ +//-///////////////////////////////////////////////////////////////////////////// +//- // +//- This file is part of the Buildbotics firmware. // +//- // +//- Copyright (c) 2015 - 2020, Buildbotics LLC, All rights reserved. // +//- // +//- This Source describes Open Hardware and is licensed under the // +//- CERN-OHL-S v2. // +//- // +//- You may redistribute and modify this Source and make products // +//- using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). // +//- This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED // +//- WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS // +//- FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable // +//- conditions. // +//- // +//- Source location: https://github.com/buildbotics // +//- // +//- As per CERN-OHL-S v2 section 4, should You produce hardware based on // +//- these sources, You must maintain the Source Location clearly visible on // +//- the external case of the CNC Controller or other product you make using // +//- this Source. // +//- // +//- For more information, email info@buildbotics.com // +//- // +//-///////////////////////////////////////////////////////////////////////////// + +script#license-view-template(type="text/x-template") + #license + h2 License + + p. + This is Open Hardware licensed under the CERN-OHL-S v2. Unless + otherwise noted, all sources are copyright 2015 - 2020, + Buildbotics LLC. + + p. + You may redistribute and modify the Source and make products + using it under the terms of the CERN-OHL-S v2 ( + #[a(href="https:/cern.ch/cern-ohl") https:/cern.ch/cern-ohl]). + The Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + + p. + The Source can be found at + #[a(href="//github.com/buildbotics") github.com/buildbotics]. + + p. + As per CERN-OHL-S v2 section 4, should You produce hardware based on + the Source, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + the Source. + + p. + For information regarding this software, email + #[a(href="mailto:info@buildbotics.com") info@buildbotics.com]. diff --git a/src/pug/templates/message.pug b/src/pug/templates/message.pug index dcaf93c..8ce5dc8 100644 --- a/src/pug/templates/message.pug +++ b/src/pug/templates/message.pug @@ -1,27 +1,27 @@ //-///////////////////////////////////////////////////////////////////////////// //- // -//- This file is part of the Buildbotics firmware. // +//- This file is part of the Buildbotics firmware. // //- // -//- Copyright (c) 2015 - 2018, Buildbotics LLC // -//- All rights reserved. // +//- Copyright (c) 2015 - 2020, 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 . // +//- This Source describes Open Hardware and is licensed under the // +//- CERN-OHL-S v2. // //- // -//- 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 may redistribute and modify this Source and make products // +//- using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). // +//- This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED // +//- WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS // +//- FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable // +//- conditions. // //- // -//- You should have received a copy of the GNU Lesser General Public // -//- License along with the software. If not, see // -//- . // +//- Source location: https://github.com/buildbotics // //- // -//- For information regarding this software email: // -//- "Joseph Coffland" // +//- As per CERN-OHL-S v2 section 4, should You produce hardware based on // +//- these sources, You must maintain the Source Location clearly visible on // +//- the external case of the CNC Controller or other product you make using // +//- this Source. // +//- // +//- For more information, email info@buildbotics.com // //- // //-///////////////////////////////////////////////////////////////////////////// diff --git a/src/pug/templates/modbus-reg-view.pug b/src/pug/templates/modbus-reg-view.pug index ac86cfd..1091d1a 100644 --- a/src/pug/templates/modbus-reg-view.pug +++ b/src/pug/templates/modbus-reg-view.pug @@ -1,27 +1,27 @@ //-///////////////////////////////////////////////////////////////////////////// //- // -//- This file is part of the Buildbotics firmware. // +//- This file is part of the Buildbotics firmware. // //- // -//- Copyright (c) 2015 - 2018, Buildbotics LLC // -//- All rights reserved. // +//- Copyright (c) 2015 - 2020, 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 . // +//- This Source describes Open Hardware and is licensed under the // +//- CERN-OHL-S v2. // //- // -//- 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 may redistribute and modify this Source and make products // +//- using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). // +//- This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED // +//- WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS // +//- FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable // +//- conditions. // //- // -//- You should have received a copy of the GNU Lesser General Public // -//- License along with the software. If not, see // -//- . // +//- Source location: https://github.com/buildbotics // //- // -//- For information regarding this software email: // -//- "Joseph Coffland" // +//- As per CERN-OHL-S v2 section 4, should You produce hardware based on // +//- these sources, You must maintain the Source Location clearly visible on // +//- the external case of the CNC Controller or other product you make using // +//- this Source. // +//- // +//- For more information, email info@buildbotics.com // //- // //-///////////////////////////////////////////////////////////////////////////// diff --git a/src/pug/templates/motor-view.pug b/src/pug/templates/motor-view.pug index 428dd8c..320a7c5 100644 --- a/src/pug/templates/motor-view.pug +++ b/src/pug/templates/motor-view.pug @@ -1,27 +1,27 @@ //-///////////////////////////////////////////////////////////////////////////// //- // -//- This file is part of the Buildbotics firmware. // +//- This file is part of the Buildbotics firmware. // //- // -//- Copyright (c) 2015 - 2018, Buildbotics LLC // -//- All rights reserved. // +//- Copyright (c) 2015 - 2020, 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 . // +//- This Source describes Open Hardware and is licensed under the // +//- CERN-OHL-S v2. // //- // -//- 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 may redistribute and modify this Source and make products // +//- using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). // +//- This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED // +//- WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS // +//- FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable // +//- conditions. // //- // -//- You should have received a copy of the GNU Lesser General Public // -//- License along with the software. If not, see // -//- . // +//- Source location: https://github.com/buildbotics // //- // -//- For information regarding this software email: // -//- "Joseph Coffland" // +//- As per CERN-OHL-S v2 section 4, should You produce hardware based on // +//- these sources, You must maintain the Source Location clearly visible on // +//- the external case of the CNC Controller or other product you make using // +//- this Source. // +//- // +//- For more information, email info@buildbotics.com // //- // //-///////////////////////////////////////////////////////////////////////////// @@ -33,8 +33,8 @@ script#motor-view-template(type="text/x-template") fieldset(v-for="category in template.motors.template", :class="$key") h2 {{$key}} - templated-input(v-for="templ in category", :name="$key", - :model.sync="motor[$key]", :template="templ") + templated-input(v-for="templ in category", v-if="show($key, templ)", + :name="$key", :model.sync="motor[$key]", :template="templ") label.extra(v-if="$key == 'microsteps'", slot="extra", title="Microsteps per second") @@ -63,3 +63,10 @@ script#motor-view-template(type="text/x-template") slot="extra") | Pin {{templ.pins[index]}} io-indicator(:name="$key + '-' + index", :state="state") + + label.extra(v-if="$key == 'search-velocity'", slot="extra", + title="Revolutions Per Minute") ({{stallRPM | fixed 0}} RPM) + + label.extra(v-if="$key == 'stall-microstep'", slot="extra", + title="Microsteps per second") + | ({{stallUStepPerSec / 1000 | fixed 1}}k µstep/sec) diff --git a/src/pug/templates/path-viewer.pug b/src/pug/templates/path-viewer.pug index 8b60c2a..8d169f9 100644 --- a/src/pug/templates/path-viewer.pug +++ b/src/pug/templates/path-viewer.pug @@ -1,27 +1,27 @@ //-///////////////////////////////////////////////////////////////////////////// //- // -//- This file is part of the Buildbotics firmware. // +//- This file is part of the Buildbotics firmware. // //- // -//- Copyright (c) 2015 - 2018, Buildbotics LLC // -//- All rights reserved. // +//- Copyright (c) 2015 - 2020, 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 . // +//- This Source describes Open Hardware and is licensed under the // +//- CERN-OHL-S v2. // //- // -//- 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 may redistribute and modify this Source and make products // +//- using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). // +//- This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED // +//- WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS // +//- FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable // +//- conditions. // //- // -//- You should have received a copy of the GNU Lesser General Public // -//- License along with the software. If not, see // -//- . // +//- Source location: https://github.com/buildbotics // //- // -//- For information regarding this software email: // -//- "Joseph Coffland" // +//- As per CERN-OHL-S v2 section 4, should You produce hardware based on // +//- these sources, You must maintain the Source Location clearly visible on // +//- the external case of the CNC Controller or other product you make using // +//- this Source. // +//- // +//- For more information, email info@buildbotics.com // //- // //-///////////////////////////////////////////////////////////////////////////// diff --git a/src/pug/templates/settings-view.pug b/src/pug/templates/settings-view.pug index b939fbf..aa4ae96 100644 --- a/src/pug/templates/settings-view.pug +++ b/src/pug/templates/settings-view.pug @@ -1,3 +1,30 @@ +//-///////////////////////////////////////////////////////////////////////////// +//- // +//- This file is part of the Buildbotics firmware. // +//- // +//- Copyright (c) 2015 - 2020, Buildbotics LLC, All rights reserved. // +//- // +//- This Source describes Open Hardware and is licensed under the // +//- CERN-OHL-S v2. // +//- // +//- You may redistribute and modify this Source and make products // +//- using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). // +//- This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED // +//- WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS // +//- FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable // +//- conditions. // +//- // +//- Source location: https://github.com/buildbotics // +//- // +//- As per CERN-OHL-S v2 section 4, should You produce hardware based on // +//- these sources, You must maintain the Source Location clearly visible on // +//- the external case of the CNC Controller or other product you make using // +//- this Source. // +//- // +//- For more information, email info@buildbotics.com // +//- // +//-///////////////////////////////////////////////////////////////////////////// + //- All rights reserved. // //- // //- This file ("the software") is free software: you can redistribute it // diff --git a/src/pug/templates/templated-input.pug b/src/pug/templates/templated-input.pug index ff93c58..75d94d3 100644 --- a/src/pug/templates/templated-input.pug +++ b/src/pug/templates/templated-input.pug @@ -1,27 +1,27 @@ //-///////////////////////////////////////////////////////////////////////////// //- // -//- This file is part of the Buildbotics firmware. // +//- This file is part of the Buildbotics firmware. // //- // -//- Copyright (c) 2015 - 2018, Buildbotics LLC // -//- All rights reserved. // +//- Copyright (c) 2015 - 2020, 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 . // +//- This Source describes Open Hardware and is licensed under the // +//- CERN-OHL-S v2. // //- // -//- 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 may redistribute and modify this Source and make products // +//- using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). // +//- This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED // +//- WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS // +//- FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable // +//- conditions. // //- // -//- You should have received a copy of the GNU Lesser General Public // -//- License along with the software. If not, see // -//- . // +//- Source location: https://github.com/buildbotics // //- // -//- For information regarding this software email: // -//- "Joseph Coffland" // +//- As per CERN-OHL-S v2 section 4, should You produce hardware based on // +//- these sources, You must maintain the Source Location clearly visible on // +//- the external case of the CNC Controller or other product you make using // +//- this Source. // +//- // +//- For more information, email info@buildbotics.com // //- // //-///////////////////////////////////////////////////////////////////////////// diff --git a/src/pug/templates/tool-view.pug b/src/pug/templates/tool-view.pug index 25dcc7f..390fd20 100644 --- a/src/pug/templates/tool-view.pug +++ b/src/pug/templates/tool-view.pug @@ -1,27 +1,27 @@ //-///////////////////////////////////////////////////////////////////////////// //- // -//- This file is part of the Buildbotics firmware. // +//- This file is part of the Buildbotics firmware. // //- // -//- Copyright (c) 2015 - 2018, Buildbotics LLC // -//- All rights reserved. // +//- Copyright (c) 2015 - 2020, 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 . // +//- This Source describes Open Hardware and is licensed under the // +//- CERN-OHL-S v2. // //- // -//- 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 may redistribute and modify this Source and make products // +//- using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). // +//- This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED // +//- WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS // +//- FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable // +//- conditions. // //- // -//- You should have received a copy of the GNU Lesser General Public // -//- License along with the software. If not, see // -//- . // +//- Source location: https://github.com/buildbotics // //- // -//- For information regarding this software email: // -//- "Joseph Coffland" // +//- As per CERN-OHL-S v2 section 4, should You produce hardware based on // +//- these sources, You must maintain the Source Location clearly visible on // +//- the external case of the CNC Controller or other product you make using // +//- this Source. // +//- // +//- For more information, email info@buildbotics.com // //- // //-///////////////////////////////////////////////////////////////////////////// diff --git a/src/pwr/config.h b/src/pwr/config.h index 206d91e..c732722 100644 --- a/src/pwr/config.h +++ b/src/pwr/config.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ @@ -30,7 +30,7 @@ #include "pins.h" -#define VERSION 6 +#define VERSION 7 // Pins diff --git a/src/pwr/main.c b/src/pwr/main.c index 92007c4..c9f56c5 100644 --- a/src/pwr/main.c +++ b/src/pwr/main.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ @@ -176,7 +176,7 @@ static void update_shunt() { static void update_shunt_power() { if (!initialized) return; - float vout = get_reg(VOUT_REG); + float vout = regs[VOUT_REG].raw / REG_SCALE; if (vnom + SHUNT_MIN_V < vout) { // Compute joules shunted this cycle: J = V^2 / RT @@ -337,6 +337,15 @@ static void adc_conversion() { // Start next conversion ADMUX = (ADMUX & 0xf0) | ch_schedule[i]; ADCSRA |= 1 << ADSC; + +#if 0 // Measure ADC conversion rate by toggling LOAD1 + // DEBUG + IO_DDR_SET(LOAD1_PIN); // Output + static bool toggle = false; + if (toggle) IO_PORT_CLR(LOAD1_PIN); // Lo + else IO_PORT_SET(LOAD1_PIN); // Hi + toggle = !toggle; +#endif } @@ -388,7 +397,7 @@ static void shunt_test() { void init() { cli(); - // CPU Clock, disable CKOUT + // CPU Clock, disable CKOUT, (NOTE CKOUT_IO is opposite the datasheet) CCP = 0xd8; CLKSR = (1 << CSTR) | (1 << CKOUT_IO) | 0b0010; // 8Mhz internal clock CCP = 0xd8; @@ -414,7 +423,7 @@ void init() { DIDR1 = (1 << ADC5D); // ADC internal 1.1v, enable, with interrupt, prescale 64 - // Note, a conversion takes ~200uS + // Note, a conversion takes ~104uS ADMUX = (1 << REFS1) | (0 << REFS0); ADCSRA = (1 << ADEN) | (1 << ADIE) | (1 << ADPS2) | (1 << ADPS1) | (0 << ADPS0); diff --git a/src/pwr/pins.c b/src/pwr/pins.c index 7d3f51a..3737265 100644 --- a/src/pwr/pins.c +++ b/src/pwr/pins.c @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/pwr/pins.h b/src/pwr/pins.h index 3852aa9..9684e85 100644 --- a/src/pwr/pins.h +++ b/src/pwr/pins.h @@ -1,27 +1,27 @@ /******************************************************************************\ - This file is part of the Buildbotics firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015 - 2018, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2020, 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 . + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. - 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 may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. - You should have received a copy of the GNU Lesser General Public - License along with the software. If not, see - . + Source location: https://github.com/buildbotics - For information regarding this software email: - "Joseph Coffland" + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com \******************************************************************************/ diff --git a/src/py/bbctrl/APIHandler.py b/src/py/bbctrl/APIHandler.py index c21ca56..d5c816c 100644 --- a/src/py/bbctrl/APIHandler.py +++ b/src/py/bbctrl/APIHandler.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/bbctrl/AVR.py b/src/py/bbctrl/AVR.py index 211fe6e..61a8484 100644 --- a/src/py/bbctrl/AVR.py +++ b/src/py/bbctrl/AVR.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/bbctrl/AVREmu.py b/src/py/bbctrl/AVREmu.py index 7f6be71..76f9575 100644 --- a/src/py/bbctrl/AVREmu.py +++ b/src/py/bbctrl/AVREmu.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/bbctrl/Camera.py b/src/py/bbctrl/Camera.py old mode 100755 new mode 100644 index bc06d3b..c3e8e48 --- a/src/py/bbctrl/Camera.py +++ b/src/py/bbctrl/Camera.py @@ -1,28 +1,29 @@ #!/usr/bin/env python3 + ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # +# # +# Copyright (c) 2015 - 2020, Buildbotics LLC, All rights reserved. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 . # +# You may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# 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. # +# Source location: https://github.com/buildbotics # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/bbctrl/Cmd.py b/src/py/bbctrl/Cmd.py old mode 100755 new mode 100644 index cbfb9b1..e0de8b9 --- a/src/py/bbctrl/Cmd.py +++ b/src/py/bbctrl/Cmd.py @@ -2,28 +2,28 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ @@ -172,7 +172,7 @@ def jog(axes): return JOG + encode_axes(axes) def seek(switch, active, error): - cmd = SEEK + str(switch) + cmd = SEEK + '%x' % switch flags = 0 if active: flags |= SEEK_ACTIVE diff --git a/src/py/bbctrl/Comm.py b/src/py/bbctrl/Comm.py index 46c087a..4dede42 100644 --- a/src/py/bbctrl/Comm.py +++ b/src/py/bbctrl/Comm.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/bbctrl/CommandQueue.py b/src/py/bbctrl/CommandQueue.py index c167c57..4967a17 100644 --- a/src/py/bbctrl/CommandQueue.py +++ b/src/py/bbctrl/CommandQueue.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/bbctrl/Config.py b/src/py/bbctrl/Config.py index 0034cfe..0ff1019 100644 --- a/src/py/bbctrl/Config.py +++ b/src/py/bbctrl/Config.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/bbctrl/Ctrl.py b/src/py/bbctrl/Ctrl.py index 9503ee2..3a6c2d7 100644 --- a/src/py/bbctrl/Ctrl.py +++ b/src/py/bbctrl/Ctrl.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/bbctrl/FileHandler.py b/src/py/bbctrl/FileHandler.py index 8fb9d31..22d3736 100644 --- a/src/py/bbctrl/FileHandler.py +++ b/src/py/bbctrl/FileHandler.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/bbctrl/I2C.py b/src/py/bbctrl/I2C.py index a97a528..a943cdc 100644 --- a/src/py/bbctrl/I2C.py +++ b/src/py/bbctrl/I2C.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/bbctrl/IOLoop.py b/src/py/bbctrl/IOLoop.py index c9c614b..e03f5b9 100644 --- a/src/py/bbctrl/IOLoop.py +++ b/src/py/bbctrl/IOLoop.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/bbctrl/IPLCDPage.py b/src/py/bbctrl/IPLCDPage.py index 4f5ee4e..2b0a4f3 100644 --- a/src/py/bbctrl/IPLCDPage.py +++ b/src/py/bbctrl/IPLCDPage.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/bbctrl/Jog.py b/src/py/bbctrl/Jog.py index c4544e2..cbb25ee 100644 --- a/src/py/bbctrl/Jog.py +++ b/src/py/bbctrl/Jog.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/bbctrl/LCD.py b/src/py/bbctrl/LCD.py index 1f13c14..9285542 100644 --- a/src/py/bbctrl/LCD.py +++ b/src/py/bbctrl/LCD.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/bbctrl/Log.py b/src/py/bbctrl/Log.py index 0436375..ee227d8 100644 --- a/src/py/bbctrl/Log.py +++ b/src/py/bbctrl/Log.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/bbctrl/Mach.py b/src/py/bbctrl/Mach.py index acaf8a1..9d3d797 100644 --- a/src/py/bbctrl/Mach.py +++ b/src/py/bbctrl/Mach.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ @@ -50,6 +50,13 @@ axis_homing_procedure = ''' G90 G28.3 %(axis)s[#<_%(axis)s_home_position>] ''' +stall_homing_procedure = ''' + G28.2 %(axis)s0 F[#<_%(axis)s_search_velocity>] + G38.6 %(axis)s[#<_%(axis)s_home_travel>] + G91 G0 G53 %(axis)s[#<_%(axis)s_zero_backoff>] + G90 G28.3 %(axis)s[#<_%(axis)s_home_position>] +''' + motor_fault_error = '''\ Motor %d driver fault. A potentially damaging electrical condition was \ detected and the motor driver was shutdown. Please power down the controller \ @@ -264,7 +271,9 @@ class Mach(Comm): # Home axis self.mlog.info('Homing %s axis' % axis) self._begin_cycle('homing') - self.planner.mdi(axis_homing_procedure % {'axis': axis}, False) + if mode.startswith('stall-'): procedure = stall_homing_procedure + else: procedure = axis_homing_procedure + self.planner.mdi(procedure % {'axis': axis}, False) super().resume() diff --git a/src/py/bbctrl/MainLCDPage.py b/src/py/bbctrl/MainLCDPage.py index ba17391..81a1bc2 100644 --- a/src/py/bbctrl/MainLCDPage.py +++ b/src/py/bbctrl/MainLCDPage.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/bbctrl/MonitorTemp.py b/src/py/bbctrl/MonitorTemp.py index 0d1501d..41abfbc 100644 --- a/src/py/bbctrl/MonitorTemp.py +++ b/src/py/bbctrl/MonitorTemp.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/bbctrl/ObjGraph.py b/src/py/bbctrl/ObjGraph.py old mode 100755 new mode 100644 index 7957bbb..982bc7f --- a/src/py/bbctrl/ObjGraph.py +++ b/src/py/bbctrl/ObjGraph.py @@ -1,3 +1,30 @@ +################################################################################ +# # +# This file is part of the Buildbotics firmware. # +# # +# Copyright (c) 2015 - 2020, Buildbotics LLC, All rights reserved. # +# # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # +# # +# You may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # +# # +# Source location: https://github.com/buildbotics # +# # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # +# # +################################################################################ + """ Tools for drawing Python object reference graphs with graphviz. diff --git a/src/py/bbctrl/Planner.py b/src/py/bbctrl/Planner.py index b77fc78..a6b441a 100644 --- a/src/py/bbctrl/Planner.py +++ b/src/py/bbctrl/Planner.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/bbctrl/Preplanner.py b/src/py/bbctrl/Preplanner.py index d961d78..2204649 100644 --- a/src/py/bbctrl/Preplanner.py +++ b/src/py/bbctrl/Preplanner.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ @@ -175,7 +175,7 @@ class Plan(object): self.progress = 1 ret = yield proc.wait_for_exit(False) - if ret: + if ret and not self.cancel: errs = yield proc.stderr.read_until_close() raise Exception('Plan failed: ' + errs.decode('utf8')) diff --git a/src/py/bbctrl/Pwr.py b/src/py/bbctrl/Pwr.py index 9c4579a..09c2e90 100644 --- a/src/py/bbctrl/Pwr.py +++ b/src/py/bbctrl/Pwr.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/bbctrl/RequestHandler.py b/src/py/bbctrl/RequestHandler.py index 771b4fd..6c08f53 100644 --- a/src/py/bbctrl/RequestHandler.py +++ b/src/py/bbctrl/RequestHandler.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/bbctrl/State.py b/src/py/bbctrl/State.py index 82a1abb..efb970e 100644 --- a/src/py/bbctrl/State.py +++ b/src/py/bbctrl/State.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ @@ -377,21 +377,23 @@ class State(object): if mode == '0': return 'manual' if mode == '1': return 'switch-min' if mode == '2': return 'switch-max' + if mode == '3': return 'stall-min' + if mode == '4': return 'stall-max' raise Exception('Unrecognized homing mode "%s"' % mode) def motor_home_direction(self, motor): mode = self.motor_homing_mode(motor) - if mode == 'switch-min': return -1 - if mode == 'switch-max': return 1 + if mode.endswith('-min'): return -1 + if mode.endswith('-max'): return 1 return 0 # Disabled def motor_home_position(self, motor): mode = self.motor_homing_mode(motor) # Return soft limit positions - if mode == 'switch-min': return self.vars['%dtn' % motor] - if mode == 'switch-max': return self.vars['%dtm' % motor] + if mode.endswith('-min'): return self.vars['%dtn' % motor] + if mode.endswith('-max'): return self.vars['%dtm' % motor] return 0 # Disabled @@ -434,13 +436,15 @@ class State(object): raise Exception('Switch "%s-%s" axis not enabled' % (axis, side)) motor = self.find_motor(axis) - # This must match the switch ID enum in avr/src/switch.h + + # The following must match the switch ID enum in avr/src/switch.h + hmode = self.motor_homing_mode(motor) + if hmode.startswith('stall-'): return motor + 10 return 2 * motor + 2 + (0 if side.lower() == 'min' else 1) def get_switch_id(self, switch): # TODO Support other input switches in CAMotics gcode/machine/PortType.h - # TODO Support stall homing switch = switch.lower() if switch == 'probe': return 1 if switch[1:] == '-min': return self.get_axis_switch(switch[0], 'min') diff --git a/src/py/bbctrl/Web.py b/src/py/bbctrl/Web.py index 5615d75..0eb757c 100644 --- a/src/py/bbctrl/Web.py +++ b/src/py/bbctrl/Web.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/bbctrl/__init__.py b/src/py/bbctrl/__init__.py index b1a6452..da3cb0e 100644 --- a/src/py/bbctrl/__init__.py +++ b/src/py/bbctrl/__init__.py @@ -2,28 +2,28 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/bbctrl/plan.py b/src/py/bbctrl/plan.py old mode 100755 new mode 100644 index 0961970..8f35499 --- a/src/py/bbctrl/plan.py +++ b/src/py/bbctrl/plan.py @@ -2,28 +2,28 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/bbctrl/v4l2.py b/src/py/bbctrl/v4l2.py index 02c49b3..aad96e6 100644 --- a/src/py/bbctrl/v4l2.py +++ b/src/py/bbctrl/v4l2.py @@ -1,3 +1,30 @@ +################################################################################ +# # +# This file is part of the Buildbotics firmware. # +# # +# Copyright (c) 2015 - 2020, Buildbotics LLC, All rights reserved. # +# # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # +# # +# You may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # +# # +# Source location: https://github.com/buildbotics # +# # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # +# # +################################################################################ + # Python bindings for the v4l2 userspace api # Copyright (C) 1999-2009 the contributors diff --git a/src/py/inevent/AbsAxisScaling.py b/src/py/inevent/AbsAxisScaling.py index 4b00721..1d94aab 100644 --- a/src/py/inevent/AbsAxisScaling.py +++ b/src/py/inevent/AbsAxisScaling.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/inevent/Constants.py b/src/py/inevent/Constants.py index 0f3a2ed..08e29a6 100644 --- a/src/py/inevent/Constants.py +++ b/src/py/inevent/Constants.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/inevent/Event.py b/src/py/inevent/Event.py index bf8f2e1..47ccbbd 100644 --- a/src/py/inevent/Event.py +++ b/src/py/inevent/Event.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/inevent/EventHandler.py b/src/py/inevent/EventHandler.py index ccc9d7c..83e3b73 100644 --- a/src/py/inevent/EventHandler.py +++ b/src/py/inevent/EventHandler.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/inevent/EventState.py b/src/py/inevent/EventState.py index d1443bf..605ed64 100644 --- a/src/py/inevent/EventState.py +++ b/src/py/inevent/EventState.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/inevent/EventStream.py b/src/py/inevent/EventStream.py index aac648d..6cedf4a 100644 --- a/src/py/inevent/EventStream.py +++ b/src/py/inevent/EventStream.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/inevent/FindDevices.py b/src/py/inevent/FindDevices.py index 2f3970a..695d37a 100644 --- a/src/py/inevent/FindDevices.py +++ b/src/py/inevent/FindDevices.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/inevent/InEvent.py b/src/py/inevent/InEvent.py index a85ea44..05d1996 100644 --- a/src/py/inevent/InEvent.py +++ b/src/py/inevent/InEvent.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/inevent/JogHandler.py b/src/py/inevent/JogHandler.py index f5fad5b..7c407fc 100644 --- a/src/py/inevent/JogHandler.py +++ b/src/py/inevent/JogHandler.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/inevent/Keys.py b/src/py/inevent/Keys.py index 449aa97..8377f1e 100644 --- a/src/py/inevent/Keys.py +++ b/src/py/inevent/Keys.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/inevent/__init__.py b/src/py/inevent/__init__.py index 5e6780d..b4e4ae7 100644 --- a/src/py/inevent/__init__.py +++ b/src/py/inevent/__init__.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/inevent/ioctl.py b/src/py/inevent/ioctl.py index 652ef68..4418884 100644 --- a/src/py/inevent/ioctl.py +++ b/src/py/inevent/ioctl.py @@ -1,27 +1,27 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/lcd/__init__.py b/src/py/lcd/__init__.py index 238a6e1..77d086b 100644 --- a/src/py/lcd/__init__.py +++ b/src/py/lcd/__init__.py @@ -2,28 +2,28 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/py/lcd/splash.py b/src/py/lcd/splash.py index 203f60a..0e99662 100644 --- a/src/py/lcd/splash.py +++ b/src/py/lcd/splash.py @@ -2,28 +2,28 @@ ################################################################################ # # -# This file is part of the Buildbotics firmware. # +# This file is part of the Buildbotics firmware. # # # -# Copyright (c) 2015 - 2018, Buildbotics LLC # -# All rights reserved. # +# Copyright (c) 2015 - 2020, 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 . # +# This Source describes Open Hardware and is licensed under the # +# CERN-OHL-S v2. # # # -# 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 may redistribute and modify this Source and make products # +# using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). # +# This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED # +# WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS # +# FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable # +# conditions. # # # -# You should have received a copy of the GNU Lesser General Public # -# License along with the software. If not, see # -# . # +# Source location: https://github.com/buildbotics # # # -# For information regarding this software email: # -# "Joseph Coffland" # +# As per CERN-OHL-S v2 section 4, should You produce hardware based on # +# these sources, You must maintain the Source Location clearly visible on # +# the external case of the CNC Controller or other product you make using # +# this Source. # +# # +# For more information, email info@buildbotics.com # # # ################################################################################ diff --git a/src/resources/config-template.json b/src/resources/config-template.json index 19067c8..90c1f52 100644 --- a/src/resources/config-template.json +++ b/src/resources/config-template.json @@ -166,10 +166,19 @@ "homing": { "homing-mode": { "type": "enum", - "values": ["manual", "switch-min", "switch-max"], + "values": [ + "manual", "switch-min", "switch-max", "stall-min", "stall-max"], "default": "manual", "code": "ho" }, + "stall-microstep": { + "type": "int", + "values": [2, 4, 8, 16, 32, 64, 128, 256], + "unit": "per full step", + "default": 8, + "code": "lm", + "hmodes": ["stall-min", "stall-max"] + }, "search-velocity": { "type": "float", "min": 0, @@ -177,7 +186,8 @@ "iunit": "IPM", "scale": 0.0254, "default": 0.5, - "code": "sv" + "code": "sv", + "hmodes": ["switch-min", "switch-max", "stall-min", "stall-max"] }, "latch-velocity": { "type": "float", @@ -186,7 +196,8 @@ "iunit": "IPM", "scale": 0.0254, "default": 0.1, - "code": "lv" + "code": "lv", + "hmodes": ["switch-min", "switch-max"] }, "latch-backoff": { "type": "float", @@ -195,7 +206,32 @@ "iunit": "in", "scale": 25.4, "default": 100, - "code": "lb" + "code": "lb", + "hmodes": ["switch-min", "switch-max"] + }, + "stall-volts": { + "type": "float", + "min": 0, + "unit": "v", + "default": 6, + "code": "tv", + "hmodes": ["stall-min", "stall-max"] + }, + "stall-sample-time": { + "type": "int", + "values": [50, 100, 200, 300, 400, 600, 800, 1000], + "default": 50, + "unit": "µsec", + "code": "sp", + "hmodes": ["stall-min", "stall-max"] + }, + "stall-current": { + "type": "float", + "min": 0, + "unit": "amps", + "default": 1.5, + "code": "tc", + "hmodes": ["stall-min", "stall-max"] }, "zero-backoff": { "type": "float", @@ -204,14 +240,8 @@ "iunit": "in", "scale": 25.4, "default": 5, - "code": "zb" - }, - "stall-volts": { - "type": "float", - "min": 0, - "unit": "v", - "default": 12, - "code": "tv" + "code": "zb", + "hmodes": ["switch-min", "switch-max", "stall-min", "stall-max"] } } } @@ -261,6 +291,18 @@ "default": "lo-hi", "code": "dom", "pin": 16 + }, + "rapid-auto-off": { + "help": "Turn tool off during rapid moves. Useful for LASERs.", + "type": "bool", + "default": false + }, + "dynamic-power": { + "help": + "Adjust tool power based on velocity and feed rate. Useful for LASERs.", + "type": "bool", + "default": false, + "code": "dp" } }, @@ -355,18 +397,6 @@ "max": 320000, "default": 1000, "code": "sf" - }, - "rapid-auto-off": { - "help": "Turn tool off during rapid moves. Useful for LASERs.", - "type": "bool", - "default": false - }, - "dynamic-power": { - "help": - "Adjust tool power based on velocity and feed rate. Useful for LASERs.", - "type": "bool", - "default": false, - "code": "dp" } }, diff --git a/src/static/js/chart-2.9.3.min.js b/src/static/js/chart-2.9.3.min.js new file mode 100644 index 0000000..7c16b0d --- /dev/null +++ b/src/static/js/chart-2.9.3.min.js @@ -0,0 +1,7 @@ +/*! + * Chart.js v2.9.3 + * https://www.chartjs.org + * (c) 2019 Chart.js Contributors + * Released under the MIT License + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(function(){try{return require("moment")}catch(t){}}()):"function"==typeof define&&define.amd?define(["require"],(function(t){return e(function(){try{return t("moment")}catch(t){}}())})):(t=t||self).Chart=e(t.moment)}(this,(function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},n=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t){var n={};for(var i in e)e.hasOwnProperty(i)&&(n[e[i]]=i);var a=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var r in a)if(a.hasOwnProperty(r)){if(!("channels"in a[r]))throw new Error("missing channels property: "+r);if(!("labels"in a[r]))throw new Error("missing channel labels property: "+r);if(a[r].labels.length!==a[r].channels)throw new Error("channel and label counts mismatch: "+r);var o=a[r].channels,s=a[r].labels;delete a[r].channels,delete a[r].labels,Object.defineProperty(a[r],"channels",{value:o}),Object.defineProperty(a[r],"labels",{value:s})}a.rgb.hsl=function(t){var e,n,i=t[0]/255,a=t[1]/255,r=t[2]/255,o=Math.min(i,a,r),s=Math.max(i,a,r),l=s-o;return s===o?e=0:i===s?e=(a-r)/l:a===s?e=2+(r-i)/l:r===s&&(e=4+(i-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),n=(o+s)/2,[e,100*(s===o?0:n<=.5?l/(s+o):l/(2-s-o)),100*n]},a.rgb.hsv=function(t){var e,n,i,a,r,o=t[0]/255,s=t[1]/255,l=t[2]/255,u=Math.max(o,s,l),d=u-Math.min(o,s,l),h=function(t){return(u-t)/6/d+.5};return 0===d?a=r=0:(r=d/u,e=h(o),n=h(s),i=h(l),o===u?a=i-n:s===u?a=1/3+e-i:l===u&&(a=2/3+n-e),a<0?a+=1:a>1&&(a-=1)),[360*a,100*r,100*u]},a.rgb.hwb=function(t){var e=t[0],n=t[1],i=t[2];return[a.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(n,i))),100*(i=1-1/255*Math.max(e,Math.max(n,i)))]},a.rgb.cmyk=function(t){var e,n=t[0]/255,i=t[1]/255,a=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-i,1-a)))/(1-e)||0),100*((1-i-e)/(1-e)||0),100*((1-a-e)/(1-e)||0),100*e]},a.rgb.keyword=function(t){var i=n[t];if(i)return i;var a,r,o,s=1/0;for(var l in e)if(e.hasOwnProperty(l)){var u=e[l],d=(r=t,o=u,Math.pow(r[0]-o[0],2)+Math.pow(r[1]-o[1],2)+Math.pow(r[2]-o[2],2));d.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)),100*(.2126*e+.7152*n+.0722*i),100*(.0193*e+.1192*n+.9505*i)]},a.rgb.lab=function(t){var e=a.rgb.xyz(t),n=e[0],i=e[1],r=e[2];return i/=100,r/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(n-i),200*(i-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},a.hsl.rgb=function(t){var e,n,i,a,r,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[r=255*l,r,r];e=2*l-(n=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var u=0;u<3;u++)(i=o+1/3*-(u-1))<0&&i++,i>1&&i--,r=6*i<1?e+6*(n-e)*i:2*i<1?n:3*i<2?e+(n-e)*(2/3-i)*6:e,a[u]=255*r;return a},a.hsl.hsv=function(t){var e=t[0],n=t[1]/100,i=t[2]/100,a=n,r=Math.max(i,.01);return n*=(i*=2)<=1?i:2-i,a*=r<=1?r:2-r,[e,100*(0===i?2*a/(r+a):2*n/(i+n)),100*((i+n)/2)]},a.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,i=t[2]/100,a=Math.floor(e)%6,r=e-Math.floor(e),o=255*i*(1-n),s=255*i*(1-n*r),l=255*i*(1-n*(1-r));switch(i*=255,a){case 0:return[i,l,o];case 1:return[s,i,o];case 2:return[o,i,l];case 3:return[o,s,i];case 4:return[l,o,i];case 5:return[i,o,s]}},a.hsv.hsl=function(t){var e,n,i,a=t[0],r=t[1]/100,o=t[2]/100,s=Math.max(o,.01);return i=(2-r)*o,n=r*s,[a,100*(n=(n/=(e=(2-r)*s)<=1?e:2-e)||0),100*(i/=2)]},a.hwb.rgb=function(t){var e,n,i,a,r,o,s,l=t[0]/360,u=t[1]/100,d=t[2]/100,h=u+d;switch(h>1&&(u/=h,d/=h),i=6*l-(e=Math.floor(6*l)),0!=(1&e)&&(i=1-i),a=u+i*((n=1-d)-u),e){default:case 6:case 0:r=n,o=a,s=u;break;case 1:r=a,o=n,s=u;break;case 2:r=u,o=n,s=a;break;case 3:r=u,o=a,s=n;break;case 4:r=a,o=u,s=n;break;case 5:r=n,o=u,s=a}return[255*r,255*o,255*s]},a.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,i=t[2]/100,a=t[3]/100;return[255*(1-Math.min(1,e*(1-a)+a)),255*(1-Math.min(1,n*(1-a)+a)),255*(1-Math.min(1,i*(1-a)+a))]},a.xyz.rgb=function(t){var e,n,i,a=t[0]/100,r=t[1]/100,o=t[2]/100;return n=-.9689*a+1.8758*r+.0415*o,i=.0557*a+-.204*r+1.057*o,e=(e=3.2406*a+-1.5372*r+-.4986*o)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(i=Math.min(Math.max(0,i),1))]},a.xyz.lab=function(t){var e=t[0],n=t[1],i=t[2];return n/=100,i/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.lab.xyz=function(t){var e,n,i,a=t[0];e=t[1]/500+(n=(a+16)/116),i=n-t[2]/200;var r=Math.pow(n,3),o=Math.pow(e,3),s=Math.pow(i,3);return n=r>.008856?r:(n-16/116)/7.787,e=o>.008856?o:(e-16/116)/7.787,i=s>.008856?s:(i-16/116)/7.787,[e*=95.047,n*=100,i*=108.883]},a.lab.lch=function(t){var e,n=t[0],i=t[1],a=t[2];return(e=360*Math.atan2(a,i)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(i*i+a*a),e]},a.lch.lab=function(t){var e,n=t[0],i=t[1];return e=t[2]/360*2*Math.PI,[n,i*Math.cos(e),i*Math.sin(e)]},a.rgb.ansi16=function(t){var e=t[0],n=t[1],i=t[2],r=1 in arguments?arguments[1]:a.rgb.hsv(t)[2];if(0===(r=Math.round(r/50)))return 30;var o=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===r&&(o+=60),o},a.hsv.ansi16=function(t){return a.rgb.ansi16(a.hsv.rgb(t),t[2])},a.rgb.ansi256=function(t){var e=t[0],n=t[1],i=t[2];return e===n&&n===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)},a.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},a.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},a.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},a.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];3===e[0].length&&(n=n.split("").map((function(t){return t+t})).join(""));var i=parseInt(n,16);return[i>>16&255,i>>8&255,255&i]},a.rgb.hcg=function(t){var e,n=t[0]/255,i=t[1]/255,a=t[2]/255,r=Math.max(Math.max(n,i),a),o=Math.min(Math.min(n,i),a),s=r-o;return e=s<=0?0:r===n?(i-a)/s%6:r===i?2+(a-n)/s:4+(n-i)/s+4,e/=6,[360*(e%=1),100*s,100*(s<1?o/(1-s):0)]},a.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=1,a=0;return(i=n<.5?2*e*n:2*e*(1-n))<1&&(a=(n-.5*i)/(1-i)),[t[0],100*i,100*a]},a.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=e*n,a=0;return i<1&&(a=(n-i)/(1-i)),[t[0],100*i,100*a]},a.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,i=t[2]/100;if(0===n)return[255*i,255*i,255*i];var a,r=[0,0,0],o=e%1*6,s=o%1,l=1-s;switch(Math.floor(o)){case 0:r[0]=1,r[1]=s,r[2]=0;break;case 1:r[0]=l,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=s;break;case 3:r[0]=0,r[1]=l,r[2]=1;break;case 4:r[0]=s,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=l}return a=(1-n)*i,[255*(n*r[0]+a),255*(n*r[1]+a),255*(n*r[2]+a)]},a.hcg.hsv=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e),i=0;return n>0&&(i=e/n),[t[0],100*i,100*n]},a.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],100*i,100*n]},a.hcg.hwb=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},a.hwb.hcg=function(t){var e=t[1]/100,n=1-t[2]/100,i=n-e,a=0;return i<1&&(a=(n-i)/(1-i)),[t[0],100*i,100*a]},a.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},a.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},a.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},a.gray.hsl=a.gray.hsv=function(t){return[0,0,t[0]]},a.gray.hwb=function(t){return[0,100,t[0]]},a.gray.cmyk=function(t){return[0,0,0,t[0]]},a.gray.lab=function(t){return[t[0],0,0]},a.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},a.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}}));n.rgb,n.hsl,n.hsv,n.hwb,n.cmyk,n.xyz,n.lab,n.lch,n.hex,n.keyword,n.ansi16,n.ansi256,n.hcg,n.apple,n.gray;function i(t){var e=function(){for(var t={},e=Object.keys(n),i=e.length,a=0;a1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"==typeof n)for(var i=n.length,a=0;a1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(i)}))}));var s=o,l={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},u={getRgba:d,getHsla:h,getRgb:function(t){var e=d(t);return e&&e.slice(0,3)},getHsl:function(t){var e=h(t);return e&&e.slice(0,3)},getHwb:c,getAlpha:function(t){var e=d(t);if(e)return e[3];if(e=h(t))return e[3];if(e=c(t))return e[3]},hexString:function(t,e){e=void 0!==e&&3===t.length?e:t[3];return"#"+v(t[0])+v(t[1])+v(t[2])+(e>=0&&e<1?v(Math.round(255*e)):"")},rgbString:function(t,e){if(e<1||t[3]&&t[3]<1)return f(t,e);return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:f,percentString:function(t,e){if(e<1||t[3]&&t[3]<1)return g(t,e);var n=Math.round(t[0]/255*100),i=Math.round(t[1]/255*100),a=Math.round(t[2]/255*100);return"rgb("+n+"%, "+i+"%, "+a+"%)"},percentaString:g,hslString:function(t,e){if(e<1||t[3]&&t[3]<1)return p(t,e);return"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:p,hwbString:function(t,e){void 0===e&&(e=void 0!==t[3]?t[3]:1);return"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"},keyword:function(t){return b[t.slice(0,3)]}};function d(t){if(t){var e=[0,0,0],n=1,i=t.match(/^#([a-fA-F0-9]{3,4})$/i),a="";if(i){a=(i=i[1])[3];for(var r=0;rn?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=t,i=void 0===e?.5:e,a=2*i-1,r=this.alpha()-n.alpha(),o=((a*r==-1?a:(a+r)/(1+a*r))+1)/2,s=1-o;return this.rgb(o*this.red()+s*n.red(),o*this.green()+s*n.green(),o*this.blue()+s*n.blue()).alpha(this.alpha()*i+n.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new y,i=this.values,a=n.values;for(var r in i)i.hasOwnProperty(r)&&(t=i[r],"[object Array]"===(e={}.toString.call(t))?a[r]=t.slice(0):"[object Number]"===e?a[r]=t:console.error("unexpected color value:",t));return n}},y.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},y.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},y.prototype.getValues=function(t){for(var e=this.values,n={},i=0;i=0;a--)e.call(n,t[a],a);else for(a=0;a=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n))},easeOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:2==(t/=.5)?1:(n||(n=.45),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),t<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-S.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*S.easeInBounce(2*t):.5*S.easeOutBounce(2*t-1)+.5}},C={effects:S};M.easingEffects=S;var P=Math.PI,A=P/180,D=2*P,T=P/2,I=P/4,F=2*P/3,L={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,n,i,a,r){if(r){var o=Math.min(r,a/2,i/2),s=e+o,l=n+o,u=e+i-o,d=n+a-o;t.moveTo(e,l),se.left-1e-6&&t.xe.top-1e-6&&t.y0&&this.requestAnimationFrame()},advance:function(){for(var t,e,n,i,a=this.animations,r=0;r=n?(V.callback(t.onAnimationComplete,[t],e),e.animating=!1,a.splice(r,1)):++r}},J=V.options.resolve,Q=["push","pop","shift","splice","unshift"];function tt(t,e){var n=t._chartjs;if(n){var i=n.listeners,a=i.indexOf(e);-1!==a&&i.splice(a,1),i.length>0||(Q.forEach((function(e){delete t[e]})),delete t._chartjs)}}var et=function(t,e){this.initialize(t,e)};V.extend(et.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(t){this.index=t},linkScales:function(){var t=this.getMeta(),e=this.chart,n=e.scales,i=this.getDataset(),a=e.options.scales;null!==t.xAxisID&&t.xAxisID in n&&!i.xAxisID||(t.xAxisID=i.xAxisID||a.xAxes[0].id),null!==t.yAxisID&&t.yAxisID in n&&!i.yAxisID||(t.yAxisID=i.yAxisID||a.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this._update(!0)},destroy:function(){this._data&&tt(this._data,this)},createMetaDataset:function(){var t=this.datasetElementType;return t&&new t({_chart:this.chart,_datasetIndex:this.index})},createMetaData:function(t){var e=this.dataElementType;return e&&new e({_chart:this.chart,_datasetIndex:this.index,_index:t})},addElements:function(){var t,e,n=this.getMeta(),i=this.getDataset().data||[],a=n.data;for(t=0,e=i.length;tn&&this.insertElements(n,i-n)},insertElements:function(t,e){for(var n=0;na?(r=a/e.innerRadius,t.arc(o,s,e.innerRadius-a,i+r,n-r,!0)):t.arc(o,s,a,i+Math.PI/2,n-Math.PI/2),t.closePath(),t.clip()}function rt(t,e,n){var i="inner"===e.borderAlign;i?(t.lineWidth=2*e.borderWidth,t.lineJoin="round"):(t.lineWidth=e.borderWidth,t.lineJoin="bevel"),n.fullCircles&&function(t,e,n,i){var a,r=n.endAngle;for(i&&(n.endAngle=n.startAngle+it,at(t,n),n.endAngle=r,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=it,n.fullCircles--)),t.beginPath(),t.arc(n.x,n.y,n.innerRadius,n.startAngle+it,n.startAngle,!0),a=0;as;)a-=it;for(;a=o&&a<=s,u=r>=n.innerRadius&&r<=n.outerRadius;return l&&u}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,n=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,n=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},draw:function(){var t,e=this._chart.ctx,n=this._view,i="inner"===n.borderAlign?.33:0,a={x:n.x,y:n.y,innerRadius:n.innerRadius,outerRadius:Math.max(n.outerRadius-i,0),pixelMargin:i,startAngle:n.startAngle,endAngle:n.endAngle,fullCircles:Math.floor(n.circumference/it)};if(e.save(),e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,a.fullCircles){for(a.endAngle=a.startAngle+it,e.beginPath(),e.arc(a.x,a.y,a.outerRadius,a.startAngle,a.endAngle),e.arc(a.x,a.y,a.innerRadius,a.endAngle,a.startAngle,!0),e.closePath(),t=0;tt.x&&(e=vt(e,"left","right")):t.basen?n:i,r:l.right||a<0?0:a>e?e:a,b:l.bottom||r<0?0:r>n?n:r,l:l.left||o<0?0:o>e?e:o}}function xt(t,e,n){var i=null===e,a=null===n,r=!(!t||i&&a)&&mt(t);return r&&(i||e>=r.left&&e<=r.right)&&(a||n>=r.top&&n<=r.bottom)}z._set("global",{elements:{rectangle:{backgroundColor:gt,borderColor:gt,borderSkipped:"bottom",borderWidth:0}}});var yt=X.extend({_type:"rectangle",draw:function(){var t=this._chart.ctx,e=this._view,n=function(t){var e=mt(t),n=e.right-e.left,i=e.bottom-e.top,a=bt(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i},inner:{x:e.left+a.l,y:e.top+a.t,w:n-a.l-a.r,h:i-a.t-a.b}}}(e),i=n.outer,a=n.inner;t.fillStyle=e.backgroundColor,t.fillRect(i.x,i.y,i.w,i.h),i.w===a.w&&i.h===a.h||(t.save(),t.beginPath(),t.rect(i.x,i.y,i.w,i.h),t.clip(),t.fillStyle=e.borderColor,t.rect(a.x,a.y,a.w,a.h),t.fill("evenodd"),t.restore())},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){return xt(this._view,t,e)},inLabelRange:function(t,e){var n=this._view;return pt(n)?xt(n,t,null):xt(n,null,e)},inXRange:function(t){return xt(this._view,t,null)},inYRange:function(t){return xt(this._view,null,t)},getCenterPoint:function(){var t,e,n=this._view;return pt(n)?(t=n.x,e=(n.y+n.base)/2):(t=(n.x+n.base)/2,e=n.y),{x:t,y:e}},getArea:function(){var t=this._view;return pt(t)?t.width*Math.abs(t.y-t.base):t.height*Math.abs(t.x-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}}),_t={},kt=ot,wt=ut,Mt=ft,St=yt;_t.Arc=kt,_t.Line=wt,_t.Point=Mt,_t.Rectangle=St;var Ct=V._deprecated,Pt=V.valueOrDefault;function At(t,e,n){var i,a,r=n.barThickness,o=e.stackCount,s=e.pixels[t],l=V.isNullOrUndef(r)?function(t,e){var n,i,a,r,o=t._length;for(a=1,r=e.length;a0?Math.min(o,Math.abs(i-n)):o,n=i;return o}(e.scale,e.pixels):-1;return V.isNullOrUndef(r)?(i=l*n.categoryPercentage,a=n.barPercentage):(i=r*o,a=1),{chunk:i/o,ratio:a,start:s-i/2}}z._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),z._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});var Dt=nt.extend({dataElementType:_t.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var t,e,n=this;nt.prototype.initialize.apply(n,arguments),(t=n.getMeta()).stack=n.getDataset().stack,t.bar=!0,e=n._getIndexScale().options,Ct("bar chart",e.barPercentage,"scales.[x/y]Axes.barPercentage","dataset.barPercentage"),Ct("bar chart",e.barThickness,"scales.[x/y]Axes.barThickness","dataset.barThickness"),Ct("bar chart",e.categoryPercentage,"scales.[x/y]Axes.categoryPercentage","dataset.categoryPercentage"),Ct("bar chart",n._getValueScale().options.minBarLength,"scales.[x/y]Axes.minBarLength","dataset.minBarLength"),Ct("bar chart",e.maxBarThickness,"scales.[x/y]Axes.maxBarThickness","dataset.maxBarThickness")},update:function(t){var e,n,i=this.getMeta().data;for(this._ruler=this.getRuler(),e=0,n=i.length;e=0&&p.min>=0?p.min:p.max,y=void 0===p.start?p.end:p.max>=0&&p.min>=0?p.max-p.min:p.min-p.max,_=g.length;if(v||void 0===v&&void 0!==b)for(i=0;i<_&&(a=g[i]).index!==t;++i)a.stack===b&&(r=void 0===(u=h._parseValue(f[a.index].data[e])).start?u.end:u.min>=0&&u.max>=0?u.max:u.min,(p.min<0&&r<0||p.max>=0&&r>0)&&(x+=r));return o=h.getPixelForValue(x),l=(s=h.getPixelForValue(x+y))-o,void 0!==m&&Math.abs(l)=0&&!c||y<0&&c?o-m:o+m),{size:l,base:o,head:s,center:s+l/2}},calculateBarIndexPixels:function(t,e,n,i){var a="flex"===i.barThickness?function(t,e,n){var i,a=e.pixels,r=a[t],o=t>0?a[t-1]:null,s=t=Ot?-Rt:b<-Ot?Rt:0)+m,y=Math.cos(b),_=Math.sin(b),k=Math.cos(x),w=Math.sin(x),M=b<=0&&x>=0||x>=Rt,S=b<=zt&&x>=zt||x>=Rt+zt,C=b<=-zt&&x>=-zt||x>=Ot+zt,P=b===-Ot||x>=Ot?-1:Math.min(y,y*p,k,k*p),A=C?-1:Math.min(_,_*p,w,w*p),D=M?1:Math.max(y,y*p,k,k*p),T=S?1:Math.max(_,_*p,w,w*p);u=(D-P)/2,d=(T-A)/2,h=-(D+P)/2,c=-(T+A)/2}for(i=0,a=g.length;i0&&!isNaN(t)?Rt*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){var e,n,i,a,r,o,s,l,u=0,d=this.chart;if(!t)for(e=0,n=d.data.datasets.length;e(u=s>u?s:u)?l:u);return u},setHoverStyle:function(t){var e=t._model,n=t._options,i=V.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=Lt(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=Lt(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=Lt(n.hoverBorderWidth,n.borderWidth)},_getRingWeightOffset:function(t){for(var e=0,n=0;n0&&Vt(l[t-1]._model,s)&&(n.controlPointPreviousX=u(n.controlPointPreviousX,s.left,s.right),n.controlPointPreviousY=u(n.controlPointPreviousY,s.top,s.bottom)),t0&&(r=t.getDatasetMeta(r[0]._datasetIndex).data),r},"x-axis":function(t,e){return ie(t,e,{intersect:!1})},point:function(t,e){return te(t,Jt(e,t))},nearest:function(t,e,n){var i=Jt(e,t);n.axis=n.axis||"xy";var a=ne(n.axis);return ee(t,i,n.intersect,a)},x:function(t,e,n){var i=Jt(e,t),a=[],r=!1;return Qt(t,(function(t){t.inXRange(i.x)&&a.push(t),t.inRange(i.x,i.y)&&(r=!0)})),n.intersect&&!r&&(a=[]),a},y:function(t,e,n){var i=Jt(e,t),a=[],r=!1;return Qt(t,(function(t){t.inYRange(i.y)&&a.push(t),t.inRange(i.x,i.y)&&(r=!0)})),n.intersect&&!r&&(a=[]),a}}},re=V.extend;function oe(t,e){return V.where(t,(function(t){return t.pos===e}))}function se(t,e){return t.sort((function(t,n){var i=e?n:t,a=e?t:n;return i.weight===a.weight?i.index-a.index:i.weight-a.weight}))}function le(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function ue(t,e,n){var i,a,r=n.box,o=t.maxPadding;if(n.size&&(t[n.pos]-=n.size),n.size=n.horizontal?r.height:r.width,t[n.pos]+=n.size,r.getPadding){var s=r.getPadding();o.top=Math.max(o.top,s.top),o.left=Math.max(o.left,s.left),o.bottom=Math.max(o.bottom,s.bottom),o.right=Math.max(o.right,s.right)}if(i=e.outerWidth-le(o,t,"left","right"),a=e.outerHeight-le(o,t,"top","bottom"),i!==t.w||a!==t.h)return t.w=i,t.h=a,n.horizontal?i!==t.w:a!==t.h}function de(t,e){var n=e.maxPadding;function i(t){var i={left:0,top:0,right:0,bottom:0};return t.forEach((function(t){i[t]=Math.max(e[t],n[t])})),i}return i(t?["left","right"]:["top","bottom"])}function he(t,e,n){var i,a,r,o,s,l,u=[];for(i=0,a=t.length;idiv{position:absolute;width:1000000px;height:1000000px;left:0;top:0}.chartjs-size-monitor-shrink>div{position:absolute;width:200%;height:200%;left:0;top:0}"}))&&fe.default||fe,me="$chartjs",ve="chartjs-size-monitor",be="chartjs-render-monitor",xe="chartjs-render-animation",ye=["animationstart","webkitAnimationStart"],_e={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function ke(t,e){var n=V.getStyle(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?Number(i[1]):void 0}var we=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}()&&{passive:!0};function Me(t,e,n){t.addEventListener(e,n,we)}function Se(t,e,n){t.removeEventListener(e,n,we)}function Ce(t,e,n,i,a){return{type:t,chart:e,native:a||null,x:void 0!==n?n:null,y:void 0!==i?i:null}}function Pe(t){var e=document.createElement("div");return e.className=t||"",e}function Ae(t,e,n){var i,a,r,o,s=t[me]||(t[me]={}),l=s.resizer=function(t){var e=Pe(ve),n=Pe(ve+"-expand"),i=Pe(ve+"-shrink");n.appendChild(Pe()),i.appendChild(Pe()),e.appendChild(n),e.appendChild(i),e._reset=function(){n.scrollLeft=1e6,n.scrollTop=1e6,i.scrollLeft=1e6,i.scrollTop=1e6};var a=function(){e._reset(),t()};return Me(n,"scroll",a.bind(n,"expand")),Me(i,"scroll",a.bind(i,"shrink")),e}((i=function(){if(s.resizer){var i=n.options.maintainAspectRatio&&t.parentNode,a=i?i.clientWidth:0;e(Ce("resize",n)),i&&i.clientWidth0){var r=t[0];r.label?n=r.label:r.xLabel?n=r.xLabel:a>0&&r.index-1?t.split("\n"):t}function We(t){var e=z.global;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,rtl:t.rtl,textDirection:t.textDirection,bodyFontColor:t.bodyFontColor,_bodyFontFamily:Re(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:Re(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:Re(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:Re(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:Re(t.titleFontStyle,e.defaultFontStyle),titleFontSize:Re(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:Re(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:Re(t.footerFontStyle,e.defaultFontStyle),footerFontSize:Re(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}function Ve(t,e){return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-t.xPadding:t.x+t.xPadding}function He(t){return Be([],Ee(t))}var je=X.extend({initialize:function(){this._model=We(this._options),this._lastActive=[]},getTitle:function(){var t=this,e=t._options,n=e.callbacks,i=n.beforeTitle.apply(t,arguments),a=n.title.apply(t,arguments),r=n.afterTitle.apply(t,arguments),o=[];return o=Be(o,Ee(i)),o=Be(o,Ee(a)),o=Be(o,Ee(r))},getBeforeBody:function(){return He(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(t,e){var n=this,i=n._options.callbacks,a=[];return V.each(t,(function(t){var r={before:[],lines:[],after:[]};Be(r.before,Ee(i.beforeLabel.call(n,t,e))),Be(r.lines,i.label.call(n,t,e)),Be(r.after,Ee(i.afterLabel.call(n,t,e))),a.push(r)})),a},getAfterBody:function(){return He(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var t=this,e=t._options.callbacks,n=e.beforeFooter.apply(t,arguments),i=e.footer.apply(t,arguments),a=e.afterFooter.apply(t,arguments),r=[];return r=Be(r,Ee(n)),r=Be(r,Ee(i)),r=Be(r,Ee(a))},update:function(t){var e,n,i,a,r,o,s,l,u,d,h=this,c=h._options,f=h._model,g=h._model=We(c),p=h._active,m=h._data,v={xAlign:f.xAlign,yAlign:f.yAlign},b={x:f.x,y:f.y},x={width:f.width,height:f.height},y={x:f.caretX,y:f.caretY};if(p.length){g.opacity=1;var _=[],k=[];y=Ne[c.position].call(h,p,h._eventPosition);var w=[];for(e=0,n=p.length;ei.width&&(a=i.width-e.width),a<0&&(a=0)),"top"===d?r+=h:r-="bottom"===d?e.height+h:e.height/2,"center"===d?"left"===u?a+=h:"right"===u&&(a-=h):"left"===u?a-=c:"right"===u&&(a+=c),{x:a,y:r}}(g,x,v=function(t,e){var n,i,a,r,o,s=t._model,l=t._chart,u=t._chart.chartArea,d="center",h="center";s.yl.height-e.height&&(h="bottom");var c=(u.left+u.right)/2,f=(u.top+u.bottom)/2;"center"===h?(n=function(t){return t<=c},i=function(t){return t>c}):(n=function(t){return t<=e.width/2},i=function(t){return t>=l.width-e.width/2}),a=function(t){return t+e.width+s.caretSize+s.caretPadding>l.width},r=function(t){return t-e.width-s.caretSize-s.caretPadding<0},o=function(t){return t<=f?"top":"bottom"},n(s.x)?(d="left",a(s.x)&&(d="center",h=o(s.y))):i(s.x)&&(d="right",r(s.x)&&(d="center",h=o(s.y)));var g=t._options;return{xAlign:g.xAlign?g.xAlign:d,yAlign:g.yAlign?g.yAlign:h}}(this,x),h._chart)}else g.opacity=0;return g.xAlign=v.xAlign,g.yAlign=v.yAlign,g.x=b.x,g.y=b.y,g.width=x.width,g.height=x.height,g.caretX=y.x,g.caretY=y.y,h._model=g,t&&c.custom&&c.custom.call(h,g),h},drawCaret:function(t,e){var n=this._chart.ctx,i=this._view,a=this.getCaretPosition(t,e,i);n.lineTo(a.x1,a.y1),n.lineTo(a.x2,a.y2),n.lineTo(a.x3,a.y3)},getCaretPosition:function(t,e,n){var i,a,r,o,s,l,u=n.caretSize,d=n.cornerRadius,h=n.xAlign,c=n.yAlign,f=t.x,g=t.y,p=e.width,m=e.height;if("center"===c)s=g+m/2,"left"===h?(a=(i=f)-u,r=i,o=s+u,l=s-u):(a=(i=f+p)+u,r=i,o=s-u,l=s+u);else if("left"===h?(i=(a=f+d+u)-u,r=a+u):"right"===h?(i=(a=f+p-d-u)-u,r=a+u):(i=(a=n.caretX)-u,r=a+u),"top"===c)s=(o=g)-u,l=o;else{s=(o=g+m)+u,l=o;var v=r;r=i,i=v}return{x1:i,x2:a,x3:r,y1:o,y2:s,y3:l}},drawTitle:function(t,e,n){var i,a,r,o=e.title,s=o.length;if(s){var l=ze(e.rtl,e.x,e.width);for(t.x=Ve(e,e._titleAlign),n.textAlign=l.textAlign(e._titleAlign),n.textBaseline="middle",i=e.titleFontSize,a=e.titleSpacing,n.fillStyle=e.titleFontColor,n.font=V.fontString(i,e._titleFontStyle,e._titleFontFamily),r=0;r0&&n.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},i={x:e.x,y:e.y},a=Math.abs(e.opacity<.001)?0:e.opacity,r=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;this._options.enabled&&r&&(t.save(),t.globalAlpha=a,this.drawBackground(i,e,t,n),i.y+=e.yPadding,V.rtl.overrideTextDirection(t,e.textDirection),this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),V.rtl.restoreTextDirection(t,e.textDirection),t.restore())}},handleEvent:function(t){var e,n=this,i=n._options;return n._lastActive=n._lastActive||[],"mouseout"===t.type?n._active=[]:(n._active=n._chart.getElementsAtEventForMode(t,i.mode,i),i.reverse&&n._active.reverse()),(e=!V.arrayEquals(n._active,n._lastActive))&&(n._lastActive=n._active,(i.enabled||i.custom)&&(n._eventPosition={x:t.x,y:t.y},n.update(!0),n.pivot())),e}}),qe=Ne,Ue=je;Ue.positioners=qe;var Ye=V.valueOrDefault;function Ge(){return V.merge({},[].slice.call(arguments),{merger:function(t,e,n,i){if("xAxes"===t||"yAxes"===t){var a,r,o,s=n[t].length;for(e[t]||(e[t]=[]),a=0;a=e[t].length&&e[t].push({}),!e[t][a].type||o.type&&o.type!==e[t][a].type?V.merge(e[t][a],[Oe.getScaleDefaults(r),o]):V.merge(e[t][a],o)}else V._merger(t,e,n,i)}})}function Xe(){return V.merge({},[].slice.call(arguments),{merger:function(t,e,n,i){var a=e[t]||{},r=n[t];"scales"===t?e[t]=Ge(a,r):"scale"===t?e[t]=V.merge(a,[Oe.getScaleDefaults(r.type),r]):V._merger(t,e,n,i)}})}function Ke(t){var e=t.options;V.each(t.scales,(function(e){ge.removeBox(t,e)})),e=Xe(z.global,z[t.config.type],e),t.options=t.config.options=e,t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.tooltip._options=e.tooltips,t.tooltip.initialize()}function Ze(t,e,n){var i,a=function(t){return t.id===i};do{i=e+n++}while(V.findIndex(t,a)>=0);return i}function $e(t){return"top"===t||"bottom"===t}function Je(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}z._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var Qe=function(t,e){return this.construct(t,e),this};V.extend(Qe.prototype,{construct:function(t,e){var n=this;e=function(t){var e=(t=t||{}).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=Xe(z.global,z[t.type],t.options||{}),t}(e);var i=Fe.acquireContext(t,e),a=i&&i.canvas,r=a&&a.height,o=a&&a.width;n.id=V.uid(),n.ctx=i,n.canvas=a,n.config=e,n.width=o,n.height=r,n.aspectRatio=r?o/r:null,n.options=e.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,Qe.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(t){n.config.data=t}}),i&&a?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return Le.notify(t,"beforeInit"),V.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.initToolTip(),Le.notify(t,"afterInit"),t},clear:function(){return V.canvas.clear(this),this},stop:function(){return $.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,i=e.canvas,a=n.maintainAspectRatio&&e.aspectRatio||null,r=Math.max(0,Math.floor(V.getMaximumWidth(i))),o=Math.max(0,Math.floor(a?r/a:V.getMaximumHeight(i)));if((e.width!==r||e.height!==o)&&(i.width=e.width=r,i.height=e.height=o,i.style.width=r+"px",i.style.height=o+"px",V.retinaScale(e,n.devicePixelRatio),!t)){var s={width:r,height:o};Le.notify(e,"resize",[s]),n.onResize&&n.onResize(e,s),e.stop(),e.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;V.each(e.xAxes,(function(t,n){t.id||(t.id=Ze(e.xAxes,"x-axis-",n))})),V.each(e.yAxes,(function(t,n){t.id||(t.id=Ze(e.yAxes,"y-axis-",n))})),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var t=this,e=t.options,n=t.scales||{},i=[],a=Object.keys(n).reduce((function(t,e){return t[e]=!1,t}),{});e.scales&&(i=i.concat((e.scales.xAxes||[]).map((function(t){return{options:t,dtype:"category",dposition:"bottom"}})),(e.scales.yAxes||[]).map((function(t){return{options:t,dtype:"linear",dposition:"left"}})))),e.scale&&i.push({options:e.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),V.each(i,(function(e){var i=e.options,r=i.id,o=Ye(i.type,e.dtype);$e(i.position)!==$e(e.dposition)&&(i.position=e.dposition),a[r]=!0;var s=null;if(r in n&&n[r].type===o)(s=n[r]).options=i,s.ctx=t.ctx,s.chart=t;else{var l=Oe.getScaleConstructor(o);if(!l)return;s=new l({id:r,type:o,options:i,ctx:t.ctx,chart:t}),n[s.id]=s}s.mergeTicksOptions(),e.isDefault&&(t.scale=s)})),V.each(a,(function(t,e){t||delete n[e]})),t.scales=n,Oe.addScalesToLayout(this)},buildOrUpdateControllers:function(){var t,e,n=this,i=[],a=n.data.datasets;for(t=0,e=a.length;t=0;--n)this.drawDataset(e[n],t);Le.notify(this,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n={meta:t,index:t.index,easingValue:e};!1!==Le.notify(this,"beforeDatasetDraw",[n])&&(t.controller.draw(e),Le.notify(this,"afterDatasetDraw",[n]))},_drawTooltip:function(t){var e=this.tooltip,n={tooltip:e,easingValue:t};!1!==Le.notify(this,"beforeTooltipDraw",[n])&&(e.draw(),Le.notify(this,"afterTooltipDraw",[n]))},getElementAtEvent:function(t){return ae.modes.single(this,t)},getElementsAtEvent:function(t){return ae.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return ae.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var i=ae.modes[e];return"function"==typeof i?i(this,t,n):[]},getDatasetAtEvent:function(t){return ae.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this.data.datasets[t];e._meta||(e._meta={});var n=e._meta[this.id];return n||(n=e._meta[this.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e.order||0,index:t}),n},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e3?n[2]-n[1]:n[1]-n[0];Math.abs(i)>1&&t!==Math.floor(t)&&(i=t-Math.floor(t));var a=V.log10(Math.abs(i)),r="";if(0!==t)if(Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]))<1e-4){var o=V.log10(Math.abs(t)),s=Math.floor(o)-Math.floor(a);s=Math.max(Math.min(s,20),0),r=t.toExponential(s)}else{var l=-1*Math.floor(a);l=Math.max(Math.min(l,20),0),r=t.toFixed(l)}else r="0";return r},logarithmic:function(t,e,n){var i=t/Math.pow(10,Math.floor(V.log10(t)));return 0===t?"0":1===i||2===i||5===i||0===e||e===n.length-1?t.toExponential():""}}},on=V.isArray,sn=V.isNullOrUndef,ln=V.valueOrDefault,un=V.valueAtIndexOrDefault;function dn(t,e,n){var i,a=t.getTicks().length,r=Math.min(e,a-1),o=t.getPixelForTick(r),s=t._startPixel,l=t._endPixel;if(!(n&&(i=1===a?Math.max(o-s,l-o):0===e?(t.getPixelForTick(1)-o)/2:(o-t.getPixelForTick(r-1))/2,(o+=rl+1e-6)))return o}function hn(t,e,n,i){var a,r,o,s,l,u,d,h,c,f,g,p,m,v=n.length,b=[],x=[],y=[];for(a=0;ae){for(n=0;n=c||d<=1||!s.isHorizontal()?s.labelRotation=h:(e=(t=s._getLabelSizes()).widest.width,n=t.highest.height-t.highest.offset,i=Math.min(s.maxWidth,s.chart.width-e),e+6>(a=l.offset?s.maxWidth/d:i/(d-1))&&(a=i/(d-(l.offset?.5:1)),r=s.maxHeight-cn(l.gridLines)-u.padding-fn(l.scaleLabel),o=Math.sqrt(e*e+n*n),f=V.toDegrees(Math.min(Math.asin(Math.min((t.highest.height+6)/a,1)),Math.asin(Math.min(r/o,1))-Math.asin(n/o))),f=Math.max(h,Math.min(c,f))),s.labelRotation=f)},afterCalculateTickRotation:function(){V.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){V.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},n=t.chart,i=t.options,a=i.ticks,r=i.scaleLabel,o=i.gridLines,s=t._isVisible(),l="bottom"===i.position,u=t.isHorizontal();if(u?e.width=t.maxWidth:s&&(e.width=cn(o)+fn(r)),u?s&&(e.height=cn(o)+fn(r)):e.height=t.maxHeight,a.display&&s){var d=pn(a),h=t._getLabelSizes(),c=h.first,f=h.last,g=h.widest,p=h.highest,m=.4*d.minor.lineHeight,v=a.padding;if(u){var b=0!==t.labelRotation,x=V.toRadians(t.labelRotation),y=Math.cos(x),_=Math.sin(x),k=_*g.width+y*(p.height-(b?p.offset:0))+(b?0:m);e.height=Math.min(t.maxHeight,e.height+k+v);var w,M,S=t.getPixelForTick(0)-t.left,C=t.right-t.getPixelForTick(t.getTicks().length-1);b?(w=l?y*c.width+_*c.offset:_*(c.height-c.offset),M=l?_*(f.height-f.offset):y*f.width+_*f.offset):(w=c.width/2,M=f.width/2),t.paddingLeft=Math.max((w-S)*t.width/(t.width-S),0)+3,t.paddingRight=Math.max((M-C)*t.width/(t.width-C),0)+3}else{var P=a.mirror?0:g.width+v+m;e.width=Math.min(t.maxWidth,e.width+P),t.paddingTop=c.height/2,t.paddingBottom=f.height/2}}t.handleMargins(),u?(t.width=t._length=n.width-t.margins.left-t.margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=n.height-t.margins.top-t.margins.bottom)},handleMargins:function(){var t=this;t.margins&&(t.margins.left=Math.max(t.paddingLeft,t.margins.left),t.margins.top=Math.max(t.paddingTop,t.margins.top),t.margins.right=Math.max(t.paddingRight,t.margins.right),t.margins.bottom=Math.max(t.paddingBottom,t.margins.bottom))},afterFit:function(){V.callback(this.options.afterFit,[this])},isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(sn(t))return NaN;if(("number"==typeof t||t instanceof Number)&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},_convertTicksToLabels:function(t){var e,n,i,a=this;for(a.ticks=t.map((function(t){return t.value})),a.beforeTickToLabelConversion(),e=a.convertTicksToLabels(t)||a.ticks,a.afterTickToLabelConversion(),n=0,i=t.length;nn-1?null:this.getPixelForDecimal(t*i+(e?i/2:0))},getPixelForDecimal:function(t){return this._reversePixels&&(t=1-t),this._startPixel+t*this._length},getDecimalForPixel:function(t){var e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this.min,e=this.max;return this.beginAtZero?0:t<0&&e<0?e:t>0&&e>0?t:0},_autoSkip:function(t){var e,n,i,a,r=this.options.ticks,o=this._length,s=r.maxTicksLimit||o/this._tickSize()+1,l=r.major.enabled?function(t){var e,n,i=[];for(e=0,n=t.length;es)return function(t,e,n){var i,a,r=0,o=e[0];for(n=Math.ceil(n),i=0;iu)return r;return Math.max(u,1)}(l,t,0,s),u>0){for(e=0,n=u-1;e1?(h-d)/(u-1):null,vn(t,i,V.isNullOrUndef(a)?0:d-a,d),vn(t,i,h,V.isNullOrUndef(a)?t.length:h+a),mn(t)}return vn(t,i),mn(t)},_tickSize:function(){var t=this.options.ticks,e=V.toRadians(this.labelRotation),n=Math.abs(Math.cos(e)),i=Math.abs(Math.sin(e)),a=this._getLabelSizes(),r=t.autoSkipPadding||0,o=a?a.widest.width+r:0,s=a?a.highest.height+r:0;return this.isHorizontal()?s*n>o*i?o/n:s/i:s*i=0&&(o=t),void 0!==r&&(t=n.indexOf(r))>=0&&(s=t),e.minIndex=o,e.maxIndex=s,e.min=n[o],e.max=n[s]},buildTicks:function(){var t=this._getLabels(),e=this.minIndex,n=this.maxIndex;this.ticks=0===e&&n===t.length-1?t:t.slice(e,n+1)},getLabelForIndex:function(t,e){var n=this.chart;return n.getDatasetMeta(e).controller._getValueScaleId()===this.id?this.getRightValue(n.data.datasets[e].data[t]):this._getLabels()[t]},_configure:function(){var t=this,e=t.options.offset,n=t.ticks;xn.prototype._configure.call(t),t.isHorizontal()||(t._reversePixels=!t._reversePixels),n&&(t._startValue=t.minIndex-(e?.5:0),t._valueRange=Math.max(n.length-(e?0:1),1))},getPixelForValue:function(t,e,n){var i,a,r,o=this;return yn(e)||yn(n)||(t=o.chart.data.datasets[n].data[e]),yn(t)||(i=o.isHorizontal()?t.x:t.y),(void 0!==i||void 0!==t&&isNaN(e))&&(a=o._getLabels(),t=V.valueOrDefault(i,t),e=-1!==(r=a.indexOf(t))?r:e,isNaN(e)&&(e=t)),o.getPixelForDecimal((e-o._startValue)/o._valueRange)},getPixelForTick:function(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t],t+this.minIndex)},getValueForPixel:function(t){var e=Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange);return Math.min(Math.max(e,0),this.ticks.length-1)},getBasePixel:function(){return this.bottom}}),kn={position:"bottom"};_n._defaults=kn;var wn=V.noop,Mn=V.isNullOrUndef;var Sn=xn.extend({getRightValue:function(t){return"string"==typeof t?+t:xn.prototype.getRightValue.call(this,t)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var n=V.sign(t.min),i=V.sign(t.max);n<0&&i<0?t.max=0:n>0&&i>0&&(t.min=0)}var a=void 0!==e.min||void 0!==e.suggestedMin,r=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?t.min=e.min:void 0!==e.suggestedMin&&(null===t.min?t.min=e.suggestedMin:t.min=Math.min(t.min,e.suggestedMin)),void 0!==e.max?t.max=e.max:void 0!==e.suggestedMax&&(null===t.max?t.max=e.suggestedMax:t.max=Math.max(t.max,e.suggestedMax)),a!==r&&t.min>=t.max&&(a?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:function(){var t,e=this.options.ticks,n=e.stepSize,i=e.maxTicksLimit;return n?t=Math.ceil(this.max/n)-Math.floor(this.min/n)+1:(t=this._computeTickLimit(),i=i||11),i&&(t=Math.min(i,t)),t},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:wn,buildTicks:function(){var t=this,e=t.options.ticks,n=t.getTickLimit(),i={maxTicks:n=Math.max(2,n),min:e.min,max:e.max,precision:e.precision,stepSize:V.valueOrDefault(e.fixedStepSize,e.stepSize)},a=t.ticks=function(t,e){var n,i,a,r,o=[],s=t.stepSize,l=s||1,u=t.maxTicks-1,d=t.min,h=t.max,c=t.precision,f=e.min,g=e.max,p=V.niceNum((g-f)/u/l)*l;if(p<1e-14&&Mn(d)&&Mn(h))return[f,g];(r=Math.ceil(g/p)-Math.floor(f/p))>u&&(p=V.niceNum(r*p/u/l)*l),s||Mn(c)?n=Math.pow(10,V._decimalPlaces(p)):(n=Math.pow(10,c),p=Math.ceil(p*n)/n),i=Math.floor(f/p)*p,a=Math.ceil(g/p)*p,s&&(!Mn(d)&&V.almostWhole(d/p,p/1e3)&&(i=d),!Mn(h)&&V.almostWhole(h/p,p/1e3)&&(a=h)),r=(a-i)/p,r=V.almostEquals(r,Math.round(r),p/1e3)?Math.round(r):Math.ceil(r),i=Math.round(i*n)/n,a=Math.round(a*n)/n,o.push(Mn(d)?i:d);for(var m=1;me.length-1?null:this.getPixelForValue(e[t])}}),Tn=Cn;Dn._defaults=Tn;var In=V.valueOrDefault,Fn=V.math.log10;var Ln={position:"left",ticks:{callback:rn.formatters.logarithmic}};function On(t,e){return V.isFinite(t)&&t>=0?t:e}var Rn=xn.extend({determineDataLimits:function(){var t,e,n,i,a,r,o=this,s=o.options,l=o.chart,u=l.data.datasets,d=o.isHorizontal();function h(t){return d?t.xAxisID===o.id:t.yAxisID===o.id}o.min=Number.POSITIVE_INFINITY,o.max=Number.NEGATIVE_INFINITY,o.minNotZero=Number.POSITIVE_INFINITY;var c=s.stacked;if(void 0===c)for(t=0;t0){var e=V.min(t),n=V.max(t);o.min=Math.min(o.min,e),o.max=Math.max(o.max,n)}}))}else for(t=0;t0?t.minNotZero=t.min:t.max<1?t.minNotZero=Math.pow(10,Math.floor(Fn(t.max))):t.minNotZero=1)},buildTicks:function(){var t=this,e=t.options.ticks,n=!t.isHorizontal(),i={min:On(e.min),max:On(e.max)},a=t.ticks=function(t,e){var n,i,a=[],r=In(t.min,Math.pow(10,Math.floor(Fn(e.min)))),o=Math.floor(Fn(e.max)),s=Math.ceil(e.max/Math.pow(10,o));0===r?(n=Math.floor(Fn(e.minNotZero)),i=Math.floor(e.minNotZero/Math.pow(10,n)),a.push(r),r=i*Math.pow(10,n)):(n=Math.floor(Fn(r)),i=Math.floor(r/Math.pow(10,n)));var l=n<0?Math.pow(10,Math.abs(n)):1;do{a.push(r),10===++i&&(i=1,l=++n>=0?1:l),r=Math.round(i*Math.pow(10,n)*l)/l}while(ne.length-1?null:this.getPixelForValue(e[t])},_getFirstTickValue:function(t){var e=Math.floor(Fn(t));return Math.floor(t/Math.pow(10,e))*Math.pow(10,e)},_configure:function(){var t=this,e=t.min,n=0;xn.prototype._configure.call(t),0===e&&(e=t._getFirstTickValue(t.minNotZero),n=In(t.options.ticks.fontSize,z.global.defaultFontSize)/t._length),t._startValue=Fn(e),t._valueOffset=n,t._valueRange=(Fn(t.max)-Fn(e))/(1-n)},getPixelForValue:function(t){var e=this,n=0;return(t=+e.getRightValue(t))>e.min&&t>0&&(n=(Fn(t)-e._startValue)/e._valueRange+e._valueOffset),e.getPixelForDecimal(n)},getValueForPixel:function(t){var e=this,n=e.getDecimalForPixel(t);return 0===n&&0===e.min?0:Math.pow(10,e._startValue+(n-e._valueOffset)*e._valueRange)}}),zn=Ln;Rn._defaults=zn;var Nn=V.valueOrDefault,Bn=V.valueAtIndexOrDefault,En=V.options.resolve,Wn={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:rn.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}};function Vn(t){var e=t.ticks;return e.display&&t.display?Nn(e.fontSize,z.global.defaultFontSize)+2*e.backdropPaddingY:0}function Hn(t,e,n,i,a){return t===i||t===a?{start:e-n/2,end:e+n/2}:ta?{start:e-n,end:e}:{start:e,end:e+n}}function jn(t){return 0===t||180===t?"center":t<180?"left":"right"}function qn(t,e,n,i){var a,r,o=n.y+i/2;if(V.isArray(e))for(a=0,r=e.length;a270||t<90)&&(n.y-=e.h)}function Yn(t){return V.isNumber(t)?t:0}var Gn=Sn.extend({setDimensions:function(){var t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=Vn(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2},determineDataLimits:function(){var t=this,e=t.chart,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;V.each(e.data.datasets,(function(a,r){if(e.isDatasetVisible(r)){var o=e.getDatasetMeta(r);V.each(a.data,(function(e,a){var r=+t.getRightValue(e);isNaN(r)||o.data[a].hidden||(n=Math.min(r,n),i=Math.max(r,i))}))}})),t.min=n===Number.POSITIVE_INFINITY?0:n,t.max=i===Number.NEGATIVE_INFINITY?0:i,t.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/Vn(this.options))},convertTicksToLabels:function(){var t=this;Sn.prototype.convertTicksToLabels.call(t),t.pointLabels=t.chart.data.labels.map((function(){var e=V.callback(t.options.pointLabels.callback,arguments,t);return e||0===e?e:""}))},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){var t=this.options;t.display&&t.pointLabels.display?function(t){var e,n,i,a=V.options._parseFont(t.options.pointLabels),r={l:0,r:t.width,t:0,b:t.height-t.paddingTop},o={};t.ctx.font=a.string,t._pointLabelSizes=[];var s,l,u,d=t.chart.data.labels.length;for(e=0;er.r&&(r.r=f.end,o.r=h),g.startr.b&&(r.b=g.end,o.b=h)}t.setReductions(t.drawingArea,r,o)}(this):this.setCenterPoint(0,0,0,0)},setReductions:function(t,e,n){var i=this,a=e.l/Math.sin(n.l),r=Math.max(e.r-i.width,0)/Math.sin(n.r),o=-e.t/Math.cos(n.t),s=-Math.max(e.b-(i.height-i.paddingTop),0)/Math.cos(n.b);a=Yn(a),r=Yn(r),o=Yn(o),s=Yn(s),i.drawingArea=Math.min(Math.floor(t-(a+r)/2),Math.floor(t-(o+s)/2)),i.setCenterPoint(a,r,o,s)},setCenterPoint:function(t,e,n,i){var a=this,r=a.width-e-a.drawingArea,o=t+a.drawingArea,s=n+a.drawingArea,l=a.height-a.paddingTop-i-a.drawingArea;a.xCenter=Math.floor((o+r)/2+a.left),a.yCenter=Math.floor((s+l)/2+a.top+a.paddingTop)},getIndexAngle:function(t){var e=this.chart,n=(t*(360/e.data.labels.length)+((e.options||{}).startAngle||0))%360;return(n<0?n+360:n)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){var e=this;if(V.isNullOrUndef(t))return NaN;var n=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*n:(t-e.min)*n},getPointPosition:function(t,e){var n=this.getIndexAngle(t)-Math.PI/2;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(t){var e=this.min,n=this.max;return this.getPointPositionForValue(t||0,this.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0)},_drawGrid:function(){var t,e,n,i=this,a=i.ctx,r=i.options,o=r.gridLines,s=r.angleLines,l=Nn(s.lineWidth,o.lineWidth),u=Nn(s.color,o.color);if(r.pointLabels.display&&function(t){var e=t.ctx,n=t.options,i=n.pointLabels,a=Vn(n),r=t.getDistanceFromCenterForValue(n.ticks.reverse?t.min:t.max),o=V.options._parseFont(i);e.save(),e.font=o.string,e.textBaseline="middle";for(var s=t.chart.data.labels.length-1;s>=0;s--){var l=0===s?a/2:0,u=t.getPointPosition(s,r+l+5),d=Bn(i.fontColor,s,z.global.defaultFontColor);e.fillStyle=d;var h=t.getIndexAngle(s),c=V.toDegrees(h);e.textAlign=jn(c),Un(c,t._pointLabelSizes[s],u),qn(e,t.pointLabels[s],u,o.lineHeight)}e.restore()}(i),o.display&&V.each(i.ticks,(function(t,n){0!==n&&(e=i.getDistanceFromCenterForValue(i.ticksAsNumbers[n]),function(t,e,n,i){var a,r=t.ctx,o=e.circular,s=t.chart.data.labels.length,l=Bn(e.color,i-1),u=Bn(e.lineWidth,i-1);if((o||s)&&l&&u){if(r.save(),r.strokeStyle=l,r.lineWidth=u,r.setLineDash&&(r.setLineDash(e.borderDash||[]),r.lineDashOffset=e.borderDashOffset||0),r.beginPath(),o)r.arc(t.xCenter,t.yCenter,n,0,2*Math.PI);else{a=t.getPointPosition(0,n),r.moveTo(a.x,a.y);for(var d=1;d=0;t--)e=i.getDistanceFromCenterForValue(r.ticks.reverse?i.min:i.max),n=i.getPointPosition(t,e),a.beginPath(),a.moveTo(i.xCenter,i.yCenter),a.lineTo(n.x,n.y),a.stroke();a.restore()}},_drawLabels:function(){var t=this,e=t.ctx,n=t.options.ticks;if(n.display){var i,a,r=t.getIndexAngle(0),o=V.options._parseFont(n),s=Nn(n.fontColor,z.global.defaultFontColor);e.save(),e.font=o.string,e.translate(t.xCenter,t.yCenter),e.rotate(r),e.textAlign="center",e.textBaseline="middle",V.each(t.ticks,(function(r,l){(0!==l||n.reverse)&&(i=t.getDistanceFromCenterForValue(t.ticksAsNumbers[l]),n.showLabelBackdrop&&(a=e.measureText(r).width,e.fillStyle=n.backdropColor,e.fillRect(-a/2-n.backdropPaddingX,-i-o.size/2-n.backdropPaddingY,a+2*n.backdropPaddingX,o.size+2*n.backdropPaddingY)),e.fillStyle=s,e.fillText(r,0,-i))})),e.restore()}},_drawTitle:V.noop}),Xn=Wn;Gn._defaults=Xn;var Kn=V._deprecated,Zn=V.options.resolve,$n=V.valueOrDefault,Jn=Number.MIN_SAFE_INTEGER||-9007199254740991,Qn=Number.MAX_SAFE_INTEGER||9007199254740991,ti={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ei=Object.keys(ti);function ni(t,e){return t-e}function ii(t){return V.valueOrDefault(t.time.min,t.ticks.min)}function ai(t){return V.valueOrDefault(t.time.max,t.ticks.max)}function ri(t,e,n,i){var a=function(t,e,n){for(var i,a,r,o=0,s=t.length-1;o>=0&&o<=s;){if(a=t[(i=o+s>>1)-1]||null,r=t[i],!a)return{lo:null,hi:r};if(r[e]n))return{lo:a,hi:r};s=i-1}}return{lo:r,hi:null}}(t,e,n),r=a.lo?a.hi?a.lo:t[t.length-2]:t[0],o=a.lo?a.hi?a.hi:t[t.length-1]:t[1],s=o[e]-r[e],l=s?(n-r[e])/s:0,u=(o[i]-r[i])*l;return r[i]+u}function oi(t,e){var n=t._adapter,i=t.options.time,a=i.parser,r=a||i.format,o=e;return"function"==typeof a&&(o=a(o)),V.isFinite(o)||(o="string"==typeof r?n.parse(o,r):n.parse(o)),null!==o?+o:(a||"function"!=typeof r||(o=r(e),V.isFinite(o)||(o=n.parse(o))),o)}function si(t,e){if(V.isNullOrUndef(e))return null;var n=t.options.time,i=oi(t,t.getRightValue(e));return null===i?i:(n.round&&(i=+t._adapter.startOf(i,n.round)),i)}function li(t,e,n,i){var a,r,o,s=ei.length;for(a=ei.indexOf(t);a=0&&(e[r].major=!0);return e}(t,r,o,n):r}var di=xn.extend({initialize:function(){this.mergeTicksOptions(),xn.prototype.initialize.call(this)},update:function(){var t=this,e=t.options,n=e.time||(e.time={}),i=t._adapter=new an._date(e.adapters.date);return Kn("time scale",n.format,"time.format","time.parser"),Kn("time scale",n.min,"time.min","ticks.min"),Kn("time scale",n.max,"time.max","ticks.max"),V.mergeIf(n.displayFormats,i.formats()),xn.prototype.update.apply(t,arguments)},getRightValue:function(t){return t&&void 0!==t.t&&(t=t.t),xn.prototype.getRightValue.call(this,t)},determineDataLimits:function(){var t,e,n,i,a,r,o,s=this,l=s.chart,u=s._adapter,d=s.options,h=d.time.unit||"day",c=Qn,f=Jn,g=[],p=[],m=[],v=s._getLabels();for(t=0,n=v.length;t1?function(t){var e,n,i,a={},r=[];for(e=0,n=t.length;e1e5*u)throw e+" and "+n+" are too far apart with stepSize of "+u+" "+l;for(a=h;a=a&&n<=r&&d.push(n);return i.min=a,i.max=r,i._unit=l.unit||(s.autoSkip?li(l.minUnit,i.min,i.max,h):function(t,e,n,i,a){var r,o;for(r=ei.length-1;r>=ei.indexOf(n);r--)if(o=ei[r],ti[o].common&&t._adapter.diff(a,i,o)>=e-1)return o;return ei[n?ei.indexOf(n):0]}(i,d.length,l.minUnit,i.min,i.max)),i._majorUnit=s.major.enabled&&"year"!==i._unit?function(t){for(var e=ei.indexOf(t)+1,n=ei.length;ee&&s=0&&t0?s:1}}),hi={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}};di._defaults=hi;var ci={category:_n,linear:Dn,logarithmic:Rn,radialLinear:Gn,time:di},fi={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};an._date.override("function"==typeof t?{_id:"moment",formats:function(){return fi},parse:function(e,n){return"string"==typeof e&&"string"==typeof n?e=t(e,n):e instanceof t||(e=t(e)),e.isValid()?e.valueOf():null},format:function(e,n){return t(e).format(n)},add:function(e,n,i){return t(e).add(n,i).valueOf()},diff:function(e,n,i){return t(e).diff(t(n),i)},startOf:function(e,n,i){return e=t(e),"isoWeek"===n?e.isoWeekday(i).valueOf():e.startOf(n).valueOf()},endOf:function(e,n){return t(e).endOf(n).valueOf()},_create:function(e){return t(e)}}:{}),z._set("global",{plugins:{filler:{propagate:!0}}});var gi={dataset:function(t){var e=t.fill,n=t.chart,i=n.getDatasetMeta(e),a=i&&n.isDatasetVisible(e)&&i.dataset._children||[],r=a.length||0;return r?function(t,e){return e=n)&&i;switch(r){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return r;default:return!1}}function mi(t){return(t.el._scale||{}).getPointPositionForValue?function(t){var e,n,i,a,r,o=t.el._scale,s=o.options,l=o.chart.data.labels.length,u=t.fill,d=[];if(!l)return null;for(e=s.ticks.reverse?o.max:o.min,n=s.ticks.reverse?o.min:o.max,i=o.getPointPositionForValue(0,e),a=0;a0;--r)V.canvas.lineTo(t,n[r],n[r-1],!0);else for(o=n[0].cx,s=n[0].cy,l=Math.sqrt(Math.pow(n[0].x-o,2)+Math.pow(n[0].y-s,2)),r=a-1;r>0;--r)t.arc(o,s,l,n[r].angle,n[r-1].angle,!0)}}function _i(t,e,n,i,a,r){var o,s,l,u,d,h,c,f,g=e.length,p=i.spanGaps,m=[],v=[],b=0,x=0;for(t.beginPath(),o=0,s=g;o=0;--n)(e=l[n].$filler)&&e.visible&&(a=(i=e.el)._view,r=i._children||[],o=e.mapper,s=a.backgroundColor||z.global.defaultColor,o&&s&&r.length&&(V.canvas.clipArea(u,t.chartArea),_i(u,r,o,a,s,i._loop),V.canvas.unclipArea(u)))}},wi=V.rtl.getRtlAdapter,Mi=V.noop,Si=V.valueOrDefault;function Ci(t,e){return t.usePointStyle&&t.boxWidth>e?e:t.boxWidth}z._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var n=e.datasetIndex,i=this.chart,a=i.getDatasetMeta(n);a.hidden=null===a.hidden?!i.data.datasets[n].hidden:null,i.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data.datasets,n=t.options.legend||{},i=n.labels&&n.labels.usePointStyle;return t._getSortedDatasetMetas().map((function(n){var a=n.controller.getStyle(i?0:void 0);return{text:e[n.index].label,fillStyle:a.backgroundColor,hidden:!t.isDatasetVisible(n.index),lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:a.borderWidth,strokeStyle:a.borderColor,pointStyle:a.pointStyle,rotation:a.rotation,datasetIndex:n.index}}),this)}}},legendCallback:function(t){var e,n,i,a=document.createElement("ul"),r=t.data.datasets;for(a.setAttribute("class",t.id+"-legend"),e=0,n=r.length;el.width)&&(h+=o+n.padding,d[d.length-(e>0?0:1)]=0),s[e]={left:0,top:0,width:i,height:o},d[d.length-1]+=i+n.padding})),l.height+=h}else{var c=n.padding,f=t.columnWidths=[],g=t.columnHeights=[],p=n.padding,m=0,v=0;V.each(t.legendItems,(function(t,e){var i=Ci(n,o)+o/2+a.measureText(t.text).width;e>0&&v+o+2*c>l.height&&(p+=m+n.padding,f.push(m),g.push(v),m=0,v=0),m=Math.max(m,i),v+=o+c,s[e]={left:0,top:0,width:i,height:o}})),p+=m,f.push(m),g.push(v),l.width+=p}t.width=l.width,t.height=l.height}else t.width=l.width=t.height=l.height=0},afterFit:Mi,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,n=e.labels,i=z.global,a=i.defaultColor,r=i.elements.line,o=t.height,s=t.columnHeights,l=t.width,u=t.lineWidths;if(e.display){var d,h=wi(e.rtl,t.left,t.minSize.width),c=t.ctx,f=Si(n.fontColor,i.defaultFontColor),g=V.options._parseFont(n),p=g.size;c.textAlign=h.textAlign("left"),c.textBaseline="middle",c.lineWidth=.5,c.strokeStyle=f,c.fillStyle=f,c.font=g.string;var m=Ci(n,p),v=t.legendHitBoxes,b=function(t,i){switch(e.align){case"start":return n.padding;case"end":return t-i;default:return(t-i+n.padding)/2}},x=t.isHorizontal();d=x?{x:t.left+b(l,u[0]),y:t.top+n.padding,line:0}:{x:t.left+n.padding,y:t.top+b(o,s[0]),line:0},V.rtl.overrideTextDirection(t.ctx,e.textDirection);var y=p+n.padding;V.each(t.legendItems,(function(e,i){var f=c.measureText(e.text).width,g=m+p/2+f,_=d.x,k=d.y;h.setWidth(t.minSize.width),x?i>0&&_+g+n.padding>t.left+t.minSize.width&&(k=d.y+=y,d.line++,_=d.x=t.left+b(l,u[d.line])):i>0&&k+y>t.top+t.minSize.height&&(_=d.x=_+t.columnWidths[d.line]+n.padding,d.line++,k=d.y=t.top+b(o,s[d.line]));var w=h.x(_);!function(t,e,i){if(!(isNaN(m)||m<=0)){c.save();var o=Si(i.lineWidth,r.borderWidth);if(c.fillStyle=Si(i.fillStyle,a),c.lineCap=Si(i.lineCap,r.borderCapStyle),c.lineDashOffset=Si(i.lineDashOffset,r.borderDashOffset),c.lineJoin=Si(i.lineJoin,r.borderJoinStyle),c.lineWidth=o,c.strokeStyle=Si(i.strokeStyle,a),c.setLineDash&&c.setLineDash(Si(i.lineDash,r.borderDash)),n&&n.usePointStyle){var s=m*Math.SQRT2/2,l=h.xPlus(t,m/2),u=e+p/2;V.canvas.drawPoint(c,i.pointStyle,s,l,u,i.rotation)}else c.fillRect(h.leftForLtr(t,m),e,m,p),0!==o&&c.strokeRect(h.leftForLtr(t,m),e,m,p);c.restore()}}(w,k,e),v[i].left=h.leftForLtr(w,v[i].width),v[i].top=k,function(t,e,n,i){var a=p/2,r=h.xPlus(t,m+a),o=e+a;c.fillText(n.text,r,o),n.hidden&&(c.beginPath(),c.lineWidth=2,c.moveTo(r,o),c.lineTo(h.xPlus(r,i),o),c.stroke())}(w,k,e,f),x?d.x+=g+n.padding:d.y+=y})),V.rtl.restoreTextDirection(t.ctx,e.textDirection)}},_getLegendItemAt:function(t,e){var n,i,a,r=this;if(t>=r.left&&t<=r.right&&e>=r.top&&e<=r.bottom)for(a=r.legendHitBoxes,n=0;n=(i=a[n]).left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height)return r.legendItems[n];return null},handleEvent:function(t){var e,n=this,i=n.options,a="mouseup"===t.type?"click":t.type;if("mousemove"===a){if(!i.onHover&&!i.onLeave)return}else{if("click"!==a)return;if(!i.onClick)return}e=n._getLegendItemAt(t.x,t.y),"click"===a?e&&i.onClick&&i.onClick.call(n,t.native,e):(i.onLeave&&e!==n._hoveredItem&&(n._hoveredItem&&i.onLeave.call(n,t.native,n._hoveredItem),n._hoveredItem=e),i.onHover&&e&&i.onHover.call(n,t.native,e))}});function Ai(t,e){var n=new Pi({ctx:t.ctx,options:e,chart:t});ge.configure(t,n,e),ge.addBox(t,n),t.legend=n}var Di={id:"legend",_element:Pi,beforeInit:function(t){var e=t.options.legend;e&&Ai(t,e)},beforeUpdate:function(t){var e=t.options.legend,n=t.legend;e?(V.mergeIf(e,z.global.legend),n?(ge.configure(t,n,e),n.options=e):Ai(t,e)):n&&(ge.removeBox(t,n),delete t.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}},Ti=V.noop;z._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var Ii=X.extend({initialize:function(t){V.extend(this,t),this.legendHitBoxes=[]},beforeUpdate:Ti,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:Ti,beforeSetDimensions:Ti,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:Ti,beforeBuildLabels:Ti,buildLabels:Ti,afterBuildLabels:Ti,beforeFit:Ti,fit:function(){var t,e=this,n=e.options,i=e.minSize={},a=e.isHorizontal();n.display?(t=(V.isArray(n.text)?n.text.length:1)*V.options._parseFont(n).lineHeight+2*n.padding,e.width=i.width=a?e.maxWidth:t,e.height=i.height=a?t:e.maxHeight):e.width=i.width=e.height=i.height=0},afterFit:Ti,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,n=t.options;if(n.display){var i,a,r,o=V.options._parseFont(n),s=o.lineHeight,l=s/2+n.padding,u=0,d=t.top,h=t.left,c=t.bottom,f=t.right;e.fillStyle=V.valueOrDefault(n.fontColor,z.global.defaultFontColor),e.font=o.string,t.isHorizontal()?(a=h+(f-h)/2,r=d+l,i=f-h):(a="left"===n.position?h+l:f-l,r=d+(c-d)/2,i=c-d,u=Math.PI*("left"===n.position?-.5:.5)),e.save(),e.translate(a,r),e.rotate(u),e.textAlign="center",e.textBaseline="middle";var g=n.text;if(V.isArray(g))for(var p=0,m=0;m=0;i--){var a=t[i];if(e(a))return a}},V.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},V.almostEquals=function(t,e,n){return Math.abs(t-e)=t},V.max=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.max(t,e)}),Number.NEGATIVE_INFINITY)},V.min=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.min(t,e)}),Number.POSITIVE_INFINITY)},V.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0===(t=+t)||isNaN(t)?t:t>0?1:-1},V.toRadians=function(t){return t*(Math.PI/180)},V.toDegrees=function(t){return t*(180/Math.PI)},V._decimalPlaces=function(t){if(V.isFinite(t)){for(var e=1,n=0;Math.round(t*e)/e!==t;)e*=10,n++;return n}},V.getAngleFromPoint=function(t,e){var n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),r=Math.atan2(i,n);return r<-.5*Math.PI&&(r+=2*Math.PI),{angle:r,distance:a}},V.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},V.aliasPixel=function(t){return t%2==0?0:.5},V._alignPixel=function(t,e,n){var i=t.currentDevicePixelRatio,a=n/2;return Math.round((e-a)*i)/i+a},V.splineCurve=function(t,e,n,i){var a=t.skip?e:t,r=e,o=n.skip?e:n,s=Math.sqrt(Math.pow(r.x-a.x,2)+Math.pow(r.y-a.y,2)),l=Math.sqrt(Math.pow(o.x-r.x,2)+Math.pow(o.y-r.y,2)),u=s/(s+l),d=l/(s+l),h=i*(u=isNaN(u)?0:u),c=i*(d=isNaN(d)?0:d);return{previous:{x:r.x-h*(o.x-a.x),y:r.y-h*(o.y-a.y)},next:{x:r.x+c*(o.x-a.x),y:r.y+c*(o.y-a.y)}}},V.EPSILON=Number.EPSILON||1e-14,V.splineCurveMonotone=function(t){var e,n,i,a,r,o,s,l,u,d=(t||[]).map((function(t){return{model:t._model,deltaK:0,mK:0}})),h=d.length;for(e=0;e0?d[e-1]:null,(a=e0?d[e-1]:null,a=e=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},V.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},V.niceNum=function(t,e){var n=Math.floor(V.log10(t)),i=t/Math.pow(10,n);return(e?i<1.5?1:i<3?2:i<7?5:10:i<=1?1:i<=2?2:i<=5?5:10)*Math.pow(10,n)},V.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},V.getRelativePosition=function(t,e){var n,i,a=t.originalEvent||t,r=t.target||t.srcElement,o=r.getBoundingClientRect(),s=a.touches;s&&s.length>0?(n=s[0].clientX,i=s[0].clientY):(n=a.clientX,i=a.clientY);var l=parseFloat(V.getStyle(r,"padding-left")),u=parseFloat(V.getStyle(r,"padding-top")),d=parseFloat(V.getStyle(r,"padding-right")),h=parseFloat(V.getStyle(r,"padding-bottom")),c=o.right-o.left-l-d,f=o.bottom-o.top-u-h;return{x:n=Math.round((n-o.left-l)/c*r.width/e.currentDevicePixelRatio),y:i=Math.round((i-o.top-u)/f*r.height/e.currentDevicePixelRatio)}},V.getConstraintWidth=function(t){return n(t,"max-width","clientWidth")},V.getConstraintHeight=function(t){return n(t,"max-height","clientHeight")},V._calculatePadding=function(t,e,n){return(e=V.getStyle(t,e)).indexOf("%")>-1?n*parseInt(e,10)/100:parseInt(e,10)},V._getParentNode=function(t){var e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e},V.getMaximumWidth=function(t){var e=V._getParentNode(t);if(!e)return t.clientWidth;var n=e.clientWidth,i=n-V._calculatePadding(e,"padding-left",n)-V._calculatePadding(e,"padding-right",n),a=V.getConstraintWidth(t);return isNaN(a)?i:Math.min(i,a)},V.getMaximumHeight=function(t){var e=V._getParentNode(t);if(!e)return t.clientHeight;var n=e.clientHeight,i=n-V._calculatePadding(e,"padding-top",n)-V._calculatePadding(e,"padding-bottom",n),a=V.getConstraintHeight(t);return isNaN(a)?i:Math.min(i,a)},V.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},V.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==n){var i=t.canvas,a=t.height,r=t.width;i.height=a*n,i.width=r*n,t.ctx.scale(n,n),i.style.height||i.style.width||(i.style.height=a+"px",i.style.width=r+"px")}},V.fontString=function(t,e,n){return e+" "+t+"px "+n},V.longestText=function(t,e,n,i){var a=(i=i||{}).data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(a=i.data={},r=i.garbageCollect=[],i.font=e),t.font=e;var o,s,l,u,d,h=0,c=n.length;for(o=0;on.length){for(o=0;oi&&(i=r),i},V.numberOfLabelLines=function(t){var e=1;return V.each(t,(function(t){V.isArray(t)&&t.length>e&&(e=t.length)})),e},V.color=k?function(t){return t instanceof CanvasGradient&&(t=z.global.defaultColor),k(t)}:function(t){return console.error("Color.js not found!"),t},V.getHoverColor=function(t){return t instanceof CanvasPattern||t instanceof CanvasGradient?t:V.color(t).saturate(.5).darken(.1).rgbString()}}(),tn._adapters=an,tn.Animation=Z,tn.animationService=$,tn.controllers=$t,tn.DatasetController=nt,tn.defaults=z,tn.Element=X,tn.elements=_t,tn.Interaction=ae,tn.layouts=ge,tn.platform=Fe,tn.plugins=Le,tn.Scale=xn,tn.scaleService=Oe,tn.Ticks=rn,tn.Tooltip=Ue,tn.helpers.each(ci,(function(t,e){tn.scaleService.registerScaleType(e,t,t._defaults)})),Li)Li.hasOwnProperty(Ni)&&tn.plugins.register(Li[Ni]);tn.platform.initialize();var Bi=tn;return"undefined"!=typeof window&&(window.Chart=tn),tn.Chart=tn,tn.Legend=Li.legend._element,tn.Title=Li.title._element,tn.pluginService=tn.plugins,tn.PluginBase=tn.Element.extend({}),tn.canvasHelpers=tn.helpers.canvas,tn.layoutService=tn.layouts,tn.LinearScaleBase=Sn,tn.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],(function(t){tn[t]=function(e,n){return new tn(e,tn.helpers.merge(n||{},{type:t.charAt(0).toLowerCase()+t.slice(1)}))}})),Bi})); diff --git a/src/static/js/chart.bundle-2.9.3.min.js b/src/static/js/chart.bundle-2.9.3.min.js new file mode 100644 index 0000000..55d9eb0 --- /dev/null +++ b/src/static/js/chart.bundle-2.9.3.min.js @@ -0,0 +1,7 @@ +/*! + * Chart.js v2.9.3 + * https://www.chartjs.org + * (c) 2019 Chart.js Contributors + * Released under the MIT License + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Chart=e()}(this,(function(){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function t(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},i=e((function(t){var e={};for(var i in n)n.hasOwnProperty(i)&&(e[n[i]]=i);var a=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var r in a)if(a.hasOwnProperty(r)){if(!("channels"in a[r]))throw new Error("missing channels property: "+r);if(!("labels"in a[r]))throw new Error("missing channel labels property: "+r);if(a[r].labels.length!==a[r].channels)throw new Error("channel and label counts mismatch: "+r);var o=a[r].channels,s=a[r].labels;delete a[r].channels,delete a[r].labels,Object.defineProperty(a[r],"channels",{value:o}),Object.defineProperty(a[r],"labels",{value:s})}a.rgb.hsl=function(t){var e,n,i=t[0]/255,a=t[1]/255,r=t[2]/255,o=Math.min(i,a,r),s=Math.max(i,a,r),l=s-o;return s===o?e=0:i===s?e=(a-r)/l:a===s?e=2+(r-i)/l:r===s&&(e=4+(i-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),n=(o+s)/2,[e,100*(s===o?0:n<=.5?l/(s+o):l/(2-s-o)),100*n]},a.rgb.hsv=function(t){var e,n,i,a,r,o=t[0]/255,s=t[1]/255,l=t[2]/255,u=Math.max(o,s,l),d=u-Math.min(o,s,l),h=function(t){return(u-t)/6/d+.5};return 0===d?a=r=0:(r=d/u,e=h(o),n=h(s),i=h(l),o===u?a=i-n:s===u?a=1/3+e-i:l===u&&(a=2/3+n-e),a<0?a+=1:a>1&&(a-=1)),[360*a,100*r,100*u]},a.rgb.hwb=function(t){var e=t[0],n=t[1],i=t[2];return[a.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(n,i))),100*(i=1-1/255*Math.max(e,Math.max(n,i)))]},a.rgb.cmyk=function(t){var e,n=t[0]/255,i=t[1]/255,a=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-i,1-a)))/(1-e)||0),100*((1-i-e)/(1-e)||0),100*((1-a-e)/(1-e)||0),100*e]},a.rgb.keyword=function(t){var i=e[t];if(i)return i;var a,r,o,s=1/0;for(var l in n)if(n.hasOwnProperty(l)){var u=n[l],d=(r=t,o=u,Math.pow(r[0]-o[0],2)+Math.pow(r[1]-o[1],2)+Math.pow(r[2]-o[2],2));d.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)),100*(.2126*e+.7152*n+.0722*i),100*(.0193*e+.1192*n+.9505*i)]},a.rgb.lab=function(t){var e=a.rgb.xyz(t),n=e[0],i=e[1],r=e[2];return i/=100,r/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(n-i),200*(i-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},a.hsl.rgb=function(t){var e,n,i,a,r,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[r=255*l,r,r];e=2*l-(n=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var u=0;u<3;u++)(i=o+1/3*-(u-1))<0&&i++,i>1&&i--,r=6*i<1?e+6*(n-e)*i:2*i<1?n:3*i<2?e+(n-e)*(2/3-i)*6:e,a[u]=255*r;return a},a.hsl.hsv=function(t){var e=t[0],n=t[1]/100,i=t[2]/100,a=n,r=Math.max(i,.01);return n*=(i*=2)<=1?i:2-i,a*=r<=1?r:2-r,[e,100*(0===i?2*a/(r+a):2*n/(i+n)),100*((i+n)/2)]},a.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,i=t[2]/100,a=Math.floor(e)%6,r=e-Math.floor(e),o=255*i*(1-n),s=255*i*(1-n*r),l=255*i*(1-n*(1-r));switch(i*=255,a){case 0:return[i,l,o];case 1:return[s,i,o];case 2:return[o,i,l];case 3:return[o,s,i];case 4:return[l,o,i];case 5:return[i,o,s]}},a.hsv.hsl=function(t){var e,n,i,a=t[0],r=t[1]/100,o=t[2]/100,s=Math.max(o,.01);return i=(2-r)*o,n=r*s,[a,100*(n=(n/=(e=(2-r)*s)<=1?e:2-e)||0),100*(i/=2)]},a.hwb.rgb=function(t){var e,n,i,a,r,o,s,l=t[0]/360,u=t[1]/100,d=t[2]/100,h=u+d;switch(h>1&&(u/=h,d/=h),i=6*l-(e=Math.floor(6*l)),0!=(1&e)&&(i=1-i),a=u+i*((n=1-d)-u),e){default:case 6:case 0:r=n,o=a,s=u;break;case 1:r=a,o=n,s=u;break;case 2:r=u,o=n,s=a;break;case 3:r=u,o=a,s=n;break;case 4:r=a,o=u,s=n;break;case 5:r=n,o=u,s=a}return[255*r,255*o,255*s]},a.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,i=t[2]/100,a=t[3]/100;return[255*(1-Math.min(1,e*(1-a)+a)),255*(1-Math.min(1,n*(1-a)+a)),255*(1-Math.min(1,i*(1-a)+a))]},a.xyz.rgb=function(t){var e,n,i,a=t[0]/100,r=t[1]/100,o=t[2]/100;return n=-.9689*a+1.8758*r+.0415*o,i=.0557*a+-.204*r+1.057*o,e=(e=3.2406*a+-1.5372*r+-.4986*o)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(i=Math.min(Math.max(0,i),1))]},a.xyz.lab=function(t){var e=t[0],n=t[1],i=t[2];return n/=100,i/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.lab.xyz=function(t){var e,n,i,a=t[0];e=t[1]/500+(n=(a+16)/116),i=n-t[2]/200;var r=Math.pow(n,3),o=Math.pow(e,3),s=Math.pow(i,3);return n=r>.008856?r:(n-16/116)/7.787,e=o>.008856?o:(e-16/116)/7.787,i=s>.008856?s:(i-16/116)/7.787,[e*=95.047,n*=100,i*=108.883]},a.lab.lch=function(t){var e,n=t[0],i=t[1],a=t[2];return(e=360*Math.atan2(a,i)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(i*i+a*a),e]},a.lch.lab=function(t){var e,n=t[0],i=t[1];return e=t[2]/360*2*Math.PI,[n,i*Math.cos(e),i*Math.sin(e)]},a.rgb.ansi16=function(t){var e=t[0],n=t[1],i=t[2],r=1 in arguments?arguments[1]:a.rgb.hsv(t)[2];if(0===(r=Math.round(r/50)))return 30;var o=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===r&&(o+=60),o},a.hsv.ansi16=function(t){return a.rgb.ansi16(a.hsv.rgb(t),t[2])},a.rgb.ansi256=function(t){var e=t[0],n=t[1],i=t[2];return e===n&&n===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)},a.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},a.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},a.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},a.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];3===e[0].length&&(n=n.split("").map((function(t){return t+t})).join(""));var i=parseInt(n,16);return[i>>16&255,i>>8&255,255&i]},a.rgb.hcg=function(t){var e,n=t[0]/255,i=t[1]/255,a=t[2]/255,r=Math.max(Math.max(n,i),a),o=Math.min(Math.min(n,i),a),s=r-o;return e=s<=0?0:r===n?(i-a)/s%6:r===i?2+(a-n)/s:4+(n-i)/s+4,e/=6,[360*(e%=1),100*s,100*(s<1?o/(1-s):0)]},a.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=1,a=0;return(i=n<.5?2*e*n:2*e*(1-n))<1&&(a=(n-.5*i)/(1-i)),[t[0],100*i,100*a]},a.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=e*n,a=0;return i<1&&(a=(n-i)/(1-i)),[t[0],100*i,100*a]},a.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,i=t[2]/100;if(0===n)return[255*i,255*i,255*i];var a,r=[0,0,0],o=e%1*6,s=o%1,l=1-s;switch(Math.floor(o)){case 0:r[0]=1,r[1]=s,r[2]=0;break;case 1:r[0]=l,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=s;break;case 3:r[0]=0,r[1]=l,r[2]=1;break;case 4:r[0]=s,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=l}return a=(1-n)*i,[255*(n*r[0]+a),255*(n*r[1]+a),255*(n*r[2]+a)]},a.hcg.hsv=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e),i=0;return n>0&&(i=e/n),[t[0],100*i,100*n]},a.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],100*i,100*n]},a.hcg.hwb=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},a.hwb.hcg=function(t){var e=t[1]/100,n=1-t[2]/100,i=n-e,a=0;return i<1&&(a=(n-i)/(1-i)),[t[0],100*i,100*a]},a.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},a.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},a.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},a.gray.hsl=a.gray.hsv=function(t){return[0,0,t[0]]},a.gray.hwb=function(t){return[0,100,t[0]]},a.gray.cmyk=function(t){return[0,0,0,t[0]]},a.gray.lab=function(t){return[t[0],0,0]},a.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},a.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}}));i.rgb,i.hsl,i.hsv,i.hwb,i.cmyk,i.xyz,i.lab,i.lch,i.hex,i.keyword,i.ansi16,i.ansi256,i.hcg,i.apple,i.gray;function a(t){var e=function(){for(var t={},e=Object.keys(i),n=e.length,a=0;a1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"==typeof n)for(var i=n.length,a=0;a1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(i)}))}));var l=s,u={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},d={getRgba:h,getHsla:c,getRgb:function(t){var e=h(t);return e&&e.slice(0,3)},getHsl:function(t){var e=c(t);return e&&e.slice(0,3)},getHwb:f,getAlpha:function(t){var e=h(t);if(e)return e[3];if(e=c(t))return e[3];if(e=f(t))return e[3]},hexString:function(t,e){e=void 0!==e&&3===t.length?e:t[3];return"#"+b(t[0])+b(t[1])+b(t[2])+(e>=0&&e<1?b(Math.round(255*e)):"")},rgbString:function(t,e){if(e<1||t[3]&&t[3]<1)return g(t,e);return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:g,percentString:function(t,e){if(e<1||t[3]&&t[3]<1)return m(t,e);var n=Math.round(t[0]/255*100),i=Math.round(t[1]/255*100),a=Math.round(t[2]/255*100);return"rgb("+n+"%, "+i+"%, "+a+"%)"},percentaString:m,hslString:function(t,e){if(e<1||t[3]&&t[3]<1)return p(t,e);return"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:p,hwbString:function(t,e){void 0===e&&(e=void 0!==t[3]?t[3]:1);return"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"},keyword:function(t){return y[t.slice(0,3)]}};function h(t){if(t){var e=[0,0,0],n=1,i=t.match(/^#([a-fA-F0-9]{3,4})$/i),a="";if(i){a=(i=i[1])[3];for(var r=0;rn?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=t,i=void 0===e?.5:e,a=2*i-1,r=this.alpha()-n.alpha(),o=((a*r==-1?a:(a+r)/(1+a*r))+1)/2,s=1-o;return this.rgb(o*this.red()+s*n.red(),o*this.green()+s*n.green(),o*this.blue()+s*n.blue()).alpha(this.alpha()*i+n.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new _,i=this.values,a=n.values;for(var r in i)i.hasOwnProperty(r)&&(t=i[r],"[object Array]"===(e={}.toString.call(t))?a[r]=t.slice(0):"[object Number]"===e?a[r]=t:console.error("unexpected color value:",t));return n}},_.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},_.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},_.prototype.getValues=function(t){for(var e=this.values,n={},i=0;i=0;a--)e.call(n,t[a],a);else for(a=0;a=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n))},easeOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:2==(t/=.5)?1:(n||(n=.45),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),t<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-D.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*D.easeInBounce(2*t):.5*D.easeOutBounce(2*t-1)+.5}},C={effects:D};S.easingEffects=D;var P=Math.PI,T=P/180,O=2*P,A=P/2,F=P/4,I=2*P/3,L={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,n,i,a,r){if(r){var o=Math.min(r,a/2,i/2),s=e+o,l=n+o,u=e+i-o,d=n+a-o;t.moveTo(e,l),se.left-1e-6&&t.xe.top-1e-6&&t.y0&&this.requestAnimationFrame()},advance:function(){for(var t,e,n,i,a=this.animations,r=0;r=n?(H.callback(t.onAnimationComplete,[t],e),e.animating=!1,a.splice(r,1)):++r}},Q=H.options.resolve,tt=["push","pop","shift","splice","unshift"];function et(t,e){var n=t._chartjs;if(n){var i=n.listeners,a=i.indexOf(e);-1!==a&&i.splice(a,1),i.length>0||(tt.forEach((function(e){delete t[e]})),delete t._chartjs)}}var nt=function(t,e){this.initialize(t,e)};H.extend(nt.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(t){this.index=t},linkScales:function(){var t=this.getMeta(),e=this.chart,n=e.scales,i=this.getDataset(),a=e.options.scales;null!==t.xAxisID&&t.xAxisID in n&&!i.xAxisID||(t.xAxisID=i.xAxisID||a.xAxes[0].id),null!==t.yAxisID&&t.yAxisID in n&&!i.yAxisID||(t.yAxisID=i.yAxisID||a.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this._update(!0)},destroy:function(){this._data&&et(this._data,this)},createMetaDataset:function(){var t=this.datasetElementType;return t&&new t({_chart:this.chart,_datasetIndex:this.index})},createMetaData:function(t){var e=this.dataElementType;return e&&new e({_chart:this.chart,_datasetIndex:this.index,_index:t})},addElements:function(){var t,e,n=this.getMeta(),i=this.getDataset().data||[],a=n.data;for(t=0,e=i.length;tn&&this.insertElements(n,i-n)},insertElements:function(t,e){for(var n=0;na?(r=a/e.innerRadius,t.arc(o,s,e.innerRadius-a,i+r,n-r,!0)):t.arc(o,s,a,i+Math.PI/2,n-Math.PI/2),t.closePath(),t.clip()}function ot(t,e,n){var i="inner"===e.borderAlign;i?(t.lineWidth=2*e.borderWidth,t.lineJoin="round"):(t.lineWidth=e.borderWidth,t.lineJoin="bevel"),n.fullCircles&&function(t,e,n,i){var a,r=n.endAngle;for(i&&(n.endAngle=n.startAngle+at,rt(t,n),n.endAngle=r,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=at,n.fullCircles--)),t.beginPath(),t.arc(n.x,n.y,n.innerRadius,n.startAngle+at,n.startAngle,!0),a=0;as;)a-=at;for(;a=o&&a<=s,u=r>=n.innerRadius&&r<=n.outerRadius;return l&&u}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,n=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,n=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},draw:function(){var t,e=this._chart.ctx,n=this._view,i="inner"===n.borderAlign?.33:0,a={x:n.x,y:n.y,innerRadius:n.innerRadius,outerRadius:Math.max(n.outerRadius-i,0),pixelMargin:i,startAngle:n.startAngle,endAngle:n.endAngle,fullCircles:Math.floor(n.circumference/at)};if(e.save(),e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,a.fullCircles){for(a.endAngle=a.startAngle+at,e.beginPath(),e.arc(a.x,a.y,a.outerRadius,a.startAngle,a.endAngle),e.arc(a.x,a.y,a.innerRadius,a.endAngle,a.startAngle,!0),e.closePath(),t=0;tt.x&&(e=bt(e,"left","right")):t.basen?n:i,r:l.right||a<0?0:a>e?e:a,b:l.bottom||r<0?0:r>n?n:r,l:l.left||o<0?0:o>e?e:o}}function xt(t,e,n){var i=null===e,a=null===n,r=!(!t||i&&a)&&vt(t);return r&&(i||e>=r.left&&e<=r.right)&&(a||n>=r.top&&n<=r.bottom)}W._set("global",{elements:{rectangle:{backgroundColor:mt,borderColor:mt,borderSkipped:"bottom",borderWidth:0}}});var _t=$.extend({_type:"rectangle",draw:function(){var t=this._chart.ctx,e=this._view,n=function(t){var e=vt(t),n=e.right-e.left,i=e.bottom-e.top,a=yt(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i},inner:{x:e.left+a.l,y:e.top+a.t,w:n-a.l-a.r,h:i-a.t-a.b}}}(e),i=n.outer,a=n.inner;t.fillStyle=e.backgroundColor,t.fillRect(i.x,i.y,i.w,i.h),i.w===a.w&&i.h===a.h||(t.save(),t.beginPath(),t.rect(i.x,i.y,i.w,i.h),t.clip(),t.fillStyle=e.borderColor,t.rect(a.x,a.y,a.w,a.h),t.fill("evenodd"),t.restore())},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){return xt(this._view,t,e)},inLabelRange:function(t,e){var n=this._view;return pt(n)?xt(n,t,null):xt(n,null,e)},inXRange:function(t){return xt(this._view,t,null)},inYRange:function(t){return xt(this._view,null,t)},getCenterPoint:function(){var t,e,n=this._view;return pt(n)?(t=n.x,e=(n.y+n.base)/2):(t=(n.x+n.base)/2,e=n.y),{x:t,y:e}},getArea:function(){var t=this._view;return pt(t)?t.width*Math.abs(t.y-t.base):t.height*Math.abs(t.x-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}}),wt={},kt=st,Mt=dt,St=gt,Dt=_t;wt.Arc=kt,wt.Line=Mt,wt.Point=St,wt.Rectangle=Dt;var Ct=H._deprecated,Pt=H.valueOrDefault;function Tt(t,e,n){var i,a,r=n.barThickness,o=e.stackCount,s=e.pixels[t],l=H.isNullOrUndef(r)?function(t,e){var n,i,a,r,o=t._length;for(a=1,r=e.length;a0?Math.min(o,Math.abs(i-n)):o,n=i;return o}(e.scale,e.pixels):-1;return H.isNullOrUndef(r)?(i=l*n.categoryPercentage,a=n.barPercentage):(i=r*o,a=1),{chunk:i/o,ratio:a,start:s-i/2}}W._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),W._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});var Ot=it.extend({dataElementType:wt.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var t,e,n=this;it.prototype.initialize.apply(n,arguments),(t=n.getMeta()).stack=n.getDataset().stack,t.bar=!0,e=n._getIndexScale().options,Ct("bar chart",e.barPercentage,"scales.[x/y]Axes.barPercentage","dataset.barPercentage"),Ct("bar chart",e.barThickness,"scales.[x/y]Axes.barThickness","dataset.barThickness"),Ct("bar chart",e.categoryPercentage,"scales.[x/y]Axes.categoryPercentage","dataset.categoryPercentage"),Ct("bar chart",n._getValueScale().options.minBarLength,"scales.[x/y]Axes.minBarLength","dataset.minBarLength"),Ct("bar chart",e.maxBarThickness,"scales.[x/y]Axes.maxBarThickness","dataset.maxBarThickness")},update:function(t){var e,n,i=this.getMeta().data;for(this._ruler=this.getRuler(),e=0,n=i.length;e=0&&m.min>=0?m.min:m.max,x=void 0===m.start?m.end:m.max>=0&&m.min>=0?m.max-m.min:m.min-m.max,_=g.length;if(v||void 0===v&&void 0!==b)for(i=0;i<_&&(a=g[i]).index!==t;++i)a.stack===b&&(r=void 0===(u=h._parseValue(f[a.index].data[e])).start?u.end:u.min>=0&&u.max>=0?u.max:u.min,(m.min<0&&r<0||m.max>=0&&r>0)&&(y+=r));return o=h.getPixelForValue(y),l=(s=h.getPixelForValue(y+x))-o,void 0!==p&&Math.abs(l)=0&&!c||x<0&&c?o-p:o+p),{size:l,base:o,head:s,center:s+l/2}},calculateBarIndexPixels:function(t,e,n,i){var a="flex"===i.barThickness?function(t,e,n){var i,a=e.pixels,r=a[t],o=t>0?a[t-1]:null,s=t=Rt?-Nt:b<-Rt?Nt:0)+p,x=Math.cos(b),_=Math.sin(b),w=Math.cos(y),k=Math.sin(y),M=b<=0&&y>=0||y>=Nt,S=b<=Wt&&y>=Wt||y>=Nt+Wt,D=b<=-Wt&&y>=-Wt||y>=Rt+Wt,C=b===-Rt||y>=Rt?-1:Math.min(x,x*m,w,w*m),P=D?-1:Math.min(_,_*m,k,k*m),T=M?1:Math.max(x,x*m,w,w*m),O=S?1:Math.max(_,_*m,k,k*m);u=(T-C)/2,d=(O-P)/2,h=-(T+C)/2,c=-(O+P)/2}for(i=0,a=g.length;i0&&!isNaN(t)?Nt*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){var e,n,i,a,r,o,s,l,u=0,d=this.chart;if(!t)for(e=0,n=d.data.datasets.length;e(u=s>u?s:u)?l:u);return u},setHoverStyle:function(t){var e=t._model,n=t._options,i=H.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=Lt(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=Lt(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=Lt(n.hoverBorderWidth,n.borderWidth)},_getRingWeightOffset:function(t){for(var e=0,n=0;n0&&Ht(l[t-1]._model,s)&&(n.controlPointPreviousX=u(n.controlPointPreviousX,s.left,s.right),n.controlPointPreviousY=u(n.controlPointPreviousY,s.top,s.bottom)),t0&&(r=t.getDatasetMeta(r[0]._datasetIndex).data),r},"x-axis":function(t,e){return ae(t,e,{intersect:!1})},point:function(t,e){return ee(t,Qt(e,t))},nearest:function(t,e,n){var i=Qt(e,t);n.axis=n.axis||"xy";var a=ie(n.axis);return ne(t,i,n.intersect,a)},x:function(t,e,n){var i=Qt(e,t),a=[],r=!1;return te(t,(function(t){t.inXRange(i.x)&&a.push(t),t.inRange(i.x,i.y)&&(r=!0)})),n.intersect&&!r&&(a=[]),a},y:function(t,e,n){var i=Qt(e,t),a=[],r=!1;return te(t,(function(t){t.inYRange(i.y)&&a.push(t),t.inRange(i.x,i.y)&&(r=!0)})),n.intersect&&!r&&(a=[]),a}}},oe=H.extend;function se(t,e){return H.where(t,(function(t){return t.pos===e}))}function le(t,e){return t.sort((function(t,n){var i=e?n:t,a=e?t:n;return i.weight===a.weight?i.index-a.index:i.weight-a.weight}))}function ue(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function de(t,e,n){var i,a,r=n.box,o=t.maxPadding;if(n.size&&(t[n.pos]-=n.size),n.size=n.horizontal?r.height:r.width,t[n.pos]+=n.size,r.getPadding){var s=r.getPadding();o.top=Math.max(o.top,s.top),o.left=Math.max(o.left,s.left),o.bottom=Math.max(o.bottom,s.bottom),o.right=Math.max(o.right,s.right)}if(i=e.outerWidth-ue(o,t,"left","right"),a=e.outerHeight-ue(o,t,"top","bottom"),i!==t.w||a!==t.h)return t.w=i,t.h=a,n.horizontal?i!==t.w:a!==t.h}function he(t,e){var n=e.maxPadding;function i(t){var i={left:0,top:0,right:0,bottom:0};return t.forEach((function(t){i[t]=Math.max(e[t],n[t])})),i}return i(t?["left","right"]:["top","bottom"])}function ce(t,e,n){var i,a,r,o,s,l,u=[];for(i=0,a=t.length;idiv{position:absolute;width:1000000px;height:1000000px;left:0;top:0}.chartjs-size-monitor-shrink>div{position:absolute;width:200%;height:200%;left:0;top:0}"}))&&ge.default||ge,ve="$chartjs",be="chartjs-size-monitor",ye="chartjs-render-monitor",xe="chartjs-render-animation",_e=["animationstart","webkitAnimationStart"],we={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function ke(t,e){var n=H.getStyle(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?Number(i[1]):void 0}var Me=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}()&&{passive:!0};function Se(t,e,n){t.addEventListener(e,n,Me)}function De(t,e,n){t.removeEventListener(e,n,Me)}function Ce(t,e,n,i,a){return{type:t,chart:e,native:a||null,x:void 0!==n?n:null,y:void 0!==i?i:null}}function Pe(t){var e=document.createElement("div");return e.className=t||"",e}function Te(t,e,n){var i,a,r,o,s=t[ve]||(t[ve]={}),l=s.resizer=function(t){var e=Pe(be),n=Pe(be+"-expand"),i=Pe(be+"-shrink");n.appendChild(Pe()),i.appendChild(Pe()),e.appendChild(n),e.appendChild(i),e._reset=function(){n.scrollLeft=1e6,n.scrollTop=1e6,i.scrollLeft=1e6,i.scrollTop=1e6};var a=function(){e._reset(),t()};return Se(n,"scroll",a.bind(n,"expand")),Se(i,"scroll",a.bind(i,"shrink")),e}((i=function(){if(s.resizer){var i=n.options.maintainAspectRatio&&t.parentNode,a=i?i.clientWidth:0;e(Ce("resize",n)),i&&i.clientWidth0){var r=t[0];r.label?n=r.label:r.xLabel?n=r.xLabel:a>0&&r.index-1?t.split("\n"):t}function Ve(t){var e=W.global;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,rtl:t.rtl,textDirection:t.textDirection,bodyFontColor:t.bodyFontColor,_bodyFontFamily:Ne(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:Ne(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:Ne(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:Ne(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:Ne(t.titleFontStyle,e.defaultFontStyle),titleFontSize:Ne(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:Ne(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:Ne(t.footerFontStyle,e.defaultFontStyle),footerFontSize:Ne(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}function He(t,e){return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-t.xPadding:t.x+t.xPadding}function Be(t){return ze([],Ee(t))}var je=$.extend({initialize:function(){this._model=Ve(this._options),this._lastActive=[]},getTitle:function(){var t=this,e=t._options,n=e.callbacks,i=n.beforeTitle.apply(t,arguments),a=n.title.apply(t,arguments),r=n.afterTitle.apply(t,arguments),o=[];return o=ze(o,Ee(i)),o=ze(o,Ee(a)),o=ze(o,Ee(r))},getBeforeBody:function(){return Be(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(t,e){var n=this,i=n._options.callbacks,a=[];return H.each(t,(function(t){var r={before:[],lines:[],after:[]};ze(r.before,Ee(i.beforeLabel.call(n,t,e))),ze(r.lines,i.label.call(n,t,e)),ze(r.after,Ee(i.afterLabel.call(n,t,e))),a.push(r)})),a},getAfterBody:function(){return Be(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var t=this,e=t._options.callbacks,n=e.beforeFooter.apply(t,arguments),i=e.footer.apply(t,arguments),a=e.afterFooter.apply(t,arguments),r=[];return r=ze(r,Ee(n)),r=ze(r,Ee(i)),r=ze(r,Ee(a))},update:function(t){var e,n,i,a,r,o,s,l,u,d,h=this,c=h._options,f=h._model,g=h._model=Ve(c),m=h._active,p=h._data,v={xAlign:f.xAlign,yAlign:f.yAlign},b={x:f.x,y:f.y},y={width:f.width,height:f.height},x={x:f.caretX,y:f.caretY};if(m.length){g.opacity=1;var _=[],w=[];x=Ye[c.position].call(h,m,h._eventPosition);var k=[];for(e=0,n=m.length;ei.width&&(a=i.width-e.width),a<0&&(a=0)),"top"===d?r+=h:r-="bottom"===d?e.height+h:e.height/2,"center"===d?"left"===u?a+=h:"right"===u&&(a-=h):"left"===u?a-=c:"right"===u&&(a+=c),{x:a,y:r}}(g,y,v=function(t,e){var n,i,a,r,o,s=t._model,l=t._chart,u=t._chart.chartArea,d="center",h="center";s.yl.height-e.height&&(h="bottom");var c=(u.left+u.right)/2,f=(u.top+u.bottom)/2;"center"===h?(n=function(t){return t<=c},i=function(t){return t>c}):(n=function(t){return t<=e.width/2},i=function(t){return t>=l.width-e.width/2}),a=function(t){return t+e.width+s.caretSize+s.caretPadding>l.width},r=function(t){return t-e.width-s.caretSize-s.caretPadding<0},o=function(t){return t<=f?"top":"bottom"},n(s.x)?(d="left",a(s.x)&&(d="center",h=o(s.y))):i(s.x)&&(d="right",r(s.x)&&(d="center",h=o(s.y)));var g=t._options;return{xAlign:g.xAlign?g.xAlign:d,yAlign:g.yAlign?g.yAlign:h}}(this,y),h._chart)}else g.opacity=0;return g.xAlign=v.xAlign,g.yAlign=v.yAlign,g.x=b.x,g.y=b.y,g.width=y.width,g.height=y.height,g.caretX=x.x,g.caretY=x.y,h._model=g,t&&c.custom&&c.custom.call(h,g),h},drawCaret:function(t,e){var n=this._chart.ctx,i=this._view,a=this.getCaretPosition(t,e,i);n.lineTo(a.x1,a.y1),n.lineTo(a.x2,a.y2),n.lineTo(a.x3,a.y3)},getCaretPosition:function(t,e,n){var i,a,r,o,s,l,u=n.caretSize,d=n.cornerRadius,h=n.xAlign,c=n.yAlign,f=t.x,g=t.y,m=e.width,p=e.height;if("center"===c)s=g+p/2,"left"===h?(a=(i=f)-u,r=i,o=s+u,l=s-u):(a=(i=f+m)+u,r=i,o=s-u,l=s+u);else if("left"===h?(i=(a=f+d+u)-u,r=a+u):"right"===h?(i=(a=f+m-d-u)-u,r=a+u):(i=(a=n.caretX)-u,r=a+u),"top"===c)s=(o=g)-u,l=o;else{s=(o=g+p)+u,l=o;var v=r;r=i,i=v}return{x1:i,x2:a,x3:r,y1:o,y2:s,y3:l}},drawTitle:function(t,e,n){var i,a,r,o=e.title,s=o.length;if(s){var l=We(e.rtl,e.x,e.width);for(t.x=He(e,e._titleAlign),n.textAlign=l.textAlign(e._titleAlign),n.textBaseline="middle",i=e.titleFontSize,a=e.titleSpacing,n.fillStyle=e.titleFontColor,n.font=H.fontString(i,e._titleFontStyle,e._titleFontFamily),r=0;r0&&n.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},i={x:e.x,y:e.y},a=Math.abs(e.opacity<.001)?0:e.opacity,r=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;this._options.enabled&&r&&(t.save(),t.globalAlpha=a,this.drawBackground(i,e,t,n),i.y+=e.yPadding,H.rtl.overrideTextDirection(t,e.textDirection),this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),H.rtl.restoreTextDirection(t,e.textDirection),t.restore())}},handleEvent:function(t){var e,n=this,i=n._options;return n._lastActive=n._lastActive||[],"mouseout"===t.type?n._active=[]:(n._active=n._chart.getElementsAtEventForMode(t,i.mode,i),i.reverse&&n._active.reverse()),(e=!H.arrayEquals(n._active,n._lastActive))&&(n._lastActive=n._active,(i.enabled||i.custom)&&(n._eventPosition={x:t.x,y:t.y},n.update(!0),n.pivot())),e}}),Ue=Ye,Ge=je;Ge.positioners=Ue;var qe=H.valueOrDefault;function Ze(){return H.merge({},[].slice.call(arguments),{merger:function(t,e,n,i){if("xAxes"===t||"yAxes"===t){var a,r,o,s=n[t].length;for(e[t]||(e[t]=[]),a=0;a=e[t].length&&e[t].push({}),!e[t][a].type||o.type&&o.type!==e[t][a].type?H.merge(e[t][a],[Re.getScaleDefaults(r),o]):H.merge(e[t][a],o)}else H._merger(t,e,n,i)}})}function $e(){return H.merge({},[].slice.call(arguments),{merger:function(t,e,n,i){var a=e[t]||{},r=n[t];"scales"===t?e[t]=Ze(a,r):"scale"===t?e[t]=H.merge(a,[Re.getScaleDefaults(r.type),r]):H._merger(t,e,n,i)}})}function Xe(t){var e=t.options;H.each(t.scales,(function(e){me.removeBox(t,e)})),e=$e(W.global,W[t.config.type],e),t.options=t.config.options=e,t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.tooltip._options=e.tooltips,t.tooltip.initialize()}function Ke(t,e,n){var i,a=function(t){return t.id===i};do{i=e+n++}while(H.findIndex(t,a)>=0);return i}function Je(t){return"top"===t||"bottom"===t}function Qe(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}W._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var tn=function(t,e){return this.construct(t,e),this};H.extend(tn.prototype,{construct:function(t,e){var n=this;e=function(t){var e=(t=t||{}).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=$e(W.global,W[t.type],t.options||{}),t}(e);var i=Ie.acquireContext(t,e),a=i&&i.canvas,r=a&&a.height,o=a&&a.width;n.id=H.uid(),n.ctx=i,n.canvas=a,n.config=e,n.width=o,n.height=r,n.aspectRatio=r?o/r:null,n.options=e.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,tn.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(t){n.config.data=t}}),i&&a?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return Le.notify(t,"beforeInit"),H.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.initToolTip(),Le.notify(t,"afterInit"),t},clear:function(){return H.canvas.clear(this),this},stop:function(){return J.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,i=e.canvas,a=n.maintainAspectRatio&&e.aspectRatio||null,r=Math.max(0,Math.floor(H.getMaximumWidth(i))),o=Math.max(0,Math.floor(a?r/a:H.getMaximumHeight(i)));if((e.width!==r||e.height!==o)&&(i.width=e.width=r,i.height=e.height=o,i.style.width=r+"px",i.style.height=o+"px",H.retinaScale(e,n.devicePixelRatio),!t)){var s={width:r,height:o};Le.notify(e,"resize",[s]),n.onResize&&n.onResize(e,s),e.stop(),e.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;H.each(e.xAxes,(function(t,n){t.id||(t.id=Ke(e.xAxes,"x-axis-",n))})),H.each(e.yAxes,(function(t,n){t.id||(t.id=Ke(e.yAxes,"y-axis-",n))})),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var t=this,e=t.options,n=t.scales||{},i=[],a=Object.keys(n).reduce((function(t,e){return t[e]=!1,t}),{});e.scales&&(i=i.concat((e.scales.xAxes||[]).map((function(t){return{options:t,dtype:"category",dposition:"bottom"}})),(e.scales.yAxes||[]).map((function(t){return{options:t,dtype:"linear",dposition:"left"}})))),e.scale&&i.push({options:e.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),H.each(i,(function(e){var i=e.options,r=i.id,o=qe(i.type,e.dtype);Je(i.position)!==Je(e.dposition)&&(i.position=e.dposition),a[r]=!0;var s=null;if(r in n&&n[r].type===o)(s=n[r]).options=i,s.ctx=t.ctx,s.chart=t;else{var l=Re.getScaleConstructor(o);if(!l)return;s=new l({id:r,type:o,options:i,ctx:t.ctx,chart:t}),n[s.id]=s}s.mergeTicksOptions(),e.isDefault&&(t.scale=s)})),H.each(a,(function(t,e){t||delete n[e]})),t.scales=n,Re.addScalesToLayout(this)},buildOrUpdateControllers:function(){var t,e,n=this,i=[],a=n.data.datasets;for(t=0,e=a.length;t=0;--n)this.drawDataset(e[n],t);Le.notify(this,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n={meta:t,index:t.index,easingValue:e};!1!==Le.notify(this,"beforeDatasetDraw",[n])&&(t.controller.draw(e),Le.notify(this,"afterDatasetDraw",[n]))},_drawTooltip:function(t){var e=this.tooltip,n={tooltip:e,easingValue:t};!1!==Le.notify(this,"beforeTooltipDraw",[n])&&(e.draw(),Le.notify(this,"afterTooltipDraw",[n]))},getElementAtEvent:function(t){return re.modes.single(this,t)},getElementsAtEvent:function(t){return re.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return re.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var i=re.modes[e];return"function"==typeof i?i(this,t,n):[]},getDatasetAtEvent:function(t){return re.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this.data.datasets[t];e._meta||(e._meta={});var n=e._meta[this.id];return n||(n=e._meta[this.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e.order||0,index:t}),n},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e3?n[2]-n[1]:n[1]-n[0];Math.abs(i)>1&&t!==Math.floor(t)&&(i=t-Math.floor(t));var a=H.log10(Math.abs(i)),r="";if(0!==t)if(Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]))<1e-4){var o=H.log10(Math.abs(t)),s=Math.floor(o)-Math.floor(a);s=Math.max(Math.min(s,20),0),r=t.toExponential(s)}else{var l=-1*Math.floor(a);l=Math.max(Math.min(l,20),0),r=t.toFixed(l)}else r="0";return r},logarithmic:function(t,e,n){var i=t/Math.pow(10,Math.floor(H.log10(t)));return 0===t?"0":1===i||2===i||5===i||0===e||e===n.length-1?t.toExponential():""}}},sn=H.isArray,ln=H.isNullOrUndef,un=H.valueOrDefault,dn=H.valueAtIndexOrDefault;function hn(t,e,n){var i,a=t.getTicks().length,r=Math.min(e,a-1),o=t.getPixelForTick(r),s=t._startPixel,l=t._endPixel;if(!(n&&(i=1===a?Math.max(o-s,l-o):0===e?(t.getPixelForTick(1)-o)/2:(o-t.getPixelForTick(r-1))/2,(o+=rl+1e-6)))return o}function cn(t,e,n,i){var a,r,o,s,l,u,d,h,c,f,g,m,p,v=n.length,b=[],y=[],x=[];for(a=0;ae){for(n=0;n=c||d<=1||!s.isHorizontal()?s.labelRotation=h:(e=(t=s._getLabelSizes()).widest.width,n=t.highest.height-t.highest.offset,i=Math.min(s.maxWidth,s.chart.width-e),e+6>(a=l.offset?s.maxWidth/d:i/(d-1))&&(a=i/(d-(l.offset?.5:1)),r=s.maxHeight-fn(l.gridLines)-u.padding-gn(l.scaleLabel),o=Math.sqrt(e*e+n*n),f=H.toDegrees(Math.min(Math.asin(Math.min((t.highest.height+6)/a,1)),Math.asin(Math.min(r/o,1))-Math.asin(n/o))),f=Math.max(h,Math.min(c,f))),s.labelRotation=f)},afterCalculateTickRotation:function(){H.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){H.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},n=t.chart,i=t.options,a=i.ticks,r=i.scaleLabel,o=i.gridLines,s=t._isVisible(),l="bottom"===i.position,u=t.isHorizontal();if(u?e.width=t.maxWidth:s&&(e.width=fn(o)+gn(r)),u?s&&(e.height=fn(o)+gn(r)):e.height=t.maxHeight,a.display&&s){var d=pn(a),h=t._getLabelSizes(),c=h.first,f=h.last,g=h.widest,m=h.highest,p=.4*d.minor.lineHeight,v=a.padding;if(u){var b=0!==t.labelRotation,y=H.toRadians(t.labelRotation),x=Math.cos(y),_=Math.sin(y),w=_*g.width+x*(m.height-(b?m.offset:0))+(b?0:p);e.height=Math.min(t.maxHeight,e.height+w+v);var k,M,S=t.getPixelForTick(0)-t.left,D=t.right-t.getPixelForTick(t.getTicks().length-1);b?(k=l?x*c.width+_*c.offset:_*(c.height-c.offset),M=l?_*(f.height-f.offset):x*f.width+_*f.offset):(k=c.width/2,M=f.width/2),t.paddingLeft=Math.max((k-S)*t.width/(t.width-S),0)+3,t.paddingRight=Math.max((M-D)*t.width/(t.width-D),0)+3}else{var C=a.mirror?0:g.width+v+p;e.width=Math.min(t.maxWidth,e.width+C),t.paddingTop=c.height/2,t.paddingBottom=f.height/2}}t.handleMargins(),u?(t.width=t._length=n.width-t.margins.left-t.margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=n.height-t.margins.top-t.margins.bottom)},handleMargins:function(){var t=this;t.margins&&(t.margins.left=Math.max(t.paddingLeft,t.margins.left),t.margins.top=Math.max(t.paddingTop,t.margins.top),t.margins.right=Math.max(t.paddingRight,t.margins.right),t.margins.bottom=Math.max(t.paddingBottom,t.margins.bottom))},afterFit:function(){H.callback(this.options.afterFit,[this])},isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(ln(t))return NaN;if(("number"==typeof t||t instanceof Number)&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},_convertTicksToLabels:function(t){var e,n,i,a=this;for(a.ticks=t.map((function(t){return t.value})),a.beforeTickToLabelConversion(),e=a.convertTicksToLabels(t)||a.ticks,a.afterTickToLabelConversion(),n=0,i=t.length;nn-1?null:this.getPixelForDecimal(t*i+(e?i/2:0))},getPixelForDecimal:function(t){return this._reversePixels&&(t=1-t),this._startPixel+t*this._length},getDecimalForPixel:function(t){var e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this.min,e=this.max;return this.beginAtZero?0:t<0&&e<0?e:t>0&&e>0?t:0},_autoSkip:function(t){var e,n,i,a,r=this.options.ticks,o=this._length,s=r.maxTicksLimit||o/this._tickSize()+1,l=r.major.enabled?function(t){var e,n,i=[];for(e=0,n=t.length;es)return function(t,e,n){var i,a,r=0,o=e[0];for(n=Math.ceil(n),i=0;iu)return r;return Math.max(u,1)}(l,t,0,s),u>0){for(e=0,n=u-1;e1?(h-d)/(u-1):null,bn(t,i,H.isNullOrUndef(a)?0:d-a,d),bn(t,i,h,H.isNullOrUndef(a)?t.length:h+a),vn(t)}return bn(t,i),vn(t)},_tickSize:function(){var t=this.options.ticks,e=H.toRadians(this.labelRotation),n=Math.abs(Math.cos(e)),i=Math.abs(Math.sin(e)),a=this._getLabelSizes(),r=t.autoSkipPadding||0,o=a?a.widest.width+r:0,s=a?a.highest.height+r:0;return this.isHorizontal()?s*n>o*i?o/n:s/i:s*i=0&&(o=t),void 0!==r&&(t=n.indexOf(r))>=0&&(s=t),e.minIndex=o,e.maxIndex=s,e.min=n[o],e.max=n[s]},buildTicks:function(){var t=this._getLabels(),e=this.minIndex,n=this.maxIndex;this.ticks=0===e&&n===t.length-1?t:t.slice(e,n+1)},getLabelForIndex:function(t,e){var n=this.chart;return n.getDatasetMeta(e).controller._getValueScaleId()===this.id?this.getRightValue(n.data.datasets[e].data[t]):this._getLabels()[t]},_configure:function(){var t=this,e=t.options.offset,n=t.ticks;xn.prototype._configure.call(t),t.isHorizontal()||(t._reversePixels=!t._reversePixels),n&&(t._startValue=t.minIndex-(e?.5:0),t._valueRange=Math.max(n.length-(e?0:1),1))},getPixelForValue:function(t,e,n){var i,a,r,o=this;return _n(e)||_n(n)||(t=o.chart.data.datasets[n].data[e]),_n(t)||(i=o.isHorizontal()?t.x:t.y),(void 0!==i||void 0!==t&&isNaN(e))&&(a=o._getLabels(),t=H.valueOrDefault(i,t),e=-1!==(r=a.indexOf(t))?r:e,isNaN(e)&&(e=t)),o.getPixelForDecimal((e-o._startValue)/o._valueRange)},getPixelForTick:function(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t],t+this.minIndex)},getValueForPixel:function(t){var e=Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange);return Math.min(Math.max(e,0),this.ticks.length-1)},getBasePixel:function(){return this.bottom}}),kn={position:"bottom"};wn._defaults=kn;var Mn=H.noop,Sn=H.isNullOrUndef;var Dn=xn.extend({getRightValue:function(t){return"string"==typeof t?+t:xn.prototype.getRightValue.call(this,t)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var n=H.sign(t.min),i=H.sign(t.max);n<0&&i<0?t.max=0:n>0&&i>0&&(t.min=0)}var a=void 0!==e.min||void 0!==e.suggestedMin,r=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?t.min=e.min:void 0!==e.suggestedMin&&(null===t.min?t.min=e.suggestedMin:t.min=Math.min(t.min,e.suggestedMin)),void 0!==e.max?t.max=e.max:void 0!==e.suggestedMax&&(null===t.max?t.max=e.suggestedMax:t.max=Math.max(t.max,e.suggestedMax)),a!==r&&t.min>=t.max&&(a?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:function(){var t,e=this.options.ticks,n=e.stepSize,i=e.maxTicksLimit;return n?t=Math.ceil(this.max/n)-Math.floor(this.min/n)+1:(t=this._computeTickLimit(),i=i||11),i&&(t=Math.min(i,t)),t},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:Mn,buildTicks:function(){var t=this,e=t.options.ticks,n=t.getTickLimit(),i={maxTicks:n=Math.max(2,n),min:e.min,max:e.max,precision:e.precision,stepSize:H.valueOrDefault(e.fixedStepSize,e.stepSize)},a=t.ticks=function(t,e){var n,i,a,r,o=[],s=t.stepSize,l=s||1,u=t.maxTicks-1,d=t.min,h=t.max,c=t.precision,f=e.min,g=e.max,m=H.niceNum((g-f)/u/l)*l;if(m<1e-14&&Sn(d)&&Sn(h))return[f,g];(r=Math.ceil(g/m)-Math.floor(f/m))>u&&(m=H.niceNum(r*m/u/l)*l),s||Sn(c)?n=Math.pow(10,H._decimalPlaces(m)):(n=Math.pow(10,c),m=Math.ceil(m*n)/n),i=Math.floor(f/m)*m,a=Math.ceil(g/m)*m,s&&(!Sn(d)&&H.almostWhole(d/m,m/1e3)&&(i=d),!Sn(h)&&H.almostWhole(h/m,m/1e3)&&(a=h)),r=(a-i)/m,r=H.almostEquals(r,Math.round(r),m/1e3)?Math.round(r):Math.ceil(r),i=Math.round(i*n)/n,a=Math.round(a*n)/n,o.push(Sn(d)?i:d);for(var p=1;pe.length-1?null:this.getPixelForValue(e[t])}}),An=Cn;On._defaults=An;var Fn=H.valueOrDefault,In=H.math.log10;var Ln={position:"left",ticks:{callback:on.formatters.logarithmic}};function Rn(t,e){return H.isFinite(t)&&t>=0?t:e}var Nn=xn.extend({determineDataLimits:function(){var t,e,n,i,a,r,o=this,s=o.options,l=o.chart,u=l.data.datasets,d=o.isHorizontal();function h(t){return d?t.xAxisID===o.id:t.yAxisID===o.id}o.min=Number.POSITIVE_INFINITY,o.max=Number.NEGATIVE_INFINITY,o.minNotZero=Number.POSITIVE_INFINITY;var c=s.stacked;if(void 0===c)for(t=0;t0){var e=H.min(t),n=H.max(t);o.min=Math.min(o.min,e),o.max=Math.max(o.max,n)}}))}else for(t=0;t0?t.minNotZero=t.min:t.max<1?t.minNotZero=Math.pow(10,Math.floor(In(t.max))):t.minNotZero=1)},buildTicks:function(){var t=this,e=t.options.ticks,n=!t.isHorizontal(),i={min:Rn(e.min),max:Rn(e.max)},a=t.ticks=function(t,e){var n,i,a=[],r=Fn(t.min,Math.pow(10,Math.floor(In(e.min)))),o=Math.floor(In(e.max)),s=Math.ceil(e.max/Math.pow(10,o));0===r?(n=Math.floor(In(e.minNotZero)),i=Math.floor(e.minNotZero/Math.pow(10,n)),a.push(r),r=i*Math.pow(10,n)):(n=Math.floor(In(r)),i=Math.floor(r/Math.pow(10,n)));var l=n<0?Math.pow(10,Math.abs(n)):1;do{a.push(r),10===++i&&(i=1,l=++n>=0?1:l),r=Math.round(i*Math.pow(10,n)*l)/l}while(ne.length-1?null:this.getPixelForValue(e[t])},_getFirstTickValue:function(t){var e=Math.floor(In(t));return Math.floor(t/Math.pow(10,e))*Math.pow(10,e)},_configure:function(){var t=this,e=t.min,n=0;xn.prototype._configure.call(t),0===e&&(e=t._getFirstTickValue(t.minNotZero),n=Fn(t.options.ticks.fontSize,W.global.defaultFontSize)/t._length),t._startValue=In(e),t._valueOffset=n,t._valueRange=(In(t.max)-In(e))/(1-n)},getPixelForValue:function(t){var e=this,n=0;return(t=+e.getRightValue(t))>e.min&&t>0&&(n=(In(t)-e._startValue)/e._valueRange+e._valueOffset),e.getPixelForDecimal(n)},getValueForPixel:function(t){var e=this,n=e.getDecimalForPixel(t);return 0===n&&0===e.min?0:Math.pow(10,e._startValue+(n-e._valueOffset)*e._valueRange)}}),Wn=Ln;Nn._defaults=Wn;var Yn=H.valueOrDefault,zn=H.valueAtIndexOrDefault,En=H.options.resolve,Vn={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:on.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}};function Hn(t){var e=t.ticks;return e.display&&t.display?Yn(e.fontSize,W.global.defaultFontSize)+2*e.backdropPaddingY:0}function Bn(t,e,n,i,a){return t===i||t===a?{start:e-n/2,end:e+n/2}:ta?{start:e-n,end:e}:{start:e,end:e+n}}function jn(t){return 0===t||180===t?"center":t<180?"left":"right"}function Un(t,e,n,i){var a,r,o=n.y+i/2;if(H.isArray(e))for(a=0,r=e.length;a270||t<90)&&(n.y-=e.h)}function qn(t){return H.isNumber(t)?t:0}var Zn=Dn.extend({setDimensions:function(){var t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=Hn(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2},determineDataLimits:function(){var t=this,e=t.chart,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;H.each(e.data.datasets,(function(a,r){if(e.isDatasetVisible(r)){var o=e.getDatasetMeta(r);H.each(a.data,(function(e,a){var r=+t.getRightValue(e);isNaN(r)||o.data[a].hidden||(n=Math.min(r,n),i=Math.max(r,i))}))}})),t.min=n===Number.POSITIVE_INFINITY?0:n,t.max=i===Number.NEGATIVE_INFINITY?0:i,t.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/Hn(this.options))},convertTicksToLabels:function(){var t=this;Dn.prototype.convertTicksToLabels.call(t),t.pointLabels=t.chart.data.labels.map((function(){var e=H.callback(t.options.pointLabels.callback,arguments,t);return e||0===e?e:""}))},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){var t=this.options;t.display&&t.pointLabels.display?function(t){var e,n,i,a=H.options._parseFont(t.options.pointLabels),r={l:0,r:t.width,t:0,b:t.height-t.paddingTop},o={};t.ctx.font=a.string,t._pointLabelSizes=[];var s,l,u,d=t.chart.data.labels.length;for(e=0;er.r&&(r.r=f.end,o.r=h),g.startr.b&&(r.b=g.end,o.b=h)}t.setReductions(t.drawingArea,r,o)}(this):this.setCenterPoint(0,0,0,0)},setReductions:function(t,e,n){var i=this,a=e.l/Math.sin(n.l),r=Math.max(e.r-i.width,0)/Math.sin(n.r),o=-e.t/Math.cos(n.t),s=-Math.max(e.b-(i.height-i.paddingTop),0)/Math.cos(n.b);a=qn(a),r=qn(r),o=qn(o),s=qn(s),i.drawingArea=Math.min(Math.floor(t-(a+r)/2),Math.floor(t-(o+s)/2)),i.setCenterPoint(a,r,o,s)},setCenterPoint:function(t,e,n,i){var a=this,r=a.width-e-a.drawingArea,o=t+a.drawingArea,s=n+a.drawingArea,l=a.height-a.paddingTop-i-a.drawingArea;a.xCenter=Math.floor((o+r)/2+a.left),a.yCenter=Math.floor((s+l)/2+a.top+a.paddingTop)},getIndexAngle:function(t){var e=this.chart,n=(t*(360/e.data.labels.length)+((e.options||{}).startAngle||0))%360;return(n<0?n+360:n)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){var e=this;if(H.isNullOrUndef(t))return NaN;var n=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*n:(t-e.min)*n},getPointPosition:function(t,e){var n=this.getIndexAngle(t)-Math.PI/2;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(t){var e=this.min,n=this.max;return this.getPointPositionForValue(t||0,this.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0)},_drawGrid:function(){var t,e,n,i=this,a=i.ctx,r=i.options,o=r.gridLines,s=r.angleLines,l=Yn(s.lineWidth,o.lineWidth),u=Yn(s.color,o.color);if(r.pointLabels.display&&function(t){var e=t.ctx,n=t.options,i=n.pointLabels,a=Hn(n),r=t.getDistanceFromCenterForValue(n.ticks.reverse?t.min:t.max),o=H.options._parseFont(i);e.save(),e.font=o.string,e.textBaseline="middle";for(var s=t.chart.data.labels.length-1;s>=0;s--){var l=0===s?a/2:0,u=t.getPointPosition(s,r+l+5),d=zn(i.fontColor,s,W.global.defaultFontColor);e.fillStyle=d;var h=t.getIndexAngle(s),c=H.toDegrees(h);e.textAlign=jn(c),Gn(c,t._pointLabelSizes[s],u),Un(e,t.pointLabels[s],u,o.lineHeight)}e.restore()}(i),o.display&&H.each(i.ticks,(function(t,n){0!==n&&(e=i.getDistanceFromCenterForValue(i.ticksAsNumbers[n]),function(t,e,n,i){var a,r=t.ctx,o=e.circular,s=t.chart.data.labels.length,l=zn(e.color,i-1),u=zn(e.lineWidth,i-1);if((o||s)&&l&&u){if(r.save(),r.strokeStyle=l,r.lineWidth=u,r.setLineDash&&(r.setLineDash(e.borderDash||[]),r.lineDashOffset=e.borderDashOffset||0),r.beginPath(),o)r.arc(t.xCenter,t.yCenter,n,0,2*Math.PI);else{a=t.getPointPosition(0,n),r.moveTo(a.x,a.y);for(var d=1;d=0;t--)e=i.getDistanceFromCenterForValue(r.ticks.reverse?i.min:i.max),n=i.getPointPosition(t,e),a.beginPath(),a.moveTo(i.xCenter,i.yCenter),a.lineTo(n.x,n.y),a.stroke();a.restore()}},_drawLabels:function(){var t=this,e=t.ctx,n=t.options.ticks;if(n.display){var i,a,r=t.getIndexAngle(0),o=H.options._parseFont(n),s=Yn(n.fontColor,W.global.defaultFontColor);e.save(),e.font=o.string,e.translate(t.xCenter,t.yCenter),e.rotate(r),e.textAlign="center",e.textBaseline="middle",H.each(t.ticks,(function(r,l){(0!==l||n.reverse)&&(i=t.getDistanceFromCenterForValue(t.ticksAsNumbers[l]),n.showLabelBackdrop&&(a=e.measureText(r).width,e.fillStyle=n.backdropColor,e.fillRect(-a/2-n.backdropPaddingX,-i-o.size/2-n.backdropPaddingY,a+2*n.backdropPaddingX,o.size+2*n.backdropPaddingY)),e.fillStyle=s,e.fillText(r,0,-i))})),e.restore()}},_drawTitle:H.noop}),$n=Vn;Zn._defaults=$n;var Xn=H._deprecated,Kn=H.options.resolve,Jn=H.valueOrDefault,Qn=Number.MIN_SAFE_INTEGER||-9007199254740991,ti=Number.MAX_SAFE_INTEGER||9007199254740991,ei={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ni=Object.keys(ei);function ii(t,e){return t-e}function ai(t){return H.valueOrDefault(t.time.min,t.ticks.min)}function ri(t){return H.valueOrDefault(t.time.max,t.ticks.max)}function oi(t,e,n,i){var a=function(t,e,n){for(var i,a,r,o=0,s=t.length-1;o>=0&&o<=s;){if(a=t[(i=o+s>>1)-1]||null,r=t[i],!a)return{lo:null,hi:r};if(r[e]n))return{lo:a,hi:r};s=i-1}}return{lo:r,hi:null}}(t,e,n),r=a.lo?a.hi?a.lo:t[t.length-2]:t[0],o=a.lo?a.hi?a.hi:t[t.length-1]:t[1],s=o[e]-r[e],l=s?(n-r[e])/s:0,u=(o[i]-r[i])*l;return r[i]+u}function si(t,e){var n=t._adapter,i=t.options.time,a=i.parser,r=a||i.format,o=e;return"function"==typeof a&&(o=a(o)),H.isFinite(o)||(o="string"==typeof r?n.parse(o,r):n.parse(o)),null!==o?+o:(a||"function"!=typeof r||(o=r(e),H.isFinite(o)||(o=n.parse(o))),o)}function li(t,e){if(H.isNullOrUndef(e))return null;var n=t.options.time,i=si(t,t.getRightValue(e));return null===i?i:(n.round&&(i=+t._adapter.startOf(i,n.round)),i)}function ui(t,e,n,i){var a,r,o,s=ni.length;for(a=ni.indexOf(t);a=0&&(e[r].major=!0);return e}(t,r,o,n):r}var hi=xn.extend({initialize:function(){this.mergeTicksOptions(),xn.prototype.initialize.call(this)},update:function(){var t=this,e=t.options,n=e.time||(e.time={}),i=t._adapter=new rn._date(e.adapters.date);return Xn("time scale",n.format,"time.format","time.parser"),Xn("time scale",n.min,"time.min","ticks.min"),Xn("time scale",n.max,"time.max","ticks.max"),H.mergeIf(n.displayFormats,i.formats()),xn.prototype.update.apply(t,arguments)},getRightValue:function(t){return t&&void 0!==t.t&&(t=t.t),xn.prototype.getRightValue.call(this,t)},determineDataLimits:function(){var t,e,n,i,a,r,o,s=this,l=s.chart,u=s._adapter,d=s.options,h=d.time.unit||"day",c=ti,f=Qn,g=[],m=[],p=[],v=s._getLabels();for(t=0,n=v.length;t1?function(t){var e,n,i,a={},r=[];for(e=0,n=t.length;e1e5*u)throw e+" and "+n+" are too far apart with stepSize of "+u+" "+l;for(a=h;a=a&&n<=r&&d.push(n);return i.min=a,i.max=r,i._unit=l.unit||(s.autoSkip?ui(l.minUnit,i.min,i.max,h):function(t,e,n,i,a){var r,o;for(r=ni.length-1;r>=ni.indexOf(n);r--)if(o=ni[r],ei[o].common&&t._adapter.diff(a,i,o)>=e-1)return o;return ni[n?ni.indexOf(n):0]}(i,d.length,l.minUnit,i.min,i.max)),i._majorUnit=s.major.enabled&&"year"!==i._unit?function(t){for(var e=ni.indexOf(t)+1,n=ni.length;ee&&s=0&&t0?s:1}}),ci={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}};hi._defaults=ci;var fi={category:wn,linear:On,logarithmic:Nn,radialLinear:Zn,time:hi},gi=e((function(e,n){e.exports=function(){var n,i;function a(){return n.apply(null,arguments)}function r(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function o(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function s(t){return void 0===t}function l(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function u(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function d(t,e){var n,i=[];for(n=0;n>>0,i=0;i0)for(n=0;n=0?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+i}var E=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,V=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,H={},B={};function j(t,e,n,i){var a=i;"string"==typeof i&&(a=function(){return this[i]()}),t&&(B[t]=a),e&&(B[e[0]]=function(){return z(a.apply(this,arguments),e[1],e[2])}),n&&(B[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),t)})}function U(t,e){return t.isValid()?(e=G(e,t.localeData()),H[e]=H[e]||function(t){var e,n,i,a=t.match(E);for(e=0,n=a.length;e=0&&V.test(t);)t=t.replace(V,i),V.lastIndex=0,n-=1;return t}var q=/\d/,Z=/\d\d/,$=/\d{3}/,X=/\d{4}/,K=/[+-]?\d{6}/,J=/\d\d?/,Q=/\d\d\d\d?/,tt=/\d\d\d\d\d\d?/,et=/\d{1,3}/,nt=/\d{1,4}/,it=/[+-]?\d{1,6}/,at=/\d+/,rt=/[+-]?\d+/,ot=/Z|[+-]\d\d:?\d\d/gi,st=/Z|[+-]\d\d(?::?\d\d)?/gi,lt=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ut={};function dt(t,e,n){ut[t]=O(e)?e:function(t,i){return t&&n?n:e}}function ht(t,e){return h(ut,t)?ut[t](e._strict,e._locale):new RegExp(ct(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(t,e,n,i,a){return e||n||i||a}))))}function ct(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var ft={};function gt(t,e){var n,i=e;for("string"==typeof t&&(t=[t]),l(e)&&(i=function(t,n){n[e]=k(t)}),n=0;n68?1900:2e3)};var Pt,Tt=Ot("FullYear",!0);function Ot(t,e){return function(n){return null!=n?(Ft(this,t,n),a.updateOffset(this,e),this):At(this,t)}}function At(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function Ft(t,e,n){t.isValid()&&!isNaN(n)&&("FullYear"===e&&Ct(t.year())&&1===t.month()&&29===t.date()?t._d["set"+(t._isUTC?"UTC":"")+e](n,t.month(),It(n,t.month())):t._d["set"+(t._isUTC?"UTC":"")+e](n))}function It(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=function(t,e){return(t%e+e)%e}(e,12);return t+=(e-n)/12,1===n?Ct(t)?29:28:31-n%7%2}Pt=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e=0?(s=new Date(t+400,e,n,i,a,r,o),isFinite(s.getFullYear())&&s.setFullYear(t)):s=new Date(t,e,n,i,a,r,o),s}function jt(t){var e;if(t<100&&t>=0){var n=Array.prototype.slice.call(arguments);n[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)}else e=new Date(Date.UTC.apply(null,arguments));return e}function Ut(t,e,n){var i=7+e-n;return-(7+jt(t,0,i).getUTCDay()-e)%7+i-1}function Gt(t,e,n,i,a){var r,o,s=1+7*(e-1)+(7+n-i)%7+Ut(t,i,a);return s<=0?o=Dt(r=t-1)+s:s>Dt(t)?(r=t+1,o=s-Dt(t)):(r=t,o=s),{year:r,dayOfYear:o}}function qt(t,e,n){var i,a,r=Ut(t.year(),e,n),o=Math.floor((t.dayOfYear()-r-1)/7)+1;return o<1?i=o+Zt(a=t.year()-1,e,n):o>Zt(t.year(),e,n)?(i=o-Zt(t.year(),e,n),a=t.year()+1):(a=t.year(),i=o),{week:i,year:a}}function Zt(t,e,n){var i=Ut(t,e,n),a=Ut(t+1,e,n);return(Dt(t)-i+a)/7}function $t(t,e){return t.slice(e,7).concat(t.slice(0,e))}j("w",["ww",2],"wo","week"),j("W",["WW",2],"Wo","isoWeek"),L("week","w"),L("isoWeek","W"),Y("week",5),Y("isoWeek",5),dt("w",J),dt("ww",J,Z),dt("W",J),dt("WW",J,Z),mt(["w","ww","W","WW"],(function(t,e,n,i){e[i.substr(0,1)]=k(t)})),j("d",0,"do","day"),j("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),j("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),j("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),j("e",0,0,"weekday"),j("E",0,0,"isoWeekday"),L("day","d"),L("weekday","e"),L("isoWeekday","E"),Y("day",11),Y("weekday",11),Y("isoWeekday",11),dt("d",J),dt("e",J),dt("E",J),dt("dd",(function(t,e){return e.weekdaysMinRegex(t)})),dt("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),dt("dddd",(function(t,e){return e.weekdaysRegex(t)})),mt(["dd","ddd","dddd"],(function(t,e,n,i){var a=n._locale.weekdaysParse(t,i,n._strict);null!=a?e.d=a:g(n).invalidWeekday=t})),mt(["d","e","E"],(function(t,e,n,i){e[i]=k(t)}));var Xt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Kt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Jt="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Qt(t,e,n){var i,a,r,o=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)r=f([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===e?-1!==(a=Pt.call(this._weekdaysParse,o))?a:null:"ddd"===e?-1!==(a=Pt.call(this._shortWeekdaysParse,o))?a:null:-1!==(a=Pt.call(this._minWeekdaysParse,o))?a:null:"dddd"===e?-1!==(a=Pt.call(this._weekdaysParse,o))?a:-1!==(a=Pt.call(this._shortWeekdaysParse,o))?a:-1!==(a=Pt.call(this._minWeekdaysParse,o))?a:null:"ddd"===e?-1!==(a=Pt.call(this._shortWeekdaysParse,o))?a:-1!==(a=Pt.call(this._weekdaysParse,o))?a:-1!==(a=Pt.call(this._minWeekdaysParse,o))?a:null:-1!==(a=Pt.call(this._minWeekdaysParse,o))?a:-1!==(a=Pt.call(this._weekdaysParse,o))?a:-1!==(a=Pt.call(this._shortWeekdaysParse,o))?a:null}var te=lt,ee=lt,ne=lt;function ie(){function t(t,e){return e.length-t.length}var e,n,i,a,r,o=[],s=[],l=[],u=[];for(e=0;e<7;e++)n=f([2e3,1]).day(e),i=this.weekdaysMin(n,""),a=this.weekdaysShort(n,""),r=this.weekdays(n,""),o.push(i),s.push(a),l.push(r),u.push(i),u.push(a),u.push(r);for(o.sort(t),s.sort(t),l.sort(t),u.sort(t),e=0;e<7;e++)s[e]=ct(s[e]),l[e]=ct(l[e]),u[e]=ct(u[e]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function ae(){return this.hours()%12||12}function re(t,e){j(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function oe(t,e){return e._meridiemParse}j("H",["HH",2],0,"hour"),j("h",["hh",2],0,ae),j("k",["kk",2],0,(function(){return this.hours()||24})),j("hmm",0,0,(function(){return""+ae.apply(this)+z(this.minutes(),2)})),j("hmmss",0,0,(function(){return""+ae.apply(this)+z(this.minutes(),2)+z(this.seconds(),2)})),j("Hmm",0,0,(function(){return""+this.hours()+z(this.minutes(),2)})),j("Hmmss",0,0,(function(){return""+this.hours()+z(this.minutes(),2)+z(this.seconds(),2)})),re("a",!0),re("A",!1),L("hour","h"),Y("hour",13),dt("a",oe),dt("A",oe),dt("H",J),dt("h",J),dt("k",J),dt("HH",J,Z),dt("hh",J,Z),dt("kk",J,Z),dt("hmm",Q),dt("hmmss",tt),dt("Hmm",Q),dt("Hmmss",tt),gt(["H","HH"],xt),gt(["k","kk"],(function(t,e,n){var i=k(t);e[xt]=24===i?0:i})),gt(["a","A"],(function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t})),gt(["h","hh"],(function(t,e,n){e[xt]=k(t),g(n).bigHour=!0})),gt("hmm",(function(t,e,n){var i=t.length-2;e[xt]=k(t.substr(0,i)),e[_t]=k(t.substr(i)),g(n).bigHour=!0})),gt("hmmss",(function(t,e,n){var i=t.length-4,a=t.length-2;e[xt]=k(t.substr(0,i)),e[_t]=k(t.substr(i,2)),e[wt]=k(t.substr(a)),g(n).bigHour=!0})),gt("Hmm",(function(t,e,n){var i=t.length-2;e[xt]=k(t.substr(0,i)),e[_t]=k(t.substr(i))})),gt("Hmmss",(function(t,e,n){var i=t.length-4,a=t.length-2;e[xt]=k(t.substr(0,i)),e[_t]=k(t.substr(i,2)),e[wt]=k(t.substr(a))}));var se,le=Ot("Hours",!0),ue={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Rt,monthsShort:Nt,week:{dow:0,doy:6},weekdays:Xt,weekdaysMin:Jt,weekdaysShort:Kt,meridiemParse:/[ap]\.?m?\.?/i},de={},he={};function ce(t){return t?t.toLowerCase().replace("_","-"):t}function fe(n){var i=null;if(!de[n]&&e&&e.exports)try{i=se._abbr,t(),ge(i)}catch(t){}return de[n]}function ge(t,e){var n;return t&&((n=s(e)?pe(t):me(t,e))?se=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),se._abbr}function me(t,e){if(null!==e){var n,i=ue;if(e.abbr=t,null!=de[t])T("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=de[t]._config;else if(null!=e.parentLocale)if(null!=de[e.parentLocale])i=de[e.parentLocale]._config;else{if(null==(n=fe(e.parentLocale)))return he[e.parentLocale]||(he[e.parentLocale]=[]),he[e.parentLocale].push({name:t,config:e}),null;i=n._config}return de[t]=new F(A(i,e)),he[t]&&he[t].forEach((function(t){me(t.name,t.config)})),ge(t),de[t]}return delete de[t],null}function pe(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return se;if(!r(t)){if(e=fe(t))return e;t=[t]}return function(t){for(var e,n,i,a,r=0;r0;){if(i=fe(a.slice(0,e).join("-")))return i;if(n&&n.length>=e&&M(a,n,!0)>=e-1)break;e--}r++}return se}(t)}function ve(t){var e,n=t._a;return n&&-2===g(t).overflow&&(e=n[bt]<0||n[bt]>11?bt:n[yt]<1||n[yt]>It(n[vt],n[bt])?yt:n[xt]<0||n[xt]>24||24===n[xt]&&(0!==n[_t]||0!==n[wt]||0!==n[kt])?xt:n[_t]<0||n[_t]>59?_t:n[wt]<0||n[wt]>59?wt:n[kt]<0||n[kt]>999?kt:-1,g(t)._overflowDayOfYear&&(eyt)&&(e=yt),g(t)._overflowWeeks&&-1===e&&(e=Mt),g(t)._overflowWeekday&&-1===e&&(e=St),g(t).overflow=e),t}function be(t,e,n){return null!=t?t:null!=e?e:n}function ye(t){var e,n,i,r,o,s=[];if(!t._d){for(i=function(t){var e=new Date(a.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}(t),t._w&&null==t._a[yt]&&null==t._a[bt]&&function(t){var e,n,i,a,r,o,s,l;if(null!=(e=t._w).GG||null!=e.W||null!=e.E)r=1,o=4,n=be(e.GG,t._a[vt],qt(Le(),1,4).year),i=be(e.W,1),((a=be(e.E,1))<1||a>7)&&(l=!0);else{r=t._locale._week.dow,o=t._locale._week.doy;var u=qt(Le(),r,o);n=be(e.gg,t._a[vt],u.year),i=be(e.w,u.week),null!=e.d?((a=e.d)<0||a>6)&&(l=!0):null!=e.e?(a=e.e+r,(e.e<0||e.e>6)&&(l=!0)):a=r}i<1||i>Zt(n,r,o)?g(t)._overflowWeeks=!0:null!=l?g(t)._overflowWeekday=!0:(s=Gt(n,i,a,r,o),t._a[vt]=s.year,t._dayOfYear=s.dayOfYear)}(t),null!=t._dayOfYear&&(o=be(t._a[vt],i[vt]),(t._dayOfYear>Dt(o)||0===t._dayOfYear)&&(g(t)._overflowDayOfYear=!0),n=jt(o,0,t._dayOfYear),t._a[bt]=n.getUTCMonth(),t._a[yt]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=s[e]=i[e];for(;e<7;e++)t._a[e]=s[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[xt]&&0===t._a[_t]&&0===t._a[wt]&&0===t._a[kt]&&(t._nextDay=!0,t._a[xt]=0),t._d=(t._useUTC?jt:Bt).apply(null,s),r=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[xt]=24),t._w&&void 0!==t._w.d&&t._w.d!==r&&(g(t).weekdayMismatch=!0)}}var xe=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_e=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,we=/Z|[+-]\d\d(?::?\d\d)?/,ke=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Me=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Se=/^\/?Date\((\-?\d+)/i;function De(t){var e,n,i,a,r,o,s=t._i,l=xe.exec(s)||_e.exec(s);if(l){for(g(t).iso=!0,e=0,n=ke.length;e0&&g(t).unusedInput.push(o),s=s.slice(s.indexOf(n)+n.length),u+=n.length),B[r]?(n?g(t).empty=!1:g(t).unusedTokens.push(r),pt(r,n,t)):t._strict&&!n&&g(t).unusedTokens.push(r);g(t).charsLeftOver=l-u,s.length>0&&g(t).unusedInput.push(s),t._a[xt]<=12&&!0===g(t).bigHour&&t._a[xt]>0&&(g(t).bigHour=void 0),g(t).parsedDateParts=t._a.slice(0),g(t).meridiem=t._meridiem,t._a[xt]=function(t,e,n){var i;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?((i=t.isPM(n))&&e<12&&(e+=12),i||12!==e||(e=0),e):e}(t._locale,t._a[xt],t._meridiem),ye(t),ve(t)}else Oe(t);else De(t)}function Fe(t){var e=t._i,n=t._f;return t._locale=t._locale||pe(t._l),null===e||void 0===n&&""===e?p({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),_(e)?new x(ve(e)):(u(e)?t._d=e:r(n)?function(t){var e,n,i,a,r;if(0===t._f.length)return g(t).invalidFormat=!0,void(t._d=new Date(NaN));for(a=0;athis?this:t:p()}));function We(t,e){var n,i;if(1===e.length&&r(e[0])&&(e=e[0]),!e.length)return Le();for(n=e[0],i=1;i=0?new Date(t+400,e,n)-hn:new Date(t,e,n).valueOf()}function gn(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-hn:Date.UTC(t,e,n)}function mn(t,e){j(0,[t,t.length],0,e)}function pn(t,e,n,i,a){var r;return null==t?qt(this,i,a).year:(e>(r=Zt(t,i,a))&&(e=r),vn.call(this,t,e,n,i,a))}function vn(t,e,n,i,a){var r=Gt(t,e,n,i,a),o=jt(r.year,0,r.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}j(0,["gg",2],0,(function(){return this.weekYear()%100})),j(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),mn("gggg","weekYear"),mn("ggggg","weekYear"),mn("GGGG","isoWeekYear"),mn("GGGGG","isoWeekYear"),L("weekYear","gg"),L("isoWeekYear","GG"),Y("weekYear",1),Y("isoWeekYear",1),dt("G",rt),dt("g",rt),dt("GG",J,Z),dt("gg",J,Z),dt("GGGG",nt,X),dt("gggg",nt,X),dt("GGGGG",it,K),dt("ggggg",it,K),mt(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,n,i){e[i.substr(0,2)]=k(t)})),mt(["gg","GG"],(function(t,e,n,i){e[i]=a.parseTwoDigitYear(t)})),j("Q",0,"Qo","quarter"),L("quarter","Q"),Y("quarter",7),dt("Q",q),gt("Q",(function(t,e){e[bt]=3*(k(t)-1)})),j("D",["DD",2],"Do","date"),L("date","D"),Y("date",9),dt("D",J),dt("DD",J,Z),dt("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),gt(["D","DD"],yt),gt("Do",(function(t,e){e[yt]=k(t.match(J)[0])}));var bn=Ot("Date",!0);j("DDD",["DDDD",3],"DDDo","dayOfYear"),L("dayOfYear","DDD"),Y("dayOfYear",4),dt("DDD",et),dt("DDDD",$),gt(["DDD","DDDD"],(function(t,e,n){n._dayOfYear=k(t)})),j("m",["mm",2],0,"minute"),L("minute","m"),Y("minute",14),dt("m",J),dt("mm",J,Z),gt(["m","mm"],_t);var yn=Ot("Minutes",!1);j("s",["ss",2],0,"second"),L("second","s"),Y("second",15),dt("s",J),dt("ss",J,Z),gt(["s","ss"],wt);var xn,_n=Ot("Seconds",!1);for(j("S",0,0,(function(){return~~(this.millisecond()/100)})),j(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),j(0,["SSS",3],0,"millisecond"),j(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),j(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),j(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),j(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),j(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),j(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),L("millisecond","ms"),Y("millisecond",16),dt("S",et,q),dt("SS",et,Z),dt("SSS",et,$),xn="SSSS";xn.length<=9;xn+="S")dt(xn,at);function wn(t,e){e[kt]=k(1e3*("0."+t))}for(xn="S";xn.length<=9;xn+="S")gt(xn,wn);var kn=Ot("Milliseconds",!1);j("z",0,0,"zoneAbbr"),j("zz",0,0,"zoneName");var Mn=x.prototype;function Sn(t){return t}Mn.add=en,Mn.calendar=function(t,e){var n=t||Le(),i=Ue(n,this).startOf("day"),r=a.calendarFormat(this,i)||"sameElse",o=e&&(O(e[r])?e[r].call(this,n):e[r]);return this.format(o||this.localeData().calendar(r,this,Le(n)))},Mn.clone=function(){return new x(this)},Mn.diff=function(t,e,n){var i,a,r;if(!this.isValid())return NaN;if(!(i=Ue(t,this)).isValid())return NaN;switch(a=6e4*(i.utcOffset()-this.utcOffset()),e=R(e)){case"year":r=an(this,i)/12;break;case"month":r=an(this,i);break;case"quarter":r=an(this,i)/3;break;case"second":r=(this-i)/1e3;break;case"minute":r=(this-i)/6e4;break;case"hour":r=(this-i)/36e5;break;case"day":r=(this-i-a)/864e5;break;case"week":r=(this-i-a)/6048e5;break;default:r=this-i}return n?r:w(r)},Mn.endOf=function(t){var e;if(void 0===(t=R(t))||"millisecond"===t||!this.isValid())return this;var n=this._isUTC?gn:fn;switch(t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=dn-cn(e+(this._isUTC?0:this.utcOffset()*un),dn)-1;break;case"minute":e=this._d.valueOf(),e+=un-cn(e,un)-1;break;case"second":e=this._d.valueOf(),e+=ln-cn(e,ln)-1}return this._d.setTime(e),a.updateOffset(this,!0),this},Mn.format=function(t){t||(t=this.isUtc()?a.defaultFormatUtc:a.defaultFormat);var e=U(this,t);return this.localeData().postformat(e)},Mn.from=function(t,e){return this.isValid()&&(_(t)&&t.isValid()||Le(t).isValid())?Xe({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},Mn.fromNow=function(t){return this.from(Le(),t)},Mn.to=function(t,e){return this.isValid()&&(_(t)&&t.isValid()||Le(t).isValid())?Xe({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},Mn.toNow=function(t){return this.to(Le(),t)},Mn.get=function(t){return O(this[t=R(t)])?this[t]():this},Mn.invalidAt=function(){return g(this).overflow},Mn.isAfter=function(t,e){var n=_(t)?t:Le(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=R(e)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()9999?U(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):O(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",U(n,"Z")):U(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},Mn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var n="["+t+'("]',i=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a=e+'[")]';return this.format(n+i+"-MM-DD[T]HH:mm:ss.SSS"+a)},Mn.toJSON=function(){return this.isValid()?this.toISOString():null},Mn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},Mn.unix=function(){return Math.floor(this.valueOf()/1e3)},Mn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},Mn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},Mn.year=Tt,Mn.isLeapYear=function(){return Ct(this.year())},Mn.weekYear=function(t){return pn.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},Mn.isoWeekYear=function(t){return pn.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)},Mn.quarter=Mn.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},Mn.month=zt,Mn.daysInMonth=function(){return It(this.year(),this.month())},Mn.week=Mn.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},Mn.isoWeek=Mn.isoWeeks=function(t){var e=qt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},Mn.weeksInYear=function(){var t=this.localeData()._week;return Zt(this.year(),t.dow,t.doy)},Mn.isoWeeksInYear=function(){return Zt(this.year(),1,4)},Mn.date=bn,Mn.day=Mn.days=function(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=function(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}(t,this.localeData()),this.add(t-e,"d")):e},Mn.weekday=function(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},Mn.isoWeekday=function(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=function(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7},Mn.dayOfYear=function(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},Mn.hour=Mn.hours=le,Mn.minute=Mn.minutes=yn,Mn.second=Mn.seconds=_n,Mn.millisecond=Mn.milliseconds=kn,Mn.utcOffset=function(t,e,n){var i,r=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=je(st,t)))return this}else Math.abs(t)<16&&!n&&(t*=60);return!this._isUTC&&e&&(i=Ge(this)),this._offset=t,this._isUTC=!0,null!=i&&this.add(i,"m"),r!==t&&(!e||this._changeInProgress?tn(this,Xe(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?r:Ge(this)},Mn.utc=function(t){return this.utcOffset(0,t)},Mn.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Ge(this),"m")),this},Mn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=je(ot,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this},Mn.hasAlignedHourOffset=function(t){return!!this.isValid()&&(t=t?Le(t).utcOffset():0,(this.utcOffset()-t)%60==0)},Mn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},Mn.isLocal=function(){return!!this.isValid()&&!this._isUTC},Mn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},Mn.isUtc=qe,Mn.isUTC=qe,Mn.zoneAbbr=function(){return this._isUTC?"UTC":""},Mn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},Mn.dates=D("dates accessor is deprecated. Use date instead.",bn),Mn.months=D("months accessor is deprecated. Use month instead",zt),Mn.years=D("years accessor is deprecated. Use year instead",Tt),Mn.zone=D("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()})),Mn.isDSTShifted=D("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var t={};if(b(t,this),(t=Fe(t))._a){var e=t._isUTC?f(t._a):Le(t._a);this._isDSTShifted=this.isValid()&&M(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}));var Dn=F.prototype;function Cn(t,e,n,i){var a=pe(),r=f().set(i,e);return a[n](r,t)}function Pn(t,e,n){if(l(t)&&(e=t,t=void 0),t=t||"",null!=e)return Cn(t,e,n,"month");var i,a=[];for(i=0;i<12;i++)a[i]=Cn(t,i,n,"month");return a}function Tn(t,e,n,i){"boolean"==typeof t?(l(e)&&(n=e,e=void 0),e=e||""):(n=e=t,t=!1,l(e)&&(n=e,e=void 0),e=e||"");var a,r=pe(),o=t?r._week.dow:0;if(null!=n)return Cn(e,(n+o)%7,i,"day");var s=[];for(a=0;a<7;a++)s[a]=Cn(e,(a+o)%7,i,"day");return s}Dn.calendar=function(t,e,n){var i=this._calendar[t]||this._calendar.sameElse;return O(i)?i.call(e,n):i},Dn.longDateFormat=function(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,(function(t){return t.slice(1)})),this._longDateFormat[t])},Dn.invalidDate=function(){return this._invalidDate},Dn.ordinal=function(t){return this._ordinal.replace("%d",t)},Dn.preparse=Sn,Dn.postformat=Sn,Dn.relativeTime=function(t,e,n,i){var a=this._relativeTime[n];return O(a)?a(t,e,n,i):a.replace(/%d/i,t)},Dn.pastFuture=function(t,e){var n=this._relativeTime[t>0?"future":"past"];return O(n)?n(e):n.replace(/%s/i,e)},Dn.set=function(t){var e,n;for(n in t)O(e=t[n])?this[n]=e:this["_"+n]=e;this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},Dn.months=function(t,e){return t?r(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||Lt).test(e)?"format":"standalone"][t.month()]:r(this._months)?this._months:this._months.standalone},Dn.monthsShort=function(t,e){return t?r(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[Lt.test(e)?"format":"standalone"][t.month()]:r(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},Dn.monthsParse=function(t,e,n){var i,a,r;if(this._monthsParseExact)return Wt.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(a=f([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(r="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[i]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[i].test(t))return i;if(n&&"MMM"===e&&this._shortMonthsParse[i].test(t))return i;if(!n&&this._monthsParse[i].test(t))return i}},Dn.monthsRegex=function(t){return this._monthsParseExact?(h(this,"_monthsRegex")||Ht.call(this),t?this._monthsStrictRegex:this._monthsRegex):(h(this,"_monthsRegex")||(this._monthsRegex=Vt),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)},Dn.monthsShortRegex=function(t){return this._monthsParseExact?(h(this,"_monthsRegex")||Ht.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(h(this,"_monthsShortRegex")||(this._monthsShortRegex=Et),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)},Dn.week=function(t){return qt(t,this._week.dow,this._week.doy).week},Dn.firstDayOfYear=function(){return this._week.doy},Dn.firstDayOfWeek=function(){return this._week.dow},Dn.weekdays=function(t,e){var n=r(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?$t(n,this._week.dow):t?n[t.day()]:n},Dn.weekdaysMin=function(t){return!0===t?$t(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin},Dn.weekdaysShort=function(t){return!0===t?$t(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort},Dn.weekdaysParse=function(t,e,n){var i,a,r;if(this._weekdaysParseExact)return Qt.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(a=f([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[i]||(r="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[i]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[i].test(t))return i;if(n&&"ddd"===e&&this._shortWeekdaysParse[i].test(t))return i;if(n&&"dd"===e&&this._minWeekdaysParse[i].test(t))return i;if(!n&&this._weekdaysParse[i].test(t))return i}},Dn.weekdaysRegex=function(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||ie.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(h(this,"_weekdaysRegex")||(this._weekdaysRegex=te),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)},Dn.weekdaysShortRegex=function(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||ie.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(h(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ee),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Dn.weekdaysMinRegex=function(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||ie.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(h(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ne),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Dn.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},Dn.meridiem=function(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"},ge("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===k(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),a.lang=D("moment.lang is deprecated. Use moment.locale instead.",ge),a.langData=D("moment.langData is deprecated. Use moment.localeData instead.",pe);var On=Math.abs;function An(t,e,n,i){var a=Xe(e,n);return t._milliseconds+=i*a._milliseconds,t._days+=i*a._days,t._months+=i*a._months,t._bubble()}function Fn(t){return t<0?Math.floor(t):Math.ceil(t)}function In(t){return 4800*t/146097}function Ln(t){return 146097*t/4800}function Rn(t){return function(){return this.as(t)}}var Nn=Rn("ms"),Wn=Rn("s"),Yn=Rn("m"),zn=Rn("h"),En=Rn("d"),Vn=Rn("w"),Hn=Rn("M"),Bn=Rn("Q"),jn=Rn("y");function Un(t){return function(){return this.isValid()?this._data[t]:NaN}}var Gn=Un("milliseconds"),qn=Un("seconds"),Zn=Un("minutes"),$n=Un("hours"),Xn=Un("days"),Kn=Un("months"),Jn=Un("years"),Qn=Math.round,ti={ss:44,s:45,m:45,h:22,d:26,M:11};function ei(t,e,n,i,a){return a.relativeTime(e||1,!!n,t,i)}var ni=Math.abs;function ii(t){return(t>0)-(t<0)||+t}function ai(){if(!this.isValid())return this.localeData().invalidDate();var t,e,n=ni(this._milliseconds)/1e3,i=ni(this._days),a=ni(this._months);t=w(n/60),e=w(t/60),n%=60,t%=60;var r=w(a/12),o=a%=12,s=i,l=e,u=t,d=n?n.toFixed(3).replace(/\.?0+$/,""):"",h=this.asSeconds();if(!h)return"P0D";var c=h<0?"-":"",f=ii(this._months)!==ii(h)?"-":"",g=ii(this._days)!==ii(h)?"-":"",m=ii(this._milliseconds)!==ii(h)?"-":"";return c+"P"+(r?f+r+"Y":"")+(o?f+o+"M":"")+(s?g+s+"D":"")+(l||u||d?"T":"")+(l?m+l+"H":"")+(u?m+u+"M":"")+(d?m+d+"S":"")}var ri=ze.prototype;return ri.isValid=function(){return this._isValid},ri.abs=function(){var t=this._data;return this._milliseconds=On(this._milliseconds),this._days=On(this._days),this._months=On(this._months),t.milliseconds=On(t.milliseconds),t.seconds=On(t.seconds),t.minutes=On(t.minutes),t.hours=On(t.hours),t.months=On(t.months),t.years=On(t.years),this},ri.add=function(t,e){return An(this,t,e,1)},ri.subtract=function(t,e){return An(this,t,e,-1)},ri.as=function(t){if(!this.isValid())return NaN;var e,n,i=this._milliseconds;if("month"===(t=R(t))||"quarter"===t||"year"===t)switch(e=this._days+i/864e5,n=this._months+In(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(Ln(this._months)),t){case"week":return e/7+i/6048e5;case"day":return e+i/864e5;case"hour":return 24*e+i/36e5;case"minute":return 1440*e+i/6e4;case"second":return 86400*e+i/1e3;case"millisecond":return Math.floor(864e5*e)+i;default:throw new Error("Unknown unit "+t)}},ri.asMilliseconds=Nn,ri.asSeconds=Wn,ri.asMinutes=Yn,ri.asHours=zn,ri.asDays=En,ri.asWeeks=Vn,ri.asMonths=Hn,ri.asQuarters=Bn,ri.asYears=jn,ri.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},ri._bubble=function(){var t,e,n,i,a,r=this._milliseconds,o=this._days,s=this._months,l=this._data;return r>=0&&o>=0&&s>=0||r<=0&&o<=0&&s<=0||(r+=864e5*Fn(Ln(s)+o),o=0,s=0),l.milliseconds=r%1e3,t=w(r/1e3),l.seconds=t%60,e=w(t/60),l.minutes=e%60,n=w(e/60),l.hours=n%24,o+=w(n/24),a=w(In(o)),s+=a,o-=Fn(Ln(a)),i=w(s/12),s%=12,l.days=o,l.months=s,l.years=i,this},ri.clone=function(){return Xe(this)},ri.get=function(t){return t=R(t),this.isValid()?this[t+"s"]():NaN},ri.milliseconds=Gn,ri.seconds=qn,ri.minutes=Zn,ri.hours=$n,ri.days=Xn,ri.weeks=function(){return w(this.days()/7)},ri.months=Kn,ri.years=Jn,ri.humanize=function(t){if(!this.isValid())return this.localeData().invalidDate();var e=this.localeData(),n=function(t,e,n){var i=Xe(t).abs(),a=Qn(i.as("s")),r=Qn(i.as("m")),o=Qn(i.as("h")),s=Qn(i.as("d")),l=Qn(i.as("M")),u=Qn(i.as("y")),d=a<=ti.ss&&["s",a]||a0,d[4]=n,ei.apply(null,d)}(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)},ri.toISOString=ai,ri.toString=ai,ri.toJSON=ai,ri.locale=rn,ri.localeData=sn,ri.toIsoString=D("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ai),ri.lang=on,j("X",0,0,"unix"),j("x",0,0,"valueOf"),dt("x",rt),dt("X",/[+-]?\d+(\.\d{1,3})?/),gt("X",(function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))})),gt("x",(function(t,e,n){n._d=new Date(k(t))})),a.version="2.24.0",n=Le,a.fn=Mn,a.min=function(){return We("isBefore",[].slice.call(arguments,0))},a.max=function(){return We("isAfter",[].slice.call(arguments,0))},a.now=function(){return Date.now?Date.now():+new Date},a.utc=f,a.unix=function(t){return Le(1e3*t)},a.months=function(t,e){return Pn(t,e,"months")},a.isDate=u,a.locale=ge,a.invalid=p,a.duration=Xe,a.isMoment=_,a.weekdays=function(t,e,n){return Tn(t,e,n,"weekdays")},a.parseZone=function(){return Le.apply(null,arguments).parseZone()},a.localeData=pe,a.isDuration=Ee,a.monthsShort=function(t,e){return Pn(t,e,"monthsShort")},a.weekdaysMin=function(t,e,n){return Tn(t,e,n,"weekdaysMin")},a.defineLocale=me,a.updateLocale=function(t,e){if(null!=e){var n,i,a=ue;null!=(i=fe(t))&&(a=i._config),e=A(a,e),(n=new F(e)).parentLocale=de[t],de[t]=n,ge(t)}else null!=de[t]&&(null!=de[t].parentLocale?de[t]=de[t].parentLocale:null!=de[t]&&delete de[t]);return de[t]},a.locales=function(){return C(de)},a.weekdaysShort=function(t,e,n){return Tn(t,e,n,"weekdaysShort")},a.normalizeUnits=R,a.relativeTimeRounding=function(t){return void 0===t?Qn:"function"==typeof t&&(Qn=t,!0)},a.relativeTimeThreshold=function(t,e){return void 0!==ti[t]&&(void 0===e?ti[t]:(ti[t]=e,"s"===t&&(ti.ss=e-1),!0))},a.calendarFormat=function(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},a.prototype=Mn,a.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},a}()})),mi={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};rn._date.override("function"==typeof gi?{_id:"moment",formats:function(){return mi},parse:function(t,e){return"string"==typeof t&&"string"==typeof e?t=gi(t,e):t instanceof gi||(t=gi(t)),t.isValid()?t.valueOf():null},format:function(t,e){return gi(t).format(e)},add:function(t,e,n){return gi(t).add(e,n).valueOf()},diff:function(t,e,n){return gi(t).diff(gi(e),n)},startOf:function(t,e,n){return t=gi(t),"isoWeek"===e?t.isoWeekday(n).valueOf():t.startOf(e).valueOf()},endOf:function(t,e){return gi(t).endOf(e).valueOf()},_create:function(t){return gi(t)}}:{}),W._set("global",{plugins:{filler:{propagate:!0}}});var pi={dataset:function(t){var e=t.fill,n=t.chart,i=n.getDatasetMeta(e),a=i&&n.isDatasetVisible(e)&&i.dataset._children||[],r=a.length||0;return r?function(t,e){return e=n)&&i;switch(r){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return r;default:return!1}}function bi(t){return(t.el._scale||{}).getPointPositionForValue?function(t){var e,n,i,a,r,o=t.el._scale,s=o.options,l=o.chart.data.labels.length,u=t.fill,d=[];if(!l)return null;for(e=s.ticks.reverse?o.max:o.min,n=s.ticks.reverse?o.min:o.max,i=o.getPointPositionForValue(0,e),a=0;a0;--r)H.canvas.lineTo(t,n[r],n[r-1],!0);else for(o=n[0].cx,s=n[0].cy,l=Math.sqrt(Math.pow(n[0].x-o,2)+Math.pow(n[0].y-s,2)),r=a-1;r>0;--r)t.arc(o,s,l,n[r].angle,n[r-1].angle,!0)}}function ki(t,e,n,i,a,r){var o,s,l,u,d,h,c,f,g=e.length,m=i.spanGaps,p=[],v=[],b=0,y=0;for(t.beginPath(),o=0,s=g;o=0;--n)(e=l[n].$filler)&&e.visible&&(a=(i=e.el)._view,r=i._children||[],o=e.mapper,s=a.backgroundColor||W.global.defaultColor,o&&s&&r.length&&(H.canvas.clipArea(u,t.chartArea),ki(u,r,o,a,s,i._loop),H.canvas.unclipArea(u)))}},Si=H.rtl.getRtlAdapter,Di=H.noop,Ci=H.valueOrDefault;function Pi(t,e){return t.usePointStyle&&t.boxWidth>e?e:t.boxWidth}W._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var n=e.datasetIndex,i=this.chart,a=i.getDatasetMeta(n);a.hidden=null===a.hidden?!i.data.datasets[n].hidden:null,i.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data.datasets,n=t.options.legend||{},i=n.labels&&n.labels.usePointStyle;return t._getSortedDatasetMetas().map((function(n){var a=n.controller.getStyle(i?0:void 0);return{text:e[n.index].label,fillStyle:a.backgroundColor,hidden:!t.isDatasetVisible(n.index),lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:a.borderWidth,strokeStyle:a.borderColor,pointStyle:a.pointStyle,rotation:a.rotation,datasetIndex:n.index}}),this)}}},legendCallback:function(t){var e,n,i,a=document.createElement("ul"),r=t.data.datasets;for(a.setAttribute("class",t.id+"-legend"),e=0,n=r.length;el.width)&&(h+=o+n.padding,d[d.length-(e>0?0:1)]=0),s[e]={left:0,top:0,width:i,height:o},d[d.length-1]+=i+n.padding})),l.height+=h}else{var c=n.padding,f=t.columnWidths=[],g=t.columnHeights=[],m=n.padding,p=0,v=0;H.each(t.legendItems,(function(t,e){var i=Pi(n,o)+o/2+a.measureText(t.text).width;e>0&&v+o+2*c>l.height&&(m+=p+n.padding,f.push(p),g.push(v),p=0,v=0),p=Math.max(p,i),v+=o+c,s[e]={left:0,top:0,width:i,height:o}})),m+=p,f.push(p),g.push(v),l.width+=m}t.width=l.width,t.height=l.height}else t.width=l.width=t.height=l.height=0},afterFit:Di,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,n=e.labels,i=W.global,a=i.defaultColor,r=i.elements.line,o=t.height,s=t.columnHeights,l=t.width,u=t.lineWidths;if(e.display){var d,h=Si(e.rtl,t.left,t.minSize.width),c=t.ctx,f=Ci(n.fontColor,i.defaultFontColor),g=H.options._parseFont(n),m=g.size;c.textAlign=h.textAlign("left"),c.textBaseline="middle",c.lineWidth=.5,c.strokeStyle=f,c.fillStyle=f,c.font=g.string;var p=Pi(n,m),v=t.legendHitBoxes,b=function(t,i){switch(e.align){case"start":return n.padding;case"end":return t-i;default:return(t-i+n.padding)/2}},y=t.isHorizontal();d=y?{x:t.left+b(l,u[0]),y:t.top+n.padding,line:0}:{x:t.left+n.padding,y:t.top+b(o,s[0]),line:0},H.rtl.overrideTextDirection(t.ctx,e.textDirection);var x=m+n.padding;H.each(t.legendItems,(function(e,i){var f=c.measureText(e.text).width,g=p+m/2+f,_=d.x,w=d.y;h.setWidth(t.minSize.width),y?i>0&&_+g+n.padding>t.left+t.minSize.width&&(w=d.y+=x,d.line++,_=d.x=t.left+b(l,u[d.line])):i>0&&w+x>t.top+t.minSize.height&&(_=d.x=_+t.columnWidths[d.line]+n.padding,d.line++,w=d.y=t.top+b(o,s[d.line]));var k=h.x(_);!function(t,e,i){if(!(isNaN(p)||p<=0)){c.save();var o=Ci(i.lineWidth,r.borderWidth);if(c.fillStyle=Ci(i.fillStyle,a),c.lineCap=Ci(i.lineCap,r.borderCapStyle),c.lineDashOffset=Ci(i.lineDashOffset,r.borderDashOffset),c.lineJoin=Ci(i.lineJoin,r.borderJoinStyle),c.lineWidth=o,c.strokeStyle=Ci(i.strokeStyle,a),c.setLineDash&&c.setLineDash(Ci(i.lineDash,r.borderDash)),n&&n.usePointStyle){var s=p*Math.SQRT2/2,l=h.xPlus(t,p/2),u=e+m/2;H.canvas.drawPoint(c,i.pointStyle,s,l,u,i.rotation)}else c.fillRect(h.leftForLtr(t,p),e,p,m),0!==o&&c.strokeRect(h.leftForLtr(t,p),e,p,m);c.restore()}}(k,w,e),v[i].left=h.leftForLtr(k,v[i].width),v[i].top=w,function(t,e,n,i){var a=m/2,r=h.xPlus(t,p+a),o=e+a;c.fillText(n.text,r,o),n.hidden&&(c.beginPath(),c.lineWidth=2,c.moveTo(r,o),c.lineTo(h.xPlus(r,i),o),c.stroke())}(k,w,e,f),y?d.x+=g+n.padding:d.y+=x})),H.rtl.restoreTextDirection(t.ctx,e.textDirection)}},_getLegendItemAt:function(t,e){var n,i,a,r=this;if(t>=r.left&&t<=r.right&&e>=r.top&&e<=r.bottom)for(a=r.legendHitBoxes,n=0;n=(i=a[n]).left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height)return r.legendItems[n];return null},handleEvent:function(t){var e,n=this,i=n.options,a="mouseup"===t.type?"click":t.type;if("mousemove"===a){if(!i.onHover&&!i.onLeave)return}else{if("click"!==a)return;if(!i.onClick)return}e=n._getLegendItemAt(t.x,t.y),"click"===a?e&&i.onClick&&i.onClick.call(n,t.native,e):(i.onLeave&&e!==n._hoveredItem&&(n._hoveredItem&&i.onLeave.call(n,t.native,n._hoveredItem),n._hoveredItem=e),i.onHover&&e&&i.onHover.call(n,t.native,e))}});function Oi(t,e){var n=new Ti({ctx:t.ctx,options:e,chart:t});me.configure(t,n,e),me.addBox(t,n),t.legend=n}var Ai={id:"legend",_element:Ti,beforeInit:function(t){var e=t.options.legend;e&&Oi(t,e)},beforeUpdate:function(t){var e=t.options.legend,n=t.legend;e?(H.mergeIf(e,W.global.legend),n?(me.configure(t,n,e),n.options=e):Oi(t,e)):n&&(me.removeBox(t,n),delete t.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}},Fi=H.noop;W._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var Ii=$.extend({initialize:function(t){H.extend(this,t),this.legendHitBoxes=[]},beforeUpdate:Fi,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:Fi,beforeSetDimensions:Fi,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:Fi,beforeBuildLabels:Fi,buildLabels:Fi,afterBuildLabels:Fi,beforeFit:Fi,fit:function(){var t,e=this,n=e.options,i=e.minSize={},a=e.isHorizontal();n.display?(t=(H.isArray(n.text)?n.text.length:1)*H.options._parseFont(n).lineHeight+2*n.padding,e.width=i.width=a?e.maxWidth:t,e.height=i.height=a?t:e.maxHeight):e.width=i.width=e.height=i.height=0},afterFit:Fi,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,n=t.options;if(n.display){var i,a,r,o=H.options._parseFont(n),s=o.lineHeight,l=s/2+n.padding,u=0,d=t.top,h=t.left,c=t.bottom,f=t.right;e.fillStyle=H.valueOrDefault(n.fontColor,W.global.defaultFontColor),e.font=o.string,t.isHorizontal()?(a=h+(f-h)/2,r=d+l,i=f-h):(a="left"===n.position?h+l:f-l,r=d+(c-d)/2,i=c-d,u=Math.PI*("left"===n.position?-.5:.5)),e.save(),e.translate(a,r),e.rotate(u),e.textAlign="center",e.textBaseline="middle";var g=n.text;if(H.isArray(g))for(var m=0,p=0;p=0;i--){var a=t[i];if(e(a))return a}},H.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},H.almostEquals=function(t,e,n){return Math.abs(t-e)=t},H.max=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.max(t,e)}),Number.NEGATIVE_INFINITY)},H.min=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.min(t,e)}),Number.POSITIVE_INFINITY)},H.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0===(t=+t)||isNaN(t)?t:t>0?1:-1},H.toRadians=function(t){return t*(Math.PI/180)},H.toDegrees=function(t){return t*(180/Math.PI)},H._decimalPlaces=function(t){if(H.isFinite(t)){for(var e=1,n=0;Math.round(t*e)/e!==t;)e*=10,n++;return n}},H.getAngleFromPoint=function(t,e){var n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),r=Math.atan2(i,n);return r<-.5*Math.PI&&(r+=2*Math.PI),{angle:r,distance:a}},H.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},H.aliasPixel=function(t){return t%2==0?0:.5},H._alignPixel=function(t,e,n){var i=t.currentDevicePixelRatio,a=n/2;return Math.round((e-a)*i)/i+a},H.splineCurve=function(t,e,n,i){var a=t.skip?e:t,r=e,o=n.skip?e:n,s=Math.sqrt(Math.pow(r.x-a.x,2)+Math.pow(r.y-a.y,2)),l=Math.sqrt(Math.pow(o.x-r.x,2)+Math.pow(o.y-r.y,2)),u=s/(s+l),d=l/(s+l),h=i*(u=isNaN(u)?0:u),c=i*(d=isNaN(d)?0:d);return{previous:{x:r.x-h*(o.x-a.x),y:r.y-h*(o.y-a.y)},next:{x:r.x+c*(o.x-a.x),y:r.y+c*(o.y-a.y)}}},H.EPSILON=Number.EPSILON||1e-14,H.splineCurveMonotone=function(t){var e,n,i,a,r,o,s,l,u,d=(t||[]).map((function(t){return{model:t._model,deltaK:0,mK:0}})),h=d.length;for(e=0;e0?d[e-1]:null,(a=e0?d[e-1]:null,a=e=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},H.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},H.niceNum=function(t,e){var n=Math.floor(H.log10(t)),i=t/Math.pow(10,n);return(e?i<1.5?1:i<3?2:i<7?5:10:i<=1?1:i<=2?2:i<=5?5:10)*Math.pow(10,n)},H.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},H.getRelativePosition=function(t,e){var n,i,a=t.originalEvent||t,r=t.target||t.srcElement,o=r.getBoundingClientRect(),s=a.touches;s&&s.length>0?(n=s[0].clientX,i=s[0].clientY):(n=a.clientX,i=a.clientY);var l=parseFloat(H.getStyle(r,"padding-left")),u=parseFloat(H.getStyle(r,"padding-top")),d=parseFloat(H.getStyle(r,"padding-right")),h=parseFloat(H.getStyle(r,"padding-bottom")),c=o.right-o.left-l-d,f=o.bottom-o.top-u-h;return{x:n=Math.round((n-o.left-l)/c*r.width/e.currentDevicePixelRatio),y:i=Math.round((i-o.top-u)/f*r.height/e.currentDevicePixelRatio)}},H.getConstraintWidth=function(t){return n(t,"max-width","clientWidth")},H.getConstraintHeight=function(t){return n(t,"max-height","clientHeight")},H._calculatePadding=function(t,e,n){return(e=H.getStyle(t,e)).indexOf("%")>-1?n*parseInt(e,10)/100:parseInt(e,10)},H._getParentNode=function(t){var e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e},H.getMaximumWidth=function(t){var e=H._getParentNode(t);if(!e)return t.clientWidth;var n=e.clientWidth,i=n-H._calculatePadding(e,"padding-left",n)-H._calculatePadding(e,"padding-right",n),a=H.getConstraintWidth(t);return isNaN(a)?i:Math.min(i,a)},H.getMaximumHeight=function(t){var e=H._getParentNode(t);if(!e)return t.clientHeight;var n=e.clientHeight,i=n-H._calculatePadding(e,"padding-top",n)-H._calculatePadding(e,"padding-bottom",n),a=H.getConstraintHeight(t);return isNaN(a)?i:Math.min(i,a)},H.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},H.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==n){var i=t.canvas,a=t.height,r=t.width;i.height=a*n,i.width=r*n,t.ctx.scale(n,n),i.style.height||i.style.width||(i.style.height=a+"px",i.style.width=r+"px")}},H.fontString=function(t,e,n){return e+" "+t+"px "+n},H.longestText=function(t,e,n,i){var a=(i=i||{}).data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(a=i.data={},r=i.garbageCollect=[],i.font=e),t.font=e;var o,s,l,u,d,h=0,c=n.length;for(o=0;on.length){for(o=0;oi&&(i=r),i},H.numberOfLabelLines=function(t){var e=1;return H.each(t,(function(t){H.isArray(t)&&t.length>e&&(e=t.length)})),e},H.color=k?function(t){return t instanceof CanvasGradient&&(t=W.global.defaultColor),k(t)}:function(t){return console.error("Color.js not found!"),t},H.getHoverColor=function(t){return t instanceof CanvasPattern||t instanceof CanvasGradient?t:H.color(t).saturate(.5).darken(.1).rgbString()}}(),en._adapters=rn,en.Animation=K,en.animationService=J,en.controllers=Jt,en.DatasetController=it,en.defaults=W,en.Element=$,en.elements=wt,en.Interaction=re,en.layouts=me,en.platform=Ie,en.plugins=Le,en.Scale=xn,en.scaleService=Re,en.Ticks=on,en.Tooltip=Ge,en.helpers.each(fi,(function(t,e){en.scaleService.registerScaleType(e,t,t._defaults)})),Ri)Ri.hasOwnProperty(zi)&&en.plugins.register(Ri[zi]);en.platform.initialize();var Ei=en;return"undefined"!=typeof window&&(window.Chart=en),en.Chart=en,en.Legend=Ri.legend._element,en.Title=Ri.title._element,en.pluginService=en.plugins,en.PluginBase=en.Element.extend({}),en.canvasHelpers=en.helpers.canvas,en.layoutService=en.layouts,en.LinearScaleBase=Dn,en.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],(function(t){en[t]=function(e,n){return new en(e,en.helpers.merge(n||{},{type:t.charAt(0).toLowerCase()+t.slice(1)}))}})),Ei})); diff --git a/src/stylus/style.styl b/src/stylus/style.styl index 36e64a2..355a188 100644 --- a/src/stylus/style.styl +++ b/src/stylus/style.styl @@ -1,3 +1,30 @@ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2020, Buildbotics LLC, All rights reserved. + + This Source describes Open Hardware and is licensed under the + CERN-OHL-S v2. + + You may redistribute and modify this Source and make products + using it under the terms of the CERN-OHL-S v2 (https:/cern.ch/cern-ohl). + This Source is distributed WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS + FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 for applicable + conditions. + + Source location: https://github.com/buildbotics + + As per CERN-OHL-S v2 section 4, should You produce hardware based on + these sources, You must maintain the Source Location clearly visible on + the external case of the CNC Controller or other product you make using + this Source. + + For more information, email info@buildbotics.com + +\******************************************************************************/ + body overflow-y scroll @@ -89,7 +116,7 @@ tt .banner float left - padding-top 40px + padding-top 30px white-space nowrap img @@ -111,6 +138,9 @@ tt font-weight 100 color #aaa + .copyright + font-size 10pt + .error background red -- 2.27.0