833 break;
834 }
835 case 'M600':
836 { 837 try { 838 this.currentTool++; 839 if (this.currentTool >= this.tools.length) { 840 this.currentTool = 0; 841 } 842 if (this.colorMode !== ColorMode.Feed) { 843 this.currentColor = this.tools[this.currentTool].color.clone(); 844 } 845 } catch (ex) { 846 console.log(ex); 847 } 848 } 849 break;
850 }
851 this.lastCommand = commands;
818 break;
819 case 'M3':
820 case 'M4':
821 { 822 const tokens = tokenString.split(/(?=[SM])/); 823 let spindleSpeed = tokens.filter((speed) => speed.startsWith('S')); 824 spindleSpeed = spindleSpeed[0] ? Number(spindleSpeed[0].substring(1)) : 0; 825 if (spindleSpeed > 0) { 826 this.hasSpindle = true; 827 } 828 } 829 break;
830 case 'M567': {
831 this.hasMixing = true;
230 switch (renderQuality) {
231 //SBC Quality - Pi 3B+
232 case 1:
233 { 234 renderStartIndex = 2; 235 this.refreshTime = 30000; 236 maxLines = 25000; 237 maxNRow = 50; 238 this.renderTravels = false; 239 } 240 break;
241 //Low Quality
242 case 2:
264 break;
265 //Ultra
266 case 5:
267 { 268 maxLines = 25000000; 269 } 270 break;
271 //Max
272 default: {
257 break;
258 //High Quality
259 case 4:
260 { 261 maxLines = 15000000; 262 maxNRow = 2; 263 } 264 break;
265 //Ultra
266 case 5:
In JavaScript, prior to ES6, standalone code blocks delimited by curly braces do not create a new scope and have no use.
For example, these curly braces do nothing to foo
:
{
var foo = bar();
}
In ES6, code blocks may create a new scope if a block-level binding (let
and const
), a class declaration or a function declaration (in strict mode) are present. A block is not considered redundant in these cases.
{}
if (foo) {
bar();
{
baz();
}
}
function bar() {
{
baz();
}
}
{
function foo() {}
}
{
aLabel: {
}
}
while (foo) {
bar();
}
if (foo) {
if (bar) {
baz();
}
}
function bar() {
baz();
}
{
let x = 1;
}
{
const y = 1;
}
{
class Foo {}
}
aLabel: {}