Fergy wrote:
Ampco_Raphael wrote:
Regarding script development:
I'd like to have a mode where the scripts are stored outside of the viewfile. Upon selection of this mode, the scripts are copied in a folder named 'src' in the same directory as the viewfile, under 'function_name.py'. Then the scripts can easily be edited with a python editor and maintained under a versionning system. When the viewfile is compiled, the content of the 'src' folder would be merged with the .npa file, each function_name.py replacing (or creating) respective scripts.
Let me start out with this information for those who are not aware. NPA stands for Nion Project Archive, and is a “zip" file. You can view the contents of this file by changing the attribute from .npa to .zip. (I always make a copy of the original file, and then change it to .zip, just in case). You will find inside of the zip folder another folder called “targets" . Inside target will be one or more folders, each representing the NioNodes of the Project. When a Python Script is created in NWare, the script is contained in an xml called “pacman_python_config.xml" .
That explained, I’m not sure I agree with creating another file that is outside of the npa. One of the great features that I love about NWare over MWare is that EVERYTHING is in a single file. I remember the days of copying everything in the folder, making sure I had the graphics, the presets, the wavs, and all of the other details from the MainFrame to a floppy or a USB drive. Some of you will remember having to install winzip on the MainFrame, so all of these files could be copied to a floppy. Oh, the joy. And it’s even more fun trying to explain how it is done on a tech support call.
Hi Fergy,
I know all this about the view file and I also like to keep it only one file. But...
Fergy wrote:
But back on point, I just tested the theory of editing the above xml file when the Project file is open (this is found in “C:Users/All Users/MeidaMatrix/(version of software in use)/Temp" ), and you can’t. None of the changes that I tried remained intact, even when I would make a change, save it to the xml, and then save the Project file (at least not with Wordpad, since I don’t have an xml editor). Making a change to the xml after the Project is closed (by changing npa to zip, editing the xml, and the reverting back npa) would be beyond all but the very advanced programmers of NWare.
That's the problem, the script is also stored in a another file data.pdn which is a binary file and not so easily edited. I guess nware uses data.pdn to generate the pacman_python_config.xml.
Fergy wrote:
But check it out, and let us know if this is a way to do what you require. If not, continue to explain why there is a need for an external scripting file outside the npa file. But being able to hide and lock your scripts, that one is a very good idea!
If it was possible to extract and re-merge the scripts, that would be half the solution because you would need to restart NWare after each modifications of a script.
But if Nware provides a switch 'external script editor' similar to 'Incremental compilation' then when the switch is turned 'on' the scripts are copied in a 'src' diretory next to the .npa.
If the switch is on and compile or emulate or save is asked then the content of the 'src' folder is reloaded in the viewfile before starting the compile or save process. Then you can have
the best of both worlds, embedded scripts and external edition.
There are three main reasons why I wish to be able to extract the scripts from the view file and merge them back when compiled.
1. The embedded editor is rather basic, enough to write a few lines but not more;
Once opened you cannot browse the viewfile; Let's say you want to edit line 500 but don't remember which input number you have to use...
you need to close the script, jump to the viewfile page where you can find the answer, re-open the script and scroll to line 500.
Not really convenient, with an external editor, you can even run the viewfile;
For that reason, I also prefer an external editor rather than a sophisticated editor embedded in Nware;
(note: the search function of the script editor is bogus, it finds the first occurence of a search but not the next ones..)
2. I'm using subversion to keep versions of the viewfile while I'm developping it. But that sort of tool is not really efficient on compressed files like .npa.
you cannot diff two versions;
you cannot keep different versions of the script without keeping different versions of the viewfile where only scripts have changed!
When the file is several MBs because of media embedded and each version is a copy of it... you get the picture.
3. It would be easy to develop a framework that could run scripts without running the viewfile. That would be much faster to test and debug scripts for example when implementing
communication protocols. When you made a typo in a variable name and the compile time takes a few minutes, you end up drinking way too much cofee :-)
I hope this clears up a little bit the request. Thanks for your attention.
Best regards