|
|
|
|
@ -309,6 +309,27 @@ class AutoRoutingTest(unittest.TestCase):
|
|
|
|
|
self.assertEqual("线槽A", wire_duct_carriers[0].get("source_label"))
|
|
|
|
|
self.assertEqual("WireDuct", wire_duct_carriers[0].get("source_kind"))
|
|
|
|
|
|
|
|
|
|
def test_route_track_records_carrier_capacity(self):
|
|
|
|
|
_install_fake_freecad()
|
|
|
|
|
terminal_objects, _wiring_objects, routing_network, auto_routing = _reload_modules()
|
|
|
|
|
app = sys.modules["FreeCAD"]
|
|
|
|
|
doc = FakeDocument()
|
|
|
|
|
terminal_objects.ensure_root_group(doc, "project-1")
|
|
|
|
|
start = _terminal(doc, terminal_objects, "TerminalStart", "terminal-start", app.Vector(0, 0, 0))
|
|
|
|
|
end = _terminal(doc, terminal_objects, "TerminalEnd", "terminal-end", app.Vector(100, 0, 0))
|
|
|
|
|
routing_network.create_route_carrier(
|
|
|
|
|
doc,
|
|
|
|
|
[app.Vector(0, 0, 20), app.Vector(100, 0, 20)],
|
|
|
|
|
project_uuid="project-1",
|
|
|
|
|
kind="WireDuct",
|
|
|
|
|
capacity=3,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
result = auto_routing.route_eplan_connection_between_terminals(doc, start, end)
|
|
|
|
|
route_track = json.loads(result["wire"].QetRouteTrackJson)
|
|
|
|
|
|
|
|
|
|
self.assertEqual(3, route_track["segments"][0]["carrier"]["capacity"])
|
|
|
|
|
|
|
|
|
|
def test_network_eplan_connection_route_offsets_lane_by_route_index(self):
|
|
|
|
|
_install_fake_freecad()
|
|
|
|
|
terminal_objects, _wiring_objects, routing_network, auto_routing = _reload_modules()
|
|
|
|
|
|