mmmzzzz / nextion2text Goto Github PK
View Code? Open in Web Editor NEWConverts a Nextion HMI file to Text files. Allows f.ex. to see changes in commit diffs.
License: Mozilla Public License 2.0
Converts a Nextion HMI file to Text files. Allows f.ex. to see changes in commit diffs.
License: Mozilla Public License 2.0
Is it possible to do the reverse-- change the property of a component in a .page file? Such as its height, width, color, or position.
I'm not sure if there are CRC's or other things in place to prevent this.
Numerical properties sometimes show a wrong value in der text file. For example the value of a Number is 2200. In the text file I get "Initial Value: 2780". For most other values it is working fine.
This error occurs
Traceback (most recent call last):
File "C:\Users\fredrik\OneDrive\Dokument\Nextion2Text-master\Nextion2Text.py", line 1744, in
hmi = HMI(hmiFile)
File "C:\Users\fredrik\OneDrive\Dokument\Nextion2Text-master\Nextion2Text.py", line 1605, in init
self.header = HMIHeader(self.raw)
File "C:\Users\fredrik\OneDrive\Dokument\Nextion2Text-master\Nextion2Text.py", line 1413, in init
self._processData(self.__getHeaderData())
File "C:\Users\fredrik\OneDrive\Dokument\Nextion2Text-master\Nextion2Text.py", line 1500, in _processData
obj = HMIContentHeader(self._raw, index)
File "C:\Users\fredrik\OneDrive\Dokument\Nextion2Text-master\Nextion2Text.py", line 1413, in init
self._processData(self.__getHeaderData())
File "C:\Users\fredrik\OneDrive\Dokument\Nextion2Text-master\Nextion2Text.py", line 1416, in __getHeaderData
return struct.unpack(self._headerFormat, self._raw[self._headerStart:self._headerStart+self.headerSize])
struct.error: unpack requires a buffer of 28 bytes
I have a project with utf-8 character encoding, because this is the only way to get Chinese characters working.
For example, I have a text element with the following txt string:
Gerät Code|Code|Code|Codice|Código|Kod|代码
Using Nextion2Text.py, I get the following output in the cmd window:
Traceback (most recent call last):
File "D:\Projekte\NextionTest\Nextion2Text.py", line 1851, in
f.write(text)
File "C:\Program Files\Python310\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\x81' in position 5744: character maps to
I would greatly appreciate any help. Thanks!
The Status output on stdout and -s option, the order of the output is inconsistent. This doesn't help in diffing versions.
Is there a way to get sorted output?
BTW. I've made a bash script and necessary config adaptations to use this with git (tested only on git-gui for Windows from git-scm.com)
Traceback (most recent call last):
File "D:\Nextion2Text.py", line 1791, in
text = page.getText(emptyLinesLimit=1, includeUnknown=includeUnknown,
File "D:\Nextion2Text.py", line 1550, in getText
return "".join(self.getTextLines(*args, **kwargs))
File "D:\Nextion2Text.py", line 1542, in getTextLines
comps = sorted(self.components, key=key)
File "D:\Nextion2Text.py", line 1508, in
defaultTextSort = lambda c: Page._defaultSortList.index(c.rawData["att"]["type"])
ValueError: 5 is not in list
Hi
Could you please write supported versions of the editor in the readme file?
Thx fredrik
Windows 10 x64 (UTF8 experimental support enabled)
Nextion editor V1.62.2
Device: NX4832T035_011
Command: python ./nextion2text/Nextion2Text.py -i ./HMI_FILE.hmi -o ./sources
Traceback (most recent call last):
File "nextion2text\Nextion2Text.py", line 1750, in <module>
hmi = HMI(hmiFile)
File "nextion2text\Nextion2Text.py", line 1611, in __init__
self.header = HMIHeader(self.raw)
File "nextion2text\Nextion2Text.py", line 1419, in __init__
self._processData(self.__getHeaderData())
File "nextion2text\Nextion2Text.py", line 1506, in _processData
obj = HMIContentHeader(self._raw, index)
File "nextion2text\Nextion2Text.py", line 1419, in __init__
self._processData(self.__getHeaderData())
File "nextion2text\Nextion2Text.py", line 1477, in _processData
self.name = data[0].decode("ansi").rstrip("\x00")
File "G:\LangAndCompilers\Python\Python3\lib\encodings\mbcs.py", line 21, in decode
return mbcs_decode(input, errors, True)
UnicodeDecodeError: 'mbcs' codec can't decode bytes in position 0--1: No mapping for the Unicode character exists in the target code page.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.