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.
Related
I'm using NSight Compute GUI (ncu-ui) to profile kernels in a certain app. My app invokes kernel my_kernel_1 thousands of times, then invokes my_kernel_2 thousands of times. I don't want to profile all invocations of all kernels; I just want to profile a single invocation of my_kernel_2 (e.g. the tenth one, or the middle one).
I know that, when profiling is paused, I can continue to the next kernel invocation; but - I don't want to press that button a thousand times. Is there a way to continue to the next invocation of a kernel with a specific name? Or alternatively, to provide a list of kernel names which are not to be profiled?
If you use GUI version, look at Activity > Profile > Filter in connection window.
Completing HyunwooKim' answer:
You can arrange for skipping the invocations of the kernel you're not interested in, and some invocations of your kernel of interest - but only before profiling starts; and only in non-interactive profiling mode:
Press the Connect button to get the Connection dialog:
Choose the "Common" tab.
Enter an output filename; profiling will be non-interactive, so a file is needed.
Switch to the "Filter" tab:
In the "Kernel name" field, enter regex:^my_kernel_2$ - to only match your kernel of interest.
Choose the number of invocations you want to skip (of the second kernel - you don't care about the invocations of my_kernel_1, which is not matched. There are multiple options.
If you don't want to profile all remaining invocations of your kernel of interest, also choose the number to profile.
Press Launch. After profiling is completed and the process has existed, the report will be loaded up.
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.
I have an application in which each test should run in a VM whose configuration has been conditioned by a test-specific System property (which can just be based on the test class name).
Something like this sort of works:
test {
forkEvery 1
maxParallelForks Runtime.runtime.availableProcessors()
beforeSuite { TestDescriptor descriptor ->
systemProperty( 'test.class.name', descriptor.getClassName() )
}
}
But it doesn't quite work. The names the forked JVMs see do change, but they aren't the ones I expect, and I suspect they aren't even deterministic. It seems as though there is one shared JavaForkOptions item, and that calls to beforeSuite aren't in a deterministic and exclusive way linked to the forking of a process for that suite, so the name a process gets might not match up with the one set in "its" beforeSuite call.
Is there a better way to do this, or some way to get more precise control over the forking process so that System properties could be set on a fork-specific data structure?
Thanks for any help!
Does anybody know if it's possible in Test Complete to run a test from a specific point in a function?
I see options like run routine, run test, run project.
Thank you,
Raluca
There is no way to start execution of a script test from a specific line, but it is possible to move the execution point to the desired line. You can set a breakpoint to the first line of a script routine and run this routine. Once the test execution is stopped at the breakpoint, use the Set Next Statement action to move the execution point to the needed line and continue the execution.
This feature is documented in the Setting Next Execution Point help topic.
TestComplete's Keyword Driven Tests have the possibility to add "Labels" and "Go To Labels".
You can put a label anywhere in your KDT script and set a GoToLabel at the very beginning of your test to move to that point.
It may even be possible to combine this with Project Variables to get a "Last Reached Milestone/Label". This is only speculation, but worth looking into it.
no there is no way you can run testcomplete scripts from a specific point. the closest point you can get to for runnning you script from a specific point is to use break point and then press F10 for executing one by one line of code
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.