back

OxyScope property axis rotation

After collecting sample sets,
OxyScope.DataUpdate() submits parameters to control plotting
View.Replot(VM.start[work], (ushort)(Sample - 1), VM.min[work], VM.max[work]));

In addition to these explicit parameters, implicitly shared are

  • samples O.x[,]
  • populated property booleans M.axis[]
  • property names M.Xprop, Y0prop, Y1prop, Y2prop, M.PropName[]

M.Xprop, Y0prop, Y1prop, Y2prop are SimHub property names,
pasted into the UI and saved over restarts.
Temporarily changing those would be problematic.

Implementing property plot rotation requires indirection

  • instead of directly indexing e.g. M.PropName[3] for plot X axis title,
    use M.PropName[xmap], where xmap[0] is the X-axis property index
  • similarly, instead of directly using scalar Xmin and Xmax,
    implement Xmin[0] and Xmax[0] for M.Xprop and O.x[,xmap[0]],
    using Xmin[1] and Xmax[1] when a Y-axis property rotates into X-axis...
  • Instead of using M.axis[] to sort currently valid Y axis properties, generate a currently valid Y property index list.
    PlotModel model = ScopeModel(currentX);		// 0 for Xmin,max or 1 Ymin,max
    for (iy = 1; iy < xmap.Count; iy++)
    	model.Series.Add(Scatter(xmap[iy]));
  • Indirect indexing also impacts curve fitting..
maintained by blekenbleu