New file format name, minor changes and fixes.

This commit is contained in:
Ad5001 2021-03-14 18:28:53 +01:00
parent f63e86b78a
commit 620bdfc28c
8 changed files with 75 additions and 44 deletions

View file

@ -15,6 +15,8 @@
id="SVGRoot" id="SVGRoot"
sodipodi:docname="logplotterfile.svg" sodipodi:docname="logplotterfile.svg"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"> inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)">
<title
id="title849">Logarithm Plotter Icon</title>
<defs <defs
id="defs10"> id="defs10">
<linearGradient <linearGradient
@ -67,16 +69,16 @@
borderopacity="1.0" borderopacity="1.0"
inkscape:pageopacity="0.0" inkscape:pageopacity="0.0"
inkscape:pageshadow="2" inkscape:pageshadow="2"
inkscape:zoom="22.4" inkscape:zoom="15.839192"
inkscape:cx="11.327682" inkscape:cx="31.617327"
inkscape:cy="10.179403" inkscape:cy="5.2075676"
inkscape:document-units="px" inkscape:document-units="px"
inkscape:current-layer="layer1" inkscape:current-layer="layer1"
inkscape:document-rotation="0" inkscape:document-rotation="0"
showgrid="true" showgrid="true"
inkscape:window-width="1920" inkscape:window-width="1920"
inkscape:window-height="1011" inkscape:window-height="1011"
inkscape:window-x="1920" inkscape:window-x="0"
inkscape:window-y="0" inkscape:window-y="0"
inkscape:window-maximized="1"> inkscape:window-maximized="1">
<inkscape:grid <inkscape:grid
@ -91,8 +93,38 @@
<dc:format>image/svg+xml</dc:format> <dc:format>image/svg+xml</dc:format>
<dc:type <dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title /> <dc:title>Logarithm Plotter File Icon</dc:title>
<dc:date>2021</dc:date>
<dc:creator>
<cc:Agent>
<dc:title>Ad5001</dc:title>
</cc:Agent>
</dc:creator>
<dc:rights>
<cc:Agent>
<dc:title>(c) Copyright Ad5001 2021</dc:title>
</cc:Agent>
</dc:rights>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-nc-sa/4.0/" />
</cc:Work> </cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-nc-sa/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:prohibits
rdf:resource="http://creativecommons.org/ns#CommercialUse" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF> </rdf:RDF>
</metadata> </metadata>
<g <g
@ -104,37 +136,33 @@
style="fill:url(#linearGradient53);fill-opacity:1;stroke:#aaaaaf;stroke-width:0.7;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" style="fill:url(#linearGradient53);fill-opacity:1;stroke:#aaaaaf;stroke-width:0.7;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 4,2 h 13 l 3,3.8181818 V 23 H 4 Z" d="m 4,2 h 13 l 3,3.8181818 V 23 H 4 Z"
sodipodi:nodetypes="cccccc" /> sodipodi:nodetypes="cccccc" />
<g <rect
id="g870" style="fill:#000000;fill-rule:evenodd;stroke-width:9.65201;stroke-opacity:0"
transform="translate(-4.5,-1)"> id="rect1410"
<rect width="11"
style="fill:#000000;fill-rule:evenodd;stroke-width:9.65201;stroke-opacity:0" height="1"
id="rect1410" x="6.5"
width="11" y="16" />
height="1" <rect
x="11" style="fill:#000000;fill-rule:evenodd;stroke-width:9.65208;stroke-opacity:0"
y="17" /> id="rect1412"
<rect width="1"
style="fill:#000000;fill-rule:evenodd;stroke-width:9.65208;stroke-opacity:0" height="11"
id="rect1412" x="10.5"
width="1" y="7" />
height="11" <path
x="15" style="fill:none;fill-rule:evenodd;stroke:#ff0000;stroke-width:0.97652;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
y="8" /> id="path1529"
<path sodipodi:type="arc"
style="fill:none;fill-rule:evenodd;stroke:#ff0000;stroke-width:0.975312;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" sodipodi:cx="6.5"
id="path1529" sodipodi:cy="7"
sodipodi:type="arc" sodipodi:rx="10.01174"
sodipodi:cx="11" sodipodi:ry="9.0117397"
sodipodi:cy="8" sodipodi:start="0"
sodipodi:rx="10.012342" sodipodi:end="1.5707963"
sodipodi:ry="9.0123415" sodipodi:arc-type="arc"
sodipodi:start="0" sodipodi:open="true"
sodipodi:end="1.5707963" d="M 16.51174,7 A 10.01174,9.0117397 0 0 1 6.5,16.01174" />
sodipodi:arc-type="arc"
sodipodi:open="true"
d="M 21.012342,8 A 10.012342,9.0123415 0 0 1 11,17.012341" />
</g>
<path <path
id="rect899" id="rect899"
style="fill:#aaaaaf;fill-opacity:1;stroke:none;stroke-width:0.7;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" style="fill:#aaaaaf;fill-opacity:1;stroke:none;stroke-width:0.7;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View file

