pull/253/head
openbuilds-engineer 2022-07-12 15:44:08 +02:00
rodzic 6deff60157
commit ea1626042f
19 zmienionych plików z 15410 dodań i 3 usunięć

Wyświetl plik

@ -18,7 +18,7 @@ jobs:
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 14
node-version: 16
- name: Prepare for app notarization
if: startsWith(matrix.os, 'macos')
# Import Apple API key for app notarization on macOS

Plik diff jest za duży Load Diff

Wyświetl plik

@ -0,0 +1,689 @@
//TODO: Merge Name, Description, Template into array under object
var grblSettingsTemplate2 = {
0: {
key: `$0`,
title: `Step pulse time, microseconds`,
description: `Stepper drivers are rated for a certain minimum step pulse length. Check the data sheet or just try some numbers. You want the shortest pulses the stepper drivers can reliably recognize. If the pulses are too long, you might run into trouble when running the system at very high feed and pulse rates, because the step pulses can begin to overlap each other. We recommend something around 10 microseconds, which is the default value`,
template: `<input id="val-0-input" data-role="input" data-clear-button="false" data-append="&micro;s" type="text">`,
utils: ``
},
1: {
key: `$1`,
title: `Step idle delay, milliseconds`,
description: `Every time your steppers complete a motion and come to a stop, Grbl will delay disabling the steppers by this value. OR, you can always keep your axes enabled (powered so as to hold position) by setting this value to the maximum 255 milliseconds. Again, just to repeat, you can keep all axes always enabled by setting $1=255. The stepper idle lock time is the time length Grbl will keep the steppers locked before disabling. Depending on the system, you can set this to zero and disable it. On others, you may need 25-50 milliseconds to make sure your axes come to a complete stop before disabling. This is to help account for machine motors that do not like to be left on for long periods of time without doing something. Also, keep in mind that some stepper drivers don't remember which micro step they stopped on, so when you re-enable, you may witness some 'lost' steps due to this. In this case, just keep your steppers enabled via $1=255`,
template: `<input id="val-1-input" data-role="input" data-clear-button="false" data-append="ms" type="text">`,
utils: ``
},
2: {
key: `$2`,
title: `Step pulse invert, mask`,
description: `This setting inverts the step pulse signal. By default, a step signal starts at normal-low and goes high upon a step pulse event. After a step pulse time set by $0, the pin resets to low, until the next step pulse event. When inverted, the step pulse behavior switches from normal-high, to low during the pulse, and back to high. Most users will not need to use this setting, but this can be useful for certain CNC-stepper drivers that have peculiar requirements. For example, an artificial delay between the direction pin and step pulse can be created by inverting the step pin.`,
template: `<input id="val-2-input" data-role="input" data-clear-button="false" data-append="mask" type="text">`,
utils: ``
},
3: {
key: `$3`,
title: `Step direction invert, mask`,
description: `This setting inverts the direction signal for each axis. By default, Grbl assumes that the axes move in a positive direction when the direction pin signal is low, and a negative direction when the pin is high. Often, axes don't move this way with some machines. This setting will invert the direction pin signal for those axes that move the opposite way.`,
template: `<input id="val-3-input" readonly type="hidden" />
<table style="width: 100%;">
<tr>
<td><span class="text-small">X</span>
</td>
<td><span class="text-small">Normal</span>
</td>
<td class="pb-1">
<label class="toggle">
<input type="checkbox" id="xdirinvert" />
<div>app-notification</div>
</label>
</td>
<td><span class="text-small">Reversed</span>
</td>
</tr>
<tr>
<td><span class="text-small">Y</span>
</td>
<td><span class="text-small">Normal</span>
</td>
<td class="pb-1">
<label class="toggle">
<input type="checkbox" id="ydirinvert" />
<div>app-notification</div>
</label>
</td>
<td><span class="text-small">Reversed</span>
</td>
</tr>
<tr>
<td><span class="text-small">Z</span>
</td>
<td><span class="text-small">Normal</span>
</td>
<td class="pb-1">
<label class="toggle">
<input type="checkbox" id="zdirinvert" />
<div>app-notification</div>
</label>
</td>
<td><span class="text-small">Reversed</span>
</td>
</tr>
</table>`,
utils: ``
},
4: {
key: `$4`,
title: `Invert step enable pin, boolean`,
description: `If you have an xPro 2/3 or BlackBox 4X, set it to 1. for BlackBox X32 set to 0. By default, the stepper enable pin is high to disable and low to enable. If your setup needs the opposite, just invert the stepper enable pin by typing $4=1. Disable with $4=0. (May need a power cycle to load the change.)`,
template: `<input id="val-4-input" data-role="input" data-clear-button="false" data-append="mask/bool" type="text">`,
utils: ``
},
5: {
key: `$5`,
title: `Invert limit pins, boolean/mask`,
description: `By default, the limit pins are held normally-high with the Arduino's internal pull-up resistor. When a limit pin is low, Grbl interprets this as triggered. For the opposite behavior, just invert the limit pins by typing $5=1. Disable with $5=0. You may need a power cycle to load the change. NOTE: For more advanced usage, the internal pull-up resistor on the limit pins may be disabled in config.h.`,
template: `<input id="val-5-input" data-role="input" data-clear-button="false" data-append="mask/bool" type="text">`,
utils: ``
},
6: {
key: `$6`,
title: `Invert probe pin, boolean`,
description: `By default, the probe pin is held normally-high with the Arduino's internal pull-up resistor. When the probe pin is low, Grbl interprets this as triggered. For the opposite behavior, just invert the probe pin by typing $6=1. Disable with $6=0. You may need a power cycle to load the change.`,
template: `<select id="val-6-input">
<option value="0">&#x2717; Disable</option>
<option value="1">&#x2713; Enable</option>
</select>`,
utils: ``
},
10: {
key: `$10`,
title: `Status report options, mask`,
description: `This setting determines what Grbl real-time data it reports back to the user when a '?' status report is sent. This data includes current run state, real-time position, real-time feed rate, pin states, current override values, buffer states, and the g-code line number currently executing (if enabled through compile-time options).`,
template: `<input id="val-10-input" data-role="input" data-clear-button="false" data-append="mask" type="text">`,
utils: ``
},
11: {
key: `$11`,
title: `Junction deviation, millimeters`,
description: `Junction deviation is used by the acceleration manager to determine how fast it can move through line segment junctions of a G-code program path. For example, if the G-code path has a sharp 10 degree turn coming up and the machine is moving at full speed, this setting helps determine how much the machine needs to slow down to safely go through the corner without losing steps`,
template: `<input id="val-11-input" data-role="input" data-clear-button="false" data-append="mm" type="text">`,
utils: ``
},
12: {
key: `$12`,
title: `Arc tolerance, millimeters`,
description: `Grbl renders G2/G3 circles, arcs, and helices by subdividing them into teeny tiny lines, such that the arc tracing accuracy is never below this value. You will probably never need to adjust this setting, since 0.002mm is well below the accuracy of most all CNC machines. But if you find that your circles are too crude or arc tracing is performing slowly, adjust this setting. Lower values give higher precision but may lead to performance issues by overloading Grbl with too many tiny lines. Alternately, higher values traces to a lower precision, but can speed up arc performance since Grbl has fewer lines to deal with.`,
template: `<input id="val-12-input" data-role="input" data-clear-button="false" data-append="mm" type="text">`,
utils: ``
},
13: {
key: `$13`,
title: `Report in inches, boolean`,
description: `Grbl has a real-time positioning reporting feature to provide a user feedback on where the machine is exactly at that time, as well as, parameters for coordinate offsets and probing. By default, it is set to report in mm, but by sending a $13=1 command, you send this boolean flag to true and these reporting features will now report in inches. $13=0 to set back to mm.`,
template: `<select id="val-13-input">
<option value="0">&#9898; Disable</option>
<option value="1">&#9899; Enable</option>
</select>`,
utils: ``
},
20: {
key: `$20`,
title: `Soft limits enable, boolean`,
description: `Soft limits is a safety feature to help prevent your machine from traveling too far and beyond the limits of travel, crashing or breaking something expensive. It works by knowing the maximum travel limits for each axis and where Grbl is in machine coordinates. Whenever a new G-code motion is sent to Grbl, it checks whether or not you accidentally have exceeded your machine space. If you do, Grbl will issue an immediate feed hold wherever it is, shutdown the spindle and coolant, and then set the system alarm indicating the problem. Machine position will be retained afterwards, since it's not due to an immediate forced stop like hard limits. NOTE: Soft limits requires homing to be enabled and accurate axis maximum travel settings, because Grbl needs to know where it is. $20=1 to enable, and $20=0 to disable.`,
template: `
<span id="grblSettingsLimits">&nbsp;</span>
<select id="val-20-input">
<option value="0">&#x2717; Disable</option>
<option value="1">&#x2713; Enable</option>
</select>`,
utils: ``
},
21: {
key: `$21`,
title: `Hard limits enable, boolean`,
description: `Hard limit work basically the same as soft limits, but use physical switches instead. Basically you wire up some switches (mechanical, magnetic, or optical) near the end of travel of each axes, or where ever you feel that there might be trouble if your program moves too far to where it shouldn't. When the switch triggers, it will immediately halt all motion, shutdown the coolant and spindle (if connected), and go into alarm mode, which forces you to check your machine and reset everything. To use hard limits with Grbl, the limit pins are held high with an internal pull-up resistor, so all you have to do is wire in a normally-open switch with the pin and ground and enable hard limits with $21=1. (Disable with $21=0.) We strongly advise taking electric interference prevention measures. If you want a limit for both ends of travel of one axes, just wire in two switches in parallel with the pin and ground, so if either one of them trips, it triggers the hard limit. Keep in mind, that a hard limit event is considered to be critical event, where steppers immediately stop and will have likely have lost steps. Grbl doesn't have any feedback on position, so it can't guarantee it has any idea where it is. So, if a hard limit is triggered, Grbl will go into an infinite loop ALARM mode, giving you a chance to check your machine and forcing you to reset Grbl. Remember it's a purely a safety feature.`,
template: `<select id="val-21-input">
<option value="0">&#x2717; Disable</option>
<option value="1">&#x2713; Enable</option>
</select>`,
utils: ``
},
22: {
key: `$22`,
title: `Homing cycle enable, boolean`,
description: `The homing cycle is used to accurately and precisely locate a known and consistent position on a machine every time you start up your Grbl between sessions. In other words, you know exactly where you are at any given time, every time. Say you start machining something or are about to start the next step in a job and the power goes out, you re-start Grbl and Grbl has no idea where it is due to steppers being open-loop control. You're left with the task of figuring out where you are. If you have homing, you always have the machine zero reference point to locate from, so all you have to do is run the homing cycle and resume where you left off. To set up the homing cycle for Grbl, you need to have limit switches in a fixed position that won't get bumped or moved, or else your reference point gets messed up. Usually they are setup in the farthest point in +x, +y, +z of each axes. Wire your limit switches in with the limit pins, add a recommended RC-filter to help reduce electrical noise, and enable homing. If you're curious, you can use your limit switches for both hard limits AND homing. They play nice with each other. Prior to trying the homing cycle for the first time, make sure you have setup everything correctly, otherwise homing may behave strangely. First, ensure your machine axes are moving in the correct directions per Cartesian coordinates (right-hand rule). If not, fix it with the $3 direction invert setting. Second, ensure your limit switch pins are not showing as 'triggered' in Grbl's status reports. If are, check your wiring and settings. Finally, ensure your $13x max travel settings are somewhat accurate (within 20%), because Grbl uses these values to determine how far it should search for the homing switches. By default, Grbl's homing cycle moves the Z-axis positive first to clear the workspace and then moves both the X and Y-axes at the same time in the positive direction. To set up how your homing cycle behaves, there are more Grbl settings down the page describing what they do (and compile-time options as well.). Also, one more thing to note, when homing is enabled. Grbl will lock out all G-code commands until you perform a homing cycle. Meaning no axes motions, unless the lock is disabled ($X) but more on that later. Most, if not all CNC controllers, do something similar, as it is mostly a safety feature to prevent users from making a positioning mistake, which is very easy to do and be saddened when a mistake ruins a part. If you find this annoying or find any weird bugs, please let us know and we'll try to work on it so everyone is happy. :) NOTE: Check out config.h for more homing options for advanced users. You can disable the homing lockout at startup, configure which axes move first during a homing cycle and in what order, and more.`,
template: `<select id="val-22-input">
<option value="0">&#x2717; Disable</option>
<option value="1">&#x2713; Enable</option>
</select>`,
utils: ``
},
23: {
key: `$23`,
title: `Homing direction invert, mask`,
description: `By default, Grbl assumes your homing limit switches are in the positive direction, first moving the z-axis positive, then the x-y axes positive before trying to precisely locate machine zero by going back and forth slowly around the switch. If your machine has a limit switch in the negative direction, the homing direction mask can invert the axes' direction. It works just like the step port invert and direction port invert masks, where all you have to do is send the value in the table to indicate what axes you want to invert and search for in the opposite direction.`,
template: `<input id="val-23-input" readonly type="hidden">
<table style="width: 100%;">
<tr>
<td><span class="text-small">X</span>
</td>
<td><span class="text-small">Min</span>
</td>
<td class="pb-1">
<label class="toggle">
<input type="checkbox" id="xHomeDir" />
<div>app-notification</div>
</label>
</td>
<td><span class="text-small">Max</span>
</td>
</tr>
<tr>
<td><span class="text-small">Y</span>
</td>
<td><span class="text-small">Min</span>
</td>
<td class="pb-1">
<label class="toggle">
<input type="checkbox" id="yHomeDir" />
<div>app-notification</div>
</label>
</td>
<td><span class="text-small">Max</span>
</td>
</tr>
<tr>
<td><span class="text-small">Z</span>
</td>
<td><span class="text-small">Min</span>
</td>
<td class="pb-1">
<label class="toggle">
<input type="checkbox" id="zHomeDir" />
<div>app-notification</div>
</label>
</td>
<td><span class="text-small">Max</span>
</td>
</tr>
</table>`,
utils: ``
},
24: {
key: `$24`,
title: `Homing locate feed rate, mm/min`,
description: `The homing cycle first searches for the limit switches at a higher seek rate, and after it finds them, it moves at a slower feed rate to home into the precise location of machine zero. Homing feed rate is that slower feed rate. Set this to whatever rate value that provides repeatable and precise machine zero locating.`,
template: `<input id="val-24-input" data-role="input" data-clear-button="false" data-append="mm/min" type="text">`,
utils: ``
},
25: {
key: `$25`,
title: `Homing search seek rate, mm/min`,
description: `Homing seek rate is the homing cycle search rate, or the rate at which it first tries to find the limit switches. Adjust to whatever rate gets to the limit switches in a short enough time without crashing into your limit switches if they come in too fast.`,
template: `<input id="val-25-input" data-role="input" data-clear-button="false" data-append="mm/min" type="text">`,
utils: ``
},
26: {
key: `$26`,
title: `Homing switch debounce delay, milliseconds`,
description: `Whenever a switch triggers, some of them can have electrical/mechanical noise that actually 'bounce' the signal high and low for a few milliseconds before settling in. To solve this, you need to debounce the signal, either by hardware with some kind of signal conditioner or by software with a short delay to let the signal finish bouncing. Grbl performs a short delay, only homing when locating machine zero. Set this delay value to whatever your switch needs to get repeatable homing. In most cases, 5-25 milliseconds is fine.`,
template: `<input id="val-26-input" data-role="input" data-clear-button="false" data-append="ms" type="text">`,
utils: ``
},
27: {
key: `$27`,
title: `Homing switch pull-off distance, millimeters`,
description: `To play nice with the hard limits feature, where homing can share the same limit switches, the homing cycle will move off all of the limit switches by this pull-off travel after it completes. In other words, it helps to prevent accidental triggering of the hard limit after a homing cycle. Make sure this value is large enough to clear the limit switch. If not, Grbl will throw an alarm error for failing to clear it.`,
template: `<input id="val-27-input" data-role="input" data-clear-button="false" data-append="mm" type="text">`,
utils: ``
},
30: {
key: `$30`,
title: `Maximum spindle speed, RPM`,
description: `This sets the spindle speed for the maximum 5V PWM pin output. For example, if you want to set 10000rpm at 5V, program $30=10000. For 255rpm at 5V, program $30=255. If a program tries to set a higher spindle RPM greater than the $30 max spindle speed, Grbl will just output the max 5V, since it can't go any faster. By default, Grbl linearly relates the max-min RPMs to 5V-0.02V PWM pin output in 255 equally spaced increments. When the PWM pin reads 0V, this indicates spindle disabled. Note that there are additional configuration options are available in config.h to tweak how this operates.`,
template: `<input id="val-30-input" data-role="input" data-clear-button="false" data-append="RPM" type="text">`,
utils: ``
},
31: {
key: `$31`,
title: `Minimum spindle speed, RPM`,
description: `This sets the spindle speed for the minimum 0.02V PWM pin output (0V is disabled). Lower RPM values are accepted by Grbl but the PWM output will not go below 0.02V, except when RPM is zero. If zero, the spindle is disabled and PWM output is 0V.`,
template: `<input id="val-31-input" data-role="input" data-clear-button="false" data-append="RPM" type="text">`,
utils: ``
},
32: {
key: `$32`,
title: `Laser-mode enable, boolean`,
description: `When enabled, Grbl will move continuously through consecutive G1, G2, or G3 motion commands when programmed with a S spindle speed (laser power). The spindle PWM pin will be updated instantaneously through each motion without stopping. Please read the GRBL laser documentation and your laser device documentation prior to using this mode. Lasers are very dangerous. They can instantly damage your vision permanantly and cause fires. Grbl does not assume any responsibility for any issues the firmware may cause, as defined by its GPL license. When disabled, Grbl will operate as it always has, stopping motion with every S spindle speed command. This is the default operation of a milling machine to allow a pause to let the spindle change speeds.`,
template: `<select id="val-32-input">
<option value="0">&#x2717; Disable</option>
<option value="1">&#x2713; Enable</option>
</select>`,
utils: ``
},
100: {
key: `$100`,
title: `X-axis steps per millimeter`,
description: `Grbl needs to know how far each step will take the tool in reality. - use the tools on the right to compute/calibrate`,
template: `<input id="val-100-input" data-role="input" data-clear-button="false" data-append="steps/mm" type="text">`,
utils: `<center>
<button title="Calculate X-Axis Steps per mm" class="button " type="button" onclick="xstepspermm()">
<span class="fa-layers fa-fw">
<i class="fas fa-calculator" data-fa-transform="shrink-2"></i>
<span class="fa-layers-text" data-fa-transform="up-16" style="font-weight:600; font-family: Arial; font-size: 10px;">Calc</span>
<span class="fa-layers-text" data-fa-transform="down-19" style="font-weight:600; font-family: Arial; font-size: 10px;">Steps</span>
</span>
</button>
</center>`
},
101: {
key: `$101`,
title: `Y-axis steps per millimeter`,
description: `Grbl needs to know how far each step will take the tool in reality. - use the tools on the right to compute/calibrate1`,
template: `<input id="val-101-input" data-role="input" data-clear-button="false" data-append="steps/mm" type="text">`,
utils: `<center>
<button title="Calculate Y-Axis Steps per mm" class="button" type="button" onclick="ystepspermm()">
<span class="fa-layers fa-fw">
<i class="fas fa-calculator" data-fa-transform="shrink-2"></i>
<span class="fa-layers-text" data-fa-transform="up-16" style="font-weight:600; font-family: Arial; font-size: 10px;">Calc</span>
<span class="fa-layers-text" data-fa-transform="down-19" style="font-weight:600; font-family: Arial; font-size: 10px;">Steps</span>
</span>
</button>
</center>`
},
102: {
key: `$102`,
title: `Z-axis steps per millimeter`,
description: `Grbl needs to know how far each step will take the tool in reality. - use the tools on the right to compute/calibrate`,
template: `<input id="val-102-input" data-role="input" data-clear-button="false" data-append="steps/mm" type="text">`,
utils: `<center>
<button title="Calculate Z-Axis Steps per mm" class="button" type="button" onclick="zstepspermm()">
<span class="fa-layers fa-fw">
<i class="fas fa-calculator" data-fa-transform="shrink-2"></i>
<span class="fa-layers-text" data-fa-transform="up-16" style="font-weight:600; font-family: Arial; font-size: 10px;">Calc</span>
<span class="fa-layers-text" data-fa-transform="down-19" style="font-weight:600; font-family: Arial; font-size: 10px;">Steps</span>
</span>
</button>
</center>`
},
110: {
key: `$110`,
title: `X-axis maximum rate, mm/min`,
description: `This sets the maximum rate each axis can move. Whenever Grbl plans a move, it checks whether or not the move causes any one of these individual axes to exceed their max rate. If so, it'll slow down the motion to ensure none of the axes exceed their max rate limits. This means that each axis has its own independent speed, which is extremely useful for limiting the typically slower Z-axis. The simplest way to determine these values is to test each axis one at a time by slowly increasing max rate settings and moving it. For example, to test the X-axis, send Grbl something like G0 X50 with enough travel distance so that the axis accelerates to its max speed. You'll know you've hit the max rate threshold when your steppers stall. It'll make a bit of noise, but shouldn't hurt your motors. Enter a setting a 10-20% below this value, so you can account for wear, friction, and the mass of your workpiece/tool. Then, repeat for your other axes. NOTE: This max rate setting also sets the G0 seek rates.`,
template: `<input id="val-110-input" data-role="input" data-clear-button="false" data-append="mm/min" type="text">`,
utils: ``
},
111: {
key: `$111`,
title: `Y-axis maximum rate, mm/min`,
description: `This sets the maximum rate each axis can move. Whenever Grbl plans a move, it checks whether or not the move causes any one of these individual axes to exceed their max rate. If so, it'll slow down the motion to ensure none of the axes exceed their max rate limits. This means that each axis has its own independent speed, which is extremely useful for limiting the typically slower Z-axis. The simplest way to determine these values is to test each axis one at a time by slowly increasing max rate settings and moving it. For example, to test the X-axis, send Grbl something like G0 X50 with enough travel distance so that the axis accelerates to its max speed. You'll know you've hit the max rate threshold when your steppers stall. It'll make a bit of noise, but shouldn't hurt your motors. Enter a setting a 10-20% below this value, so you can account for wear, friction, and the mass of your workpiece/tool. Then, repeat for your other axes. NOTE: This max rate setting also sets the G0 seek rates.`,
template: `<input id="val-111-input" data-role="input" data-clear-button="false" data-append="mm/min" type="text">`,
utils: ``
},
112: {
key: `$112`,
title: `Z-axis maximum rate, mm/min`,
description: `This sets the maximum rate each axis can move. Whenever Grbl plans a move, it checks whether or not the move causes any one of these individual axes to exceed their max rate. If so, it'll slow down the motion to ensure none of the axes exceed their max rate limits. This means that each axis has its own independent speed, which is extremely useful for limiting the typically slower Z-axis. The simplest way to determine these values is to test each axis one at a time by slowly increasing max rate settings and moving it. For example, to test the X-axis, send Grbl something like G0 X50 with enough travel distance so that the axis accelerates to its max speed. You'll know you've hit the max rate threshold when your steppers stall. It'll make a bit of noise, but shouldn't hurt your motors. Enter a setting a 10-20% below this value, so you can account for wear, friction, and the mass of your workpiece/tool. Then, repeat for your other axes. NOTE: This max rate setting also sets the G0 seek rates.`,
template: `<input id="val-112-input" data-role="input" data-clear-button="false" data-append="mm/min" type="text">`,
utils: ``
},
120: {
key: `$120`,
title: `X-axis acceleration, mm/sec^2`,
description: `This sets the axes acceleration parameters in mm/second/second. Simplistically, a lower value makes Grbl ease slower into motion, while a higher value yields tighter moves and reaches the desired feed rates much quicker. Much like the max rate setting, each axis has its own acceleration value and are independent of each other. This means that a multi-axis motion will only accelerate as quickly as the lowest contributing axis can. Again, like the max rate setting, the simplest way to determine the values for this setting is to individually test each axis with slowly increasing values until the motor stalls. Then finalize your acceleration setting with a value 10-20% below this absolute max value. This should account for wear, friction, and mass inertia. We highly recommend that you dry test some G-code programs with your new settings before committing to them. Sometimes the loading on your machine is different when moving in all axes together.`,
template: `<input id="val-120-input" data-role="input" data-clear-button="false" data-append="mm/sec&sup2" type="text">`,
utils: ``
},
121: {
key: `$121`,
title: `Y-axis acceleration, mm/sec^2`,
description: `This sets the axes acceleration parameters in mm/second/second. Simplistically, a lower value makes Grbl ease slower into motion, while a higher value yields tighter moves and reaches the desired feed rates much quicker. Much like the max rate setting, each axis has its own acceleration value and are independent of each other. This means that a multi-axis motion will only accelerate as quickly as the lowest contributing axis can. Again, like the max rate setting, the simplest way to determine the values for this setting is to individually test each axis with slowly increasing values until the motor stalls. Then finalize your acceleration setting with a value 10-20% below this absolute max value. This should account for wear, friction, and mass inertia. We highly recommend that you dry test some G-code programs with your new settings before committing to them. Sometimes the loading on your machine is different when moving in all axes together.`,
template: `<input id="val-121-input" data-role="input" data-clear-button="false" data-append="mm/sec&sup2" type="text">`,
utils: ``
},
122: {
key: `$122`,
title: `Z-axis acceleration, mm/sec^2`,
description: `This sets the axes acceleration parameters in mm/second/second. Simplistically, a lower value makes Grbl ease slower into motion, while a higher value yields tighter moves and reaches the desired feed rates much quicker. Much like the max rate setting, each axis has its own acceleration value and are independent of each other. This means that a multi-axis motion will only accelerate as quickly as the lowest contributing axis can. Again, like the max rate setting, the simplest way to determine the values for this setting is to individually test each axis with slowly increasing values until the motor stalls. Then finalize your acceleration setting with a value 10-20% below this absolute max value. This should account for wear, friction, and mass inertia. We highly recommend that you dry test some G-code programs with your new settings before committing to them. Sometimes the loading on your machine is different when moving in all axes together.`,
template: `<input id="val-122-input" data-role="input" data-clear-button="false" data-append="mm/sec&sup2" type="text">`,
utils: ``
},
130: {
key: `$130`,
title: `X-axis maximum travel, millimeters`,
description: `This sets the maximum travel from end to end for each axis in mm. This is only useful if you have soft limits (and homing) enabled, as this is only used by Grbl's soft limit feature to check if you have exceeded your machine limits with a motion command.`,
template: `<input id="val-130-input" data-role="input" data-clear-button="false" data-append="mm" type="text">`,
utils: ``
},
131: {
key: `$131`,
title: `Y-axis maximum travel, millimeters`,
description: `This sets the maximum travel from end to end for each axis in mm. This is only useful if you have soft limits (and homing) enabled, as this is only used by Grbl's soft limit feature to check if you have exceeded your machine limits with a motion command.`,
template: `<input id="val-131-input" data-role="input" data-clear-button="false" data-append="mm" type="text">`,
utils: ``
},
132: {
key: `$132`,
title: `Z-axis maximum travel, millimeters`,
description: `This sets the maximum travel from end to end for each axis in mm. This is only useful if you have soft limits (and homing) enabled, as this is only used by Grbl's soft limit feature to check if you have exceeded your machine limits with a motion command.`,
template: `<input id="val-132-input" data-role="input" data-clear-button="false" data-append="mm" type="text">`,
utils: ``
},
7: {
key: `$7`,
title: `Disable spindle with 0 speed, boolean`,
description: ``,
template: `<input id="val-7-input" data-role="input" data-clear-button="false" data-append="bool" type="text" >`,
utils: ``
},
14: {
key: `$14`,
title: `Limit pins invert, mask`,
description: ``,
template: `<input id="val-14-input" data-role="input" data-clear-button="false" data-append="mask" type="text" >`,
utils: ``
},
15: {
key: `$15`,
title: `Coolant pins invert, mask`,
description: ``,
template: `<input id="val-15-input" data-role="input" data-clear-button="false" data-append="mask" type="text" >`,
utils: ``
},
16: {
key: `$16`,
title: `Spindle pins invert, mask`,
description: ``,
template: `<input id="val-16-input" data-role="input" data-clear-button="false" data-append="mask" type="text" >`,
utils: ``
},
17: {
key: `$17`,
title: `Control pins pullup disable, mask`,
description: ``,
template: `<input id="val-17-input" data-role="input" data-clear-button="false" data-append="mask" type="text" >`,
utils: ``
},
18: {
key: `$18`,
title: `Limit pins pullup disable, mask`,
description: ``,
template: `<input id="val-18-input" data-role="input" data-clear-button="false" data-append="mask" type="text" >`,
utils: ``
},
19: {
key: `$19`,
title: `Probe pin pullup disable, boolean`,
description: ``,
template: `<input id="val-19-input" data-role="input" data-clear-button="false" data-append="bool" type="text" >`,
utils: ``
},
28: {
key: `$28`,
title: `G73 retract distance, in mm`,
description: ``,
template: `<input id="val-28-input" data-role="input" data-clear-button="false" data-append="mm" type="text" >`,
utils: ``
},
29: {
key: `$29`,
title: `Step pulse delay (ms)`,
description: ``,
template: `<input id="val-29-input" data-role="input" data-clear-button="false" data-append="ms" type="text" >`,
utils: ``
},
33: {
key: `$33`,
title: `Spindle PWM frequency`,
description: ``,
template: `<input id="val-33-input" data-role="input" data-clear-button="false" data-append="Hz" type="text" >`,
utils: ``
},
34: {
key: `$34`,
title: `Spindle off Value`,
description: ``,
template: `<input id="val-34-input" data-role="input" data-clear-button="false" data-append="S" type="text" >`,
utils: ``
},
35: {
key: `$35`,
title: `Spindle min value`,
description: ``,
template: `<input id="val-35-input" data-role="input" data-clear-button="false" data-append="S" type="text" >`,
utils: ``
},
36: {
key: `$36`,
title: `Spindle max value`,
description: ``,
template: `<input id="val-36-input" data-role="input" data-clear-button="false" data-append="S" type="text" >`,
utils: ``
},
37: {
key: `$37`,
title: `Stepper deenergize mask`,
description: ``,
template: `<input id="val-37-input" data-role="input" data-clear-button="false" data-append="mask" type="text" >`,
utils: ``
},
38: {
key: `$38`,
title: `Spindle encoder pulses per revolution`,
description: ``,
template: `<input id="val-38-input" data-role="input" data-clear-button="false" data-append="ppr" type="text" >`,
utils: ``
},
39: {
key: `$39`,
title: `Enable printable realtime command characters, boolean`,
description: ``,
template: `<input id="val-39-input" data-role="input" data-clear-button="false" data-append="bool" type="text" >`,
utils: ``
},
40: {
key: `$40`,
title: `Apply soft limits for jog commands, boolean`,
description: ``,
template: `<input id="val-40-input" data-role="input" data-clear-button="false" data-append="bool" type="text" >`,
utils: ``
},
43: {
key: `$43`,
title: `Homing passes`,
description: ``,
template: `<input id="val-43-input" data-role="input" data-clear-button="false" data-append="passes" type="text" >`,
utils: ``
},
44: {
key: `$44`,
title: `Homing cycle 1`,
description: ``,
template: `<input id="val-44-input" data-role="input" data-clear-button="false" data-append="-" type="text" >`,
utils: ``
},
45: {
key: `$45`,
title: `Homing cycle 2`,
description: ``,
template: `<input id="val-45-input" data-role="input" data-clear-button="false" data-append="-" type="text" >`,
utils: ``
},
46: {
key: `$46`,
title: `Homing cycle 3`,
description: ``,
template: `<input id="val-46-input" data-role="input" data-clear-button="false" data-append="-" type="text" >`,
utils: ``
},
47: {
key: `$47`,
title: `Homing cycle 4`,
description: ``,
template: `<input id="val-47-input" data-role="input" data-clear-button="false" data-append="-" type="text" >`,
utils: ``
},
48: {
key: `$48`,
title: `Homing cycle 5`,
description: ``,
template: `<input id="val-48-input" data-role="input" data-clear-button="false" data-append="-" type="text" >`,
utils: ``
},
49: {
key: `$49`,
title: `Homing cycle 6`,
description: ``,
template: `<input id="val-49-input" data-role="input" data-clear-button="false" data-append="-" type="text" >`,
utils: ``
},
62: {
key: `$62`,
title: `Sleep Enable`,
description: ``,
template: `<input id="val-62-input" data-role="input" data-clear-button="false" data-append="bool" type="text" >`,
utils: ``
},
63: {
key: `$`,
title: `Feed Hold Actions`,
description: `Disable Laser During Hold, Restore Spindle/Coolant on Resume (Mask)`,
template: `<input id="val-63-input" data-role="input" data-clear-button="false" data-append="mask" type="text" >`,
utils: ``
},
64: {
key: `$64`,
title: `Force Init Alarm`,
description: ``,
template: `<input id="val-64-input" data-role="input" data-clear-button="false" data-append="bool" type="text" >`,
utils: ``
},
341: {
key: `$341`,
title: `Tool Change Mode`,
description: ``,
template: `<input id="val-341-input" data-role="input" data-clear-button="false" data-append="mode" type="text" >`,
utils: ``
},
342: {
key: `$342`,
title: `Tool Change probing distance`,
description: ``,
template: `<input id="val-342-input" data-role="input" data-clear-button="false" data-append="mm" type="text" >`,
utils: ``
},
343: {
key: `$343`,
title: `Tool Change Locate Feed rate`,
description: ``,
template: `<input id="val-343-input" data-role="input" data-clear-button="false" data-append="mm/min" type="text" >`,
utils: ``
},
344: {
key: `$344`,
title: `Tool Change Search Seek rate`,
description: ``,
template: `<input id="val-344-input" data-role="input" data-clear-button="false" data-append="mm/min" type="text" >`,
utils: ``
},
345: {
key: `$345`,
title: `Tool Change Probe Pull Off rate`,
description: ``,
template: `<input id="val-345-input" data-role="input" data-clear-button="false" data-append="mm/min" type="text" >`,
utils: ``
},
370: {
key: `$370`,
title: `Invert I/O Port Inputs (mask)`,
description: ``,
template: `<input id="val-370-input" data-role="input" data-clear-button="false" data-append="mask" type="text" >`,
utils: ``
},
384: {
key: `$384`,
title: `Disable G92 Persistence`,
description: ``,
template: `<input id="val-384-input" data-role="input" data-clear-button="false" data-append="bool" type="text" >`,
utils: ``
},
70: {
key: `$70`,
title: `Network Services`,
description: `70`,
template: `<input id="val--input" data-role="input" data-clear-button="false" data-append="mask" type="text" >`,
utils: ``
},
300: {
key: `$300`,
title: `Hostname`,
description: ``,
template: `<input id="val-300-input" data-role="input" data-clear-button="false" data-append="text" type="text" >`,
utils: ``
},
302: {
key: `$302`,
title: `IP Address`,
description: ``,
template: `<input id="val-302-input" data-role="input" data-clear-button="false" data-append="ip" type="text" >`,
utils: ``
},
303: {
key: `$303`,
title: `Gateway`,
description: ``,
template: `<input id="val-303-input" data-role="input" data-clear-button="false" data-append="gateway" type="text" >`,
utils: ``
},
304: {
key: `$304`,
title: `Netmask`,
description: ``,
template: `<input id="val-304-input" data-role="input" data-clear-button="false" data-append="netmask" type="text" >`,
utils: ``
},
305: {
key: `$305`,
title: `Telnet Port`,
description: ``,
template: `<input id="val-305-input" data-role="input" data-clear-button="false" data-append="tcp" type="text" >`,
utils: ``
},
306: {
key: `$306`,
title: `HTTP Port`,
description: ``,
template: `<input id="val-306-input" data-role="input" data-clear-button="false" data-append="tcp" type="text" >`,
utils: ``
},
307: {
key: `$307`,
title: `Websocket Port`,
description: ``,
template: `<input id="val-307-input" data-role="input" data-clear-button="false" data-append="tcp" type="text" >`,
utils: ``
},
73: {
key: `$73`,
title: `Wifi Mode`,
description: ``,
template: `<input id="val-73-input" data-role="input" data-clear-button="false" data-append="mode" type="text" >`,
utils: ``
},
74: {
key: `$74`,
title: `Wifi network SSID`,
description: ``,
template: `<input id="val-74-input" data-role="input" data-clear-button="false" data-append="ssid" type="text" >`,
utils: ``
},
75: {
key: `$75`,
title: `Wifi network PSK`,
description: ``,
template: `<input id="val-75-input" data-role="input" data-clear-button="false" data-append="psk" type="text" >`,
utils: ``
}
}

