diff --git a/VVSU/js/Plan_VVSU.js b/VVSU/js/Plan_VVSU.js index dbb4c9e..12595e0 100644 --- a/VVSU/js/Plan_VVSU.js +++ b/VVSU/js/Plan_VVSU.js @@ -1,8 +1,7 @@ let planXML = ` - - - - + + + @@ -140,12 +139,13 @@ let planXML = ` - + + - + @@ -192,7 +192,6 @@ let planXML = ` - @@ -249,6 +248,9 @@ let planXML = ` + + + diff --git a/find_route.js b/find_route.js index ca15acd..5a6861f 100644 --- a/find_route.js +++ b/find_route.js @@ -164,10 +164,6 @@ function findRoute (point_from, point_to) } let route = get_route(plan.point_by_id.get(point_from), plan.point_by_id.get(point_to)); - if (route.length == 0) { - throw new Error(`Пункт ${point_to} недостижим из пункта ${point_from}`); - } - let route_text = get_route_text(route); //route_strs.push.apply(route_strs, route_text); // добавить route_text к route_strs return route_text; diff --git a/read_plan.js b/read_plan.js index 069b7eb..94cb6a6 100644 --- a/read_plan.js +++ b/read_plan.js @@ -55,7 +55,7 @@ function get_point_by_id (point_id, floor) point_index = plan.point_by_id.get(elevator_point_id); else point_index = plan.point_by_id.get(point_id); - if (point_index == undefined) { alert("Ошибка: пункт с id " + point_id + " на этаже " + floor + " не найден!"); } + if (point_index == undefined) { alert("Ошибка: точка с id " + point_id + " на этаже " + floor + " не найдена!"); } return point_index; } @@ -83,8 +83,8 @@ function process_xml_node (xml_node, path_index, floor_num) id: ("id" in xml_node.attributes ? xml_node.attributes["id"].nodeValue : ""), name: ("name" in xml_node.attributes ? xml_node.attributes["name"].nodeValue : ""), type: "", - wall: ("wall" in xml_node.attributes ? xml_node.attributes["wall"].nodeValue : ""), - hidden: false, //(xml_node.attributes["show_name"] != "1"), + location: ("location" in xml_node.attributes ? xml_node.attributes["location"].nodeValue : ""), + hidden: (xml_node.attributes["show_name"] != "1"), edges: [], to: ("to" in xml_node.attributes ? xml_node.attributes["to"].nodeValue : ""), fav: ("fav" in xml_node.attributes) @@ -131,15 +131,9 @@ function process_xml_node (xml_node, path_index, floor_num) else if (node_tag == "Wall") { point_index = add_point(point); } - else if (node_tag == "Door") { + else if (node_tag = "Door") { point_index = add_point(point); } - else if (node_tag == "Joint") { - point_index = add_point(point); - } - else { - alert(node_tag); - } } // добавляем пункт к пути if (path_index != -1) @@ -167,13 +161,12 @@ function read_path (xml_node, path_index, floor_num) for (node_child of xml_node.childNodes) { if (node_child.tagName == "Path") { // обрабатываем путь перемещения - // let point_index = get_point_by_id(node_child.attributes["start"].nodeValue, floor_num); - let point_index = plan.paths[path_index].path_points[plan.paths[path_index].path_points.length - 1]; + let point_index = get_point_by_id(node_child.attributes["start"].nodeValue, floor_num); let rotate_str = node_child.attributes["rotate"].nodeValue; let parent_path_dir = plan.paths[path_index].dir; let dir = rotate_dir(parent_path_dir, rotate_str); let path = { - walls: ("walls" in node_child.attributes ? node_child.attributes["walls"].nodeValue : "no"), + type: node_child.attributes["type"].nodeValue, dir: dir, path_points: [point_index], }; @@ -217,7 +210,7 @@ function read_plan () let dir_str = floor_child.attributes["dir"].nodeValue; let dir = motionDirForStr(dir_str); let path = { - walls: ("walls" in floor_child.attributes ? floor_child.attributes["walls"].nodeValue : "no"), + type: floor_child.attributes["type"].nodeValue, dir: dir, path_points: [], };