Home Forums Development Octave blocks

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #7070
    drahnoel
    Participant

      For some purposes, the post-processing functionality of QucsStudio is not sufficient. People can use octave post processing for that reason. Unfortunately, octave is only available “stand-alone”. So either you use .dpl or you use octave.

      To better integrate Octave, I suggest to add an Octave Block to QucsStudio. This block contains octave code, which is executed during simulation. When executed, first the data is implicely loaded by something behaving like dataset = loadQucsDataset(“<filename>.dat”). Then the code is executed. Afterwards, as tear down, the data is stored back by something behaving like saveQucsVariable.

      In order to properly integrate, there are probably some additional properties. I can think of:

      • Octave code.
      • Dependant variables. (To evaluate the order of evaluation. Further, the setup code could just load the dependencies.)
      • Output variables. These variables are stored back to the dataset by the tear down code. (like saveQucsVariable)

      The Octave block should be resizable like plots and they should show the standard output of the script.

      As an future addon, advanced behavior like plotting could be achived by the implicit tear down code. The simplest solution would be to 1. check if there exists a figure then 2. export the figure as temporary .png file and then display this picture in the body of the Octave block. One could also in the setup code provide a variable with a path for a temporary image. Then the octave code can decide to create this image file and draw there something arbitrarily. Once finished, Qucs can check, if the file exists and display it.

      So what could be achieved by such a building block?

      • Perform more complex post processing and provide data back to QucsStudio.
      • Create arbitrary independent and dependent variables, which can be plotted in native QucsStudio.
      • Extract information of the simulation and output as Text.
      • Potential future advanced behavior: show arbitrary octave plots, draw pictures, …

      Implementation idea:

      • To reuse existing loadQucsDataset style octave code, create a temporary .dat file.
        • Only explicitly requested variables and their dependents need to be included.
        • Instead of a .dat file one could map the .dat content in shared memory to avoid disk writes.
        • Once finished, the “output variables” are read back from the same .dat file.
      • One octave process can be kept running in background and reused for each octave block and execution.
      • Advanced behavior like image output:
        • In the startup code, create one figure with figure(‘Visible’, ‘off’)
      • This topic was modified 1 year, 2 months ago by drahnoel.
      #7077
      zhu
      Participant

        Such an extension would really be a contribution to convenience. Admittedly somewhat more laborious, the present link to Octave is quite powerful. One can easliy read and write data with the provided *.m functions.

        Until this proposal is considered it can also be suggested to utillize the log.txt file which can contain even more data. For example the output of the $strobe() functions placed in a VA code is piped to this file. One can access its content by an Octave routine constructed by the User. The reader can collect the data to a *.CSV file which can be converted to a standard *.DAT file by qucsconv.exe. An additional strong link provided by the tool.

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.