-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
16 changed files
with
15,816 additions
and
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> | ||
<CodeBlocks_project_file> | ||
<FileVersion major="1" minor="6" /> | ||
<Project> | ||
<Option title="QET_ElementScaler" /> | ||
<Option pch_mode="2" /> | ||
<Option compiler="gcc" /> | ||
<Build> | ||
<Target title="Release"> | ||
<Option output="QET_ElementScaler" prefix_auto="1" extension_auto="1" /> | ||
<Option object_output="obj/" /> | ||
<Option type="1" /> | ||
<Option compiler="gcc" /> | ||
<Compiler> | ||
<Add option="-O2" /> | ||
</Compiler> | ||
<Linker> | ||
<Add option="-s" /> | ||
</Linker> | ||
</Target> | ||
</Build> | ||
<Compiler> | ||
<Add option="-Wall" /> | ||
<Add option="-std=c++17" /> | ||
</Compiler> | ||
<Unit filename="inc/pugixml/pugiconfig.hpp" /> | ||
<Unit filename="inc/pugixml/pugixml.cpp" /> | ||
<Unit filename="inc/pugixml/pugixml.hpp" /> | ||
<Unit filename="main.cpp" /> | ||
<Unit filename="main.h" /> | ||
<Extensions> | ||
<lib_finder disable_auto="1" /> | ||
</Extensions> | ||
</Project> | ||
</CodeBlocks_project_file> |
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
File renamed without changes.
File renamed without changes.
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,35 @@ | ||
# QET_ElementScaler | ||
|
||
QET_ElementScaler is a commandline-tool to scale QElectroTech-Elements with constant factor(s) and save the changed data to a renamed file. | ||
With the optional parameter "-o" or "--stdout" the scaled element is written to stdout and no new file is created. | ||
The optional parameter "-i" or "--stdin" is used to read the input-data from stdin and the output is forced to stdout.<br> | ||
|
||
It compiles with Lazarus 2.2.2 and FreePascal 3.2.2 on Debian/GNU Linux (unstable) and ReactOS (0.4.15-dev-4888). | ||
The ReactOS-Build can also be used with Win in a cmd-window.<br> | ||
|
||
QET_ElementScaler can process one file at a time. | ||
If you want to edit all files in a directory, you need to call QET_ElementScaler from a batch-, cmd- or shell-script-file such as the ones available here.<br> | ||
|
||
You do not want to (or can't) compile the FreePascal program yourself? Download the executable file suitable for your operating system from the releases-page and use that.<br><br> | ||
Hint: <br> | ||
Get familiar with the command line before using this software. | ||
General support for using the command line for the various systems cannot be provided here.<br> | ||
|
||
|
||
usage:<br> | ||
QET_ElementScaler [-i] [-o] <file> <scaling-factor> <br> | ||
(as used in Batch-File "scale.cmd" and shell-script "scale.sh")<br> | ||
|
||
or:<br> | ||
QET_ElementScaler [-i] [-o] [-x FactorForX] [-y FactorForY] -f FILENAME<br> | ||
|
||
<br> | ||
examples to use data from stdin: <br> | ||
QET_ElementScaler -i 2.0 < ElementToScale.elmt > ScaledElement.elmt <br> | ||
<br> | ||
or use a pipe like this <br> | ||
cat ElementToScale.elmt | QET_ElementScaler -i 2.0 | OtherSoftwareBinary <br> | ||
<br> | ||
extended mode and long-options are also possible:<br> | ||
QET_ElementScaler --stdin -x 2 -y 3 < ElementToScale.elmt > ScaledElement.elmt <br> | ||
<br> |
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,37 @@ | ||
@echo skaliere QET - Element-Dateien ... | ||
|
||
@echo off & setlocal | ||
|
||
rem Wo liegt das Programm? | ||
rem Where does the Program lie? | ||
set "ProgPfad=C:\Tools\QET_ElementScaler" | ||
|
||
rem Wo liegen die zu skalierenden Element-Dateien? | ||
rem Path to the directory of element-files to be scaled: | ||
set "DataPfad=Z:\win\Elemente" | ||
|
||
rem Welcher Faktor soll angewendet werden? | ||
set "Skalierung=0.9" | ||
|
||
|
||
rem ------ Ab hier nichts mehr ändern! ------ | ||
rem ------ No changes below this line! ------ | ||
|
||
|
||
rem Findet rekursiv alle passenden Dateien: | ||
@for /r "%DataPfad%" %%i in ("*.elmt") do ( | ||
rem gefundene Dateien bearbeiten: | ||
"%ProgPfad%\QET_ElementScaler.exe" "%%i" %Skalierung% | ||
) | ||
|
||
|
||
rem Rekursiv den XML-Header entfernen: | ||
@for /r "%DataPfad%" %%i in ("*.SCALED.elmt") do ( | ||
rem gefundene Dateien bearbeiten: | ||
more +1 < "%%i" > "%%i.txt" | ||
rem und wieder umbenennen: | ||
move /Y "%%i.txt" "%%i" | ||
) | ||
|
||
|
||
@echo + + + Fertig! + + + |
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,35 @@ | ||
#!/bin/sh | ||
|
||
# scales QET - Element-files in the directory and all sub-dirs | ||
# by the factor given here: | ||
|
||
Skalierung="0.5" | ||
SkalierProg="/usr/local/bin/QET_ElementScaler" | ||
|
||
# um Leerzeichen in Dateinamen verarbeiten zu können: | ||
# Originalzustand merken: | ||
OFS=$IFS | ||
# Einstellen: | ||
IFS=" | ||
" | ||
|
||
for i in `find . -name "*.elmt"` ; do | ||
echo "processing $i" | ||
# Grafik skalieren: | ||
"$SkalierProg" "$i" "$Skalierung" | ||
done | ||
|
||
for i in `find . -name "*.SCALED.elmt"` ; do | ||
echo "processing $i" | ||
# "xml version" entfernen | ||
grep -v -i "xml version" "$i" > /tmp/tempfile.elmt | ||
# Dateiname wieder herstellen | ||
cat /tmp/tempfile.elmt > "$i" | ||
done | ||
|
||
# aufräumen: | ||
rm -r /tmp/tempfile.elmt | ||
|
||
# Leerzeichen in Dateinamen - wieder Originalzustand: | ||
IFS=$OFS | ||
# FERTIG! |
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,7 @@ | ||
rem compile with GCC in "path" | ||
|
||
g++.exe -Wall -O2 -std=c++17 -c inc\pugixml\pugixml.cpp -o obj\inc\pugixml\pugixml.o | ||
g++.exe -Wall -O2 -std=c++17 -c main.cpp -o obj\main.o | ||
g++.exe -o QET_ElementScaler.exe obj\inc\pugixml\pugixml.o obj\main.o -s | ||
|
||
pause |
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,7 @@ | ||
#!/bin/sh | ||
|
||
# compile QET_ElementScaler | ||
|
||
g++ -Wall -O2 std=c++17 -c inc/pugixml/pugixml.cpp -o obj/inc/pugixml/pugixml.o | ||
g++ -Wall -O2 std=c++17 -c main.cpp -o obj/main.o | ||
g++ -o QET_ElementScaler obj/inc/pugixml/pugixml.o obj/main.o -s |
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,77 @@ | ||
/** | ||
* pugixml parser - version 1.12 | ||
* -------------------------------------------------------- | ||
* Copyright (C) 2006-2022, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com) | ||
* Report bugs and download new versions at https://pugixml.org/ | ||
* | ||
* This library is distributed under the MIT License. See notice at the end | ||
* of this file. | ||
* | ||
* This work is based on the pugxml parser, which is: | ||
* Copyright (C) 2003, by Kristen Wegner (kristen@tima.net) | ||
*/ | ||
|
||
#ifndef HEADER_PUGICONFIG_HPP | ||
#define HEADER_PUGICONFIG_HPP | ||
|
||
// Uncomment this to enable wchar_t mode | ||
// #define PUGIXML_WCHAR_MODE | ||
|
||
// Uncomment this to enable compact mode | ||
// #define PUGIXML_COMPACT | ||
|
||
// Uncomment this to disable XPath | ||
// #define PUGIXML_NO_XPATH | ||
|
||
// Uncomment this to disable STL | ||
// #define PUGIXML_NO_STL | ||
|
||
// Uncomment this to disable exceptions | ||
// #define PUGIXML_NO_EXCEPTIONS | ||
|
||
// Set this to control attributes for public classes/functions, i.e.: | ||
// #define PUGIXML_API __declspec(dllexport) // to export all public symbols from DLL | ||
// #define PUGIXML_CLASS __declspec(dllimport) // to import all classes from DLL | ||
// #define PUGIXML_FUNCTION __fastcall // to set calling conventions to all public functions to fastcall | ||
// In absence of PUGIXML_CLASS/PUGIXML_FUNCTION definitions PUGIXML_API is used instead | ||
|
||
// Tune these constants to adjust memory-related behavior | ||
// #define PUGIXML_MEMORY_PAGE_SIZE 32768 | ||
// #define PUGIXML_MEMORY_OUTPUT_STACK 10240 | ||
// #define PUGIXML_MEMORY_XPATH_PAGE_SIZE 4096 | ||
|
||
// Tune this constant to adjust max nesting for XPath queries | ||
// #define PUGIXML_XPATH_DEPTH_LIMIT 1024 | ||
|
||
// Uncomment this to switch to header-only version | ||
// #define PUGIXML_HEADER_ONLY | ||
|
||
// Uncomment this to enable long long support | ||
// #define PUGIXML_HAS_LONG_LONG | ||
|
||
#endif | ||
|
||
/** | ||
* Copyright (c) 2006-2022 Arseny Kapoulkine | ||
* | ||
* Permission is hereby granted, free of charge, to any person | ||
* obtaining a copy of this software and associated documentation | ||
* files (the "Software"), to deal in the Software without | ||
* restriction, including without limitation the rights to use, | ||
* copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the | ||
* Software is furnished to do so, subject to the following | ||
* conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be | ||
* included in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
* OTHER DEALINGS IN THE SOFTWARE. | ||
*/ |
Oops, something went wrong.