On Tue, Aug 7, 2012 at 7:16 PM, Joerg Mayer
<jmayer@xxxxxxxxx> wrote:
Naive question: Why isn't that cross handling code shared between the two
files?
Thanks
Jörg
--
I think it was Guy that asked before about factoring out code that is common between the 2 modules. I really dislike that there is identical code in both modules. I did start to make a list of types and functions that could be shared, but it quickly looked messy. I couldn't even decide what to call the new module (was it just to be shared between these 2 files, or would it likely be useful for someone creating a third module like these?).
rlc_lte_graph.c began as a copy of tcp_graph.c. Initially there were some features that I didn't like (or in some cases didn't understand) so cut them out. Some of them I have since added back, with improvements copied back to the TCP graph. The biggest change is that I didn't want to have the control window, so there are various places where I cut out references to the controls in the control panel that affects behaviour of the graph, then tried to automatically do the sensible thing (e.g. customising the way the zoom factors work, or the way the divisions on the axis work).
Even where some functions are textually the same, they often refer to types (chiefly the graph struct) that are different between the 2 graphs. This could have worked well in C++...
I will stop messing around with the RLC graph soon - it may be easier to see how to share what they have in common when it has settled down.
Martin