lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [5812] Experimentally pause between printouts


From: Greg Chicares
Subject: [lmi-commits] [5812] Experimentally pause between printouts
Date: Wed, 30 Oct 2013 14:15:21 +0000

Revision: 5812
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5812
Author:   chicares
Date:     2013-10-30 14:15:20 +0000 (Wed, 30 Oct 2013)
Log Message:
-----------
Experimentally pause between printouts

Modified Paths:
--------------
    lmi/trunk/ChangeLog
    lmi/trunk/group_values.cpp

Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2013-10-30 13:08:14 UTC (rev 5811)
+++ lmi/trunk/ChangeLog 2013-10-30 14:15:20 UTC (rev 5812)
@@ -32797,3 +32797,15 @@
   group_tutorial.html
 Update user manual for direct census editing.
 
+20131030T1308Z <address@hidden> [542]
+
+  timer.cpp
+  timer.hpp
+  timer_test.cpp
+Add a cross-platform sleep function.
+
+20131030T1415Z <address@hidden> [542]
+
+  group_values.cpp
+Experimentally pause between printouts.
+

Modified: lmi/trunk/group_values.cpp
===================================================================
--- lmi/trunk/group_values.cpp  2013-10-30 13:08:14 UTC (rev 5811)
+++ lmi/trunk/group_values.cpp  2013-10-30 14:15:20 UTC (rev 5812)
@@ -34,6 +34,7 @@
 #include "contains.hpp"
 #include "emit_ledger.hpp"
 #include "fenv_guard.hpp"
+#include "global_settings.hpp"
 #include "illustrator.hpp"       // assert_consistency()
 #include "input.hpp"
 #include "ledger.hpp"
@@ -59,6 +60,39 @@
         ;
 }
 
+/// Eat the bread of idleness between printouts.
+///
+/// Rationale: lmi sends illustrations to a printer in census order,
+/// but end users have complained that they are printed in a different
+/// order. Pausing briefly between printouts may fix that problem.
+///
+/// This experimental implementation inserts a delay when sending PDF
+/// output not only to a printer, but also to a file, so that testing
+/// can be performed without clogging a printer. For experimentation,
+/// it has no effect without the innermost password; the header
+/// "global_settings.hpp" is included above only for this purpose,
+/// and should be removed after testing.
+///
+/// Emission of output should be monitored by a progress meter in the
+/// "parallel" case. Testing makes this latent defect even more
+/// painfully obvious.
+///
+/// The delay should probably be moved to class progress_meter. That
+/// class ought to be used for any series of operations that takes a
+/// long time, anyway. And the progress_meter implementation varies
+/// by platform, making it possible to use a wx delay function that
+/// is readily interrupted by pressing "Cancel" (as is not the case
+/// here).
+
+void dawdle(mcenum_emission emission)
+{
+    if(!global_settings::instance().ash_nazg()) return;
+    if((emission & mce_emit_pdf_to_printer) || (emission & mce_emit_pdf_file))
+        {
+        lmi_sleep(10);
+        }
+}
+
 progress_meter::enum_display_mode progress_meter_mode(mcenum_emission emission)
 {
     return (emission & mce_emit_quietly)
@@ -129,6 +163,7 @@
                 ,*IV.ledger()
                 ,emission
                 );
+            dawdle(emission);
             }
         if(!meter->reflect_progress())
             {
@@ -613,6 +648,7 @@
             ,*(*i)->ledger_from_av()
             ,emission
             );
+        dawdle(emission);
         }
     }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]