@ -2,10 +2,11 @@
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info"> <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info" type="application/x-logarithm-plotter"> <mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info" type="application/x-logarithm-plotter">
<comment>Logarithm Plot/Graph</comment> <comment>Logarithm Plot/Graph</comment>
<comment xml:lang="fr">Graphe Logarithmique</comment>
<icon name="/home/ad5001/Apps/LogarithmPlotter/linux/logplotterfile.svg"/> <icon name="/home/ad5001/Apps/LogarithmPlotter/linux/logplotterfile.svg"/>
<glob-deleteall/> <glob-deleteall/>
<glob pattern="*.json"/> <glob pattern="*.json"/>
<glob pattern="*.lgg"/> <glob pattern="*.lgg"/>
<glob pattern="*.lgp"/> <glob pattern="*.lpf"/>
</mime-type> </mime-type>
</mime-info> </mime-info>

View file

@ -52,7 +52,7 @@
<dc:title>Logarithm Plotter Icon v1.0</dc:title> <dc:title>Logarithm Plotter Icon v1.0</dc:title>
<cc:license <cc:license
rdf:resource="http://creativecommons.org/licenses/by-nc-sa/4.0/" /> rdf:resource="http://creativecommons.org/licenses/by-nc-sa/4.0/" />
<dc:date>27/12/2020</dc:date> <dc:date>2021</dc:date>
<dc:creator> <dc:creator>
<cc:Agent> <cc:Agent>
<dc:title>Ad5001</dc:title> <dc:title>Ad5001</dc:title>
@ -60,7 +60,7 @@
</dc:creator> </dc:creator>
<dc:rights> <dc:rights>
<cc:Agent> <cc:Agent>
<dc:title>(c) Ad5001 2020 - All rights reserved</dc:title> <dc:title>(c) Ad5001 2021 - All rights reserved</dc:title>
</cc:Agent> </cc:Agent>
</dc:rights> </dc:rights>
</cc:Work> </cc:Work>

Before

Width:  |  Height:  |  Size: 4 KiB

After

Width:  |  Height:  |  Size: 4 KiB

View file

@ -24,7 +24,7 @@ D.FileDialog {
property bool exportMode: false property bool exportMode: false
title: exportMode ? "Export Logarithmic Graph file" : "Import Logarithmic Graph file" title: exportMode ? "Export Logarithmic Graph file" : "Import Logarithmic Graph file"
nameFilters: ["Logarithmic Graph JSON Data (*.lgg)", "Old Logarithmic Graph JSON Data (*.json)", "All files (*)"] nameFilters: ["Logarithmic Graph JSON Data (*.lpf *.lgg)", "Old Logarithmic Graph JSON Data (*.json)", "All files (*)"]
folder: shortcuts.documents folder: shortcuts.documents
selectExisting: !exportMode selectExisting: !exportMode

View file

@ -94,9 +94,9 @@ ApplicationWindow {
LogGraphCanvas { LogGraphCanvas {
id: drawCanvas id: drawCanvas
anchors.top: parent.top anchors.top: parent.top
anchors.left: sidebar.right anchors.left: sidebar.inPortrait ? parent.left : sidebar.right
height: parent.height height: parent.height
width: parent.width - sidebar.position*sidebar.width width: sidebar.inPortrait ? parent.width : parent.width - sidebar.position*sidebar.width
x: sidebar.position*sidebar.width x: sidebar.position*sidebar.width
xmin: settings.xmin xmin: settings.xmin
@ -117,6 +117,8 @@ ApplicationWindow {
} }
function saveDiagram(filename) { function saveDiagram(filename) {
if(['json', 'lpf', 'lgg'].indexOf(filename.split('.')[filename.split('.').length-1]) == -1)
filename += '.lpf'
settings.saveFilename = filename settings.saveFilename = filename
var objs = {} var objs = {}
for(var objType in Objects.currentObjects){ for(var objType in Objects.currentObjects){

View file

@ -234,7 +234,7 @@ class Function extends ExecutableObject {
getReadableString() { getReadableString() {
if(this.displayMode == 'application') { if(this.displayMode == 'application') {
return `${this.name}: ${this.definitionDomain} ${this.destinationDomain}\n ${' '.repeat(this.name.length)}x ⟼ ${this.expression.toString()}` return `${this.name}: ${this.definitionDomain} ${this.destinationDomain}\n ${' '.repeat(this.name.length)}x ⟼ ${this.expression.toString()}`
} else { } else {
return `${this.name}(x) = ${this.expression.toString()}\nD${Utils.textsub(this.name)} = ${this.definitionDomain}` return `${this.name}(x) = ${this.expression.toString()}\nD${Utils.textsub(this.name)} = ${this.definitionDomain}`
} }

2
run.py
View file

@ -93,7 +93,7 @@ engine.addImportPath(os.path.realpath(os.path.join(os.getcwd(), "qml")))
engine.load(os.path.realpath(os.path.join(os.getcwd(), "qml", "LogGraph.qml"))) engine.load(os.path.realpath(os.path.join(os.getcwd(), "qml", "LogGraph.qml")))
os.chdir(pwd) os.chdir(pwd)
if len(argv) > 0 and os.path.exists(argv[-1]) and argv[-1].split('.')[-1] in ['json', 'lgg']: if len(argv) > 0 and os.path.exists(argv[-1]) and argv[-1].split('.')[-1] in ['json', 'lgg', 'lpf']:
print(argv[-1]) print(argv[-1])
engine.rootObjects()[0].loadDiagram(argv[-1]) engine.rootObjects()[0].loadDiagram(argv[-1])
os.chdir(os.path.dirname(os.path.realpath(__file__))) os.chdir(os.path.dirname(os.path.realpath(__file__)))

BIN
win/logplotter.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB