how to create user interface to enter input dynamically in omnett++ - omnet++

i want to create user interface in omnet++. For example; In my project I randomly created 1000 node in specific range (x:1500,y:1500) for simulation. But i want to enter inputs dynamically. In order to do that, I need to create interface. How can i handle this issue? Any suggestions?

The default behavior of the OMNeT++ TkEnv (that is, the simulation GUI) is to interactively prompt its user for any parameter that has not been assigned a value.
See the #prompt ned property if you want to change the prompt.
If you do not want to use OMNET++'s facilities, of course, you can write any C++ code that would prompt your user for a value to use in the program. Your simulation is a C++ program after all.

Related

Selection of CAPL Test Module programmatically

I want to know if we can control the selection/deselection of checkboxes of the CAPL Test Modules via CAPL Scripts, either by setting some system variable or by calling certain events. Is this possible?
It is actually possible:
Use Start to define when the test module is to be started:
Immediately after start of measurement.
When the defined environment variable switches to a value unequal to 0 during measurement. -When the defined system variable switches to
a value unequal to 0 during measurement.
When a defined key is pressed during measurement.
You can start the test modules manually in the execution dialog, in
the test module's context menu or by using the arrow button on the
test module block in the Simulation Setup. Test modules can be started
several times during a measurement. You can therefore define (and use)
several start conditions. During the runtime of a test module it is
not possible to start it again.
CANoe help Test module : Configuration dialog
Right-click on the test module and select configuration
Use Start to define when the test module is to be started:
define system variable: starts the test module if value unequal to 0 during measurement.
use the system variable wherever you want for e.g. create a panel and assign it to a button or a switch (don't forget to configure the 'on' & 'off' value)
I think it is entirely impossible to change the selected tests during test execution. I suppose you could activate/deactivate test modules with the COM interface but certainly not during test execution.

Parameterise Parm File name In Informatatica

I want to know how to (or can I) parameterize the parm file name in informatica?
little bit of background. I am building a standard map in informatica. Which business users can call directly after selecting the standard filters they want to apply in the map using a GUI.
The parm file name will be given by business users and all the filters that he/she selected will be in parm. The file will be dropped in the parm folder in informatica server.
This is a good case scenario, when only 1 users is using it at 1 point of time.
Also, I want to find out what should I do when multiple users are working on GUI and generating the parm files and invoking the informatica map. How do I get multiple instences of the same map running at the same time?
I hope I am making sense here....
Thanks!!!
You can achieve this by using concurrent execution of the workflow. Read about it and understand how can you implement it.
Once you know how to implement it, use a backend script/code by the gui to assign an instance name to each call through GUI. For each instance name, you can have an individual parameter file. (I believe that there would be a finite set of combination of variable values in your case). You can use below command to call individual instances, (either through you GUI or by any other backend code.
pmcmd %workflow_name% %informatica_folder_name%
-paramfile %paramfilepathandname% -rin %instance_name%
It might sound a bit confusing, but once you understand how concurrent workflows work, you can build on it based on the above input.
It'll be only possible if you call the Informatica from external tool, not the Client tools. One way is described by #Utsav, the other is when you use Informatica WSH to call a Workflow - you can indicate the parameterfile you want to be used with the workflow, as well as desired instance name.
I Think this guide to concurrent workflows May be what you are looking for:
https://kb.informatica.com/howto/6/Pages/17/301264.aspx

Bash - Prepare command in cli without executing it

I'm working on a bash script that lets the user configure a number of settings (like for example the current driver or list of drivers, the current release, the current test suite, the current compiler or list of compilers, etc) and which works with a number of tools (compilers, misra analyzer, test report creator, etc). The script defines some aliases like for example: compile, test, misra, report, etc. When such an alias is run by the user, the script prepares about 1-3 sample commands that can be run with that tool and echoes the sample commands on the screen like for example:
s1 = misra current_driver current_compiler
s2 = misra current_drivers_list current_compiler
s3 = misra current_drivers_list current_compilers_list
The user looks at the samples, chooses the most appropriate, types s1, s2 or s3
and hits Enter. The script adds the selected command in the history, as top command. The user presses 'up arrow' and has the command ready to be edited if needed and executed when everything is ok, at a hit of Enter key.
Now, I want to speed up the process of selecting the command, by getting rid of that 'up arrow key' press. What I would like to accomplish is: when user types s1, s2 or s3 and hits Enter, the corresponding command is added in the command line, without being executed. The thing is that I want to obtain the same behavior like the command would have been typed by the user, meaning the user should still be able to edit it, before launching it by pressing Enter.
Is there any method I can use to implement this behavior ?
Thank you

How to run a script after a choice is made in a tcl tk combobox

I'm using ttk::combobox and I want to run a script each time a choice is made. But in the documentation only a -postcommand option exists, which runs the script before the choice. How can I run the script after the choice (I want to be able to know when a choice is made).
Also, the combobox is -state readonly so no choices can be made through the entry.
Bind to the <<ComboboxSelected>> virtual event, which the combobox generates every time after an item is chosen.
bind .combo <<ComboboxSelected>> {puts "chosen [%W get]"}

How do I get data from a Simulink block into a MATLAB GUI?

I have a Simulink model that uses an embedded MATLAB function for a block, and I haven't been able to figure out how to move data between the embedded MATLAB block and a GUI in real-time (i.e. while the model is running). I tried to implement a "to workspace" block in my model but I don't know how to correctly use it.
Does anyone know how to move data from a Simulink block into a GUI in real-time?
Non-real-time solution:
If you want to set parameters in a GUI, simulate a model with those parameters, and then display the simulation output in the GUI, there is a good tutorial on blinkdagger.com. One solution they describe is using the SIMSET function to define which workspace the Simulink model interacts with. You should be able to supersede the base workspace so that data is instead sent to and from the workspace of the GUI functions that are calling the Simulink model.
Real-time solution
As suggested by MikeT, you can use a RuntimeObject. You first have to use the get_param function to get the RuntimeObject from the block:
rto = get_param(obj,'RuntimeObject');
Where obj is either a block pathname or a block-object handle. You can get the pathname of the most recently selected block using the GCB function (in which case you can replace obj with gcb). You can then get the block's output with the following:
blockData = rto.OutputPort(1).Data
One additional caveat from the documentation:
To ensure the Data field contains the
correct block output, turn off the
Signal storage reuse option (see
Signal storage reuse) on the
Optimization pane in the Configuration Parameters dialog box.
You would likely end up with a loop or a timer routine running in your GUI that would continuously get the output data from the RuntimeObject for as long as the simulation is running. The documentation also states:
A run-time object exists only while
the model containing the block is
running or paused. If the model is
stopped, get_param returns an empty
handle. When you stop or pause a
model, all existing handles for
run-time objects become empty.
Your loop or timer routine would thus have to keep checking first that the RuntimeObject exists, and either stop (if it doesn't) or get the data from it (if it does). I'm unsure of exactly how to check for existence of a RuntimeObject, but I believe you would either check if the object is empty or if the BlockHandle property of the object is empty:
isempty(rto) % Check if the RuntimeObject is empty
%OR
isempty(rto.BlockHandle) % Check if the BlockHandle property is empty
From your responses, I'm guessing you want to see the results while the simulation is running, is that correct? The blinkdagger.com tutorial lets you view the results of a simulation after it is done, but not while it is running. Do you basically want to embed something like a scope block into your GUI?
There's a few ways to do this, the best is probably using the EML block's runtime object. If you use this, you should be able to look at the output of the EML block while it is running.

Resources