TinyC .pvs chart editorTinyC .pvs-Diagramm-Editor

Look at and change the stored data of a TinyC programDie gespeicherten Daten eines TinyC-Programms ansehen und ändern

Start

With this tool you can look at the stored data of a TinyC program and change it, for example a wrong bar in the day chart or a wrong start reading.

▶ Open the online editor, or download tinyc_chart_editor.html and open it on your PC. It is a single file. Nothing is uploaded anywhere, everything happens in your browser.

Each TinyC program keeps its data in a file with the ending .pvs (for /sml_chart.tcb that is /sml_chart.pvs). It contains the chart history, the start readings and the settings, everything that survives a restart. You download and upload it in the file manager of your device: http://<device>/ufsd.

Coming from an old Scripter script? Then use the converter.

Mit diesem Werkzeug kannst du die gespeicherten Daten eines TinyC-Programms ansehen und ändern, zum Beispiel einen falschen Balken im Tagesdiagramm oder einen falschen Anfangsstand.

▶ Online-Editor öffnen, oder tinyc_chart_editor.html herunterladen und auf deinem PC öffnen. Es ist eine einzelne Datei. Es wird nichts irgendwohin hochgeladen, alles passiert in deinem Browser.

Jedes TinyC-Programm speichert seine Daten in einer Datei mit der Endung .pvs (zu /sml_chart.tcb gehört /sml_chart.pvs). Darin stehen der Diagrammverlauf, die Anfangsstände und die Einstellungen, also alles, was einen Neustart übersteht. Herunter- und hochladen kannst du sie im Dateimanager deines Geräts: http://<geraet>/ufsd.

Du kommst von einem alten Scripter-Script? Dann nimm den Konverter.

EditingBearbeiten

  1. Download the .pvs in the file manager of your device and drag it into the editor.
  2. You see all stored values: rows of values as a chart with an input box, single values as an input field. What you changed gets a blue frame. Move the mouse over a chart to see the exact value.
  3. Download the changed .pvs and put it back:
    • Stop the program: Tools › TinyC Console › the red ■
    • Upload: Tools › Manage File system › Upload, with the same name
    • Start the program again: Tools › TinyC Console › the green ▶

Keep this order. If the program is still running, it writes its own values over yours when it stops.

Did you change a start reading, the day of the month or a setting? The program takes these from the tc_options.cfg at start-up, not from the .pvs. So upload the tc_options.cfg as well, see below. The editor reminds you of this when saving.

If you do not change anything, the file stays exactly the same. Values the editor does not know are kept as they are.

  1. Die .pvs im Dateimanager deines Geräts herunterladen und in den Editor ziehen.
  2. Du siehst alle gespeicherten Werte: Wertereihen als Diagramm mit Eingabefeld, einzelne Werte als Eingabefeld. Was du geändert hast, ist blau umrandet. Fährst du mit der Maus über ein Diagramm, siehst du den genauen Wert.
  3. Die geänderte .pvs herunterladen und zurückspielen:
    • Programm stoppen: Tools › TinyC Console › das rote ■
    • Hochladen: Tools › Manage File system › Upload, mit demselben Namen
    • Programm wieder starten: Tools › TinyC Console › das grüne ▶

Halte diese Reihenfolge ein. Läuft das Programm noch, schreibt es beim Stoppen seine eigenen Werte über deine.

Hast du einen Anfangsstand, den Monatstag oder eine Einstellung geändert? Die holt sich das Programm beim Start aus der tc_options.cfg, nicht aus der .pvs. Lade also die tc_options.cfg mit hoch, siehe unten. Der Editor erinnert dich beim Speichern daran.

Änderst du nichts, bleibt die Datei genau gleich. Werte, die der Editor nicht kennt, bleiben unverändert.

tc_options.cfg

All TinyC programs share the file /tc_options.cfg. It holds the language, meter, pins, emulator settings and the start readings, so they are kept when you change the program. At start-up the program takes these values from tc_options.cfg, not from the .pvs. A value you only change in the .pvs is therefore back to the old one a second after the start.

This concerns these values:

.pvstc_options.cfg
sml_dval · sml_mval · sml_yvalimp_day · imp_month · imp_year
sml_dval2 · sml_mval2 · sml_yval2exp_day · exp_month · exp_year
sml_wval · sml_wval2imp_week · exp_week
sml_virt_outexp_virt (here the higher of the two values wins)
sml_stmin · sml_chmainchart_short · chart_onmain
sml_da, ui_*, sml_* settings, mb_*, es_*, ct_*same name

The editor has its own box for this. Load the tc_options.cfg of your device there. The table shows the value from the .pvs and from the cfg next to each other and marks where they differ. If you change such a value in the .pvs, it is copied into the box automatically, or you type the new value there directly. Download only changes these lines and keeps everything else, including the settings of programs that are not running right now. Upload it together with the .pvs, with the program stopped.

Alle TinyC-Programme teilen sich die Datei /tc_options.cfg. Darin stehen Sprache, Zähler, Pins, Emulator-Einstellungen und die Anfangsstände, damit sie beim Programmwechsel erhalten bleiben. Beim Start nimmt das Programm diese Werte aus der tc_options.cfg, nicht aus der .pvs. Ein Wert, den du nur in der .pvs änderst, steht deshalb eine Sekunde nach dem Start wieder auf dem alten.

Das betrifft diese Werte:

.pvstc_options.cfg
sml_dval · sml_mval · sml_yvalimp_day · imp_month · imp_year
sml_dval2 · sml_mval2 · sml_yval2exp_day · exp_month · exp_year
sml_wval · sml_wval2imp_week · exp_week
sml_virt_outexp_virt (hier gewinnt der höhere der beiden Werte)
sml_stmin · sml_chmainchart_short · chart_onmain
sml_da, ui_*, sml_*-Einstellungen, mb_*, es_*, ct_*gleicher Name

