- 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_min = call_setup_time_min
+ self.call_setup_time_max = call_setup_time_max
+
+ self.ring_time_min = ring_time_min
+ self.ring_time_max = ring_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.dot_time = SymbolTime(call_setup_time_min,
+ call_setup_time_max, 0,
+ inter_symbol_distance)
+ self.dash_time = SymbolTime(call_setup_time_min,
+ call_setup_time_max, 1,
+ inter_symbol_distance)
+ self.signalspace_time = SymbolTime(call_setup_time_min,
+ call_setup_time_max, 2,
+ inter_symbol_distance)
+ self.wordspace_time = SymbolTime(call_setup_time_min,
+ call_setup_time_max, 3,
+ inter_symbol_distance)
+ self.eom_time = SymbolTime(call_setup_time_min,
+ call_setup_time_max, 4,
+ inter_symbol_distance)
+
+ logging.debug("call setup time between %.2f and %.2f "
+ "--------- dot transmit time: %.2f + %.2f "
+ "receive time: between %.2f and %.2f",
+ self.call_setup_time_min,
+ self.call_setup_time_max,
+ self.call_setup_time_max,
+ self.dot_time.dist,
+ self.dot_time.min,
+ self.dot_time.max)
+ logging.debug("call setup time between %.2f and %.2f "
+ "-------- dash transmit time: %.2f + %.2f "
+ "receive time: between %.2f and %.2f",
+ self.call_setup_time_min,
+ self.call_setup_time_max,
+ self.call_setup_time_max,
+ self.dash_time.dist,
+ self.dash_time.min,
+ self.dash_time.max)
+ logging.debug("call setup time between %.2f and %.2f "
+ "- signalspace transmit time: %.2f + %.2f "
+ "receive time: between %.2f and %.2f",
+ self.call_setup_time_min,
+ self.call_setup_time_max,
+ self.call_setup_time_max,
+ self.signalspace_time.dist,
+ self.signalspace_time.min,
+ self.signalspace_time.max)
+ logging.debug("call setup time between %.2f and %.2f "
+ "--- wordspace transmit time: %.2f + %.2f "
+ "receive time: between %.2f and %.2f",
+ self.call_setup_time_min,
+ self.call_setup_time_max,
+ self.call_setup_time_max,
+ self.wordspace_time.dist,
+ self.wordspace_time.min,
+ self.wordspace_time.max)
+ logging.debug("call setup time between %.2f and %.2f "
+ "--------- EOM transmit time: %.2f + %.2f "
+ "receive time: between %.2f and inf",
+ self.call_setup_time_min,
+ self.call_setup_time_max,
+ self.call_setup_time_max,
+ self.eom_time.dist,
+ self.eom_time.min)