Seite 1 von 1

Robo Pro Coding Übernahme von Funktionen von einem Projekt ins andere

Verfasst: 10 Jan 2022, 12:43
von Zungara
Hallo Zusammen,

vielleicht bin ich ja zu alt oder zu dämlich, aber gibt es eine einfache Möglichkeit schon einmal in einem Projekt definierte Funktionen in ein neues Projekt zwecks Wiederverwendung zu importieren ohne die Funktionen immer wieder neu zu erstellen. Mit einem Mac bekomme ich z.B. eine FT Projektdatei entpackt und sehe auch dort die einzelnen Dateien z.B. im lib Verzeichnis. Ich bekomme aber keine funktionstüchtige Datei wieder gepackt die ich dann mit Robo Pro Coding wieder importieren kann.

Re: Robo Pro Coding Übernahme von Funktionen von einem Projekt ins andere

Verfasst: 10 Jan 2022, 22:30
von Techum
Wenn ich mich recht erinnere, habe ich entpackt, ungewünschte Inhalte entfernt, das ganze wieder gezippt, von .zip in .ft umbenannt und die entstandene Datei erfolgreich laden können.
Du solltest also ein Projekt entpacken, eine Library von einem anderen Projekt hineinkopieren, dann wieder packen und umbenennen können.
Ob das elegant ist, ist eine andere Frage...

Schönen Abend
Techum

+ unter Windows

Re: Robo Pro Coding Übernahme von Funktionen von einem Projekt ins andere

Verfasst: 11 Jan 2022, 07:32
von jocscha
Wäre es in Anknüpfung des Vorschlags von Zungara ein gangbarer Weg eine bestimmte Funktionalität herauszustellen und unter eigenem Namen zu speichern?
Dann kann diese Funktionalität einzeln hinzugefügt werden, wenn sie gebraucht wird.

Re: Robo Pro Coding Übernahme von Funktionen von einem Projekt ins andere

Verfasst: 11 Jan 2022, 09:24
von KarlKarlson
Die bequemste Möglichkeit Funktionen zu übernehmen, die ich kenne, ist per Copy&Paste.

Also entweder über Rechtsklick "Kopieren" und "Hier einfügen" oder klassisch über Strg+C und Strg+V. Es scheint allerdings so als könnte man das nur in der gleichen Instanz von ROBO Pro Coding nutzen, d.h. Funktion aus bestehendem Projekt kopieren, neues Projekt anlegen oder ein bestehendes importieren und dort die Funktion einfügen. Ich hoffe man versteht, was ich meine, ansonsten schreibe ich es noch mal detaillierter. :D

Re: Robo Pro Coding Übernahme von Funktionen von einem Projekt ins andere

Verfasst: 11 Jan 2022, 11:25
von vleeuwen
Only inside a project.
Copy past between .py files in a project, select object, right mouse klick:
Copy.JPG
Copy.JPG (51.28 KiB) 2655 mal betrachtet
change .py module, right mouse click:
Past1.JPG
Past1.JPG (24.42 KiB) 2655 mal betrachtet
Past2.JPG
Past2.JPG (31.22 KiB) 2655 mal betrachtet

Re: Robo Pro Coding Übernahme von Funktionen von einem Projekt ins andere

Verfasst: 11 Jan 2022, 13:13
von MasterOfGizmo
vleeuwen hat geschrieben:
11 Jan 2022, 11:25
Only inside a project.
He was explicitly asking for a way to copy between projects and the other posters have already answered with useful replies.

Re: Robo Pro Coding Übernahme von Funktionen von einem Projekt ins andere

Verfasst: 11 Jan 2022, 13:28
von Zungara
Wenn ich mich recht erinnere, habe ich entpackt, ungewünschte Inhalte entfernt, das ganze wieder gezippt, von .zip in .ft umbenannt und die entstandene Datei erfolgreich laden können.
Du solltest also ein Projekt entpacken, eine Library von einem anderen Projekt hineinkopieren, dann wieder packen und umbenennen können.
Ob das elegant ist, ist eine andere Frage...
So hatte ich mir das auch vorgestellt. Funktioniert bei mir leider nicht. Wenn ich den entpackten Ordner unter einem neuen Namen wieder packe kommt dann auch ein nettes Zip-Archiv heraus. Wenn ich dieses dann umbenenne (xyz.ft) und auch in den Preferencen angebe das dies eine FT-Datei ist die mit ROBO Pro Coding zu öffnen ist bekomme ich unter Robo Pro Coding die Fehlermeldung "Dieses Projekt ist defekt und kann nicht repariert werden"

