Ver Fonte

porpawa id_path brak

a.binder há 9 anos atrás
pai
commit
6605176daa

+ 1 - 0
SE/dev/php-cli/build__biale_plamy.xml

@@ -302,6 +302,7 @@
     <target name="edge_paths_with_PE.xml">
         <echo message="Wyznaczenie PE na podstawie tras ${edge_paths_with_PE.xml} nowym ${edge_paths_with_PE_controll.xsl} "/>
         <delete file="${edge_paths_with_PE.xml}"/>
+        <delete file="${edge_paths_with_PE_controll.xml}"/>
         <xslt basedir="./" style="${edge_paths_with_PE_controll.xsl}" in="${edge_joins_filled_paths.xml}"  destdir="./" out="${edge_paths_with_PE_controll.xml}" >
             <factory name="net.sf.saxon.TransformerFactoryImpl">    
                 <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>

+ 10 - 0
SE/dev/php-cli/edge_joins_filled_paths_make.xsl

@@ -155,6 +155,16 @@
                             <!--<xsl:with-param name="not_id" select="$Ways/Ways/Way_next_cand/@id"/>-->
                         </xsl:call-template>
                     </xsl:variable>
+                    
+                    <xsl:variable name="LineString"> <!-- dodanie tylko unikalnego @id_path bo sie chrzani bez tego -->
+                        <xsl:for-each select="$LineString/LineString">
+                            <LineString>
+                                <xsl:copy-of select="@*"/>
+                                <xsl:attribute name="id_path" select="position()"/>
+                                <xsl:copy-of select="."/>
+                            </LineString>
+                        </xsl:for-each>
+                    </xsl:variable>
                     <xsl:variable name="len" select="sum($LineString/LineString/@len)"/>
                     <xsl:attribute name="len" select="$len"/>
                     <xsl:attribute name="Points_cnt" select="count($LineString/LineString/Points)"/>

+ 8 - 5
SE/dev/php-cli/edge_paths_with_PE_controll.xsl

@@ -15,6 +15,8 @@
     <xsl:param name="PE_Price" select="1500"/>
     <xsl:param name="Cable_Price" select="10"/>
     
+    <xsl:param name="edge_paths_with_PE.xml"/>
+    
     <!-- bedziemy od najdluzszej drogi starac sie rozmiescic PE w oparciu o rozmieszczenie klientow oraz odleglosci  -->
     
     
@@ -93,6 +95,7 @@
                             <xsl:attribute name="pos" select="position()"/>
                             <xsl:attribute name="not_id" select="@not_id"/>
                             <xsl:attribute name="len" select="@len"/>
+                            <xsl:attribute name="id_path" select="@id_path"/>
                             <xsl:variable name="Points" select="count(Points)"/>
                             <xsl:variable name="Ways" select="count(Ways)"/>
                         <xsl:choose>
@@ -124,13 +127,14 @@
                                     <xsl:attribute name="disttopkt" select="$disttopkt" />
                                     <xsl:variable name="cost_dist" select="$Cable_Price * $disttopkt * @point_count"/>
                                     <xsl:attribute name="cost_dist" select="$cost_dist"/>
+                                    
                                     <xsl:if test="$cost_dist &gt; $PE_Price">
                                         <xsl:attribute name="cut_by_pe" select="1"/>
                                     </xsl:if>
                                     <xsl:attribute name="not_id" select="@not_id"/>
                                 </xsl:when>
                             </xsl:choose>
-                            
+                            <xsl:attribute name="id_path" select="@id_path"/>
                             <xsl:copy-of select="@point_count"/>
                             <xsl:copy-of select="@pos"/>
                             <xsl:copy-of select="@len"/>
@@ -155,8 +159,6 @@
                             <xsl:attribute name="elements_cnt_Pos" select="$elements_cnt_Pos"/>
                             <xsl:attribute name="bit_max_Pos" select="$bit_max_Pos"/>
                             <xsl:attribute name="point_count_Pos" select="sum(current-group()/@point_count)"/>
-                            
-                            
                                 <xsl:for-each select="current-group()">
                                     <xsl:copy-of select="."/>
                                 </xsl:for-each>
@@ -180,8 +182,9 @@
                         <xsl:attribute name="pos" select="@pos"/>
                         <xsl:attribute name="len" select="@len"/>
                         <xsl:attribute name="distance" select="@distance"/>
-                        <xsl:attribute name="X" select="$edge_joins_filled_path/edge_joins_filled_paths_xml/asText_XMl/LineString[@not_id = current()/@not_id]/@X"/>
-                        <xsl:attribute name="Y" select="$edge_joins_filled_path/edge_joins_filled_paths_xml/asText_XMl/LineString[@not_id = current()/@not_id]/@Y"/>
+                        <xsl:attribute name="id_path" select="@id_path"/>
+                        <xsl:attribute name="X" select="$edge_joins_filled_path/edge_joins_filled_paths_xml/asText_XMl/LineString[@id_path = current()/@id_path]/@X"/>
+                        <xsl:attribute name="Y" select="$edge_joins_filled_path/edge_joins_filled_paths_xml/asText_XMl/LineString[@id_path = current()/@id_path]/@Y"/>
                     </bp:Path_Point>
                 </xsl:for-each>
             </xsl:for-each>