+ //max_y=pa.attributes().namedItem("max").nodeValue().toInt();
+ //int val=pa.attributes().namedItem("value").nodeValue().toInt();
+ QStringList defaults;
+ if (pa.attributes().namedItem("start").nodeValue().contains(";"))
+ defaults = pa.attributes().namedItem("start").nodeValue().split(";");
+ else if (pa.attributes().namedItem("value").nodeValue().contains(";"))
+ defaults = pa.attributes().namedItem("value").nodeValue().split(";");
+ else if (pa.attributes().namedItem("default").nodeValue().contains(";"))
+ defaults = pa.attributes().namedItem("default").nodeValue().split(";");
+ QStringList maxv = pa.attributes().namedItem("max").nodeValue().split(";");
+ QStringList minv = pa.attributes().namedItem("max").nodeValue().split(";");
+ for (int i = 0;i < maxv.size();i++) {
+ if (max_y < maxv[i].toInt()) max_y = maxv[i].toInt();
+ if (min_y > minv[i].toInt()) min_y = minv[i].toInt();
+ }
+
+ for (int i = 0;i < parameterNameList.count();i++) {
+ KPlotObject *plot = new KPlotObject(colors[plotobjects.size()%colors.size()]);
+ plot->setShowLines(true);
+ if (!stretchFactors.contains(i)) {
+ if (maxv[i].toInt() != 0)
+ stretchFactors[i] = max_y / maxv[i].toInt();
+ else
+ stretchFactors[i] = 1.0;
+ }
+ if (defaults[i].toDouble() > max_y)
+ defaults[i] = max_y;
+ plot->addPoint(startframe, defaults[i].toInt()*stretchFactors[i], parameterNameList[i]);
+ //add keyframes here
+ plot->addPoint(endframe, defaults[i].toInt()*stretchFactors[i]);
+
+ plotobjects.append(plot);
+ }
+
+ /*TODO keyframes
+ while (pointit.hasNext()){
+ pointit.next();
+ plot->addPoint(QPointF(pointit.key(),pointit.value().toDouble()),item.first,1);
+ if (pointit.value().toInt() >maxy)
+ max_y=pointit.value().toInt();
+ }*/
+
+ }
+ maxx = endframe;
+ maxy = max_y;
+ setLimits(-1, endframe + 1, min_y - 10, maxy + 10);
+ addPlotObjects(plotobjects);