thx.
I get understand the whole thing.
When I choose an editor to edit the epy_block, it is temporally saved in C:\User\[user name]\AppData\Local\Temp\epy_block_0_[some char].py. This file is temp file.
The real descriptions will be copied to grc file:
If I changed the temp file, the grc file changed correspondingly. (This is what you said "Embedded python blocks should go wherever the flowgraph goes").
Even I remove the temp file, after I reopen the grc file, another new temp python will be opened(copied in temp directory) with the same code in grc. However, the temp python file's name changed, with suffix
changed. for example, from epy_block_0_n8bgjds3 to epy_block_0_usl3fla6, and I guess the suffix is a time stamp. Am I right?
So
1. I can edit the grc file's _source_code directly to update the python code(block code)?
2. Is there any way that use a include way? take above as example, can I write like this in grc file:
_source_code: "include epy_block.py" // or "import epy_block.py"
or even better:
_source_code: "include some_dir/my_own_name.py" // or "import some_dir/my_own_name.py"
And I should make sure in some_dir, there is a file named my_own_name.py, which describes the block function.
I know this definitely does not work. But I wish to.
My aim is that:
1. I only write python file one time.
2. it can be instanced in grc block many times but maybe with different parameter input.
3. grc only describes the interconnection of blocks and parameters, the real implement is in python file, and then I can use swig to import my C++ code, when I need to accelerate the simulation(calculation).
Thanks a lot!