When running the simulator in command line run.x -o -ohtml output.html, the resulting html file is not very helpful. This appears for multiple models that I have tested and there is no such problem when saving a trace from interactive simulation. The output txt file is more detailed.
I agree on your point. Would you be able to modify the way the HTML is written? What would you like to improve? Could you provide examples where it fails to nicely represent the trace?
I've enclosed what I get, and I find the result nice.
May be due to the missing css file.
Indeed, the missing style was due to the css file that was not genereted and assumed to be in the same directory as that of the html file. I modified the simulator code to also generate a css file havint the same name as the html file. I also added the css code and various HTML constants in definitions.h.
Adapt scale to reduce data size according to signal activity.
It seems difficult to improve this since currently only one cell is generated per transaction using the colspan attribute for the transaction length. One way to reduce the size of the generated HTML file could be to avoid generating the scale at each time step. This would make the information harder to read however and would not save much data. I suggest we leave it as is and come up with a different solution when really needed. The generation currently works fine for the large ZigBee tutorial model, which however revealed several errors described below.
The display of the signals in html with Firefox is wrong for the ZigBee tutorial. For example, run the interactive simulation to the end for mapping 0. Then genrate the simulation trace in html. The scheduling for device INTL_DMA_0 should be idle for the first 4356 time steps. However it is shown idle only for the first time step. This is because the colspan attribute is used in the displayed HTML table to define the length of the signal. However Firefox does not support colspan higher than 1000. For the Chrome browser, such limit seems to be higher at about 8190. This can be seen on the trace for the FEP_DMA_0 device, which should have its first activity at 8610 but is erroneously displayed at 8190 on Chrome.
Fixed. I modified the simulator to generate several column of maximum 1000 col span so that the traces are rendered properly on both browsers.
Also the widths of the cells at the end of a row are sometimes larger due to the adjustment for the width of the scale number. See end of signal for device INTL_DMA_0 on the ZigBee tutorial model.
Fixed. The problem was due to the browser adjusting the width of the last cells so that they end at the same position as the number labesl. I defined a maximum widht in the css and added the unset width attributed for other cells that can be larger.
Also the class generated for the color of the cell is sometimes of css style t0, which is not defined in the css. Additionally, the last style defined in the css (t15) is of white color, which is also the color of the idle state. In addition, the color style determined when there are more tasks than the number of available colors is wrong. The bitwise symbol & is used instead of the modulo operator %.
Fixed. I also replaced the black color by the LightGoldenRodYellow color because it does not allowed to see the end of a transaction since the cell borders are also black.
Also it would be nice that in the interactive simulation dialog box that the file extension is automatically added for the chosen format when not specified.
Also when changing the #undef ADD_COMMENTS to #define ADD_COMMENTS in file definitions.h in order to enable the comment option, after recompiling, the simulator crashes when executing a simulation to completion on the mapping0 of the ZigBee tutorial model.
Fixed. The problem was due to function replaceAll in definitions.cpp that was not using proper type for the return of the find method.