Wyświetl plik

@ -0,0 +1,773 @@
$(document).ready(function() {
var backupFileOpen = document.getElementById('grblBackupFile');
if (backupFileOpen) {
backupFileOpen.addEventListener('change', readGrblBackupFile, false);
}
});
function readGrblBackupFile(evt) {
var files = evt.target.files || evt.dataTransfer.files;
loadGrblBackupFile(files[0]);
document.getElementById('grblBackupFile').value = '';
}
function loadGrblBackupFile(f) {
if (f) {
// Filereader
var r = new FileReader();
// if (f.name.match(/.gcode$/i)) {
r.readAsText(f);
r.onload = function(event) {
//var grblsettingsfile = this.result
//console.log(this.result)
var data = this.result.split("\n");
for (i = 0; i < data.length; i++) {
if (data[i].indexOf("$I=") == 0) {
setMachineButton(data[i].split('=')[1])
} else {
var key = data[i].split('=')[0];
var param = data[i].split('=')[1]
$("#val-" + key.substring(1) + "-input").val(parseFloat(param))
fixGrblHALSettings(key.substring(1)); // Fix GrblHAL Defaults
}
};
checkifchanged();
enableLimits(); // Enable or Disable
displayDirInvert();
}
}
}
function backupGrblSettings() {
var grblBackup = ""
for (key in grblParams) {
var key2 = key.split('=')[0].substr(1);
if (grblSettingsTemplate2[key2] !== undefined) {
var descr = grblSettingsTemplate2[key2].title
} else {
var descr = "unknown"
}
grblBackup += key + "=" + grblParams[key] + " ; " + descr + "\n"
}
if (laststatus.machine.name.length > 0) {
grblBackup += "$I=" + laststatus.machine.name
}
var blob = new Blob([grblBackup], {
type: "plain/text"
});
var date = new Date();
if (laststatus.machine.name.length > 0) {
invokeSaveAsDialog(blob, 'grbl-settings-backup-' + laststatus.machine.name + "-" + date.yyyymmdd() + '.txt');
} else {
invokeSaveAsDialog(blob, 'grbl-settings-backup-' + date.yyyymmdd() + '.txt');
}
}
function grblSettings(data) {
// console.log(data)
var template = ``
grblconfig = data.split('\n')
for (i = 0; i < grblconfig.length; i++) {
var key = grblconfig[i].split('=')[0];
var param = grblconfig[i].split('=')[1]
grblParams[key] = param
}
// $('#grblconfig').show();
// grblPopulate();
// $('#grblSaveBtn').removeAttr('disabled');
// $('#grblFirmwareBtn').removeAttr('disabled');
$('#grblSettings').show()
if (grblParams['$22'] == 1) {
$('#gotozeroMPos').removeClass('disabled')
$('#homeBtn').attr('disabled', false)
$('#gotoXzeroMpos').removeClass('disabled')
$('#gotoYzeroMpos').removeClass('disabled')
$('#gotoZzeroMpos').removeClass('disabled')
$('.PullOffMPos').html("-" + grblParams['$27'])
} else {
$('#gotozeroMPos').addClass('disabled')
$('#homeBtn').attr('disabled', true)
$('#gotoXzeroMpos').addClass('disabled')
$('#gotoYzeroMpos').addClass('disabled')
$('#gotoZzeroMpos').addClass('disabled')
}
if (grblParams['$32'] == 1) {
$('#enLaser').removeClass('alert').addClass('success').html('ON')
} else {
$('#enLaser').removeClass('success').addClass('alert').html('OFF')
}
updateToolOnSValues();
if (localStorage.getItem('jogOverride')) {
jogOverride(localStorage.getItem('jogOverride'))
} else {
jogOverride(100);
}
}
function grblPopulate() {
if (!isJogWidget) {
$('#grblconfig').show();
$('#grblconfig').empty();
var template = `
<form id="grblSettingsTable">
<div id="grblProfileSection">
<h6 class="fg-dark"><i class="fas fa-tasks fg-blue"></i> 1. Load Machine Profile<br>
<small>Loads our standard Machine Profiles to your controller. If you have built a machine exactly to specification this is all your need. If you made modifications, or built a custom machine, you can customize the parameters below. Remember to click SAVE when done</small>
</h6>
<div class="grid">
<div class="row">
<div class="cell-8">
<a style="width: 100%;" class="button dropdown-toggle bd-dark dark outline" id="context_toggle2"><img src="img/mch/sphinx55.png"/> Select Machine</a>
<ul class="ribbon-dropdown" data-role="dropdown" data-duration="100">
<li><a href="#" onclick="selectMachine('custom');"><img src="img/mch/custom.png" width="16px"/> Custom Machine</a></li>
<li>
<a href="#" class="dropdown-toggle"><img src="img/mch/acro55.png" width="16px"/> OpenBuilds Acro</a>
<ul class="ribbon-dropdown" data-role="dropdown">
<li onclick="selectMachine('acro55');"><a href="#"><img src="img/mch/acro55.png" width="16px"/> OpenBuilds Acro 55</a></li>
<li onclick="selectMachine('acro510');"><a href="#"><img src="img/mch/acro510.png" width="16px"/> OpenBuilds Acro 510</a></li>
<li onclick="selectMachine('acro1010');"><a href="#"><img src="img/mch/acro1010.png" width="16px"/> OpenBuilds Acro 1010</a></li>
<li onclick="selectMachine('acro1510');"><a href="#"><img src="img/mch/acro1510.png" width="16px"/> OpenBuilds Acro 1510</a></li>
<li onclick="selectMachine('acro1515');"><a href="#"><img src="img/mch/acro1515.png" width="16px"/> OpenBuilds Acro 1515</a></li>
</ul>
</li>
<li>
<a href="#" class="dropdown-toggle"><img src="img/mch/acro55.png" width="16px"/> OpenBuilds Acro with Servo Pen Attachment</a>
<ul class="ribbon-dropdown" data-role="dropdown">
<li onclick="selectMachine('acro55pen');"><a href="#"><img src="img/mch/acro55.png" width="16px"/> OpenBuilds Acro 55 with Servo Pen Attachment</a></li>
<li onclick="selectMachine('acro510pen');"><a href="#"><img src="img/mch/acro510.png" width="16px"/> OpenBuilds Acro 510 with Servo Pen Attachment</a></li>
<li onclick="selectMachine('acro1010pen');"><a href="#"><img src="img/mch/acro1010.png" width="16px"/> OpenBuilds Acro 1010 with Servo Pen Attachment</a></li>
<li onclick="selectMachine('acro1510pen');"><a href="#"><img src="img/mch/acro1510.png" width="16px"/> OpenBuilds Acro 1510 with Servo Pen Attachment</a></li>
<li onclick="selectMachine('acro1515pen');"><a href="#"><img src="img/mch/acro1515.png" width="16px"/> OpenBuilds Acro 1515 with Servo Pen Attachment</a></li>
</ul>
</li>
<li>
<a href="#" class="dropdown-toggle"><img src="img/mch/cbeam.png" width="16px"/> OpenBuilds C-Beam Machine</a>
<ul class="ribbon-dropdown" data-role="dropdown">
<li onclick="selectMachine('cbeam');"><a href="#"><img src="img/mch/cbeam.png" width="16px"/> OpenBuilds C-Beam Machine</a></li>
<li onclick="selectMachine('cbeamxl');"><a href="#"><img src="img/mch/cbeamxl.png" width="16px"/> OpenBuilds C-Beam XL</a></li>
</ul>
</li>
<li>
<a href="#" class="dropdown-toggle"><img src="img/mch/leadmachine1010.png" width="16px"/> OpenBuilds LEAD Machine</a>
<ul class="ribbon-dropdown" data-role="dropdown">
<li onclick="selectMachine('leadmachine1010');"><a href="#"><img src="img/mch/leadmachine1010.png" width="16px"/>OpenBuilds LEAD 1010</a></li>
<li onclick="selectMachine('leadmachine1010laser');"><a href="#"><img src="img/mch/leadmachine1010laser.png" width="16px"/>OpenBuilds LEAD 1010 with Laser Module</a></li>
<li onclick="selectMachine('leadmachine1515');"><a href="#"><img src="img/mch/leadmachine1515.png" width="16px"/>OpenBuilds LEAD 1515</a></li>
</ul>
</li>
<li><a href="#" onclick="selectMachine('minimill');"><img src="img/mch/minimill.png" width="16px"/> OpenBuilds MiniMill</a></li>
<li>
<a href="#" class="dropdown-toggle"><img src="img/mch/sphinx55.png" width="16px"/> OpenBuilds Sphinx</a>
<ul class="ribbon-dropdown" data-role="dropdown">
<li onclick="selectMachine('sphinx55');"><a href="#"><img src="img/mch/sphinx55.png" width="16px"/> OpenBuilds Sphinx 55</a></li>
<li onclick="selectMachine('sphinx1050');"><a href="#"><img src="img/mch/sphinx1050.png" width="16px"/> OpenBuilds Sphinx 1050</a></li>
</ul>
</li>
<li>
<a href="#" class="dropdown-toggle"><img src="img/mch/workbee1010.png" width="16px"/> OpenBuilds WorkBee</a>
<ul class="ribbon-dropdown" data-role="dropdown">
<li onclick="selectMachine('workbee1010');"><a href="#"><img src="img/mch/workbee1010.png" width="16px"/> OpenBuilds WorkBee 1010</a></li>
<li onclick="selectMachine('workbee1050');"><a href="#"><img src="img/mch/workbee1050.png" width="16px"/> OpenBuilds WorkBee 1050</a></li>
<li onclick="selectMachine('workbee1510');"><a href="#"><img src="img/mch/workbee1510.png" width="16px"/> OpenBuilds WorkBee 1510</a></li>
</ul>
</li>
</ul>
</div>
<div class="cell-4">
<input id="limitsinstalled" data-cls-caption="fg-openbuilds" data-cls-check="bd-openbuilds openbuilds-switch" data-cls-switch="openbuilds-switch" type="checkbox" data-role="switch" data-caption="Limit&nbsp;Switches&nbsp;Installed">
</div>
</div>
</div>
<hr class="bg-openbuilds">
</div> <!-- End grblProfileSection -->
<h6 class="fg-dark"><i class="fas fa-cogs fg-lightOrange"></i> 2. Customize Profile (Optional)<br><small>Customise your Grbl settings below. For custom machines, modifications and also for fine tuning your machine profile. Remember to make a BACKUP so you don't lose your customized settings</small></h6>
<div id="grblSettingsTableView" style="overflow-y: scroll; height: calc(100vh - 460px); max-height: calc(100vh - 460px);">
<table class="table compact striped row-hover row-border" data-show-rows-steps="false" data-rows="200" data-show-pagination="false" data-show-table-info="false" data-show-search="false">
<tbody>
<tr>
<th style="text-align: left;">Key</th>
<th style="text-align: left;">Parameter</th>
<th style="width: 250px; min-width: 240px !important;">Value</th>
<th style="width: 110px; min-width: 110px !important;">Utility</th>
</tr>`
// Insert Table Rows here
for (key in grblParams) {
var key2 = key.split('=')[0].substr(1);
//console.log(key2)
if (grblSettingsTemplate2[key2] !== undefined) {
//template += grblSettingsTemplate2[key2].template;
template += `<tr id="grblSettingsRow` + key2 + `" title="` + grblSettingsTemplate2[key2].description + `">
<td>` + grblSettingsTemplate2[key2].key + `</td>
<td>` + grblSettingsTemplate2[key2].title + `</td>
<td>` + grblSettingsTemplate2[key2].template + `</td>
<td>` + grblSettingsTemplate2[key2].utils + `</td>
</tr>`
} else {
template += `
<tr>
<td>` + key + `</td>
<td><span class="tally alert">` + key + `</span></td>
<td><input data-role="input" data-clear-button="false" data-append="?" type="text" value="` + grblParams[key] + `" id="val-` + key2 + `-input"></td>
<td></td>
</tr>
`
}
}
template += `</tbody>
</table>
</div> <!-- End of grblSettingsTableView -->
</form>
`
$('#grblconfig').append(template)
for (key in grblParams) {
var key2 = key.split('=')[0].substr(1);
$("#val-" + key2 + "-input").val(grblParams[key])
}
setTimeout(function() {
$("#val-32-input").val(parseInt(grblParams['$32'])).trigger("change");
$("#val-20-input").val(parseInt(grblParams['$20'])).trigger("change");
$("#val-21-input").val(parseInt(grblParams['$21'])).trigger("change");
$("#val-22-input").val(parseInt(grblParams['$22'])).trigger("change");
$("#val-23-input").val(parseInt(grblParams['$23'])).trigger("change");
$("#val-5-input").val(parseInt(grblParams['$5'])).trigger("change");
$("#val-6-input").val(parseInt(grblParams['$6'])).trigger("change");
$("#val-2-input").val(parseInt(grblParams['$2'])).trigger("change");
$("#val-3-input").val(parseInt(grblParams['$3'])).trigger("change");
$("#val-4-input").val(parseInt(grblParams['$4'])).trigger("change");
}, 100);;
$('#grblSettingsTable').on('keyup paste click change', 'input, select', function() {
checkifchanged()
});
// $("#grblSettingsTableView").scroll(function() {
// var scroll = $("#grblSettingsTableView").scrollTop();
// console.log('scrolling: ', scroll)
// if (scroll > 200) {
// if (allowGrblSettingsViewScroll) {
// $("#grblProfileSection").slideUp('slow');
// $("#grblSettingsTableView").css("max-height", "calc(100vh - 320px)")
// $("#grblSettingsTableView").css("height", "calc(100vh - 320px)")
// }
// } else if (scroll < 200) {
// $("#grblProfileSection").slideDown('slow')
// $("#grblSettingsTableView").css("max-height", "calc(100vh - 460px)")
// $("#grblSettingsTableView").css("height", "calc(100vh - 460px)")
// }
// });
// Event Handlers for Switch Checkboxes
setTimeout(function() {
$('#limitsinstalled:checkbox').change(function() {
enableLimits();
});
$('#xdirinvert:checkbox').change(function() {
changeDirInvert();
});
$('#ydirinvert:checkbox').change(function() {
changeDirInvert();
});
$('#zdirinvert:checkbox').change(function() {
changeDirInvert();
});
$('#xHomeDir:checkbox').change(function() {
changeProbeDirInvert();
});
$('#yHomeDir:checkbox').change(function() {
changeProbeDirInvert();
});
$('#zHomeDir:checkbox').change(function() {
changeProbeDirInvert();
});
// populare Direction Invert Checkboxes
displayDirInvert()
displayProbeDirInvert()
}, 100)
$('#grblSettingsBadge').hide();
if (grblParams['$21'] == 1 && grblParams['$22'] == 1) {
$('#limitsinstalled:checkbox').prop('checked', true);
$('#gotozeroMPos').removeClass('disabled')
$('#homeBtn').attr('disabled', false)
} else {
$('#limitsinstalled:checkbox').prop('checked', false);
$('#gotozeroMPos').addClass('disabled')
$('#homeBtn').attr('disabled', true)
}
setTimeout(function() {
setMachineButton(laststatus.machine.name)
}, 500)
}
}
function checkifchanged() {
var hasChanged = false;
for (var key in grblParams) {
if (grblParams.hasOwnProperty(key)) {
var j = key.substring(1)
var newVal = $("#val-" + j + "-input").val();
if (newVal !== undefined) {
// Only send values that changed
if (parseFloat(newVal) != parseFloat(grblParams[key]) && newVal != grblParams[key]) {
hasChanged = true;
if (!$("#val-" + j + "-input").parent().is('td')) {
$("#val-" + j + "-input").parent().addClass('alert')
} else if ($("#val-" + j + "-input").is('select')) {
$("#val-" + j + "-input").addClass('alert')
} else if (j == 3) { // axes
$('#xdirinvert').parent().children('.check').addClass('bd-red')
$('#ydirinvert').parent().children('.check').addClass('bd-red')
$('#zdirinvert').parent().children('.check').addClass('bd-red')
}
} else {
if (!$("#val-" + j + "-input").parent().is('td')) {
$("#val-" + j + "-input").parent().removeClass('alert')
} else if ($("#val-" + j + "-input").is('select')) {
$("#val-" + j + "-input").removeClass('alert')
} else if (j == 3) {
$('#xdirinvert').parent().children('.check').removeClass('bd-red')
$('#ydirinvert').parent().children('.check').removeClass('bd-red')
$('#zdirinvert').parent().children('.check').removeClass('bd-red')
}
}
}
}
}
if (hasChanged) {
$('#grblSettingsBadge').fadeIn('slow');
$('#saveBtn').attr('disabled', false).removeClass('disabled');
$('#saveBtnIcon').removeClass('fg-gray').addClass('fg-grayBlue');
} else {
$('#grblSettingsBadge').fadeOut('slow');
$('#saveBtn').attr('disabled', true).addClass('disabled');
$('#saveBtnIcon').removeClass('fg-grayBlue').addClass('fg-gray');
}
// if ($("#val-21-input").val() == 1 && $("#val-22-input").val() == 1) {
// $('#limitsinstalled:checkbox').prop('checked', true);
// $('#gotozeroMPos').removeClass('disabled')
// $('#homeBtn').attr('disabled', false)
// } else {
// $('#limitsinstalled:checkbox').prop('checked', false);
// $('#gotozeroMPos').addClass('disabled')
// $('#homeBtn').attr('disabled', true)
// }
// if ($("#val-21-input").val() == 1) { // Hard Limits enabled?
// if (laststatus.machine.inputs.includes('X') || laststatus.machine.inputs.includes('Y') || laststatus.machine.inputs.includes('Z')) { // But a limit is currently Active?
// console.log("created")
// for (i = 0; i < openDialogs.length; i++) {
// Metro.dialog.close(openDialogs[i]);
// }
// openDialogs.length = 0;
// var dialog = Metro.dialog.create({
// title: "Enable Hard Limits / Endstops?",
// content: `<div>You have <code>$21=1 ; Hard Limits = Enabled</code> in your settings. <br>
// We detected one or more Limits inputs as Triggered. <br>
// Please make sure none of the Limit switches are triggered before enabling Hard Limits:<p>
//
// <table class="table striped compact">
// <thead>
// <tr>
// <th style="width: 40%;">PIN</th>
// <th style="width: 60%;">Status</th>
// </tr>
// </thead>
// <tbody>
// <tr>
// <td class="pt-1 mt-0 pb-0 pt-0">X-Limit</td>
// <td class="pt-1 mt-0 pb-0 pt-0"><span class="tally alert pinstatus xpin">NOCOMM</span></td>
// </tr>
// <tr>
// <td class="pt-1 mt-0 pb-0 pt-0">Y-Limit</td>
// <td class="pt-1 mt-0 pb-0 pt-0"><span class="tally alert pinstatus ypin">NOCOMM</span></td>
// </tr>
// <tr>
// <td class="pt-1 mt-0 pb-0 pt-0">Z-Limit</td>
// <td class="pt-1 mt-0 pb-0 pt-0"><span class="tally alert pinstatus zpin">NOCOMM</span></td>
// </tr>
// </tbody>
// </table>`,
// clsDialog: 'dark',
// actions: [{
// caption: "Set 'Hard Limits' to Disabled",
// cls: "js-dialog-close",
// onclick: function() {
// $("#limitsinstalled").prop("checked", false);
// enableLimits()
// setTimeout(function() {
// checkifchanged()
// }, 400); // reset
// }
// }]
// });
// openDialogs.push(dialog);
// }
// }
}
function grblSaveSettings() {
var toSaveCommands = [];
var saveProgressBar = $("#grblSaveProgress").data("progress");
for (var key in grblParams) {
if (grblParams.hasOwnProperty(key)) {
var j = key.substring(1)
var newVal = $("#val-" + j + "-input").val();
// Only send values that changed
if (newVal !== undefined) {
if (parseFloat(newVal) != parseFloat(grblParams[key]) && newVal != grblParams[key]) {
// console.log(key + ' was ' + grblParams[key] + ' but now, its ' + newVal);
toSaveCommands.push(key + '=' + newVal);
}
}
}
}
if (toSaveCommands.length > 0) {
//console.log("commands", toSaveCommands)
let counter = 0;
// Blank the dialog
if (saveProgressBar) {
saveProgressBar.val(0);
}
$("#grblNewParam").html("")
$("#grblNewParamVal").html("")
// Open Dialog savingGrblSettingsProgress
Metro.dialog.open('#savingGrblSettingsProgress')
const i = setInterval(function() {
//console.log(counter, toSaveCommands[counter]);
var newParam = toSaveCommands[counter].split("=")[0];
var newParamKey = newParam.substr(1);
if (grblSettingsTemplate2[newParamKey] !== undefined) {
var newParamName = grblSettingsTemplate2[newParamKey].title
} else {
var newParamName = "unknown"
}
var newParamVal = toSaveCommands[counter].split("=")[1];
$("#grblNewParam").html("<code>" + newParam + " : " + newParamName + "</code>")
$("#grblNewParamVal").html("<code>" + newParamVal + "</code>")
if (saveProgressBar) {
saveProgressBar.val(counter / toSaveCommands.length * 100);
}
//
sendGcode(toSaveCommands[counter] + "\n");;
counter++;
if (counter === toSaveCommands.length) {
// Finished running
clearInterval(i);
grblParams = {};
toSaveCommands = [];
setTimeout(function() {
Metro.dialog.close('#savingGrblSettingsProgress')
Metro.dialog.create({
title: "Configuration Updated. Reset Grbl?",
content: "<div>Some changes in the Grbl Configuration only take effect after a restart/reset of the controller. Would you like to Reset the controller now?</div>",
clsDialog: 'dark',
actions: [{
caption: "Yes",
cls: "js-dialog-close success",
onclick: function() {
setTimeout(function() {
sendGcode(String.fromCharCode(0x18));
setTimeout(function() {
refreshGrblSettings()
}, 1000); // refresh grbl settings
}, 800); // reset
}
},
{
caption: "Later",
cls: "js-dialog-close",
onclick: function() {
console.log("Do nothing")
refreshGrblSettings();
}
}
]
});
$('#grblSettingsBadge').hide();
}, 1000); // Just to show settings was written
}
}, 400); // send another command every 200ms
}
}
// Old Gnea-Grbl way
// function grblSaveSettings() {
// var commands = ""
// for (var key in grblParams) {
// if (grblParams.hasOwnProperty(key)) {
// var j = key.substring(1)
// var newVal = $("#val-" + j + "-input").val();
// // Only send values that changed
// if (newVal !== undefined) {
// if (parseFloat(newVal) != parseFloat(grblParams[key])) {
// // console.log(key + ' was ' + grblParams[key] + ' but now, its ' + newVal);
// commands += key + '=' + newVal + "\n"
// // sendGcode(key + '=' + newVal) + "\n";
// }
// }
// }
// }
// console.log("commands", commands)
// socket.emit('runJob', {
// data: commands,
// isJob: false,
// fileName: ""
// });
// grblParams = {};
//
// Metro.dialog.create({
// title: "Configuration Updated. Reset Grbl?",
// content: "<div>Some changes in the Grbl Configuration only take effect after a restart/reset of the controller. Would you like to Reset the controller now?</div>",
// actions: [{
// caption: "Yes",
// cls: "js-dialog-close secondary",
// onclick: function() {
// setTimeout(function() {
// sendGcode(String.fromCharCode(0x18));
// setTimeout(function() {
// refreshGrblSettings()
// }, 1000);
// }, 400);
// }
// },
// {
// caption: "Later",
// cls: "js-dialog-close",
// onclick: function() {
// console.log("Do nothing")
// refreshGrblSettings();
// }
// }
// ]
// });
// $('#grblSettingsBadge').hide();
// }
function refreshGrblSettings() {
$('#saveBtn').attr('disabled', true).addClass('disabled');
$('#saveBtnIcon').removeClass('fg-grayBlue').addClass('fg-gray');
grblParams = {};
$('#grblconfig').empty();
$('#grblconfig').append("<center>Please Wait... </center><br><center>Requesting updated parameters from the controller firmware...</center>");
setTimeout(function() {
sendGcode('$$');
sendGcode('$I');
setTimeout(function() {
grblPopulate();
}, 500);
}, 200);
}
function enableLimits() {
var grblParams_lim = {
$21: "0", //"Hard limits enable, boolean"
$22: "0", //"Homing cycle enable, boolean"
}
var hasLimits = $('#limitsinstalled').is(':checked');
if (hasLimits) {
grblParams_lim.$21 = "1"; //"Hard limits enable, boolean"
grblParams_lim.$22 = "1"; //"Homing cycle enable, boolean"
} else {
grblParams_lim.$21 = "0"; //"Hard limits enable, boolean"
grblParams_lim.$22 = "0"; //"Homing cycle enable, boolean"
}
for (var key in grblParams_lim) {
if (grblParams_lim.hasOwnProperty(key)) {
var j = key.substring(1)
var newVal = $("#val-" + j + "-input").val();
// console.log("$" + j + " = " + newVal)
$("#val-" + j + "-input").val(parseFloat(grblParams_lim[key]))
}
}
allowGrblSettingsViewScroll = false;
setTimeout(function() {
allowGrblSettingsViewScroll = true;
}, 500);
checkifchanged();
var elm = document.getElementById("grblSettingsLimits");
elm.scrollIntoView(true);
}
// Calc Grbl 1.1 Invert Masks
// Call: calcDecFromMask(true, false, false)
// Return: 1
function calcDecFromMask(x, y, z) {
var string = "0000000" + (z ? "1" : "0") + (y ? "1" : "0") + (x ? "1" : "0");
// console.log(string)
return parseInt(string, 2);
}
// Calc Grbl 1.1 Invert Masks
// Call: calcMaskFromDec("4")
// Returns: {x: false, y: false, z: true}
function calcMaskFromDec(dec) {
var num = parseInt(dec)
num = num.toString(2)
num = ("000" + num).substr(-3, 3)
// console.log(num)
var invertmask = {
x: (num.charAt(2) == 0 ? false : true),
y: (num.charAt(1) == 0 ? false : true),
z: (num.charAt(0) == 0 ? false : true)
}
return invertmask
}
function changeProbeDirInvert() {
var xticked = $('#xHomeDir').is(':checked');
var yticked = $('#yHomeDir').is(':checked');
var zticked = $('#zHomeDir').is(':checked');
var value = calcDecFromMask(!xticked, !yticked, !zticked)
console.log("Homing Dir $23=" + value)
$("#val-23-input").val(value).trigger("change");
checkifchanged();
}
function displayProbeDirInvert() {
var dir = calcMaskFromDec($("#val-23-input").val())
$('#xHomeDir:checkbox').prop('checked', !dir.x);
$('#yHomeDir:checkbox').prop('checked', !dir.y);
$('#zHomeDir:checkbox').prop('checked', !dir.z);
checkifchanged();
}
function changeDirInvert() {
var xticked = $('#xdirinvert').is(':checked');
var yticked = $('#ydirinvert').is(':checked');
var zticked = $('#zdirinvert').is(':checked');
var value = calcDecFromMask(xticked, yticked, zticked)
$("#val-3-input").val(value).trigger("change");
checkifchanged();
}
function displayDirInvert() {
var dir = calcMaskFromDec($("#val-3-input").val())
$('#xdirinvert:checkbox').prop('checked', dir.x);
$('#ydirinvert:checkbox').prop('checked', dir.y);
$('#zdirinvert:checkbox').prop('checked', dir.z);
checkifchanged();
}
function clearSettings() {
Metro.dialog.create({
title: "Are you sure?",
content: "<div>Resetting the Grbl Settings will restore all the settings to factory defaults, but will keep other EEPROM settings intact. Would you like to continue?</div>",
clsDialog: 'dark',
actions: [{
caption: "Yes",
cls: "js-dialog-close success",
onclick: function() {
sendGcode('$RST=$');
refreshGrblSettings()
}
},
{
caption: "Cancel",
cls: "js-dialog-close",
onclick: function() {
refreshGrblSettings();
}
}
]
});
}
function clearWCO() {
Metro.dialog.create({
title: "Are you sure?",
content: "<div>Resetting the Work Coordinate Systems will erase all the coordinate system offsets currently stored in the EEPROM on the controller. Would you like to continue?</div>",
clsDialog: 'dark',
actions: [{
caption: "Yes",
cls: "js-dialog-close success",
onclick: function() {
sendGcode('$RST=#');
refreshGrblSettings()
}
},
{
caption: "Cancel",
cls: "js-dialog-close",
onclick: function() {
refreshGrblSettings();
}
}
]
});
}
function clearEEPROM() {
Metro.dialog.create({
title: "Are you sure?",
content: "<div>Resetting the EEPROM will erase all the Grbl Firmware settings from your controller, effectively resetting it back to factory defaults. Would you like to continue?</div>",
clsDialog: 'dark',
actions: [{
caption: "Yes",
cls: "js-dialog-close success",
onclick: function() {
sendGcode('$RST=*');
refreshGrblSettings()
}
},
{
caption: "Cancel",
cls: "js-dialog-close",
onclick: function() {
refreshGrblSettings();
}
}
]
});
}
function updateToolOnSValues() {
$(".ToolOnS1").html((parseInt(grblParams.$30) * 0.01).toFixed(0))
$(".ToolOnS5").html((parseInt(grblParams.$30) * 0.05).toFixed(0))
$(".ToolOnS10").html((parseInt(grblParams.$30) * 0.1).toFixed(0))
$(".ToolOnS25").html((parseInt(grblParams.$30) * 0.25).toFixed(0))
$(".ToolOnS50").html((parseInt(grblParams.$30) * 0.5).toFixed(0))
$(".ToolOnS75").html((parseInt(grblParams.$30) * 0.75).toFixed(0))
$(".ToolOnS100").html(parseInt(grblParams.$30).toFixed(0))
}