Re: Robo Pro Coding Übernahme von Funktionen von einem Projekt ins andere

Verfasst: 11 Jan 2022, 13:38
von Zungara
Die bequemste Möglichkeit Funktionen zu übernehmen, die ich kenne, ist per Copy&Paste.

Also entweder über Rechtsklick "Kopieren" und "Hier einfügen" oder klassisch über Strg+C und Strg+V. Es scheint allerdings so als könnte man das nur in der gleichen Instanz von ROBO Pro Coding nutzen, d.h. Funktion aus bestehendem Projekt kopieren, neues Projekt anlegen oder ein bestehendes importieren und dort die Funktion einfügen. Ich hoffe man versteht, was ich meine, ansonsten schreibe ich es noch mal detaillierter. :D
Für eine Funktion geht es tatsächlich Projekt übergreifend. (Library Projekt importieren, Funktion kopieren, Zielprojekt importieren, Datei erstellen, Funktion einfügen, Ziel Projekt exportieren. Und der Spaß geht von vorne los) Eine Sammlung von Funktionen geht leider nicht! Da mit macht wieder verwenden von Code aber überhaupt keinen Spaß!

Re: Robo Pro Coding Übernahme von Funktionen von einem Projekt ins andere

Verfasst: 11 Jan 2022, 14:03
von vleeuwen
It is possible to open a .blockly XML file and copy/past parts of it into a new project.
However this ask a certain study of the structure and good understanding of the relations between the Blockly variable defined in other Blocklies.
The accompanying .py files is generated and not used when the project has been loaded into the development environment.
So copying parts of a project into a different project is possible but not obviously.
Here you can find the Blockly namespace definition file:
https://developers.google.com/blockly/r ... lockly.Xml
https://developers.google.com/blockly

Re: Robo Pro Coding Übernahme von Funktionen von einem Projekt ins andere

Verfasst: 11 Jan 2022, 15:57
von Zungara
hi,

The problem must before. Perhaps it is a Mac special problem. I take a woking file like "test.ft". Then I uncompress this file. I get folder with some files. In the main directory there are 2 files. One "blocky" File and one "Python" file. And another Folder called "lib" The minimum file inside "lib" is controller.blockly and controller.py. So fare....

Now I compress the folder "Test" and I got the File "Test.zip" I rename the file "test.zip" into "test.ft". Now I try to import this file into Robo Pro Coding and I got the Error that the file is defect and cannot repaired.

Re: Robo Pro Coding Übernahme von Funktionen von einem Projekt ins andere

Verfasst: 11 Jan 2022, 16:10
von vleeuwen
I saved both projects in the gitlab (fischertechnik cloud) and does the copying in gitlab.
After that I was able to reload the second project.
And the second project was working fine.
So it is possible.

Re: Robo Pro Coding Übernahme von Funktionen von einem Projekt ins andere

Verfasst: 11 Jan 2022, 16:41
von Zungara
Yes it is. I is a Mac problem. With Windows it was possible to unzip the file and to add some files and than to zip it again and to import it to RoboPro Coding.
I think the problem is the missing json file.

Re: Robo Pro Coding Übernahme von Funktionen von einem Projekt ins andere

Verfasst: 11 Jan 2022, 16:54
von vleeuwen
Or maybe character coding?

Re: Robo Pro Coding Übernahme von Funktionen von einem Projekt ins andere

Verfasst: 11 Jan 2022, 17:02
von Zungara
I do not know. I make the invisible files visible (Apfel Shift Punkt) I compress the Folder again. Now the json file is inside the archive. I rename the file from zip to ft. I check that the renaming is correct (not *.ft.zip common problem) Import the file but Robo Pro Coding still tells me that the file is corrupted