Compare commits
1 Commits
testpull
...
feature/nu
| Author | SHA1 | Date | |
|---|---|---|---|
| 6a03b7aec1 |
@@ -5,10 +5,9 @@
|
|||||||
<link rel="stylesheet" href="ZGUI.css">
|
<link rel="stylesheet" href="ZGUI.css">
|
||||||
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
|
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
|
||||||
<script src="TrimSPelec.js"></script>
|
<script src="TrimSPelec.js"></script>
|
||||||
<!script src="TrimSPWeb.js"></script>
|
|
||||||
<script src="TrimSPlib.js"></script>
|
<script src="TrimSPlib.js"></script>
|
||||||
<script src="myplots.js"></script>
|
<script src="myplots.js"></script>
|
||||||
<!script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
|
|
||||||
<title>Trim.SP</title>
|
<title>Trim.SP</title>
|
||||||
</head>
|
</head>
|
||||||
<body onresize="resizePl()" onload="adjust_table();adjust_scans();">
|
<body onresize="resizePl()" onload="adjust_table();adjust_scans();">
|
||||||
@@ -63,7 +62,6 @@
|
|||||||
<option value="Mg-31">Mg-31</option>
|
<option value="Mg-31">Mg-31</option>
|
||||||
<option value="H">H</option>
|
<option value="H">H</option>
|
||||||
<option value="He">He</option>
|
<option value="He">He</option>
|
||||||
<option value="Ar">Ar</option>
|
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
15
TrimSPlib.js
15
TrimSPlib.js
@@ -1425,20 +1425,7 @@ function startSequence() {
|
|||||||
iScan++;
|
iScan++;
|
||||||
}
|
}
|
||||||
|
|
||||||
let data = readAsciiFile(All["workPath"]+"/"+"fort.33");
|
let seq_file = All["fileNamePrefix"]+"_Seq_Results.dat";
|
||||||
let LComp = "";
|
|
||||||
let chem_formula = "";
|
|
||||||
let place_holder = "";
|
|
||||||
let re = new RegExp(place_holder,"g");
|
|
||||||
for (let i=1;i<=All["numLayer"];i++) {
|
|
||||||
LComp = "L"+i+"Comp";
|
|
||||||
chem_formula = All[LComp];
|
|
||||||
place_holder = "impL"+i;
|
|
||||||
re = new RegExp(place_holder,"g");
|
|
||||||
data = data.replace(re, chem_formula);
|
|
||||||
}
|
|
||||||
let seq_file = All["workPath"]+"/"+All["fileNamePrefix"]+"_Seq_Results.dat";
|
|
||||||
writeAsciiFile(seq_file, data);
|
|
||||||
|
|
||||||
// Remove redundant files and change the name fort.33
|
// Remove redundant files and change the name fort.33
|
||||||
if (!webOrApp) {
|
if (!webOrApp) {
|
||||||
|
|||||||
59
TrimSPweb.js
59
TrimSPweb.js
@@ -4,70 +4,26 @@ function writeAsciiFile(filename,content) {
|
|||||||
// Write string content into ascii file filename
|
// Write string content into ascii file filename
|
||||||
// Go via CGI script
|
// Go via CGI script
|
||||||
//console.log(filename, content);
|
//console.log(filename, content);
|
||||||
// Prepare CGI args use POST for long files
|
// Prepare CGI args
|
||||||
let cgiargs = "fn="+filename; // POST
|
let cgiargs = "?fn="+filename;
|
||||||
let lines = content.split(/\n/);
|
let lines = content.split(/\n/);
|
||||||
let prefix = filename.split(/\//);
|
let prefix = filename.split(/\//);
|
||||||
for (let i=0; i<lines.length; i++) {
|
for (let i=0; i<lines.length; i++) {
|
||||||
cgiargs += "&line" + i + "=" + lines[i].replace(/\s\s+/g, ' ');
|
cgiargs += "&line" + i + "=" + lines[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
var xhttp;
|
var xhttp;
|
||||||
xhttp = new XMLHttpRequest();
|
xhttp = new XMLHttpRequest();
|
||||||
xhttp.onreadystatechange = function() {
|
xhttp.onreadystatechange = function() {
|
||||||
if (this.readyState == 4 && this.status == 200) {
|
if (this.readyState == 4 && this.status == 200) {
|
||||||
console.log("response=",xhttp.responseText);
|
//console.log("resptext=",xhttp.responseText);
|
||||||
} else if (this.readyState == 4) {
|
} else if (this.readyState == 4) {
|
||||||
console.log(xhttp.status, xhttp.statusText);
|
console.log(xhttp.status, xhttp.statusText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let request = "/cgi-bin/singleTrimSP.cgi"; //POST
|
let request = "/cgi-bin/singleTrimSP.cgi"+cgiargs;
|
||||||
xhttp.open("POST", request, false); //POST
|
xhttp.open("GET", request, false);
|
||||||
|
xhttp.send();
|
||||||
//Send the proper header information along with the request
|
|
||||||
xhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); //POST
|
|
||||||
xhttp.send(cgiargs); //POST
|
|
||||||
// Now you can add a link to the files
|
|
||||||
let d = document.getElementById("linkDiv");
|
|
||||||
if (!d) {
|
|
||||||
d = document.createElement("div");
|
|
||||||
d.id = "linkDiv";
|
|
||||||
document.body.appendChild(d);
|
|
||||||
}
|
|
||||||
let htmlLink = "Download files: <a href='";
|
|
||||||
htmlLink += "/tmp/" + prefix[2] + ".tgz'>";
|
|
||||||
htmlLink += prefix[2] + ".tgz</a>";
|
|
||||||
d.innerHTML = htmlLink;
|
|
||||||
|
|
||||||
return(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
function writeAsciiFile2(filename,content) {
|
|
||||||
// Write string content into ascii file filename
|
|
||||||
// Go via CGI script
|
|
||||||
//console.log(filename, content);
|
|
||||||
// Prepare CGI args use GET for short files
|
|
||||||
let cgiargs = "?fn="+filename; // GET
|
|
||||||
let lines = content.split(/\n/);
|
|
||||||
let prefix = filename.split(/\//);
|
|
||||||
for (let i=0; i<lines.length; i++) {
|
|
||||||
cgiargs += "&line" + i + "=" + lines[i].replace(/\s\s+/g, ' ');
|
|
||||||
}
|
|
||||||
|
|
||||||
var xhttp;
|
|
||||||
xhttp = new XMLHttpRequest();
|
|
||||||
xhttp.onreadystatechange = function() {
|
|
||||||
if (this.readyState == 4 && this.status == 200) {
|
|
||||||
console.log("response=",xhttp.responseText);
|
|
||||||
} else if (this.readyState == 4) {
|
|
||||||
console.log(xhttp.status, xhttp.statusText);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let request = "/cgi-bin/singleTrimSP.cgi"+cgiargs; // GET
|
|
||||||
xhttp.open("GET", request, false); //GET
|
|
||||||
|
|
||||||
//Send the proper header information along with the request
|
|
||||||
xhttp.send(); // GET
|
|
||||||
// Now you can add a link to the files
|
// Now you can add a link to the files
|
||||||
let d = document.getElementById("linkDiv");
|
let d = document.getElementById("linkDiv");
|
||||||
if (!d) {
|
if (!d) {
|
||||||
@@ -104,7 +60,6 @@ function readAsciiFile(filename) {
|
|||||||
filename += "?" + Date();
|
filename += "?" + Date();
|
||||||
//filename = "http://musruser.psi.ch" + filename;
|
//filename = "http://musruser.psi.ch" + filename;
|
||||||
xhttp.open("GET", filename, false);
|
xhttp.open("GET", filename, false);
|
||||||
xhttp.overrideMimeType("text/plain");
|
|
||||||
xhttp.send();
|
xhttp.send();
|
||||||
return(xhttp.responseText);
|
return(xhttp.responseText);
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
4662
fortran/trimspNLv1.0.1.F
Normal file
4662
fortran/trimspNLv1.0.1.F
Normal file
File diff suppressed because it is too large
Load Diff
64
main.js
64
main.js
@@ -34,10 +34,8 @@ function createWindow () {
|
|||||||
console.log(result.canceled);
|
console.log(result.canceled);
|
||||||
console.log(result.filePaths);
|
console.log(result.filePaths);
|
||||||
if (!result.canceled) {
|
if (!result.canceled) {
|
||||||
setImmediate(function() {
|
var focusedWindow = BrowserWindow.getFocusedWindow();
|
||||||
var focusedWindow = BrowserWindow.getFocusedWindow();
|
focusedWindow.webContents.send('openFile',result.filePaths);
|
||||||
focusedWindow.webContents.send('openFile',result.filePaths);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
@@ -53,11 +51,9 @@ function createWindow () {
|
|||||||
defaultPath : app.getPath('temp'),
|
defaultPath : app.getPath('temp'),
|
||||||
properties:["openDirectory"]}
|
properties:["openDirectory"]}
|
||||||
).then(result => {
|
).then(result => {
|
||||||
setImmediate(function() {
|
console.log(result.filePaths)
|
||||||
console.log(result.filePaths)
|
var focusedWindow = BrowserWindow.getFocusedWindow();
|
||||||
var focusedWindow = BrowserWindow.getFocusedWindow();
|
focusedWindow.webContents.send('selectFolder',result.filePaths);
|
||||||
focusedWindow.webContents.send('selectFolder',result.filePaths);
|
|
||||||
});
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
})
|
})
|
||||||
@@ -67,10 +63,8 @@ function createWindow () {
|
|||||||
label: 'Save',
|
label: 'Save',
|
||||||
accelerator: 'CmdOrCtrl+S',
|
accelerator: 'CmdOrCtrl+S',
|
||||||
click () {
|
click () {
|
||||||
setImmediate(function() {
|
var focusedWindow = BrowserWindow.getFocusedWindow();
|
||||||
var focusedWindow = BrowserWindow.getFocusedWindow();
|
focusedWindow.webContents.send('saveFile','');
|
||||||
focusedWindow.webContents.send('saveFile','');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -86,10 +80,8 @@ function createWindow () {
|
|||||||
],
|
],
|
||||||
properties: ['showOverwriteConfirmation']}
|
properties: ['showOverwriteConfirmation']}
|
||||||
).then(result => {
|
).then(result => {
|
||||||
setImmediate(function() {
|
var focusedWindow = BrowserWindow.getFocusedWindow();
|
||||||
var focusedWindow = BrowserWindow.getFocusedWindow();
|
focusedWindow.webContents.send('saveFile',result.filePath);
|
||||||
focusedWindow.webContents.send('saveFile',result.filePath);
|
|
||||||
});
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
})
|
})
|
||||||
@@ -99,13 +91,11 @@ function createWindow () {
|
|||||||
label: 'Print',
|
label: 'Print',
|
||||||
accelerator: 'CmdOrCtrl+P',
|
accelerator: 'CmdOrCtrl+P',
|
||||||
click () {
|
click () {
|
||||||
setImmediate(function() {
|
var focusedWindow = BrowserWindow.getFocusedWindow();
|
||||||
var focusedWindow = BrowserWindow.getFocusedWindow();
|
const options = {};
|
||||||
const options = {};
|
focusedWindow.webContents.print(options, (success, errorType) => {
|
||||||
focusedWindow.webContents.print(options, (success, errorType) => {
|
if (!success) console.log(errorType)
|
||||||
if (!success) console.log(errorType)
|
})
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -134,10 +124,8 @@ function createWindow () {
|
|||||||
console.log(result.canceled);
|
console.log(result.canceled);
|
||||||
console.log(result.filePaths);
|
console.log(result.filePaths);
|
||||||
if (!result.canceled) {
|
if (!result.canceled) {
|
||||||
setImmediate(function() {
|
var focusedWindow = BrowserWindow.getFocusedWindow();
|
||||||
var focusedWindow = BrowserWindow.getFocusedWindow();
|
focusedWindow.webContents.send('plotProf',result.filePaths);
|
||||||
focusedWindow.webContents.send('plotProf',result.filePaths);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
@@ -159,10 +147,8 @@ function createWindow () {
|
|||||||
console.log(result.canceled);
|
console.log(result.canceled);
|
||||||
console.log(result.filePaths);
|
console.log(result.filePaths);
|
||||||
if (!result.canceled) {
|
if (!result.canceled) {
|
||||||
setImmediate(function() {
|
var focusedWindow = BrowserWindow.getFocusedWindow();
|
||||||
var focusedWindow = BrowserWindow.getFocusedWindow();
|
focusedWindow.webContents.send('plotFrac',result.filePaths);
|
||||||
focusedWindow.webContents.send('plotFrac',result.filePaths);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
@@ -184,10 +170,8 @@ function createWindow () {
|
|||||||
console.log(result.canceled);
|
console.log(result.canceled);
|
||||||
console.log(result.filePaths);
|
console.log(result.filePaths);
|
||||||
if (!result.canceled) {
|
if (!result.canceled) {
|
||||||
setImmediate(function() {
|
var focusedWindow = BrowserWindow.getFocusedWindow();
|
||||||
var focusedWindow = BrowserWindow.getFocusedWindow();
|
focusedWindow.webContents.send('plotMean',result.filePaths);
|
||||||
focusedWindow.webContents.send('plotMean',result.filePaths);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
@@ -247,11 +231,9 @@ ipcMain.on('browseFolder', (event, args) => {
|
|||||||
properties:["openDirectory"]}
|
properties:["openDirectory"]}
|
||||||
).then(result => {
|
).then(result => {
|
||||||
console.log(result)
|
console.log(result)
|
||||||
setImmediate(function() {
|
var focusedWindow = BrowserWindow.getFocusedWindow();
|
||||||
var focusedWindow = BrowserWindow.getFocusedWindow();
|
focusedWindow.webContents.send('browseFolder',result.filePaths);
|
||||||
focusedWindow.webContents.send('browseFolder',result.filePaths);
|
app.setPath('temp',result.filePaths[0]);
|
||||||
app.setPath('temp',result.filePaths[0]);
|
|
||||||
});
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
})
|
})
|
||||||
|
|||||||
BIN
out/make/deb/x64/trimsp_1.0.1_amd64.deb
Normal file
BIN
out/make/deb/x64/trimsp_1.0.1_amd64.deb
Normal file
Binary file not shown.
BIN
out/make/rpm/x64/TrimSP-1.0.1-1.x86_64.rpm
Normal file
BIN
out/make/rpm/x64/TrimSP-1.0.1-1.x86_64.rpm
Normal file
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "TrimSP",
|
"name": "TrimSP",
|
||||||
"version": "1.0.2",
|
"version": "1.1.0",
|
||||||
"description": "Trim.SP simulation to calculate stopping profile of implanted probes.",
|
"description": "Trim.SP simulation to calculate stopping profile of implanted probes.",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
"SRIM"
|
"SRIM"
|
||||||
],
|
],
|
||||||
"author": "Zaher Salman",
|
"author": "Zaher Salman",
|
||||||
"license": "GPL2",
|
"license": "GPL3",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@electron-forge/cli": "^6.0.0-beta.57",
|
"@electron-forge/cli": "^6.0.0-beta.57",
|
||||||
"@electron-forge/maker-deb": "^6.0.0-beta.57",
|
"@electron-forge/maker-deb": "^6.0.0-beta.57",
|
||||||
|
|||||||
Reference in New Issue
Block a user