Skip to content

Commit

Permalink
rename ecc to ewds
Browse files Browse the repository at this point in the history
  • Loading branch information
ChangChiTW committed May 10, 2023
1 parent 2253c85 commit 18eb869
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/store/actions/projectAct.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,25 +158,25 @@ const projectActions = {
/**
* Downloads the current vuegg project definition as a .gg (base64 json) file
*
* @return {download} : [project-name].gg file containing the vuegg project definition
* @return {download} : [project-name].ecc file containing the vuegg project definition
*/
[types.downloadProjectEWDS]: async function ({ state, dispatch, commit }) {
[types.downloadProjectECC]: async function ({ state, dispatch, commit }) {
commit(types._toggleLoadingStatus, true)

const parsedRepoName = state.project.title.replace(/[^a-zA-Z0-9-_]+/g, '-')

const projectB64 = btoa(JSON.stringify(state.project))
download(projectB64, parsedRepoName + '.ewds', 'appliction/json')
download(projectB64, parsedRepoName + '.ecc', 'appliction/json')
commit(types._toggleLoadingStatus, false)
},

/**
* Downloads the current project routing result and electrode position
* Used for GUI
*
* @return {download} : [project-name].ecc file containing routing result and electrode position
* @return {download} : [project-name].ewds file containing routing result and electrode position
*/
[types.downloadProjectECC]: async function ({ state, dispatch, commit }) {
[types.downloadProjectEWDS]: async function ({ state, dispatch, commit }) {
commit(types._toggleLoadingStatus, true)
commit(types._toggleApiStatus, true)

Expand All @@ -187,14 +187,14 @@ const projectActions = {
const ewd = {
electrode_size: state.app.gridUnit.origin,
unit: state.app.routingUnit === 0 ? 1 : state.app.gridUnit.origin / 100 * state.app.routingUnit,
output_format: 'ecc_pattern',
output_format: 'ewds',
ewd_content: dataElectrode
}

const resp = await api.nrrouter(ewd)

if (resp.status === 200) {
download(resp.data, parsedRepoName + '.ecc')
download(resp.data, parsedRepoName + '.ewds')
commit(types._toggleLoadingStatus, false)
} else {
commit(types._toggleLoadingStatus, false)
Expand Down

0 comments on commit 18eb869

Please sign in to comment.