Skip to content

Commit

Permalink
Fix: Update 2w and 200W CNC parameters
Browse files Browse the repository at this point in the history
* AB position modal disable
* no laserCamera after reconneted
* 2w update laser module
  • Loading branch information
IDKHTS committed Jun 7, 2024
1 parent f8f8305 commit 8c08f85
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/app/machines/snapmaker-2-toolheads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export const L2WLaserToolModule: ToolHead = {
identifier: '2W Laser Module',

label: '2W Laser Module',
image: '/resources/images/machine/40w_laser_module.jpeg',
image: '/resources/images/machine/2w-laser-module.jpg',

metadata: {
headType: ToolHeadType.Laser,
Expand Down
6 changes: 3 additions & 3 deletions src/app/resources/i18n/en/resource.json
Original file line number Diff line number Diff line change
Expand Up @@ -2244,7 +2244,7 @@
"key-default_name-Cutting 5mm": "Cutting 5mm",
"key-default_name-Cutting 6mm": "Cutting 6mm",
"key-default_name-Cutting 8mm": "Cutting 8mm",
"key-default_name-Dot filled": "Dot filled",
"key-default_name-Dot filled": "Standard dot filled",
"key-default_name-Dot-filled Engraving": "Dot-filled Engraving",
"key-default_name-Fast Print": "Fast Print",
"key-default_name-Fast-Line-filled Engraving": "Fast Line-filled",
Expand All @@ -2253,7 +2253,7 @@
"key-default_name-Flat End Mill 4": "Flat End Mill 4",
"key-default_name-HD Fill": "HD Fill",
"key-default_name-High Quality": "High Quality",
"key-default_name-Line filled": "Line filled",
"key-default_name-Line filled": "Standard line filled",
"key-default_name-Line-filled Engraving": "Line-filled Engraving",
"key-default_name-Normal Print": "Normal Print",
"key-default_name-Normal Print (Others)": "Normal Print (Others)",
Expand All @@ -2262,7 +2262,7 @@
"key-default_name-Normal Quality": "Normal Quality",
"key-default_name-Nylon-CoPA": "Nylon-CoPA",
"key-default_name-Nylon-PA6-CF": "Nylon-PA6-CF",
"key-default_name-On the path": "On the path",
"key-default_name-On the path": "Standard on the path",
"key-default_name-Other": "Other-White",
"key-default_name-PC": "PC-Black",
"key-default_name-PETG": "PETG",
Expand Down
12 changes: 6 additions & 6 deletions src/app/resources/i18n/zh-CN/resource.json
Original file line number Diff line number Diff line change
Expand Up @@ -2244,7 +2244,7 @@
"key-default_name-Cutting 5mm": "切割 5 毫米",
"key-default_name-Cutting 6mm": "切割 6 毫米",
"key-default_name-Cutting 8mm": "切割 8 毫米",
"key-default_name-Dot filled": "",
"key-default_name-Dot filled": "标准点填充",
"key-default_name-Dot-filled Engraving": "点填充雕刻",
"key-default_name-Fast Print": "快速打印",
"key-default_name-Fast-Line-filled Engraving": "快速线填充",
Expand All @@ -2253,7 +2253,7 @@
"key-default_name-Flat End Mill 4": "平底铣刀 4 毫米",
"key-default_name-HD Fill": "HD Fill",
"key-default_name-High Quality": "高品质",
"key-default_name-Line filled": "",
"key-default_name-Line filled": "标准线填充",
"key-default_name-Line-filled Engraving": "线填充雕刻",
"key-default_name-Normal Print": "正常打印",
"key-default_name-Normal Print (Others)": "Normal Print (Others)",
Expand All @@ -2262,7 +2262,7 @@
"key-default_name-Normal Quality": "普通品质",
"key-default_name-Nylon-CoPA": "Nylon-CoPA",
"key-default_name-Nylon-PA6-CF": "Nylon-PA6-CF",
"key-default_name-On the path": "",
"key-default_name-On the path": "标准沿着路径",
"key-default_name-Other": "白色-Other",
"key-default_name-PC": "黑色-PC",
"key-default_name-PETG": "PETG",
Expand All @@ -2289,9 +2289,9 @@
"key-default_name-TPU_Black": "黑色-TPU",
"key-default_name-TPU_Yellow": "黄色-TPU",
"key-default_name-Vector Engraving": "矢量雕刻",
"key-default_name-Vector dot filled": "",
"key-default_name-Vector line filled": "",
"key-default_name-Vector on the path": "",
"key-default_name-Vector dot filled": "矢量点填充",
"key-default_name-Vector line filled": "矢量线填充",
"key-default_name-Vector on the path": "矢量沿着路径",
"key-machineMaterialSettings/Profile-update": "编辑参数",
"key-machine_selection-10W Laser": "10W 激光",
"key-machine_selection-3D Printing": "3D 打印",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 8 additions & 3 deletions src/app/ui/views/model-operation-overlay/ABPositionOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,17 @@ const ABPositionOverlay: React.FC<ABPositionOverlayProps> = (props) => {
workflowStatus,
isRotate,
isRayNewVersion,
worksapceToolHead
toolHead: worksapceToolHead
} = useSelector((state: RootState) => state.workspace);
const server: MachineAgent = useSelector((state: RootState) => state.workspace.server);
const dispatch = useDispatch();
const [isConnectedRay, setIsConnectedRay] = useState(false);
const [isShowTip, setIsShowTip] = useState(true);
const canABPosition = useCallback(() => {
const isSupportedHead = includes([L2WLaserToolModule.identifier, L20WLaserToolModule.identifier, L40WLaserToolModule], worksapceToolHead);
const isSupportedHead = includes([L2WLaserToolModule.identifier, L20WLaserToolModule.identifier, L40WLaserToolModule.identifier], worksapceToolHead);
// if old ray firmware version, can't operate ab position
if (isConnectedRay && !isRayNewVersion) return false;

return (isConnected
&& machineIdentifier === activeMachine.identifier
&& headType === HEAD_LASER
Expand Down Expand Up @@ -76,7 +77,11 @@ const ABPositionOverlay: React.FC<ABPositionOverlayProps> = (props) => {
}, [machineIdentifier]);

useEffect(() => {
if (isHomed || !isConnected || (isConnectedRay && !isRayNewVersion)) {
console.log('+++++++++++++++', isHomed, isConnectedRay && !isRayNewVersion);
if (isConnectedRay && !isRayNewVersion) {
setShowHomeTip(false);
}
if (isHomed || !isConnected) {
setShowHomeTip(false);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/ui/widgets/Connection/NetworkConnection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ const NetworkConnection: React.FC = () => {
if (server) {
dispatch(connectActions.disconnect(server));
dispatch(workspaceActions.updateState({ moduleList: [] }));
dispatch(workspaceActions.updateState({ laserCamera: false }));
}
}, [dispatch, server]);

Expand Down Expand Up @@ -579,7 +580,6 @@ const NetworkConnection: React.FC = () => {
}
}

console.log('==========================', moduleStatusList, airPurifierHasPower);
Object.keys(moduleStatusList).forEach((key) => {
if (moduleStatusList[key]) {
newModuleStatusList.push({
Expand Down
1 change: 1 addition & 0 deletions src/app/ui/widgets/Connection/SerialConnection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ const SerialConnection: React.FC = () => {
const closePort = useCallback(() => {
dispatch(connectActions.disconnect(selectedAgent));
dispatch(workspaceActions.updateState({ moduleList: [] }));
dispatch(workspaceActions.updateState({ laserCamera: false }));
}, [dispatch, selectedAgent]);

const actions = {
Expand Down
4 changes: 3 additions & 1 deletion src/app/ui/widgets/ConnectionControl/ControlPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,9 @@ const ControlPanel: React.FC<ControlPanelProps> = (props) => {
return (
<div className={styles['control-panel']}>
{
(headType === HEAD_LASER && !includes([L2WLaserToolModule.identifier], toolHead)) && (
(headType === HEAD_LASER
&& !includes([L2WLaserToolModule.identifier], toolHead)
&& !(isConnectedRay && isNotInWorkspace)) && (
<div className="margin-bottom-8">
<div className="sm-flex justify-space-between">
<span>{i18n._('Keep Laser On When Moving')}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const HomeTipModal: React.FC<HomeTipModalProps> = (props) => {
<Button
type="default"
priority="level-two"
className="align-r"
className="align-r margin-right-8"
width="96px"
onClick={() => onClose && onClose()}
>
Expand Down

0 comments on commit 8c08f85

Please sign in to comment.