sg-s/cpplab

relative hyperlinks in matlab are broken when scrolling past items in STDOUT

Closed this issue · 8 comments

If you try to click on the hyperlink within MATLAB while inspecting an object, the hyperlinks are all messed up.
Here's a very boring model with a presynaptic compartment with nothing in it and a post-synaptic compartment with a Leak current. Clicking the NMDAergic link or the Leak link results in an error. Clicking the 'compartment' link opens c++/synapses/borgers/NMDAergic.hpp.
If instead, you drill into the object and inspect the synapse object, the hyperlink goes where expected. Same thing if you use the links from the xolotl object. It's only at the level of the compartment are the hyperlinks incorrect.

>> xolotl object with 
---------------------
+ presynaptic  
---------------------
+ proximal  
  > Leak (g=0.1, E=-70)
---------------------
>> x.proximal

ans = 

 compartment object (8dc35d7) with:

                   len : NaN
                     A : 0.01
                Ca_out : 3000
                radius : NaN
                    Cm : 10
             Ca_target : NaN
       shell_thickness : NaN
            Ca_average : 0.0500000000000942
                   vol : NaN
            neuron_idx : NaN
              tree_idx : NaN
                     V : -69.9570174510912
                    Ca : 0.05
  NMDAergicpresynaptic : NMDAergic object
                  Leak : Leak object
>> x.proximal.NMDAergicpresynaptic

ans = 

 NMDAergic object (9ac38a2) with:

            Mg : 1
             E : 0
         tau_d : 1
         tau_r : 1
             s : 6.14413685155769e-06
          gmax : 100
No appropriate method, property, or field 'NMDAergicpresynaptic' for class 'cpplab'.
 
No appropriate method, property, or field 'Leak' for class 'cpplab'.
 
No appropriate method, property, or field 'NMDAergicpresynaptic' for class 'cpplab'.
 
>> 
sg-s commented

i cannot reproduce this error using xolotl.examples.BurstingNeuron

can you send me the script to generate the object where you see this problem?

sg-s commented

ah, you're saying, if you open up something, then scroll up, then click on the link, you go to the wrong place? this is expected behaviour, though confusing.

here's the problem as i see it:

  1. have a xolotl object. inspect by calling "x"
  2. click on a compartment, then click on something inside a compartment to inspect that
  3. now clicking on "compartment" will open the C++ file corresponding to the object last inspected, instead of "compartment"
sg-s commented

this is a very hard thing to fix because cpplab doesn't know what's being clicked

Ah, I gotcha. Yeah, I don't think there's a good way to fix it. It just looks clickable (and it is), but it's really not, since it's history (in the command window) by then. Let's table this for now, it's not a priority.

sg-s commented

MATLAB has a way of doing this nicely -- need to find where they do it and copy that

sg-s commented

@alec-hoyland should be fixed now?

edit: the problem with clicking on the "compartment" etc links should be fixed. relative links still broken if you go backwards in time

sg-s commented

the problem remains: if I click on a compartment in a xolotl tree, how does that compartment know what it is called in the tree?

sg-s commented

This is possible, but it is very complicated. This can be achieved by abandoning the use of displayScalarObject, and instead rewriting all links to point to a special method of cpplab that also takes a second argument, that tells it the namespace it exists in. That way, every link that appears can be written with absolute rather than relative links.

However, this is too hard and will not be fixed for the foreseeable future.