- self.destination_number = ""
-
- self.call_setup_time = call_setup_average + call_setup_uncertainty
- self.rings_distance = ring_distance_average + ring_uncertainty
-
- # In theory the symbol distance, the distance between calls which
- # represent symbols, can be arbitrary, but in practice it's better to
- # wait at least the duration of a ring between terminating one call and
- # initiating the next call, as pick-up and hang-up can take some time
- # with old analog modems.
- symbol_distance = self.rings_distance
-
- def symbol_time(multiplier):
- return self.call_setup_time + symbol_distance * multiplier
-
- self.dot_time = symbol_time(1)
- self.dash_time = symbol_time(2)
- self.signalspace_time = symbol_time(3)
- self.wordspace_time = symbol_time(4)
- self.eom_time = symbol_time(5)
-
- self.ring_uncertainty = ring_uncertainty
- self.symbol_uncertainty = symbol_distance / 2.
-
- logging.debug("dot time: transmit: %.2f receive: (%.2f, %.2f)",
- self.dot_time,
- (self.dot_time - self.symbol_uncertainty),
- (self.dot_time + self.symbol_uncertainty))
- logging.debug("dash time: transmit: %.2f receive: (%.2f, %.2f)",
- self.dash_time,
- (self.dash_time - self.symbol_uncertainty),
- (self.dash_time + self.symbol_uncertainty))
- logging.debug("signalspace time: transmit: %.2f receive: (%.2f, %.2f)",
- self.signalspace_time,
- (self.signalspace_time - self.symbol_uncertainty),
- (self.signalspace_time + self.symbol_uncertainty))
- logging.debug("wordspace time: transmit: %.2f receive: (%.2f, %.2f)",
- self.wordspace_time,
- (self.wordspace_time - self.symbol_uncertainty),
- (self.wordspace_time + self.symbol_uncertainty))
- logging.debug("EOM time: transmit: %.2f receive: (%.2f, +inf)",
- self.eom_time,
- (self.eom_time - self.symbol_uncertainty))
+ self.call_setup_time_max = call_setup_time_max
+
+ if add_inter_call_distance:
+ # Analog modems don't like to dial a new call immediately after
+ # they hung up the previous one; an extra delay of about one
+ # ring time makes them happy.
+ inter_symbol_distance = ring_time_max
+ else:
+ inter_symbol_distance = 0
+
+ self.modulator = MorseDistanceModulator(call_setup_time_min,
+ call_setup_time_max,
+ ring_time_min,
+ ring_time_max,
+ inter_symbol_distance)
+
+ logging.debug("call setup time between %.2f and %.2f "
+ "--------- dot transmit time: %.2f + %.2f "
+ "receive time: between %.2f and %.2f",
+ self.modulator.period_min,
+ self.modulator.period_max,
+ self.modulator.period_max,
+ self.modulator.dot_time.dist,
+ self.modulator.dot_time.min,
+ self.modulator.dot_time.max)
+ logging.debug("call setup time between %.2f and %.2f "
+ "-------- dash transmit time: %.2f + %.2f "
+ "receive time: between %.2f and %.2f",
+ self.modulator.period_min,
+ self.modulator.period_max,
+ self.modulator.period_max,
+ self.modulator.dash_time.dist,
+ self.modulator.dash_time.min,
+ self.modulator.dash_time.max)
+ logging.debug("call setup time between %.2f and %.2f "
+ "- signalspace transmit time: %.2f + %.2f "
+ "receive time: between %.2f and %.2f",
+ self.modulator.period_min,
+ self.modulator.period_max,
+ self.modulator.period_max,
+ self.modulator.signalspace_time.dist,
+ self.modulator.signalspace_time.min,
+ self.modulator.signalspace_time.max)
+ logging.debug("call setup time between %.2f and %.2f "
+ "--- wordspace transmit time: %.2f + %.2f "
+ "receive time: between %.2f and %.2f",
+ self.modulator.period_min,
+ self.modulator.period_max,
+ self.modulator.period_max,
+ self.modulator.wordspace_time.dist,
+ self.modulator.wordspace_time.min,
+ self.modulator.wordspace_time.max)
+ logging.debug("call setup time between %.2f and %.2f "
+ "--------- EOM transmit time: %.2f + %.2f "
+ "receive time: between %.2f and inf",
+ self.modulator.period_min,
+ self.modulator.period_max,
+ self.modulator.period_max,
+ self.modulator.eom_time.dist,
+ self.modulator.eom_time.min)