Skip to content

Commit

Permalink
fix: store mut error
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy44458 committed Jul 11, 2023
1 parent 79af110 commit 612c216
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async function cad (ewd) {

async function nrrouter (ewd) {
try {
return await axios.post('http:https://140.114.75.22:3000/public/eda/nr_router', ewd)
return await axios.post('http:https://140.114.75.22/public/eda/nr_router', ewd)
} catch (e) {
console.error(e)
return false
Expand Down
28 changes: 24 additions & 4 deletions src/store/actions/projectAct.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,33 @@ const generateEWD = function (state) {
let dataElectrode = ''
dataElectrode = dataElectrode + 'contactpad circle r 750\n'

const baseEl = newElectrodeUnit('base', unit, state.app.cornerSize, state.app.gapSize, 0, 0)
const cornerSize = state.app.cornerSize
const gapSizeTmp = state.app.gapSize

electrodes.push(baseEl)
const baseEl = newElectrodeUnit('base', unit, cornerSize, gapSizeTmp, 0, 0)

const electrodesShape = {}

// base electrode
electrodesShape[baseEl.name] = []
let path = ''
const pathlist = baseEl.children[0].attrs.d.split(' ')
pathlist.forEach(p => {
if (p === 'M' || p === 'L') {
path += p
} else if (p !== '' && p !== 'Z') {
path += parseInt(p * scale) + ' '
} else {
path += 'Z\n'
}
})
for (let i = 0; i < pathlist.length - 1; i = i + 3) {
if (pathlist[i] !== '') {
electrodesShape[baseEl.name].push([parseInt(pathlist[i] * scale), parseInt(pathlist[i + 1] * scale)])
}
}
dataElectrode = dataElectrode + baseEl.name + ' path ' + path

electrodes.forEach(el => {
// console.log(el)
if (!(el.name in electrodesShape)) {
Expand All @@ -47,8 +69,6 @@ const generateEWD = function (state) {
}
})

electrodes.pop()

// dataElectrode = dataElectrode + "square path M0 100 L0 1900 L100 2000 L1900 2000 L2000 1900 L2000 100 L1900 0 L100 0 Z\n";
dataElectrode = dataElectrode + '#ENDOFDEFINITION#\n'
let tx = 0
Expand Down

0 comments on commit 612c216

Please sign in to comment.