Der Editor hat dafür einen eigenen Kasten. Lade dort die tc_options.cfg deines Geräts. Die Tabelle zeigt den Wert aus der .pvs und aus der cfg nebeneinander und markiert, wo sie sich unterscheiden. Änderst du so einen Wert in der .pvs, wird er automatisch in den Kasten übernommen, oder du trägst den neuen Wert dort direkt ein. Herunterladen ändert nur diese Zeilen und lässt alles andere stehen, auch die Einstellungen von Programmen, die gerade nicht laufen. Zusammen mit der .pvs hochladen, während das Programm gestoppt ist.

For experts: the .pvs fileFür Fortgeschrittene: die .pvs-Datei

The current format PVS3 stores every value under its name. There is no checksum:

'P' 'V' '3'  count:u8
per entry:   nameLen:u8  name:nameLen  slotCount:u16 LE  data:slotCount*4 LE

The older format PVS2 ('P','V','H', layout_hash:u32, a number instead of the name) is also read and written back in the same format. Its hash only covers the layout, not the values, so changing values keeps it valid.

The device is tolerant when loading: unknown names are skipped, a missing value keeps its current value, a value that is too short is loaded as far as it goes.

Das aktuelle Format PVS3 speichert jeden Wert unter seinem Namen. Eine Prüfsumme gibt es nicht:

'P' 'V' '3'  count:u8
je Eintrag:  nameLen:u8  name:nameLen  slotCount:u16 LE  data:slotCount*4 LE

Das ältere Format PVS2 ('P','V','H', layout_hash:u32, eine Nummer statt des Namens) wird auch gelesen und im selben Format zurückgeschrieben. Sein Hash umfasst nur den Aufbau, nicht die Werte, Änderungen an Werten lassen ihn also gültig.

Das Gerät ist beim Laden tolerant: Unbekannte Namen werden übersprungen, ein fehlender Wert behält seinen aktuellen Wert, ein zu kurzer wird so weit geladen, wie er reicht.

For experts: typesFür Fortgeschrittene: Typen

Every slot in the file has 4 bytes. How they have to be read is not in the file, only the program knows it. The editor knows the values of the SML programs:

NameTypeValues
sml_s4h, sml_s24hint16481 / 1441
sml_dcon, sml_dprodfloat31 each
sml_mcon, sml_mprodfloat12 each
sml_wcon, sml_wprodfloat53 each (week 1 = index 0)
sml_s4h_pos, sml_s24h_pos, sml_daint321
sml_dval, sml_wval, sml_mval, sml_yval and the same with 2, sml_virt_outfloat1
sml_stmin, sml_chmain, sml_pv, sml_sndpwr, sml_meter_sel … ui_*, mb_*, es_*, ct_*int321
ct_mac, ct_mailbyte16 / 64

int16 holds two values per slot, byte four.

Values the editor does not know are shown as float, or as int32 if they would make no sense as float. You can change the type for each value, so the editor also works for other TinyC programs.

Jeder Platz in der Datei hat 4 Bytes. Wie sie gelesen werden müssen, steht nicht in der Datei, das weiß nur das Programm. Der Editor kennt die Werte der SML-Programme:

NameTypWerte
sml_s4h, sml_s24hint16481 / 1441
sml_dcon, sml_dprodfloatje 31
sml_mcon, sml_mprodfloatje 12
sml_wcon, sml_wprodfloatje 53 (Woche 1 = Index 0)
sml_s4h_pos, sml_s24h_pos, sml_daint321
sml_dval, sml_wval, sml_mval, sml_yval und dasselbe mit 2, sml_virt_outfloat1
sml_stmin, sml_chmain, sml_pv, sml_sndpwr, sml_meter_sel … ui_*, mb_*, es_*, ct_*int321
ct_mac, ct_mailbyte16 / 64

int16 hält zwei Werte pro Platz, byte vier.

Werte, die der Editor nicht kennt, zeigt er als float, oder als int32, wenn sie als float keinen Sinn ergeben würden. Den Typ kannst du für jeden Wert umstellen. So geht der Editor auch für andere TinyC-Programme.

For experts: the .bin fileFür Fortgeschrittene: die .bin-Datei

The editor can also read and write a .bin. That file is only for importing: the program reads it once at start-up, takes the data over into the .pvs and deletes it. It holds the values as plain float32, without a header:

FileContentswithoutwith start readings+ weeks
sml_chart.binsml_s4h · sml_s24h · sml_dcon · sml_mcon196519692023
sml_chart_pv.binsml_dprod · sml_mprod4346100

The start readings and the week block are only written when they are complete.

Normally the .pvs is the better way, because it contains all values. In both cases the start readings must also go into the tc_options.cfg. When you load a .bin with start readings, the editor puts them into that box automatically.

Der Editor kann auch eine .bin lesen und schreiben. Diese Datei ist nur zum Importieren da: Das Programm liest sie beim Start einmal, übernimmt die Daten in die .pvs und löscht sie. Sie enthält die Werte als einfache float32, ohne Kopf:

DateiInhaltohnemit Anfangsständen+ Wochen
sml_chart.binsml_s4h · sml_s24h · sml_dcon · sml_mcon196519692023
sml_chart_pv.binsml_dprod · sml_mprod4346100

Die Anfangsstände und der Wochenblock werden nur geschrieben, wenn sie vollständig sind.

Normalerweise ist die .pvs der bessere Weg, weil sie alle Werte enthält. In beiden Fällen müssen die Anfangsstände zusätzlich in die tc_options.cfg. Lädst du eine .bin mit Anfangsständen, übernimmt der Editor sie automatisch in diesen Kasten.