This repository has been archived by the owner on Jun 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Aggelos Vogiatzis
authored and
Aggelos Vogiatzis
committed
Jul 24, 2021
1 parent
de10e94
commit bf1f547
Showing
10 changed files
with
239 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,18 @@ | ||
const { ipcRenderer,dialog } = require('electron'); | ||
|
||
|
||
|
||
function openDbSel() { | ||
console.log('Opening Selection window'); | ||
async function openDbSel() { | ||
let dialogOptions = { | ||
title: 'Navigate to Datablock text file and select it', | ||
properties: ['openFile'], | ||
filters: [ | ||
{ name: 'txt', extensions: [txt] } | ||
], | ||
}; | ||
|
||
|
||
let lookWindow = await dialog.showOpenDialog(dialogOptions); | ||
console.log(lookWindow); | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
body { | ||
font-family: 'Open Sans', sans-serif; | ||
/* font-family: 'Roboto', sans-serif; */ | ||
/* font-weight: 300; */ | ||
margin: auto; | ||
color: white; | ||
background-color: #363636; | ||
} | ||
|
||
.title { | ||
margin: 10px; | ||
text-align: center; | ||
font-size: 30px; | ||
} | ||
|
||
.bigTitle { | ||
margin: 10px; | ||
text-align: center; | ||
font-size: 40px; | ||
} | ||
|
||
.args { | ||
text-align: center; | ||
} | ||
|
||
.button { | ||
background-color: rgb(0, 0, 0); | ||
/* Green */ | ||
min-width: 250px; | ||
border: none; | ||
color: white; | ||
padding: 12px 25px; | ||
text-align: center; | ||
text-decoration: none; | ||
display: inline-block; | ||
font-size: 16px; | ||
margin: 4px 2px; | ||
transition-duration: 0.4s; | ||
cursor: pointer; | ||
border-radius: 5px; | ||
} | ||
|
||
.button:hover { | ||
background-color: white; | ||
color: black; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link rel="stylesheet" href="index.css"> | ||
<title>Datablock</title> | ||
</head> | ||
<body> | ||
|
||
<div> | ||
<h1 class="title">Datablock:</h1> | ||
</div> | ||
<div style="text-align: center;"> | ||
<button onclick="openDbSel();" class="button">Select Datablock</button> | ||
</div> | ||
<script src="index.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const { ipcRenderer } = require('electron'); | ||
const { giveFileGetBlock } = require('../parseDatablock/parser'); | ||
|
||
ipcRenderer.on('sendFile', (event, data) => { | ||
console.log(data); | ||
giveFileGetBlock(data.filePaths[0]); | ||
}); | ||
|
||
async function openDbSel() { | ||
ipcRenderer.send('openFile'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
module.exports = { | ||
"names": [ | ||
": Bool", | ||
": Byte", | ||
": Word", | ||
": DWord", | ||
": Char", | ||
": SInt", | ||
": Int", | ||
": DInt", | ||
": USInt", | ||
": UInt", | ||
": UDInt", | ||
": Real", | ||
": LReal", | ||
": Time", | ||
": String" | ||
], | ||
"memory": [ | ||
0.1, | ||
1, | ||
2, | ||
4, | ||
1, | ||
1, | ||
2, | ||
4, | ||
2, | ||
2, | ||
4, | ||
4, | ||
8, | ||
4, | ||
256 | ||
], | ||
"types": | ||
[ | ||
"X", | ||
"BYTE", | ||
"WORD", | ||
"DWORD", | ||
"CHAR", | ||
"SINT", | ||
"INT", | ||
"DINT", | ||
"USINT", | ||
"UINT", | ||
"UDINT", | ||
"REAL", | ||
"LREAL", | ||
"TIME", | ||
"STRING" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const rules = require('./dbRules'); | ||
const Decimal = require('decimal.js'); | ||
const fs = require('fs'); | ||
|
||
|
||
let dbVars = {}; | ||
|
||
async function giveFileGetBlock(filePath) { | ||
fs.readFile(filePath, 'utf8', (err, data) => { | ||
if(err) { | ||
console.error(err); | ||
return; | ||
} else { | ||
console.log(data); | ||
} | ||
}); | ||
}; | ||
|
||
|
||
module.exports = { | ||
giveFileGetBlock: giveFileGetBlock, | ||
}; |