DINKIN / coreemu

Automatically exported from code.google.com/p/coreemu
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Running in batch mode dont give the right canvas/scale #256

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
- What steps will reproduce the problem?
1. Run in GUI mode and observe the canvas/scale (default to 150.0)
2. Run again but in batch mode and observe the canvas/scale: it will be now 1.0 
(which is the default value for session.location.refscale)

- What is the expected output? What do you see instead?

I expect to see the scale that I have configured or the default value of 150.0, 
but instead I see always 1.0

- What version of the product are you using? On what operating system?

4.6svn7 (20140403)

- Please provide any additional information below.

I am working in a extension to mobility basic range model for wlan, which use 
the distance (in meters) between nodes and some propagation model (e.g. FSPL) 
to verify the existence of conectivity, instead of only pixel distance. I know 
about EMANE but it is very complex for what I need and it dont give me the 
information that I need.

I could find that CORE/TCL dont read some configs when running in batch mode, 
specially (api.tcl):

...
proc sendCanvasInfo { sock } {
    global curcanvas

    if { ![info exists curcanvas] } { return } ;# batch mode
    set obj "location"

    set scale [getCanvasScale $curcanvas]
...

From the above code, the scale is never set when running in batch mode.

Some possible solutions are as following: i) use different scales in GUI and 
batch mode, but this is very bad for the emulation; ii) use GUI scale of 1.0 
would be a work around, but the emulation area will grow a lot; iii) another 
workaround would be create a new scale config parameter in my extension, but it 
will be a duplication of configuration. For now, I'm just using iii.

What do you guys think?

Original issue reported on code.google.com by italova...@gmail.com on 5 Aug 2014 at 1:57

GoogleCodeExporter commented 8 years ago
Hi there,
As a workaround, instead of using batch mode, you could try the following:
1. Open your imn scenario file and choose "File" > "Save As XML...", and save 
it to an xml file e.g. "bug256.xml"
2. Tell the running core-daemon to execute your XML file as a session, using 
"core-daemon -e ~/.core/configs/bug256.xml" (NOTE: core-daemon should already 
be running as root when you execute this extra 'core-daemon' command as a 
normal user.)
3. Now your session will be running, without any GUI.
4. You can connect the GUI and verify the scale setting.

Long-term I'm thinking to deprecate the batch mode, which is somewhat of a 
hack, and just use the XML parser for loading headless sessions.

I agree that the mismatched default value of refscale=1.0 versus refscale=150.0 
is a source of problems.

Original comment by ahrenh...@gmail.com on 5 Aug 2014 at 5:00