Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5,672 changes: 3,329 additions & 2,343 deletions package-lock.json

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
"@types/workerpool": "^6.1.0",
"@typescript-eslint/eslint-plugin": "5.23.0",
"@typescript-eslint/parser": "5.23.0",
"babel-loader": "8.1.0",
"babel-loader": "^10.0.0",
"bundle-loader": "0.5.6",
"canvas2d-zoom": "^0.1.5",
"commitizen": "4.2.5",
Expand Down Expand Up @@ -305,27 +305,30 @@
"json-loader": "0.5.7",
"mini-css-extract-plugin": "1.6.2",
"nib": "1.2.0",
"path-browserify": "^1.0.1",
"plugin-error": "1.0.1",
"pofile": "1.0.11",
"progress": "2.0.3",
"react-textarea-autosize": "8.3.4",
"snapmaker-react-icon": "1.26.7",
"stream-browserify": "^3.0.0",
"style-loader": "2.0.0",
"stylint": "2.0.0",
"stylus": "0.54.8",
"stylus-loader": "3.0.2",
"tape": "4.11.0",
"terser-webpack-plugin": "4.2.3",
"timers-browserify": "^2.0.12",
"transform-loader": "0.2.4",
"ts-loader": "8.4.0",
"ts-node": "~10.9.1",
"typescript": "4.4.4",
"url-loader": "^4.1.1",
"webpack": "4.47.0",
"webpack-cli": "4.10.0",
"webpack-dev-server": "4.14.0",
"webpack-hot-middleware": "2.25.4",
"webpack-manifest-plugin": "3.2.0",
"webpack": "^5.104.1",
"webpack-cli": "^6.0.1",
"webpack-dev-server": "^5.2.3",
"webpack-hot-middleware": "^2.26.1",
"webpack-manifest-plugin": "^6.0.1",
"word-wrap": "1.2.5",
"worker-loader": "3.0.8",
"xlsx": "0.18.5"
Expand All @@ -343,4 +346,4 @@
"pre-push": "npm run eslint:debug"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function mergeVertices(geometry, tolerance = 1e-4): BufferGeometry {
// Add another reference to the vertex if it's already
// used by another index
if (hash in hashToIndex) {
newIndices.push(hashToIndex[hash]);
newIndices.push(hashToIndex[contenthash]);
} else {
// copy data to the new index in the temporary attributes
for (let j = 0, l = attributeNames.length; j < l; j++) {
Expand All @@ -99,7 +99,7 @@ function mergeVertices(geometry, tolerance = 1e-4): BufferGeometry {
}
}

hashToIndex[hash] = nextIndex;
hashToIndex[contenthash] = nextIndex;
newIndices.push(nextIndex);
nextIndex++;
}
Expand Down
13 changes: 12 additions & 1 deletion src/app/lib/manager/ClippingPoolManager.worker.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
import { delay } from 'lodash';
import { Pool, spawn, Transfer, Worker } from 'threads';
import { PoolEventType } from 'threads/dist/master/pool-types';
import { Box3, BufferAttribute, BufferGeometry, Line3, Matrix4, Plane, Vector3 } from 'three';
import { MeshBVH } from 'three-mesh-bvh';
import { expandBuffer, pointToBuffer } from '../buffer-utils';

// Define PoolEventType locally since it's not exported by threads package
enum PoolEventType {
initialized = 'initialized',
taskCanceled = 'taskCanceled',
taskCompleted = 'taskCompleted',
taskFailed = 'taskFailed',
taskQueued = 'taskQueued',
taskQueueDrained = 'taskQueueDrained',
taskStart = 'taskStart',
terminated = 'terminated'
}

type TPoint = { x: number, y: number, z?: number }

type TInfillPattern = 'lines' | 'grid' | 'triangles' | 'trihexagon' | 'cubic'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class MaterialTestGcodeParams extends PureComponent {
styleSize="large"
/>
</div>
{/*路径*/}
{/* 路径*/}
{pathType === 'path' && (
<div>
<div className="border-bottom-normal padding-bottom-4 margin-vertical-16">
Expand Down
32 changes: 16 additions & 16 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,27 @@ import fetch from 'node-fetch';
import path from 'path';
import url from 'url';

import * as Sentry from '@sentry/electron/main';
import DataStorage from './DataStorage';
import MenuBuilder, { addRecentFile, cleanAllRecentFiles } from './electron-app/Menu';
import { configureWindow } from './electron-app/window';
import pkg from './package.json';

import * as Sentry from "@sentry/electron/main";

Sentry.init({
dsn: "https://cd2af28a126afbc7a8257a75b3b5d0ab@o4508125599563776.ingest.us.sentry.io/4508125605068800",
release: pkg.version,
// integrations: [new Sentry.Integrations.BrowserTracing()],
tracesSampleRate: 1.0,
debug: true,
beforeSend(event) {
log.info('Sentry event::: ', event);
// Log the error to the console
if (event.exception) {
console.error('Captured exception:', event.exception.values[0]);
dsn: 'https://cd2af28a126afbc7a8257a75b3b5d0ab@o4508125599563776.ingest.us.sentry.io/4508125605068800',
release: pkg.version,
// integrations: [new Sentry.Integrations.BrowserTracing()],
tracesSampleRate: 1.0,
debug: true,
beforeSend(event) {
log.info('Sentry event::: ', event);
// Log the error to the console
if (event.exception) {
console.error('Captured exception:', event.exception.values[0]);
}
return event;
}
return event;
}
});

log.setLevel(log.levels.INFO);
Expand Down Expand Up @@ -350,9 +350,9 @@ const showMainWindow = async () => {
const window = new BrowserWindow(windowOptions);
mainWindow = window;
// Monitor policy links, do not allow redirection
window.webContents.on('did-attach-webview', (e, webContent)=> {
webContent.on('will-navigate', (e, url) => {
if (url.includes('policy')) {
window.webContents.on('did-attach-webview', (_, webContent) => {
webContent.on('will-navigate', (e, webContentUrl) => {
if (webContentUrl.includes('policy')) {
e.preventDefault();
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/server/controllers/Marlin/MarlinController.js
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ class MarlinController extends EventEmitter {
}, 1000);
});
this.controller.on('cnc:highpower', (res) => {
// log.info(`controller.on('cnc:highpower'): source=${this.history.writeSource}, res=${JSON.stringify(res)}`);
log.info(`controller.on('cnc:highpower'): source=${this.history.writeSource}, res=${JSON.stringify(res)}`);
});
this.controller.on('laser10w:state', (res) => {
if (res.laser10WErrorState !== undefined) {
Expand Down
2 changes: 1 addition & 1 deletion src/server/services/api/api-online-resources-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ export function getUserInfoData(req, res) {
}).catch((err) => {
log.error('get information flow err:', JSON.stringify(err));
});
}
}
2 changes: 1 addition & 1 deletion src/server/services/machine/ConnectionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ class ConnectionManager {
Promise.all(promises)
.then(() => {
this.channel.uploadGcodeFile(gcodeFilePath, headType, renderName, (msg) => {
log.info('uploadGcodeFile result:' + msg);
log.info(`uploadGcodeFile result:${msg}`);
if (msg) {
socket.emit(SocketEvent.StartGCode, { err: 'failed', text: msg || 'Failed to upload file' });
// FIXME: Add abort message
Expand Down
4 changes: 2 additions & 2 deletions src/server/services/machine/channels/SacpChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ class SacpChannelBase extends Channel implements
};
this.sacpClient.ack(0x01, 0x36, packet, new Response(0).toBuffer()).then(() => {
if (stateData.headType !== HEAD_PRINTING) {
this.sacpClient.getCurrentCoordinateInfo().then(({ response }) => {
this.sacpClient.getCurrentCoordinateInfo().then(() => {
this.sacpClient.updateCoordinate(CoordinateType.WORKSPACE).then(({ response }) => {
log.info(`updateCoordinateType, ${response.result}`);
});
Expand Down Expand Up @@ -1273,7 +1273,7 @@ class SacpChannelBase extends Channel implements
return this.sacpClient.getCurrentCoordinateInfo();
};

public goHome = async (headType?: string) => {
public goHome = async () => {
log.info('onClick gohome');
await this.sacpClient.updateCoordinate(CoordinateType.MACHINE).then(res => {
log.info(`Update Coordinate: ${res}`);
Expand Down
2 changes: 1 addition & 1 deletion src/server/services/machine/channels/SstpHttpChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const _getResult = (err, res: request.Response): Result => {
};
};
// let timeoutHandle = null;
const intervalHandle = null;
// const intervalHandle = null;


export type StateOptions = {
Expand Down
2 changes: 1 addition & 1 deletion src/server/services/machine/sacp/SacpClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,7 @@ export default class SacpClient extends Dispatcher {
public async setMotorPowerHoldMode(motorPowerMode: MotorPowerMode) {
const buffer = Buffer.alloc(1);
writeUint8(buffer, 0, motorPowerMode);
return this.send(0x01, 0x48, PeerId.CONTROLLER, buffer).then(({ response, packet }) => {
return this.send(0x01, 0x48, PeerId.CONTROLLER, buffer).then(({ response }) => {
return readUint8(response.data);
});
}
Expand Down
30 changes: 16 additions & 14 deletions webpack.config.app.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ module.exports = {
'node_modules',
],
extensions: ['.js', '.json', '.jsx', '.styl', '.ts', '.tsx'],
fallback: {
'path': require.resolve('path-browserify'),
'timers': require.resolve('timers-browserify'),
'stream': require.resolve('stream-browserify'),
'fs': false,
'net': false,
'tls': false,
},
},
entry: {
app: path.resolve(__dirname, 'src/app/index.jsx'),
Expand All @@ -59,7 +67,7 @@ module.exports = {
},
output: {
path: path.resolve(__dirname, 'output/src/app'),
filename: '[name].[hash].bundle.js',
filename: '[name].[contenthash].bundle.js',
publicPath: '',
globalObject: 'this',
libraryTarget: 'umd',
Expand All @@ -68,9 +76,8 @@ module.exports = {
minimize: false,
splitChunks: {
chunks: 'all',
name: true,
cacheGroups: {
vendors: {
defaultVendors: {
test: /[\\/]node_modules[\\/]/,
priority: -10
}
Expand Down Expand Up @@ -215,24 +222,19 @@ module.exports = {
// image files
{
test: /\.(png|jpg|svg)$/,
loader: 'url-loader',
options: {
limit: 8192
type: 'asset',
parser: {
dataUrlCondition: {
maxSize: 8192
}
}
},
// font files
{
test: /\.(ttf|woff|woff2|eot)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'file-loader'
type: 'asset/resource'
},
]
},
// Some libraries import Node modules but don't use them in the browser.
// Tell Webpack to provide empty mocks for them so importing them works.
node: {
fs: 'empty',
net: 'empty',
tls: 'empty',
},
devServer: devServer,
};
27 changes: 15 additions & 12 deletions webpack.config.app.production.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,15 @@ module.exports = {
path.resolve(__dirname, 'src/app'),
'node_modules'
],
extensions: ['.js', '.json', '.jsx', '.styl', '.ts', '.tsx']
extensions: ['.js', '.json', '.jsx', '.styl', '.ts', '.tsx'],
fallback: {
'path': require.resolve('path-browserify'),
'timers': require.resolve('timers-browserify'),
'stream': require.resolve('stream-browserify'),
'fs': false,
'net': false,
'tls': false,
},
},
entry: {
polyfill: path.resolve(__dirname, 'src/app/polyfill/index.js'),
Expand Down Expand Up @@ -195,23 +203,18 @@ module.exports = {
// image files
{
test: /\.(png|jpg|svg)$/,
loader: 'url-loader',
options: {
limit: 8192
type: 'asset',
parser: {
dataUrlCondition: {
maxSize: 8192
}
}
},
// font files
{
test: /\.(ttf|woff|woff2|eot)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'file-loader'
type: 'asset/resource'
}
]
},
// Some libraries import Node modules but don't use them in the browser.
// Tell Webpack to provide empty mocks for them so importing them works.
node: {
fs: 'empty',
net: 'empty',
tls: 'empty',
}
};
1 change: 0 additions & 1 deletion webpack.config.server.worker.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ module.exports = {
mode: 'development',
devtool: 'eval-source-map',
target: 'node',
watch: true,
context: path.resolve(__dirname, './src/server'),
entry: path.resolve(__dirname, './src/server/services/task-manager/Pool.worker.js'),
output: {
Expand Down