Wyświetl plik

@ -0,0 +1,309 @@
var selectedControllerType = 'blackbox4x'
function flashToolBoard(device) {
selectedControllerType = device
if (device == "blackbox4x") {
$("#grblAxesCount").data("select").val("3axes-grbl")
$("#flash-tool-grbl-row").show();
$("#flash-tool-grblhal-row").hide();
$("#flash-tool-interface-fw-row").hide();
$("#flash-tool-custom-row").hide();
$("#customFirmwareSet").html("Please select the Grbl Firmware hex file you want to flash");
} else if (device == "blackboxx32") {
$("#grblHalAxesCount").data("select").val("3axes-grblhal")
$("#flash-tool-grbl-row").hide();
$("#flash-tool-grblhal-row").show();
$("#flash-tool-interface-fw-row").hide();
$("#flash-tool-custom-row").hide();
$("#customFirmwareSet").html("Please select the GrblHAL Firmware binary file you want to flash");
} else if (device == "interfacev1") {
$("#interfaceFirmwareVer").data("select").val("online")
$("#flash-tool-grbl-row").hide();
$("#flash-tool-grblhal-row").hide();
$("#flash-tool-interface-fw-row").show();
$("#customFirmwareSet").html("Please select the Interface Firmware binary file you want to flash");
}
}
function openFlashingTool() {
var template = `
<div id="FlashDialogMsg"></div>
<p class="small mb-4">You can use this wizard to flash Firmware onto compatible controllers. Only use with care, or when instructed by Support</p>
<ul data-role="tabs" data-expand="true">
<li><a href="#" onclick="flashToolBoard('blackbox4x');"><img src="/wizards/flashingtool2/img/bb4x-icon.png"> BlackBox 4X</a></li>
<li><a href="#" onclick="flashToolBoard('blackboxx32');"><img src="/wizards/flashingtool2/img/bbx32-icon.png"> BlackBox X32</a></li>
<li><a href="#" onclick="flashToolBoard('interfacev1');"><img src="/wizards/flashingtool2/img/interfacev1-icon.png"> Interface</a></li>
</ul>
<div class="row mt-2">
<div class="cell-md-3 mb-1">Port</div>
<div class="cell-md-9 mb-1">
<select data-prepend="&nbsp;<i class='fab fa-usb'></i>" data-role="select" data-filter="false" id="portUSB2" disabled data-editable="true">
<option value="">Waiting for USB</option>
</select>
</div>
</div>
<div class="row" id="flash-tool-interface-fw-row" style="display: none;">
<div class="cell-md-3 mb-1">Firmware Version</div>
<div class="cell-md-9 mb-1">
<select data-prepend="&nbsp;<i class='fas fa-cube'></i>" data-role="select" data-filter="false" id="interfaceFirmwareVer" data-editable="true">
<option value="online">Latest available version</option>
<option value="custom">Custom: firmware binary file</option>
</select>
</div>
</div>
<div class="row" id="flash-tool-grbl-row">
<div class="cell-md-3 mb-1">Machine Style</div>
<div class="cell-md-9 mb-1">
<select data-prepend="&nbsp;<i class='fas fa-cube'></i>" data-role="select" data-filter="false" id="grblAxesCount" data-editable="true">
<option value="3axes-grbl">3 Axes CNC/Laser: Dual-Y with XYZ Axis Homing</option>
<option value="2axes-grbl">2 Axes CNC/Laser: Dual-Y with Z-Axis Homing Disabled</option>
<option value="servo-grbl">2/3 Axes Plotter: Dual-Y with Servo Toolhead</option>
<option value="custom">Custom: firmware hex file</option>
</select>
</div>
</div>
</div>
<div class="row" id="flash-tool-grblhal-row" style="display: none;">
<div class="cell-md-3 mb-1">Machine Style</div>
<div class="cell-md-9 mb-1">
<select data-prepend="&nbsp;<i class='fas fa-cube'></i>" data-role="select" data-filter="false" id="grblHalAxesCount" data-editable="true">
<option value="3axes-grblhal">3 Axes CNC/Laser: Dual-Y with XYZ Axis Homing</option>
<!-- option value="2axes-grblhal">2 Axes CNC/Laser: Dual-Y with Z-Axis Homing Disabled</option>
<option value="4axes-grblhal">4 Axes CNC/Laser: with XYZ Axis Homing</option -->
<option value="custom">Custom: firmware hex file</option>
</select>
</div>
</div>
</div>
<div class="row" id="flash-tool-custom-row" style="display: none;">
<div class="cell-md-3 mb-1">Firmware Image</div>
<div class="cell-md-9 mb-1">
<form id="customFirmwareForm" enctype="multipart/form-data">
<button class="button alert shadow btn-file" action="#"><input class="btn-file" id="firmwareBin" type="file" accept=".bin, .hex" name="firmwareBin" /><i class="far fa-folder-open fa-fw"></i> Use custom firmware image</button>
<br>
<small id="customFirmwareSet"></small>
</form>
</div>
</div>
`
Metro.dialog.create({
title: "<i class='fas fa-microchip fa-fw'></i> Firmware Flashing Tool",
content: template,
toTop: true,
width: '75%',
clsDialog: 'dark',
actions: [{
caption: "FLASH",
cls: "js-dialog-close success",
onclick: function() {
flashFirmwarefromWizard();
}
}, {
caption: "Cancel",
cls: "js-dialog-close",
onclick: function() {
//
}
}]
});
$("#grblAxesCount").on("change", function() {
if (this.value == "custom") {
$("#flash-tool-door-row").hide();
$("#flash-tool-custom-row").show();
} else {
$("#flash-tool-door-row").show();
$("#flash-tool-custom-row").hide();
}
});
$("#grblHalAxesCount").on("change", function() {
if (this.value == "custom") {
$("#flash-tool-door-row").hide();
$("#flash-tool-custom-row").show();
} else {
$("#flash-tool-door-row").show();
$("#flash-tool-custom-row").hide();
}
});
$("#interfaceFirmwareVer").on("change", function() {
if (this.value == "custom") {
$("#flash-tool-custom-row").show();
} else {
$("#flash-tool-custom-row").hide();
}
});
setTimeout(function() {
var opts = `<option value="custom">Custom: firmware binary file</option>`;
if (parseFloat(laststatus.interface.firmware.availVersion) > 0) {
opts += `<option value="online" selected>Latest available v` + laststatus.interface.firmware.availVersion + `</option>`;
}
var fwselect = $("#interfaceFirmwareVer").data("select");
fwselect.data(opts);
populatePortsMenu();
}, 200);
}
function readEspFirmwareFile() {
console.log("Sending")
var form = document.getElementById('customFirmwareForm');
var formData = new FormData(form);
var xhr = new XMLHttpRequest();
xhr.onload = function() {
if (xhr.status == 200) {
$("#customFirmwareSet").html(xhr.response)
}
};
// Add any event handlers here...
xhr.open('POST', '/uploadCustomFirmware', true);
xhr.send(formData);
}
function flashFirmwarefromWizard() {
if (selectedControllerType == "blackbox4x") {
if ($("#grblAxesCount").val() == "3axes-grbl") {
var filename = "grbl-3axes-nodoor.hex";
} else if ($("#grblAxesCount").val() == "2axes-grbl") {
var filename = "grbl-2axes-nodoor.hex";
} else if ($("#grblAxesCount").val() == "servo-grbl") {
var filename = "grbl-servo-nodoor.hex";
}
var data = {
port: $("#portUSB2").val(),
file: filename,
board: $("#flashController").val(),
customImg: false
}
if ($("#grblAxesCount").val() == "custom") {
// Custom Firmware
if ($("#firmwareBin").val().length > 0) {
var form = document.getElementById('customFirmwareForm');
var formData = new FormData(form);
var xhr = new XMLHttpRequest();
xhr.onload = function() {
if (xhr.status == 200) {
$("#customFirmwareSet").html(xhr.response);
data.customImg = true;
data.file = $("#firmwareBin").val();
socket.emit('flashGrbl', data);
}
};
// Add any event handlers here...
xhr.open('POST', '/uploadCustomFirmware', true);
xhr.send(formData);
} else {
$('#controlTab').click();
$('#consoletab').click();
printLog("<span class='fg-red'>[ Firmware Upgrade ] </span><span class='fg-red'><i class='fas fa-times fa-fw fg-red fa-fw'></i>You selected the option to use a custom firmware file, but failed to select a file to use for the operation. Please try again</span>")
}
} else {
// Precompiled Firmwares
socket.emit('flashGrbl', data)
}
} else if (selectedControllerType == "blackboxx32") {
if ($("#grblHalAxesCount").val() == "3axes-grblhal") {
var filename = "grblhal-grbl3axis.bin";
} else if ($("#grblAxesCount").val() == "2axes-grblhal") {
var filename = "";
} else if ($("#grblAxesCount").val() == "4axes-grblhal") {
var filename = "";
}
var data = {
port: $("#portUSB2").val(),
file: filename,
customImg: false
}
if ($("#grblHalAxesCount").val() == "custom") {
// Custom Firmware
if ($("#firmwareBin").val().length > 0) {
var form = document.getElementById('customFirmwareForm');
var formData = new FormData(form);
var xhr = new XMLHttpRequest();
xhr.onload = function() {
if (xhr.status == 200) {
$("#customFirmwareSet").html(xhr.response);
data.customImg = true;
data.file = $("#firmwareBin").val();
socket.emit('flashGrblHal', data);
}
};
// Add any event handlers here...
xhr.open('POST', '/uploadCustomFirmware', true);
xhr.send(formData);
} else {
$('#controlTab').click();
$('#consoletab').click();
printLog("<span class='fg-red'>[ Firmware Upgrade ] </span><span class='fg-red'><i class='fas fa-times fa-fw fg-red fa-fw'></i>You selected the option to use a custom firmware file, but failed to select a file to use for the operation. Please try again</span>")
}
} else {
// Precompiled Firmwares
socket.emit('flashGrblHal', data)
}
} else if (selectedControllerType == "interfacev1") {
var data = {
port: $("#portUSB2").val(),
file: "firmware.bin", // version that ships with Interface
board: $("#flashController").val()
}
if ($("#interfaceFirmwareVer").val() == "custom") {
// custom image
if ($("#firmwareBin").val().length > 0) {
var form = document.getElementById('customFirmwareForm');
var formData = new FormData(form);
var xhr = new XMLHttpRequest();
xhr.onload = function() {
if (xhr.status == 200) {
$("#customFirmwareSet").html(xhr.response);
data.file = $("#firmwareBin").val();
socket.emit('flashInterface', data);
}
};
// Add any event handlers here...
xhr.open('POST', '/uploadCustomFirmware', true);
xhr.send(formData);
} else {
$('#controlTab').click();
$('#consoletab').click();
printLog("<span class='fg-red'>[ Firmware Upgrade ] </span><span class='fg-red'><i class='fas fa-times fa-fw fg-red fa-fw'></i>You selected the option to use a custom firmware file, but failed to select a file to use for the operation. Please try again</span>")
}
} else {
// latest included firmware
socket.emit('flashInterface', data)
}
} else {
console.log("no controller selected")
}
}

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 2.1 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 178 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 2.1 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 253 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 2.7 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 440 KiB

