]> git.tdb.fi Git - r2c2.git/commitdiff
Display composition during extend
authorMikko Rasa <tdb@tdb.fi>
Sat, 2 Apr 2011 19:48:37 +0000 (19:48 +0000)
committerMikko Rasa <tdb@tdb.fi>
Sat, 2 Apr 2011 19:48:37 +0000 (19:48 +0000)
source/designer/manipulator.cpp

index 359fbbb5e0b8d05feb884ac4ada0fb3707ebaceb..01633fa908246dacdb95424d129e209d7cd63560 100644 (file)
@@ -484,11 +484,23 @@ void Manipulator::pointer_motion(int x, int y)
                                        delete *i;
                                extend_tracks = trks;
 
+                               map<ArticleNumber, unsigned> counts;
                                length = 0;
                                for(vector<Track *>::iterator i=extend_tracks.begin(); i!=extend_tracks.end(); ++i)
+                               {
                                        length += (*i)->get_type().get_total_length();
-
-                               signal_status.emit(format("Extend: %.0fmm", length*1000));
+                                       ++counts[(*i)->get_type().get_article_number()];
+                               }
+
+                               string detail;
+                               for(map<ArticleNumber, unsigned>::const_iterator i=counts.begin(); i!=counts.end(); ++i)
+                               {
+                                       if(!detail.empty())
+                                               detail += ", ";
+                                       detail += format("%dx %s", i->second, i->first);
+                               }
+
+                               signal_status.emit(format("Extend: %.0fmm (%s)", length*1000, detail));
                        }
                }
        }