Wyświetl plik

@ -0,0 +1,2 @@
./avrdude -Cavrdude.conf -v -patmega328p -cusbtiny -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m
./avrdude -Cavrdude.conf -v -patmega328p -cusbtiny -Uflash:w:optiboot_atmega328.hex:i -Ulock:w:0x0F:m

BIN
grbl.bin 100644

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

12550
package-lock.json-old 100644

Plik diff jest za duży Load Diff

Wyświetl plik

@ -1,6 +1,6 @@
{
"name": "OpenBuildsCONTROL",
"version": "1.0.326",
"version": "1.0.327",
"license": "AGPL-3.0",
"description": "OpenBuildsCONTROL CNC Machine Interface Software",
"author": "github.com/openbuilds <support@openbuilds.com>",
@ -17,7 +17,7 @@
"directory-tree": "^2.2.4",
"drivelist": "^9.2.4",
"electron-builder-notarize": "^1.2.0",
"electron-updater": "^5.0.0",
"electron-updater": "^5.0.5",
"evilscan": "^1.9.1",
"express": "^4.17.1",
"formidable": "^1.2.2",

54
scan.js 100644
Wyświetl plik

@ -0,0 +1,54 @@
var ip = require("ip");
const net = require('net');
const Evilscan = require('evilscan');
var localNetwork = ip.address().split('.');
var network = localNetwork[0] + '.' + localNetwork[1] + '.' + localNetwork[2];
var range = network + ".1-" + network + ".254"
var networkDevices = []
const options = {
target: range,
port: '23',
status: 'TROU', // Timeout, Refused, Open, Unreachable
banner: true
};
new Evilscan(options, (err, scan) => {
if (err) {
//console.log(err);
return;
}
scan.on('result', data => {
// fired when item is matching options
//console.log(data);
if (data.status == "open") {
var type = false
if (data.banner.indexOf("GrblHAL") != -1) {
type = "grblHAL"
} else if (data.banner.indexOf("Grbl") != -1) {
type = "grbl"
}
networkDevices.push({
ip: data.ip,
type: type,
banner: data.banner
})
}
});
scan.on('error', err => {
//throw new Error(data.toString());
});
scan.on('done', () => {
// finished !
console.log(networkDevices);
});
scan.run();
});