diff --git a/modeling/AVATAR/AirbusDoor_V2.xml b/modeling/AVATAR/AirbusDoor_V2.xml index 7f6fbf318069b27a2e6c096c2201d30c9d788a69..fc71ca5a0792bba4f041ce96ff3a38c2a53b1fc7 100644 --- a/modeling/AVATAR/AirbusDoor_V2.xml +++ b/modeling/AVATAR/AirbusDoor_V2.xml @@ -4035,8 +4035,8 @@ <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="null" /> <TGConnectingPoint num="0" id="2011" /> -<P1 x="787" y="437" id="2122" /> -<P2 x="658" y="595" id="2138" /> +<P1 x="787" y="437" id="2288" /> +<P2 x="658" y="595" id="2218" /> <AutomaticDrawing data="true" /> </CONNECTOR><SUBCOMPONENT type="-1" id="2010" > <father id="2012" num="0" /> @@ -4065,8 +4065,8 @@ <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="null" /> <TGConnectingPoint num="0" id="2018" /> -<P1 x="837" y="437" id="2124" /> -<P2 x="892" y="587" id="2195" /> +<P1 x="837" y="437" id="2290" /> +<P2 x="892" y="587" id="2193" /> <AutomaticDrawing data="true" /> </CONNECTOR><SUBCOMPONENT type="-1" id="2017" > <father id="2019" num="0" /> @@ -4095,8 +4095,8 @@ <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="null" /> <TGConnectingPoint num="0" id="2025" /> -<P1 x="875" y="424" id="2107" /> -<P2 x="988" y="469" id="2220" /> +<P1 x="875" y="424" id="2273" /> +<P2 x="988" y="469" id="2136" /> <AutomaticDrawing data="true" /> </CONNECTOR><SUBCOMPONENT type="-1" id="2024" > <father id="2026" num="0" /> @@ -4125,8 +4125,8 @@ <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="null" /> <TGConnectingPoint num="0" id="2032" /> -<P1 x="775" y="412" id="2097" /> -<P2 x="618" y="455" id="2261" /> +<P1 x="775" y="412" id="2263" /> +<P2 x="618" y="455" id="2095" /> <AutomaticDrawing data="true" /> </CONNECTOR><SUBCOMPONENT type="-1" id="2031" > <father id="2033" num="0" /> @@ -4155,8 +4155,8 @@ <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="null" /> <TGConnectingPoint num="0" id="2039" /> -<P1 x="836" y="345" id="2135" /> -<P2 x="825" y="387" id="2095" /> +<P1 x="836" y="345" id="2258" /> +<P2 x="825" y="387" id="2261" /> <AutomaticDrawing data="true" /> </CONNECTOR><SUBCOMPONENT type="-1" id="2038" > <father id="2040" num="0" /> @@ -4347,12 +4347,12 @@ </COMPONENT> <SUBCOMPONENT type="5106" id="2134" > <father id="2341" num="0" /> -<cdparam x="775" y="387" /> +<cdparam x="568" y="455" /> <sizeparam width="100" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <enabled value="true" /> <cdrectangleparam minX="0" maxX="541" minY="0" maxY="391" /> -<infoparam name="state0" value="Test" /> +<infoparam name="state0" value="IDLE" /> <TGConnectingPoint num="0" id="2094" /> <TGConnectingPoint num="1" id="2095" /> <TGConnectingPoint num="2" id="2096" /> @@ -4396,176 +4396,176 @@ <extraparam> </extraparam> </SUBCOMPONENT> -<SUBCOMPONENT type="5100" id="2136" > +<SUBCOMPONENT type="5106" id="2175" > <father id="2341" num="1" /> -<cdparam x="829" y="325" /> -<sizeparam width="15" height="15" minWidth="1" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="938" y="469" /> +<sizeparam width="100" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="0" maxX="626" minY="0" maxY="426" /> -<infoparam name="start state" value="null" /> +<enabled value="true" /> +<cdrectangleparam minX="0" maxX="541" minY="0" maxY="391" /> +<infoparam name="state0" value="FAULT" /> <TGConnectingPoint num="0" id="2135" /> -</SUBCOMPONENT> -<SUBCOMPONENT type="5106" id="2177" > +<TGConnectingPoint num="1" id="2136" /> +<TGConnectingPoint num="2" id="2137" /> +<TGConnectingPoint num="3" id="2138" /> +<TGConnectingPoint num="4" id="2139" /> +<TGConnectingPoint num="5" id="2140" /> +<TGConnectingPoint num="6" id="2141" /> +<TGConnectingPoint num="7" id="2142" /> +<TGConnectingPoint num="8" id="2143" /> +<TGConnectingPoint num="9" id="2144" /> +<TGConnectingPoint num="10" id="2145" /> +<TGConnectingPoint num="11" id="2146" /> +<TGConnectingPoint num="12" id="2147" /> +<TGConnectingPoint num="13" id="2148" /> +<TGConnectingPoint num="14" id="2149" /> +<TGConnectingPoint num="15" id="2150" /> +<TGConnectingPoint num="16" id="2151" /> +<TGConnectingPoint num="17" id="2152" /> +<TGConnectingPoint num="18" id="2153" /> +<TGConnectingPoint num="19" id="2154" /> +<TGConnectingPoint num="20" id="2155" /> +<TGConnectingPoint num="21" id="2156" /> +<TGConnectingPoint num="22" id="2157" /> +<TGConnectingPoint num="23" id="2158" /> +<TGConnectingPoint num="24" id="2159" /> +<TGConnectingPoint num="25" id="2160" /> +<TGConnectingPoint num="26" id="2161" /> +<TGConnectingPoint num="27" id="2162" /> +<TGConnectingPoint num="28" id="2163" /> +<TGConnectingPoint num="29" id="2164" /> +<TGConnectingPoint num="30" id="2165" /> +<TGConnectingPoint num="31" id="2166" /> +<TGConnectingPoint num="32" id="2167" /> +<TGConnectingPoint num="33" id="2168" /> +<TGConnectingPoint num="34" id="2169" /> +<TGConnectingPoint num="35" id="2170" /> +<TGConnectingPoint num="36" id="2171" /> +<TGConnectingPoint num="37" id="2172" /> +<TGConnectingPoint num="38" id="2173" /> +<TGConnectingPoint num="39" id="2174" /> +<extraparam> +</extraparam> +</SUBCOMPONENT> +<SUBCOMPONENT type="5106" id="2216" > <father id="2341" num="2" /> -<cdparam x="559" y="595" /> -<sizeparam width="198" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<enabled value="true" /> -<cdrectangleparam minX="0" maxX="443" minY="0" maxY="391" /> -<infoparam name="state0" value="FAULT_AND_OPEN" /> -<TGConnectingPoint num="0" id="2137" /> -<TGConnectingPoint num="1" id="2138" /> -<TGConnectingPoint num="2" id="2139" /> -<TGConnectingPoint num="3" id="2140" /> -<TGConnectingPoint num="4" id="2141" /> -<TGConnectingPoint num="5" id="2142" /> -<TGConnectingPoint num="6" id="2143" /> -<TGConnectingPoint num="7" id="2144" /> -<TGConnectingPoint num="8" id="2145" /> -<TGConnectingPoint num="9" id="2146" /> -<TGConnectingPoint num="10" id="2147" /> -<TGConnectingPoint num="11" id="2148" /> -<TGConnectingPoint num="12" id="2149" /> -<TGConnectingPoint num="13" id="2150" /> -<TGConnectingPoint num="14" id="2151" /> -<TGConnectingPoint num="15" id="2152" /> -<TGConnectingPoint num="16" id="2153" /> -<TGConnectingPoint num="17" id="2154" /> -<TGConnectingPoint num="18" id="2155" /> -<TGConnectingPoint num="19" id="2156" /> -<TGConnectingPoint num="20" id="2157" /> -<TGConnectingPoint num="21" id="2158" /> -<TGConnectingPoint num="22" id="2159" /> -<TGConnectingPoint num="23" id="2160" /> -<TGConnectingPoint num="24" id="2161" /> -<TGConnectingPoint num="25" id="2162" /> -<TGConnectingPoint num="26" id="2163" /> -<TGConnectingPoint num="27" id="2164" /> -<TGConnectingPoint num="28" id="2165" /> -<TGConnectingPoint num="29" id="2166" /> -<TGConnectingPoint num="30" id="2167" /> -<TGConnectingPoint num="31" id="2168" /> -<TGConnectingPoint num="32" id="2169" /> -<TGConnectingPoint num="33" id="2170" /> -<TGConnectingPoint num="34" id="2171" /> -<TGConnectingPoint num="35" id="2172" /> -<TGConnectingPoint num="36" id="2173" /> -<TGConnectingPoint num="37" id="2174" /> -<TGConnectingPoint num="38" id="2175" /> -<TGConnectingPoint num="39" id="2176" /> -<extraparam> -</extraparam> -</SUBCOMPONENT> -<SUBCOMPONENT type="5106" id="2218" > -<father id="2341" num="3" /> <cdparam x="855" y="587" /> <sizeparam width="100" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <enabled value="true" /> <cdrectangleparam minX="0" maxX="541" minY="0" maxY="391" /> <infoparam name="state0" value="OPEN" /> -<TGConnectingPoint num="0" id="2178" /> -<TGConnectingPoint num="1" id="2179" /> -<TGConnectingPoint num="2" id="2180" /> -<TGConnectingPoint num="3" id="2181" /> -<TGConnectingPoint num="4" id="2182" /> -<TGConnectingPoint num="5" id="2183" /> -<TGConnectingPoint num="6" id="2184" /> -<TGConnectingPoint num="7" id="2185" /> -<TGConnectingPoint num="8" id="2186" /> -<TGConnectingPoint num="9" id="2187" /> -<TGConnectingPoint num="10" id="2188" /> -<TGConnectingPoint num="11" id="2189" /> -<TGConnectingPoint num="12" id="2190" /> -<TGConnectingPoint num="13" id="2191" /> -<TGConnectingPoint num="14" id="2192" /> -<TGConnectingPoint num="15" id="2193" /> -<TGConnectingPoint num="16" id="2194" /> -<TGConnectingPoint num="17" id="2195" /> -<TGConnectingPoint num="18" id="2196" /> -<TGConnectingPoint num="19" id="2197" /> -<TGConnectingPoint num="20" id="2198" /> -<TGConnectingPoint num="21" id="2199" /> -<TGConnectingPoint num="22" id="2200" /> -<TGConnectingPoint num="23" id="2201" /> -<TGConnectingPoint num="24" id="2202" /> -<TGConnectingPoint num="25" id="2203" /> -<TGConnectingPoint num="26" id="2204" /> -<TGConnectingPoint num="27" id="2205" /> -<TGConnectingPoint num="28" id="2206" /> -<TGConnectingPoint num="29" id="2207" /> -<TGConnectingPoint num="30" id="2208" /> -<TGConnectingPoint num="31" id="2209" /> -<TGConnectingPoint num="32" id="2210" /> -<TGConnectingPoint num="33" id="2211" /> -<TGConnectingPoint num="34" id="2212" /> -<TGConnectingPoint num="35" id="2213" /> -<TGConnectingPoint num="36" id="2214" /> -<TGConnectingPoint num="37" id="2215" /> -<TGConnectingPoint num="38" id="2216" /> -<TGConnectingPoint num="39" id="2217" /> -<extraparam> -</extraparam> -</SUBCOMPONENT> -<SUBCOMPONENT type="5106" id="2259" > -<father id="2341" num="4" /> -<cdparam x="938" y="469" /> -<sizeparam width="100" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<TGConnectingPoint num="0" id="2176" /> +<TGConnectingPoint num="1" id="2177" /> +<TGConnectingPoint num="2" id="2178" /> +<TGConnectingPoint num="3" id="2179" /> +<TGConnectingPoint num="4" id="2180" /> +<TGConnectingPoint num="5" id="2181" /> +<TGConnectingPoint num="6" id="2182" /> +<TGConnectingPoint num="7" id="2183" /> +<TGConnectingPoint num="8" id="2184" /> +<TGConnectingPoint num="9" id="2185" /> +<TGConnectingPoint num="10" id="2186" /> +<TGConnectingPoint num="11" id="2187" /> +<TGConnectingPoint num="12" id="2188" /> +<TGConnectingPoint num="13" id="2189" /> +<TGConnectingPoint num="14" id="2190" /> +<TGConnectingPoint num="15" id="2191" /> +<TGConnectingPoint num="16" id="2192" /> +<TGConnectingPoint num="17" id="2193" /> +<TGConnectingPoint num="18" id="2194" /> +<TGConnectingPoint num="19" id="2195" /> +<TGConnectingPoint num="20" id="2196" /> +<TGConnectingPoint num="21" id="2197" /> +<TGConnectingPoint num="22" id="2198" /> +<TGConnectingPoint num="23" id="2199" /> +<TGConnectingPoint num="24" id="2200" /> +<TGConnectingPoint num="25" id="2201" /> +<TGConnectingPoint num="26" id="2202" /> +<TGConnectingPoint num="27" id="2203" /> +<TGConnectingPoint num="28" id="2204" /> +<TGConnectingPoint num="29" id="2205" /> +<TGConnectingPoint num="30" id="2206" /> +<TGConnectingPoint num="31" id="2207" /> +<TGConnectingPoint num="32" id="2208" /> +<TGConnectingPoint num="33" id="2209" /> +<TGConnectingPoint num="34" id="2210" /> +<TGConnectingPoint num="35" id="2211" /> +<TGConnectingPoint num="36" id="2212" /> +<TGConnectingPoint num="37" id="2213" /> +<TGConnectingPoint num="38" id="2214" /> +<TGConnectingPoint num="39" id="2215" /> +<extraparam> +</extraparam> +</SUBCOMPONENT> +<SUBCOMPONENT type="5106" id="2257" > +<father id="2341" num="3" /> +<cdparam x="559" y="595" /> +<sizeparam width="198" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <enabled value="true" /> -<cdrectangleparam minX="0" maxX="541" minY="0" maxY="391" /> -<infoparam name="state0" value="FAULT" /> -<TGConnectingPoint num="0" id="2219" /> -<TGConnectingPoint num="1" id="2220" /> -<TGConnectingPoint num="2" id="2221" /> -<TGConnectingPoint num="3" id="2222" /> -<TGConnectingPoint num="4" id="2223" /> -<TGConnectingPoint num="5" id="2224" /> -<TGConnectingPoint num="6" id="2225" /> -<TGConnectingPoint num="7" id="2226" /> -<TGConnectingPoint num="8" id="2227" /> -<TGConnectingPoint num="9" id="2228" /> -<TGConnectingPoint num="10" id="2229" /> -<TGConnectingPoint num="11" id="2230" /> -<TGConnectingPoint num="12" id="2231" /> -<TGConnectingPoint num="13" id="2232" /> -<TGConnectingPoint num="14" id="2233" /> -<TGConnectingPoint num="15" id="2234" /> -<TGConnectingPoint num="16" id="2235" /> -<TGConnectingPoint num="17" id="2236" /> -<TGConnectingPoint num="18" id="2237" /> -<TGConnectingPoint num="19" id="2238" /> -<TGConnectingPoint num="20" id="2239" /> -<TGConnectingPoint num="21" id="2240" /> -<TGConnectingPoint num="22" id="2241" /> -<TGConnectingPoint num="23" id="2242" /> -<TGConnectingPoint num="24" id="2243" /> -<TGConnectingPoint num="25" id="2244" /> -<TGConnectingPoint num="26" id="2245" /> -<TGConnectingPoint num="27" id="2246" /> -<TGConnectingPoint num="28" id="2247" /> -<TGConnectingPoint num="29" id="2248" /> -<TGConnectingPoint num="30" id="2249" /> -<TGConnectingPoint num="31" id="2250" /> -<TGConnectingPoint num="32" id="2251" /> -<TGConnectingPoint num="33" id="2252" /> -<TGConnectingPoint num="34" id="2253" /> -<TGConnectingPoint num="35" id="2254" /> -<TGConnectingPoint num="36" id="2255" /> -<TGConnectingPoint num="37" id="2256" /> -<TGConnectingPoint num="38" id="2257" /> -<TGConnectingPoint num="39" id="2258" /> -<extraparam> -</extraparam> +<cdrectangleparam minX="0" maxX="443" minY="0" maxY="391" /> +<infoparam name="state0" value="FAULT_AND_OPEN" /> +<TGConnectingPoint num="0" id="2217" /> +<TGConnectingPoint num="1" id="2218" /> +<TGConnectingPoint num="2" id="2219" /> +<TGConnectingPoint num="3" id="2220" /> +<TGConnectingPoint num="4" id="2221" /> +<TGConnectingPoint num="5" id="2222" /> +<TGConnectingPoint num="6" id="2223" /> +<TGConnectingPoint num="7" id="2224" /> +<TGConnectingPoint num="8" id="2225" /> +<TGConnectingPoint num="9" id="2226" /> +<TGConnectingPoint num="10" id="2227" /> +<TGConnectingPoint num="11" id="2228" /> +<TGConnectingPoint num="12" id="2229" /> +<TGConnectingPoint num="13" id="2230" /> +<TGConnectingPoint num="14" id="2231" /> +<TGConnectingPoint num="15" id="2232" /> +<TGConnectingPoint num="16" id="2233" /> +<TGConnectingPoint num="17" id="2234" /> +<TGConnectingPoint num="18" id="2235" /> +<TGConnectingPoint num="19" id="2236" /> +<TGConnectingPoint num="20" id="2237" /> +<TGConnectingPoint num="21" id="2238" /> +<TGConnectingPoint num="22" id="2239" /> +<TGConnectingPoint num="23" id="2240" /> +<TGConnectingPoint num="24" id="2241" /> +<TGConnectingPoint num="25" id="2242" /> +<TGConnectingPoint num="26" id="2243" /> +<TGConnectingPoint num="27" id="2244" /> +<TGConnectingPoint num="28" id="2245" /> +<TGConnectingPoint num="29" id="2246" /> +<TGConnectingPoint num="30" id="2247" /> +<TGConnectingPoint num="31" id="2248" /> +<TGConnectingPoint num="32" id="2249" /> +<TGConnectingPoint num="33" id="2250" /> +<TGConnectingPoint num="34" id="2251" /> +<TGConnectingPoint num="35" id="2252" /> +<TGConnectingPoint num="36" id="2253" /> +<TGConnectingPoint num="37" id="2254" /> +<TGConnectingPoint num="38" id="2255" /> +<TGConnectingPoint num="39" id="2256" /> +<extraparam> +</extraparam> +</SUBCOMPONENT> +<SUBCOMPONENT type="5100" id="2259" > +<father id="2341" num="4" /> +<cdparam x="829" y="325" /> +<sizeparam width="15" height="15" minWidth="1" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="0" maxX="626" minY="0" maxY="426" /> +<infoparam name="start state" value="null" /> +<TGConnectingPoint num="0" id="2258" /> </SUBCOMPONENT> <SUBCOMPONENT type="5106" id="2300" > <father id="2341" num="5" /> -<cdparam x="568" y="455" /> +<cdparam x="775" y="387" /> <sizeparam width="100" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <enabled value="true" /> <cdrectangleparam minX="0" maxX="541" minY="0" maxY="391" /> -<infoparam name="state0" value="IDLE" /> +<infoparam name="state0" value="Test" /> <TGConnectingPoint num="0" id="2260" /> <TGConnectingPoint num="1" id="2261" /> <TGConnectingPoint num="2" id="2262" /> @@ -11811,11 +11811,11 @@ in DoorAndLockButton </COMPONENT> <SUBCOMPONENT type="5000" id="5187" > <father id="5287" num="0" /> -<cdparam x="65" y="217" /> +<cdparam x="64" y="322" /> <sizeparam width="225" height="98" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="0" maxX="525" minY="0" maxY="321" /> -<infoparam name="Block0" value="Captain" /> +<infoparam name="Block0" value="FirstOfficer" /> <TGConnectingPoint num="0" id="5163" /> <TGConnectingPoint num="1" id="5164" /> <TGConnectingPoint num="2" id="5165" /> @@ -11849,11 +11849,11 @@ in DoorAndLockButton </SUBCOMPONENT> <SUBCOMPONENT type="5000" id="5212" > <father id="5287" num="1" /> -<cdparam x="299" y="249" /> +<cdparam x="534" y="247" /> <sizeparam width="225" height="134" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="0" maxX="525" minY="0" maxY="285" /> -<infoparam name="Block0" value="Crew" /> +<infoparam name="Block0" value="Passenger" /> <TGConnectingPoint num="0" id="5188" /> <TGConnectingPoint num="1" id="5189" /> <TGConnectingPoint num="2" id="5190" /> @@ -11882,16 +11882,16 @@ in DoorAndLockButton <blockType data="block" color="-4072719" /> <CryptoBlock value="false" /> <Attribute access="0" id="isInCockpit" value="false" type="4" typeOther="" /> -<Attribute access="0" id="knowsEmergencyCode" value="true" type="4" typeOther="" /> +<Attribute access="0" id="knowsEmergencyCode" value="false" type="4" typeOther="" /> </extraparam> </SUBCOMPONENT> <SUBCOMPONENT type="5000" id="5237" > <father id="5287" num="2" /> -<cdparam x="534" y="247" /> +<cdparam x="299" y="249" /> <sizeparam width="225" height="134" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="0" maxX="525" minY="0" maxY="285" /> -<infoparam name="Block0" value="Passenger" /> +<infoparam name="Block0" value="Crew" /> <TGConnectingPoint num="0" id="5213" /> <TGConnectingPoint num="1" id="5214" /> <TGConnectingPoint num="2" id="5215" /> @@ -11920,16 +11920,16 @@ in DoorAndLockButton <blockType data="block" color="-4072719" /> <CryptoBlock value="false" /> <Attribute access="0" id="isInCockpit" value="false" type="4" typeOther="" /> -<Attribute access="0" id="knowsEmergencyCode" value="false" type="4" typeOther="" /> +<Attribute access="0" id="knowsEmergencyCode" value="true" type="4" typeOther="" /> </extraparam> </SUBCOMPONENT> <SUBCOMPONENT type="5000" id="5262" > <father id="5287" num="3" /> -<cdparam x="64" y="322" /> +<cdparam x="65" y="217" /> <sizeparam width="225" height="98" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="0" maxX="525" minY="0" maxY="321" /> -<infoparam name="Block0" value="FirstOfficer" /> +<infoparam name="Block0" value="Captain" /> <TGConnectingPoint num="0" id="5238" /> <TGConnectingPoint num="1" id="5239" /> <TGConnectingPoint num="2" id="5240" /> diff --git a/modeling/DIPLODOCUS/simpleSDF.xml b/modeling/DIPLODOCUS/simpleSDF.xml index 53fb1b6ea196124645a98fd8d6500a0e67d6ba3e..d2eba9e0dd22b6c1b583c480a292e7b905ee5944 100644 --- a/modeling/DIPLODOCUS/simpleSDF.xml +++ b/modeling/DIPLODOCUS/simpleSDF.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<TURTLEGMODELING version="1.0beta" ANIMATE_INTERACTIVE_SIMULATION="true" ACTIVATE_PENALTIES="true" UPDATE_INFORMATION_DIPLO_SIM="false" ANIMATE_WITH_INFO_DIPLO_SIM="true" OPEN_DIAG_DIPLO_SIM="false" LAST_SELECTED_MAIN_TAB="4" LAST_SELECTED_SUB_TAB="3"> +<TURTLEGMODELING version="1.0beta" ANIMATE_INTERACTIVE_SIMULATION="true" ACTIVATE_PENALTIES="true" UPDATE_INFORMATION_DIPLO_SIM="false" ANIMATE_WITH_INFO_DIPLO_SIM="true" OPEN_DIAG_DIPLO_SIM="false" LAST_SELECTED_MAIN_TAB="4" LAST_SELECTED_SUB_TAB="0"> <Modeling type="TML Component Design" nameTab="Application" tabs="TML Component Task Diagram$Src$T1$T2$T3$T4$T5$Dst" > <TMLComponentTaskDiagramPanel name="TML Component Task Diagram" minX="10" maxX="2500" minY="10" maxY="1500" channels="true" events="true" requests="true" zoom="1.0" > @@ -2973,44 +2973,74 @@ <cdparam x="335" y="236" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="Connector between ports" /> -<P1 x="335" y="237" id="802" /> -<P2 x="414" y="236" id="815" /> +<P1 x="335" y="237" id="819" /> +<P2 x="414" y="236" id="832" /> <AutomaticDrawing data="true" /> </CONNECTOR> <CONNECTOR type="126" id="801" > <cdparam x="590" y="241" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="Connector between ports" /> -<P1 x="590" y="241" id="813" /> -<P2 x="670" y="238" id="826" /> +<P1 x="590" y="241" id="830" /> +<P2 x="670" y="238" id="843" /> <AutomaticDrawing data="true" /> </CONNECTOR> -<COMPONENT type="1202" id="812" > +<COMPONENT type="308" id="818" > +<cdparam x="116" y="69" /> +<sizeparam width="284" height="45" minWidth="80" minHeight="10" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="Pragma" value=" +PERIOD 10ms +" /> +<TGConnectingPoint num="0" id="802" /> +<TGConnectingPoint num="1" id="803" /> +<TGConnectingPoint num="2" id="804" /> +<TGConnectingPoint num="3" id="805" /> +<TGConnectingPoint num="4" id="806" /> +<TGConnectingPoint num="5" id="807" /> +<TGConnectingPoint num="6" id="808" /> +<TGConnectingPoint num="7" id="809" /> +<TGConnectingPoint num="8" id="810" /> +<TGConnectingPoint num="9" id="811" /> +<TGConnectingPoint num="10" id="812" /> +<TGConnectingPoint num="11" id="813" /> +<TGConnectingPoint num="12" id="814" /> +<TGConnectingPoint num="13" id="815" /> +<TGConnectingPoint num="14" id="816" /> +<TGConnectingPoint num="15" id="817" /> +<extraparam> +<Line value="" /> +<Line value="PERIOD 10ms" /> +</extraparam> +</COMPONENT> + +<COMPONENT type="1202" id="829" > <cdparam x="122" y="175" /> <sizeparam width="200" height="150" minWidth="1" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> <infoparam name="Primitive component" value="Src" /> -<TGConnectingPoint num="0" id="804" /> -<TGConnectingPoint num="1" id="805" /> -<TGConnectingPoint num="2" id="806" /> -<TGConnectingPoint num="3" id="807" /> -<TGConnectingPoint num="4" id="808" /> -<TGConnectingPoint num="5" id="809" /> -<TGConnectingPoint num="6" id="810" /> -<TGConnectingPoint num="7" id="811" /> +<TGConnectingPoint num="0" id="821" /> +<TGConnectingPoint num="1" id="822" /> +<TGConnectingPoint num="2" id="823" /> +<TGConnectingPoint num="3" id="824" /> +<TGConnectingPoint num="4" id="825" /> +<TGConnectingPoint num="5" id="826" /> +<TGConnectingPoint num="6" id="827" /> +<TGConnectingPoint num="7" id="828" /> <extraparam> <Data isAttacker="No" daemon="false" Operation="" /> </extraparam> </COMPONENT> -<SUBCOMPONENT type="1203" id="803" > -<father id="812" num="0" /> +<SUBCOMPONENT type="1203" id="820" > +<father id="829" num="0" /> <cdparam x="309" y="224" /> <sizeparam width="26" height="26" minWidth="1" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="-13" maxX="187" minY="-13" maxY="137" /> <infoparam name="Primitive port" value="Channel chToT1" /> -<TGConnectingPoint num="0" id="802" /> +<TGConnectingPoint num="0" id="819" /> <extraparam> <Prop commName="chToT1" commType="0" origin="true" finite="false" blocking="true" maxSamples="500" widthSamples="4" isLossy="false" isPrex="false" isPostex="false" lossPercentage="0" maxNbOfLoss="0" dataFlowType="int16_t" associatedEvent="" checkConf="false" checkConfStatus="0" checkAuth="false" checkWeakAuthStatus="0" checkStrongAuthStatus="0" vc="0" /> <Type type="0" typeOther="" /> @@ -3021,32 +3051,32 @@ </extraparam> </SUBCOMPONENT> -<COMPONENT type="1202" id="825" > +<COMPONENT type="1202" id="842" > <cdparam x="427" y="177" /> <sizeparam width="150" height="150" minWidth="1" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> <infoparam name="Primitive component" value="T1" /> -<TGConnectingPoint num="0" id="817" /> -<TGConnectingPoint num="1" id="818" /> -<TGConnectingPoint num="2" id="819" /> -<TGConnectingPoint num="3" id="820" /> -<TGConnectingPoint num="4" id="821" /> -<TGConnectingPoint num="5" id="822" /> -<TGConnectingPoint num="6" id="823" /> -<TGConnectingPoint num="7" id="824" /> +<TGConnectingPoint num="0" id="834" /> +<TGConnectingPoint num="1" id="835" /> +<TGConnectingPoint num="2" id="836" /> +<TGConnectingPoint num="3" id="837" /> +<TGConnectingPoint num="4" id="838" /> +<TGConnectingPoint num="5" id="839" /> +<TGConnectingPoint num="6" id="840" /> +<TGConnectingPoint num="7" id="841" /> <extraparam> <Data isAttacker="No" daemon="false" Operation="" /> </extraparam> </COMPONENT> -<SUBCOMPONENT type="1203" id="814" > -<father id="825" num="0" /> +<SUBCOMPONENT type="1203" id="831" > +<father id="842" num="0" /> <cdparam x="564" y="228" /> <sizeparam width="26" height="26" minWidth="1" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="-13" maxX="137" minY="-13" maxY="137" /> <infoparam name="Primitive port" value="Channel chToT2" /> -<TGConnectingPoint num="0" id="813" /> +<TGConnectingPoint num="0" id="830" /> <extraparam> <Prop commName="chToT2" commType="0" origin="true" finite="false" blocking="true" maxSamples="8" widthSamples="4" isLossy="false" isPrex="false" isPostex="false" lossPercentage="0" maxNbOfLoss="0" dataFlowType="int16_t" associatedEvent="" checkConf="false" checkConfStatus="0" checkAuth="false" checkWeakAuthStatus="0" checkStrongAuthStatus="0" vc="0" /> <Type type="0" typeOther="" /> @@ -3056,14 +3086,14 @@ <Type type="0" typeOther="" /> </extraparam> </SUBCOMPONENT> -<SUBCOMPONENT type="1203" id="816" > -<father id="825" num="1" /> +<SUBCOMPONENT type="1203" id="833" > +<father id="842" num="1" /> <cdparam x="414" y="223" /> <sizeparam width="26" height="26" minWidth="1" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="-13" maxX="137" minY="-13" maxY="137" /> <infoparam name="Primitive port" value="Channel chToT1" /> -<TGConnectingPoint num="0" id="815" /> +<TGConnectingPoint num="0" id="832" /> <extraparam> <Prop commName="chToT1" commType="0" origin="false" finite="false" blocking="true" maxSamples="8" widthSamples="4" isLossy="false" isPrex="false" isPostex="false" lossPercentage="0" maxNbOfLoss="0" dataFlowType="int16_t" associatedEvent="" checkConf="false" checkConfStatus="0" checkAuth="false" checkWeakAuthStatus="0" checkStrongAuthStatus="0" vc="0" /> <Type type="0" typeOther="" /> @@ -3074,32 +3104,32 @@ </extraparam> </SUBCOMPONENT> -<COMPONENT type="1202" id="836" > +<COMPONENT type="1202" id="853" > <cdparam x="683" y="179" /> <sizeparam width="185" height="150" minWidth="1" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> <infoparam name="Primitive component" value="T2" /> -<TGConnectingPoint num="0" id="828" /> -<TGConnectingPoint num="1" id="829" /> -<TGConnectingPoint num="2" id="830" /> -<TGConnectingPoint num="3" id="831" /> -<TGConnectingPoint num="4" id="832" /> -<TGConnectingPoint num="5" id="833" /> -<TGConnectingPoint num="6" id="834" /> -<TGConnectingPoint num="7" id="835" /> +<TGConnectingPoint num="0" id="845" /> +<TGConnectingPoint num="1" id="846" /> +<TGConnectingPoint num="2" id="847" /> +<TGConnectingPoint num="3" id="848" /> +<TGConnectingPoint num="4" id="849" /> +<TGConnectingPoint num="5" id="850" /> +<TGConnectingPoint num="6" id="851" /> +<TGConnectingPoint num="7" id="852" /> <extraparam> <Data isAttacker="No" daemon="false" Operation="" /> </extraparam> </COMPONENT> -<SUBCOMPONENT type="1203" id="827" > -<father id="836" num="0" /> +<SUBCOMPONENT type="1203" id="844" > +<father id="853" num="0" /> <cdparam x="670" y="225" /> <sizeparam width="26" height="26" minWidth="1" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="-13" maxX="172" minY="-13" maxY="137" /> <infoparam name="Primitive port" value="Channel chToT2" /> -<TGConnectingPoint num="0" id="826" /> +<TGConnectingPoint num="0" id="843" /> <extraparam> <Prop commName="chToT2" commType="0" origin="false" finite="false" blocking="true" maxSamples="8" widthSamples="4" isLossy="false" isPrex="false" isPostex="false" lossPercentage="0" maxNbOfLoss="0" dataFlowType="int16_t" associatedEvent="" checkConf="false" checkConfStatus="0" checkAuth="false" checkWeakAuthStatus="0" checkStrongAuthStatus="0" vc="0" /> <Type type="0" typeOther="" /> @@ -3114,101 +3144,93 @@ </TMLComponentTaskDiagramPanel> <TMLActivityDiagramPanel name="Src" minX="10" maxX="2500" minY="10" maxY="1500" > -<COMPONENT type="1001" id="838" > +<COMPONENT type="1001" id="855" > <cdparam x="322" y="286" /> <sizeparam width="20" height="20" minWidth="1" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> <infoparam name="stop state" value="null" /> -<TGConnectingPoint num="0" id="837" /> +<TGConnectingPoint num="0" id="854" /> </COMPONENT> -<COMPONENT type="1006" id="841" > +<COMPONENT type="1006" id="858" > <cdparam x="292" y="245" /> <sizeparam width="81" height="20" minWidth="30" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <enabled value="true" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> <infoparam name="write channel" value="chToT1(50)" /> -<TGConnectingPoint num="0" id="839" /> -<TGConnectingPoint num="1" id="840" /> +<TGConnectingPoint num="0" id="856" /> +<TGConnectingPoint num="1" id="857" /> <extraparam> <Data channelName="chToT1" nbOfSamples="50" secPattern="" isAttacker="No" isEncForm="Yes" /> </extraparam> </COMPONENT> -<COMPONENT type="1000" id="843" > +<COMPONENT type="1000" id="860" > <cdparam x="325" y="145" /> <sizeparam width="15" height="15" minWidth="1" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> <infoparam name="start state" value="null" /> -<TGConnectingPoint num="0" id="842" /> +<TGConnectingPoint num="0" id="859" /> </COMPONENT> -<CONNECTOR type="115" id="844" > +<CONNECTOR type="115" id="861" > <cdparam x="332" y="160" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="null" /> -<P1 x="332" y="160" id="842" /> -<P2 x="332" y="240" id="839" /> +<P1 x="332" y="160" id="859" /> +<P2 x="332" y="240" id="856" /> <AutomaticDrawing data="true" /> </CONNECTOR> -<CONNECTOR type="115" id="845" > +<CONNECTOR type="115" id="862" > <cdparam x="332" y="223" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="null" /> -<P1 x="332" y="270" id="840" /> -<P2 x="332" y="281" id="837" /> +<P1 x="332" y="270" id="857" /> +<P2 x="332" y="281" id="854" /> <AutomaticDrawing data="true" /> </CONNECTOR> </TMLActivityDiagramPanel> <TMLActivityDiagramPanel name="T1" minX="10" maxX="2500" minY="10" maxY="1500" > -<CONNECTOR type="115" id="916" > -<cdparam x="432" y="325" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector" value="null" /> -<P1 x="422" y="328" id="915" /> -<P2 x="422" y="363" id="846" /> -<AutomaticDrawing data="true" /> -</CONNECTOR> -<COMPONENT type="1006" id="913" > +<COMPONENT type="1006" id="865" > <cdparam x="382" y="303" /> -<sizeparam width="81" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<sizeparam width="81" height="20" minWidth="30" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <enabled value="true" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> <infoparam name="write channel" value="chToT2(15)" /> -<TGConnectingPoint num="0" id="914" /> -<TGConnectingPoint num="1" id="915" /> +<TGConnectingPoint num="0" id="863" /> +<TGConnectingPoint num="1" id="864" /> <extraparam> <Data channelName="chToT2" nbOfSamples="15" secPattern="" isAttacker="No" isEncForm="Yes" /> </extraparam> </COMPONENT> -<COMPONENT type="1001" id="847" > +<COMPONENT type="1001" id="867" > <cdparam x="412" y="368" /> <sizeparam width="20" height="20" minWidth="1" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> <infoparam name="stop state" value="null" /> -<TGConnectingPoint num="0" id="846" /> +<TGConnectingPoint num="0" id="866" /> </COMPONENT> -<COMPONENT type="1013" id="851" > +<COMPONENT type="1013" id="871" > <cdparam x="417" y="216" /> <sizeparam width="10" height="30" minWidth="1" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <enabled value="true" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> <infoparam name="execI" value="null" /> -<TGConnectingPoint num="0" id="849" /> -<TGConnectingPoint num="1" id="850" /> +<TGConnectingPoint num="0" id="869" /> +<TGConnectingPoint num="1" id="870" /> </COMPONENT> -<SUBCOMPONENT type="-1" id="848" > -<father id="851" num="0" /> +<SUBCOMPONENT type="-1" id="868" > +<father id="871" num="0" /> <cdparam x="432" y="236" /> <sizeparam width="24" height="15" minWidth="10" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> @@ -3216,69 +3238,77 @@ <infoparam name="value of the delay" value="100" /> </SUBCOMPONENT> -<COMPONENT type="1009" id="854" > +<COMPONENT type="1009" id="874" > <cdparam x="380" y="162" /> <sizeparam width="85" height="20" minWidth="30" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <enabled value="true" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> <infoparam name="read channel" value="chToT1(50) " /> -<TGConnectingPoint num="0" id="852" /> -<TGConnectingPoint num="1" id="853" /> +<TGConnectingPoint num="0" id="872" /> +<TGConnectingPoint num="1" id="873" /> <extraparam> <Data channelName="chToT1" nbOfSamples="50" secPattern="" isAttacker="No" isEncForm="Yes" /> </extraparam> </COMPONENT> -<COMPONENT type="1000" id="856" > +<COMPONENT type="1000" id="876" > <cdparam x="416" y="76" /> <sizeparam width="15" height="15" minWidth="1" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> <infoparam name="start state" value="null" /> -<TGConnectingPoint num="0" id="855" /> +<TGConnectingPoint num="0" id="875" /> </COMPONENT> -<CONNECTOR type="115" id="857" > +<CONNECTOR type="115" id="877" > +<cdparam x="432" y="325" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<P1 x="422" y="328" id="864" /> +<P2 x="422" y="363" id="866" /> +<AutomaticDrawing data="true" /> +</CONNECTOR> +<CONNECTOR type="115" id="878" > <cdparam x="422" y="251" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="null" /> -<P1 x="422" y="251" id="850" /> -<P2 x="422" y="298" id="914" /> +<P1 x="422" y="251" id="870" /> +<P2 x="422" y="298" id="863" /> <AutomaticDrawing data="true" /> </CONNECTOR> -<CONNECTOR type="115" id="858" > +<CONNECTOR type="115" id="879" > <cdparam x="423" y="91" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="null" /> -<P1 x="423" y="91" id="855" /> -<P2 x="422" y="157" id="852" /> +<P1 x="423" y="91" id="875" /> +<P2 x="422" y="157" id="872" /> <AutomaticDrawing data="true" /> </CONNECTOR> -<CONNECTOR type="115" id="859" > +<CONNECTOR type="115" id="880" > <cdparam x="432" y="199" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="null" /> -<P1 x="422" y="187" id="853" /> -<P2 x="422" y="211" id="849" /> +<P1 x="422" y="187" id="873" /> +<P2 x="422" y="211" id="869" /> <AutomaticDrawing data="true" /> </CONNECTOR> </TMLActivityDiagramPanel> <TMLActivityDiagramPanel name="T2" minX="10" maxX="2500" minY="10" maxY="1500" > -<COMPONENT type="1013" id="863" > +<COMPONENT type="1013" id="884" > <cdparam x="348" y="280" /> <sizeparam width="10" height="30" minWidth="1" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <enabled value="true" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> <infoparam name="execI" value="null" /> -<TGConnectingPoint num="0" id="861" /> -<TGConnectingPoint num="1" id="862" /> +<TGConnectingPoint num="0" id="882" /> +<TGConnectingPoint num="1" id="883" /> </COMPONENT> -<SUBCOMPONENT type="-1" id="860" > -<father id="863" num="0" /> +<SUBCOMPONENT type="-1" id="881" > +<father id="884" num="0" /> <cdparam x="363" y="300" /> <sizeparam width="16" height="15" minWidth="10" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> @@ -3286,18 +3316,18 @@ <infoparam name="value of the delay" value="20" /> </SUBCOMPONENT> -<COMPONENT type="1013" id="867" > +<COMPONENT type="1013" id="888" > <cdparam x="733" y="279" /> <sizeparam width="10" height="30" minWidth="1" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <enabled value="true" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> <infoparam name="execI" value="null" /> -<TGConnectingPoint num="0" id="865" /> -<TGConnectingPoint num="1" id="866" /> +<TGConnectingPoint num="0" id="886" /> +<TGConnectingPoint num="1" id="887" /> </COMPONENT> -<SUBCOMPONENT type="-1" id="864" > -<father id="867" num="0" /> +<SUBCOMPONENT type="-1" id="885" > +<father id="888" num="0" /> <cdparam x="748" y="299" /> <sizeparam width="16" height="15" minWidth="10" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> @@ -3305,35 +3335,35 @@ <infoparam name="value of the delay" value="25" /> </SUBCOMPONENT> -<COMPONENT type="1012" id="875" > +<COMPONENT type="1012" id="896" > <cdparam x="524" y="161" /> <sizeparam width="30" height="30" minWidth="1" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> <infoparam name="choice" value="null" /> -<TGConnectingPoint num="0" id="871" /> -<TGConnectingPoint num="1" id="872" /> -<TGConnectingPoint num="2" id="873" /> -<TGConnectingPoint num="3" id="874" /> +<TGConnectingPoint num="0" id="892" /> +<TGConnectingPoint num="1" id="893" /> +<TGConnectingPoint num="2" id="894" /> +<TGConnectingPoint num="3" id="895" /> </COMPONENT> -<SUBCOMPONENT type="-1" id="868" > -<father id="875" num="0" /> +<SUBCOMPONENT type="-1" id="889" > +<father id="896" num="0" /> <cdparam x="499" y="171" /> <sizeparam width="14" height="15" minWidth="10" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="-75" maxX="-20" minY="10" maxY="35" /> <infoparam name="guard 1" value="[ ]" /> </SUBCOMPONENT> -<SUBCOMPONENT type="-1" id="869" > -<father id="875" num="1" /> +<SUBCOMPONENT type="-1" id="890" > +<father id="896" num="1" /> <cdparam x="559" y="171" /> <sizeparam width="14" height="15" minWidth="10" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="35" maxX="55" minY="10" maxY="35" /> <infoparam name="guard 2" value="[ ]" /> </SUBCOMPONENT> -<SUBCOMPONENT type="-1" id="870" > -<father id="875" num="2" /> +<SUBCOMPONENT type="-1" id="891" > +<father id="896" num="2" /> <cdparam x="544" y="206" /> <sizeparam width="14" height="15" minWidth="10" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> @@ -3341,39 +3371,39 @@ <infoparam name="guard 3" value="[ ]" /> </SUBCOMPONENT> -<COMPONENT type="1020" id="879" > +<COMPONENT type="1020" id="900" > <cdparam x="366" y="103" /> <sizeparam width="90" height="20" minWidth="30" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <enabled value="true" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> <infoparam name="for loop" value="1" /> -<TGConnectingPoint num="0" id="876" /> -<TGConnectingPoint num="1" id="877" /> -<TGConnectingPoint num="2" id="878" /> +<TGConnectingPoint num="0" id="897" /> +<TGConnectingPoint num="1" id="898" /> +<TGConnectingPoint num="2" id="899" /> </COMPONENT> -<COMPONENT type="1001" id="881" > +<COMPONENT type="1001" id="902" > <cdparam x="533" y="533" /> <sizeparam width="20" height="20" minWidth="1" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> <infoparam name="stop state" value="null" /> -<TGConnectingPoint num="0" id="880" /> +<TGConnectingPoint num="0" id="901" /> </COMPONENT> -<COMPONENT type="1013" id="885" > +<COMPONENT type="1013" id="906" > <cdparam x="538" y="306" /> <sizeparam width="10" height="30" minWidth="1" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <enabled value="true" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> <infoparam name="execI" value="null" /> -<TGConnectingPoint num="0" id="883" /> -<TGConnectingPoint num="1" id="884" /> +<TGConnectingPoint num="0" id="904" /> +<TGConnectingPoint num="1" id="905" /> </COMPONENT> -<SUBCOMPONENT type="-1" id="882" > -<father id="885" num="0" /> +<SUBCOMPONENT type="-1" id="903" > +<father id="906" num="0" /> <cdparam x="553" y="326" /> <sizeparam width="24" height="15" minWidth="10" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> @@ -3381,161 +3411,161 @@ <infoparam name="value of the delay" value="150" /> </SUBCOMPONENT> -<COMPONENT type="1009" id="888" > +<COMPONENT type="1009" id="909" > <cdparam x="497" y="252" /> <sizeparam width="93" height="20" minWidth="30" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <enabled value="true" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> <infoparam name="read channel" value="chToT2(100) " /> -<TGConnectingPoint num="0" id="886" /> -<TGConnectingPoint num="1" id="887" /> +<TGConnectingPoint num="0" id="907" /> +<TGConnectingPoint num="1" id="908" /> <extraparam> <Data channelName="chToT2" nbOfSamples="100" secPattern="" isAttacker="No" isEncForm="Yes" /> </extraparam> </COMPONENT> -<COMPONENT type="1000" id="890" > +<COMPONENT type="1000" id="911" > <cdparam x="396" y="55" /> <sizeparam width="15" height="15" minWidth="1" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> <infoparam name="start state" value="null" /> -<TGConnectingPoint num="0" id="889" /> +<TGConnectingPoint num="0" id="910" /> </COMPONENT> -<COMPONENT type="1001" id="892" > +<COMPONENT type="1001" id="913" > <cdparam x="728" y="506" /> <sizeparam width="20" height="20" minWidth="1" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> <infoparam name="stop state" value="null" /> -<TGConnectingPoint num="0" id="891" /> +<TGConnectingPoint num="0" id="912" /> </COMPONENT> -<COMPONENT type="1009" id="895" > +<COMPONENT type="1009" id="916" > <cdparam x="696" y="225" /> <sizeparam width="85" height="20" minWidth="30" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <enabled value="true" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> <infoparam name="read channel" value="chToT2(50) " /> -<TGConnectingPoint num="0" id="893" /> -<TGConnectingPoint num="1" id="894" /> +<TGConnectingPoint num="0" id="914" /> +<TGConnectingPoint num="1" id="915" /> <extraparam> <Data channelName="chToT2" nbOfSamples="50" secPattern="" isAttacker="No" isEncForm="Yes" /> </extraparam> </COMPONENT> -<COMPONENT type="1001" id="897" > +<COMPONENT type="1001" id="918" > <cdparam x="343" y="507" /> <sizeparam width="20" height="20" minWidth="1" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> <infoparam name="stop state" value="null" /> -<TGConnectingPoint num="0" id="896" /> +<TGConnectingPoint num="0" id="917" /> </COMPONENT> -<COMPONENT type="1009" id="900" > +<COMPONENT type="1009" id="921" > <cdparam x="311" y="226" /> <sizeparam width="85" height="20" minWidth="30" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <enabled value="true" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> <infoparam name="read channel" value="chToT2(50) " /> -<TGConnectingPoint num="0" id="898" /> -<TGConnectingPoint num="1" id="899" /> +<TGConnectingPoint num="0" id="919" /> +<TGConnectingPoint num="1" id="920" /> <extraparam> <Data channelName="chToT2" nbOfSamples="50" secPattern="" isAttacker="No" isEncForm="Yes" /> </extraparam> </COMPONENT> -<CONNECTOR type="115" id="901" > +<CONNECTOR type="115" id="922" > <cdparam x="411" y="128" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="null" /> -<P1 x="411" y="128" id="878" /> -<P2 x="353" y="221" id="898" /> +<P1 x="411" y="128" id="899" /> +<P2 x="353" y="221" id="919" /> <AutomaticDrawing data="true" /> </CONNECTOR> -<CONNECTOR type="115" id="902" > +<CONNECTOR type="115" id="923" > <cdparam x="579" y="176" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="null" /> -<P1 x="579" y="176" id="873" /> -<P2 x="738" y="220" id="893" /> +<P1 x="579" y="176" id="894" /> +<P2 x="738" y="220" id="914" /> <AutomaticDrawing data="true" /> </CONNECTOR> -<CONNECTOR type="115" id="903" > +<CONNECTOR type="115" id="924" > <cdparam x="543" y="341" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="null" /> -<P1 x="543" y="341" id="884" /> -<P2 x="543" y="528" id="880" /> +<P1 x="543" y="341" id="905" /> +<P2 x="543" y="528" id="901" /> <AutomaticDrawing data="true" /> </CONNECTOR> -<CONNECTOR type="115" id="904" > +<CONNECTOR type="115" id="925" > <cdparam x="553" y="289" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="null" /> -<P1 x="543" y="277" id="887" /> -<P2 x="543" y="301" id="883" /> +<P1 x="543" y="277" id="908" /> +<P2 x="543" y="301" id="904" /> <AutomaticDrawing data="true" /> </CONNECTOR> -<CONNECTOR type="115" id="905" > +<CONNECTOR type="115" id="926" > <cdparam x="403" y="70" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="null" /> -<P1 x="403" y="70" id="889" /> -<P2 x="411" y="98" id="876" /> +<P1 x="403" y="70" id="910" /> +<P2 x="411" y="98" id="897" /> <AutomaticDrawing data="true" /> </CONNECTOR> -<CONNECTOR type="115" id="906" > +<CONNECTOR type="115" id="927" > <cdparam x="456" y="117" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="null" /> -<P1 x="456" y="117" id="877" /> -<P2 x="539" y="151" id="871" /> +<P1 x="456" y="117" id="898" /> +<P2 x="539" y="151" id="892" /> <AutomaticDrawing data="true" /> </CONNECTOR> -<CONNECTOR type="115" id="907" > +<CONNECTOR type="115" id="928" > <cdparam x="539" y="216" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="null" /> -<P1 x="539" y="216" id="874" /> -<P2 x="543" y="247" id="886" /> +<P1 x="539" y="216" id="895" /> +<P2 x="543" y="247" id="907" /> <AutomaticDrawing data="true" /> </CONNECTOR> -<CONNECTOR type="115" id="908" > +<CONNECTOR type="115" id="929" > <cdparam x="738" y="314" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="null" /> -<P1 x="738" y="314" id="866" /> -<P2 x="738" y="501" id="891" /> +<P1 x="738" y="314" id="887" /> +<P2 x="738" y="501" id="912" /> <AutomaticDrawing data="true" /> </CONNECTOR> -<CONNECTOR type="115" id="909" > +<CONNECTOR type="115" id="930" > <cdparam x="748" y="262" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="null" /> -<P1 x="738" y="250" id="894" /> -<P2 x="738" y="274" id="865" /> +<P1 x="738" y="250" id="915" /> +<P2 x="738" y="274" id="886" /> <AutomaticDrawing data="true" /> </CONNECTOR> -<CONNECTOR type="115" id="910" > +<CONNECTOR type="115" id="931" > <cdparam x="353" y="315" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="null" /> -<P1 x="353" y="315" id="862" /> -<P2 x="353" y="502" id="896" /> +<P1 x="353" y="315" id="883" /> +<P2 x="353" y="502" id="917" /> <AutomaticDrawing data="true" /> </CONNECTOR> -<CONNECTOR type="115" id="911" > +<CONNECTOR type="115" id="932" > <cdparam x="363" y="263" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="null" /> -<P1 x="353" y="251" id="899" /> -<P2 x="353" y="275" id="861" /> +<P1 x="353" y="251" id="920" /> +<P2 x="353" y="275" id="882" /> <AutomaticDrawing data="true" /> </CONNECTOR> diff --git a/src/main/java/tmltranslator/TMLModeling.java b/src/main/java/tmltranslator/TMLModeling.java index 93dd82a64f00c9bd6b29cc1276af2272c0cdc6bd..e0c939c2387912f6a7c81a84c0619254af5ca3e4 100755 --- a/src/main/java/tmltranslator/TMLModeling.java +++ b/src/main/java/tmltranslator/TMLModeling.java @@ -55,6 +55,7 @@ import ui.TAttribute; import ui.tmlcompd.TMLCPrimitiveComponent; import ui.tmlcompd.TMLCPrimitivePort; import ui.TGComponent; +import ui.tmlcompd.TMLPragma; import java.util.*; @@ -72,7 +73,7 @@ public class TMLModeling<E> { private List<TMLChannel> channels; private List<TMLRequest> requests; private List<TMLEvent> events; - private List<String[]> pragmas; + private List<String> pragmas; private TMLElement correspondance[]; // Link to graphical components @@ -177,15 +178,12 @@ public class TMLModeling<E> { } private void init() { - /*tasks = new LinkedList(); - channels = new LinkedList(); - requests = new LinkedList(); - events = new LinkedList();*/ + tasks = new ArrayList<TMLTask>(); channels = new ArrayList<TMLChannel>(); events = new ArrayList<TMLEvent>(); requests = new ArrayList<TMLRequest>(); - pragmas = new ArrayList<String[]>(); + pragmas = new ArrayList<String>(); securityPatterns = new ArrayList<String>(); secPatterns = new ArrayList<SecurityPattern>(); @@ -199,7 +197,8 @@ public class TMLModeling<E> { public void addTask(TMLTask task) { tasks.add(task); } - public void addPragma(String[] s){ + + public void addPragma(String s){ pragmas.add(s); } public void addChannel(TMLChannel channel) { @@ -742,9 +741,10 @@ public class TMLModeling<E> { return attackers; } - public List<String[]> getPragmas(){ + public List<String> getPragmas(){ return pragmas; } + public Iterator<TMLTask> getListIteratorTasks() { return tasks.listIterator(); } @@ -2720,6 +2720,9 @@ public class TMLModeling<E> { for (TMLTask t: tasks) { s += t.toXML(); } + for(String p: pragmas) { + s += "<PRAGMA value=\"" + p + "\" />\n"; + } for (TMLChannel c: channels) { s += c.toXML(); } diff --git a/src/main/java/tmltranslator/TMLTextSpecification.java b/src/main/java/tmltranslator/TMLTextSpecification.java index 238388fe45c81acb8d33d6c9e046a1693b97cfdf..7d915caa9b0623f9fa9eebfc0fb65f3006677ba8 100755 --- a/src/main/java/tmltranslator/TMLTextSpecification.java +++ b/src/main/java/tmltranslator/TMLTextSpecification.java @@ -100,7 +100,7 @@ public class TMLTextSpecification<E> { "SELECTEVT", "CASE", "ENDSELECTEVT", "ENDCASE", "WRITE", "READ", "WAIT", "NOTIFY", "NOTIFIED", "NOTIFYREQUEST", "RAND", "CASERAND", "ENDRAND", "ENDCASERAND", "EXECI", "EXECC", "DELAY", "RANDOM", - "RANDOMSEQ", "ENDRANDOMSEQ", "SEQ", "ENDSEQ"}; + "RANDOMSEQ", "ENDRANDOMSEQ", "SEQ", "ENDSEQ", "PRAGMA"}; private String channeltypes[] = {"BRBW", "NBRNBW", "BRNBW"}; private String eventtypes[] = {"INF", "NIB", "NINB"}; @@ -222,10 +222,16 @@ public class TMLTextSpecification<E> { public String makeDeclarations(TMLModeling<E> tmlm) { int i; String sb = ""; - sb += "// TML Application - FORMAT 0.1" + CR; + sb += "// TML Application - FORMAT 0.2" + CR; sb += "// Application: " + title + CR; sb += "// Generated: " + new Date().toString() + CR2; + sb += "// PRAGMAS" + CR; + for(String s: tmlm.getPragmas()) { + sb += "PRAGMA " + s + CR; + } + sb += CR; + sb += "// Channels" + CR; for (TMLChannel ch : tmlm.getChannels()) { if (ch.isBasicChannel()) { @@ -809,6 +815,28 @@ public class TMLTextSpecification<E> { } } + // PRAGMA + if (isInstruction("PRAGMA", _split[0])) { + if (!inDec) { + error = "A pragma must not be declared outside of the declaration part of a TML specification"; + addError(0, _lineNb, 0, error); + return -1; + } + + if (_split.length < 2) { + error = "A pragma instruction must contain a pragma"; + addError(0, _lineNb, 0, error); + return -1; + } + + String pragma = ""; + for (int cpt=1; cpt<_split.length; cpt++) { + pragma += _split[cpt] + " "; + } + tmlm.addPragma(pragma); + } + + // CHANNEL if (isInstruction("CHANNEL", _split[0])) { if (!inDec) { diff --git a/src/main/java/ui/ActionPerformer.java b/src/main/java/ui/ActionPerformer.java index b8e5151dbf6e5c9b7cfba82aad2110c4623ca0e7..86b7c18c642b071fb28ebfcce1df24135717524e 100644 --- a/src/main/java/ui/ActionPerformer.java +++ b/src/main/java/ui/ActionPerformer.java @@ -330,6 +330,8 @@ public class ActionPerformer { mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.SAFETY_PRAGMA); } else if (command.equals(mgui.actions[TGUIAction.PERFORMANCE_PRAGMA].getActionCommand())) { mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.PERFORMANCE_PRAGMA); + } else if (command.equals(mgui.actions[TGUIAction.TML_PRAGMA].getActionCommand())) { + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.TML_PRAGMA); // AVATAR actions } else if (command.equals(mgui.actions[TGUIAction.ACT_AVATAR_SIM].getActionCommand())) { diff --git a/src/main/java/ui/GTMLModeling.java b/src/main/java/ui/GTMLModeling.java index 99d9c7fa9fab223fe6d2ed59cce68e3e340e0cee..60d35ace605c2abde5f84e5104e843d2d3e881a2 100644 --- a/src/main/java/ui/GTMLModeling.java +++ b/src/main/java/ui/GTMLModeling.java @@ -40,20 +40,9 @@ package ui; -import java.awt.Point; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Vector; - import avatartranslator.AvatarSpecification; import myutil.TraceManager; import tmltranslator.*; -import tmltranslator.HwNoC; import tmltranslator.modelcompiler.ArchUnitMEC; import tmltranslator.tmlcp.TMLCPElement; import tmltranslator.tmlcp.TMLSDAction; @@ -68,40 +57,17 @@ import ui.tmlcd.TMLChannelOperator; import ui.tmlcd.TMLEventOperator; import ui.tmlcd.TMLRequestOperator; import ui.tmlcd.TMLTaskOperator; -import ui.tmlcompd.TMLCChannelOutPort; -import ui.tmlcompd.TMLCFork; -import ui.tmlcompd.TMLCJoin; -import ui.tmlcompd.TMLCPath; -import ui.tmlcompd.TMLCPortConnector; -import ui.tmlcompd.TMLCPrimitiveComponent; -import ui.tmlcompd.TMLCPrimitivePort; -import ui.tmlcompd.TMLCRecordComponent; -import ui.tmldd.TMLArchiArtifact; -import ui.tmldd.TMLArchiBUSNode; -import ui.tmldd.TMLArchiBridgeNode; -import ui.tmldd.TMLArchiRouterNode; -import ui.tmldd.TMLArchiCPNode; -import ui.tmldd.TMLArchiCPUNode; -import ui.tmldd.TMLArchiCommunicationArtifact; -import ui.tmldd.TMLArchiCommunicationNode; -import ui.tmldd.TMLArchiConnectorNode; -import ui.tmldd.TMLArchiCrossbarNode; -import ui.tmldd.TMLArchiDMANode; -import ui.tmldd.TMLArchiEventArtifact; -import ui.tmldd.TMLArchiFPGANode; -import ui.tmldd.TMLArchiCAMSNode; -import ui.tmldd.TMLArchiFirewallNode; -import ui.tmldd.TMLArchiHWANode; -import ui.tmldd.TMLArchiKey; -import ui.tmldd.TMLArchiMemoryNode; -import ui.tmldd.TMLArchiNode; -import ui.tmldd.TMLArchiPortArtifact; -import ui.tmldd.TMLArchiVGMNNode; +import ui.tmlcompd.*; +import ui.tmldd.*; import ui.tmlsd.TGConnectorMessageTMLSD; import ui.tmlsd.TMLSDControllerInstance; import ui.tmlsd.TMLSDStorageInstance; import ui.tmlsd.TMLSDTransferInstance; +import java.awt.*; +import java.util.*; +import java.util.List; + /** * Class GTMLModeling * Use to translate graphical TML modeling to "tmlmodeling" @@ -119,6 +85,7 @@ public class GTMLModeling { private List<? extends TGComponent> tasksToTakeIntoAccount; private List<? extends TGComponent> componentsToTakeIntoAccount; private List<? extends TGComponent> components; + private List<? extends TGComponent> pragmas; private List<String> removedChannels, removedRequests, removedEvents; private static CorrespondanceTGElement listE; private Map<String, String> table; @@ -313,13 +280,11 @@ public class GTMLModeling { removedEvents = new LinkedList<String>(); try { - - addTMLTasks(); addTMLChannels(); addTMLEvents(); addTMLRequests(); - //addTMLPragmas(); + addTMLPragmas(); //TraceManager.addDev("At line 151"); generateTasksActivityDiagrams(); removeActionsWithDollars(); @@ -372,6 +337,8 @@ public class GTMLModeling { } } + pragmas = tmlcdp.tmlctdp.getPragmaList(); + removedChannels = new LinkedList<String>(); removedRequests = new LinkedList<String>(); removedEvents = new LinkedList<String>(); @@ -401,6 +368,9 @@ public class GTMLModeling { //TraceManager.addDev("Processing attacker"); processAttacker(); //TraceManager.addDev("Adding channels"); + + addTMLPragmas(); + addTMLCChannels(); //TraceManager.addDev("Adding events"); addTMLCEvents(); @@ -481,24 +451,33 @@ public class GTMLModeling { } // - // private void addTMLPragmas(){ - // TGComponent tgc; - // components = tmlap.tmlap.getComponentList(); - // ListIterator iterator = components.listIterator(); - // while(iterator.hasNext()) { - // tgc = (TGComponent)(iterator.next()); - // if (tgc instanceof TGCNote){ - // TGCNote note = (TGCNote) tgc; - // String[] vals = note.getValues(); - // for (String s: vals){ - // TraceManager.addDev("Val " + s); - // if (s.contains("#") && s.contains(" ")){ - // map.addPragma(s.split(" ")); - // } - // } - // } - // } - // } + private void addTMLPragmas() { + TGComponent tgc; + + TraceManager.addDev("ADDING PRAGMA"); + if(pragmas == null) return; + + Iterator<? extends TGComponent> iterator = pragmas.listIterator(); + while (iterator.hasNext()) { + tgc = iterator.next(); + if (tgc instanceof TMLPragma) { + TraceManager.addDev("TML PRAGMA FOUND"); + TMLPragma pragma = (TMLPragma) tgc; + String[] vals = pragma.getValues(); + TraceManager.addDev("PRAGMA Vals " + vals); + for (String s : vals) { + TraceManager.addDev("Val " + s); + s = s.trim(); + if (s.length() > 0) { + TraceManager.addDev("ADDING PRAGMA " + s); + tmlm.addPragma(s); + } + } + } + } + } + + private void addTMLTasks() throws MalformedTMLDesignException { TGComponent tgc; TMLTask tmlt; @@ -942,7 +921,6 @@ public class GTMLModeling { channel.setTasks(tt1, tt2); - // Complex channels are used only for transformation towards the simulator TMLPort tmlport1, tmlport2; tmlport1 = new TMLPort(port1.getPortName(), port1); @@ -1119,7 +1097,7 @@ public class GTMLModeling { if (!(alreadyConsidered.contains(port1))) { portstome = tmlcdp.tmlctdp.getPortsConnectedTo(port1, componentsToTakeIntoAccount); //TraceManager.addDev("Considering port1 = " +port1.getPortName() + " size of connecting ports:" + portstome.size()); - // Iterator<?> ite = portstome.listIterator(); + // Iterator<?> ite = portstome.listIterator(); /*while(ite.hasNext()) { TraceManager.addDev("port=" + ((TMLCPrimitivePort)(ite.next())).getPortName()); }*/ @@ -1697,16 +1675,16 @@ public class GTMLModeling { tmltask = iterator.next(); // Issue #69: Component disabling - ActivityDiagram2TMLTranslator.INSTANCE.generateTaskActivityDiagrams( tmltask, - checkingErrors, - warnings, - listE, - tmlm, - securityPatterns, - table, - removedChannels, - removedEvents, - removedRequests ); + ActivityDiagram2TMLTranslator.INSTANCE.generateTaskActivityDiagrams(tmltask, + checkingErrors, + warnings, + listE, + tmlm, + securityPatterns, + table, + removedChannels, + removedEvents, + removedRequests); // generateTaskActivityDiagrams(tmltask); } //TraceManager.addDev( "errors: " + checkingErrors.size() ); @@ -2632,7 +2610,7 @@ public class GTMLModeling { } // public SystemCAMSPanel<TGComponent> translateToSystemCAMS() { //ajout CD 04/07 FIXME - /*tous est a changé et a créé ici*/ + /*tous est a changé et a créé ici*/ // tmlm = new TMLModeling<>(true); // archi = new TMLArchitecture(); //filled by makeArchitecture // cams = new TMLSystemCAMS<>(tmlm, archi, false); @@ -2783,7 +2761,7 @@ public class GTMLModeling { TMLArchiCPUNode node; TMLArchiFPGANode fpgaNode; - TMLArchiCAMSNode camsnode; + TMLArchiCAMSNode camsnode; TMLArchiHWANode hwanode; TMLArchiBUSNode busnode; TMLArchiVGMNNode vgmnnode; @@ -2795,7 +2773,7 @@ public class GTMLModeling { TMLArchiRouterNode routerNode; HwCPU cpu; HwFPGA fpga; - HwCams cams; + HwCams cams; HwA hwa; HwBus bus; HwVGMN vgmn; @@ -2872,7 +2850,7 @@ public class GTMLModeling { } } - if (tgc instanceof TMLArchiCAMSNode) { + if (tgc instanceof TMLArchiCAMSNode) { camsnode = (TMLArchiCAMSNode) tgc; if (nameInUse(names, camsnode.getName())) { // Node with the same name @@ -2894,7 +2872,6 @@ public class GTMLModeling { } } - if (tgc instanceof TMLArchiHWANode) { hwanode = (TMLArchiHWANode) tgc; @@ -3215,7 +3192,7 @@ public class GTMLModeling { throws MalformedTMLDesignException { tmltranslator.tmlcp.TMLCPStart start; tmltranslator.tmlcp.TMLCPStop stop; - // tmltranslator.tmlcp.TMLCPJunction junction; + // tmltranslator.tmlcp.TMLCPJunction junction; tmltranslator.tmlcp.TMLCPJoin join; tmltranslator.tmlcp.TMLCPFork fork; tmltranslator.tmlcp.TMLCPChoice choice; @@ -3505,7 +3482,7 @@ public class GTMLModeling { Vector<Vector<TGComponent>> taskss = new Vector<Vector<TGComponent>>(); Vector<TMLCPrimitiveComponent> allcomp = new Vector<TMLCPrimitiveComponent>(); int index; - // System.out.println("nodes " + nodesToTakeIntoAccount); + // System.out.println("nodes " + nodesToTakeIntoAccount); if (nodesToTakeIntoAccount == null) { components = tmlap.tmlap.getComponentList(); } else { @@ -3857,7 +3834,7 @@ public class GTMLModeling { //TraceManager.addDev("3) Trying to get task named:" + s); task = tmlm.getTMLTaskByName(s); if (task != null) { - if (operationType != -1) { + if (operationType != -1) { task.addOperationType(operationType); } //TraceManager.addDev("Putting operation " + operationType + "/" + operationMEC + " to task " + task.getTaskName()); diff --git a/src/main/java/ui/TGComponentManager.java b/src/main/java/ui/TGComponentManager.java index 1e72d9e3b035c370f1a7eeb9990979faee17235e..d2c9ef19dd29d07a05f44b67ca57acf0fe55facf 100644 --- a/src/main/java/ui/TGComponentManager.java +++ b/src/main/java/ui/TGComponentManager.java @@ -180,6 +180,7 @@ public class TGComponentManager { public static final int INFO_PANEL = 304; public static final int AVATAR_FIREWALL = 306; public static final int PERFORMANCE_PRAGMA = 307; + public static final int TML_PRAGMA = 308; public static final int IOD_CHOICE = 501; public static final int IOD_START_STATE = 502; @@ -931,6 +932,9 @@ public class TGComponentManager { case PERFORMANCE_PRAGMA: tgc = new AvatarBDPerformancePragma(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); break; + case TML_PRAGMA: + tgc = new TMLPragma(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; case AVATAR_FIREWALL: tgc = new AvatarBDFirewall(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); break; diff --git a/src/main/java/ui/TGUIAction.java b/src/main/java/ui/TGUIAction.java index 5a7b509e8ae501a3c9f33afc94277ad6c5c0815a..5b9ef5cb0701a2d4345a096fb466056421f0ba87 100644 --- a/src/main/java/ui/TGUIAction.java +++ b/src/main/java/ui/TGUIAction.java @@ -598,6 +598,7 @@ public class TGUIAction extends AbstractAction { public static final int SAFETY_PRAGMA = 425; public static final int PERFORMANCE_PRAGMA = 438; public static final int AVATAR_FIREWALL = 437; + public static final int TML_PRAGMA = 521; public static final int ACT_CUT = 44; public static final int ACT_COPY = 45; @@ -675,7 +676,7 @@ public class TGUIAction extends AbstractAction { public static final int MOVE_ENABLED = 463; public static final int FIRST_DIAGRAM = 464; - public static final int NB_ACTION = 521; + public static final int NB_ACTION = 522; private static final TAction [] actions = new TAction[NB_ACTION]; @@ -993,6 +994,7 @@ public class TGUIAction extends AbstractAction { actions[UML_NOTE] = new TAction("edit-note", "Add a note to a diagram", IconManager.imgic320, IconManager.imgic321, "Add a comment", "Add a comment to the currently opened TTool diagram", 0); actions[PRAGMA] = new TAction("pragma", "Security pragmas", IconManager.imgic6000, IconManager.imgic6001, "Security pragmas", "Add security pragmas to the currently opened TTool diagram", 0); actions[SAFETY_PRAGMA] = new TAction("safety_pragma", "Add a safety (UPPAAL) property to a diagram", IconManager.imgic6002, IconManager.imgic6003, "Safety property (UPPAAL)", "Add a safety (UPPAAL) property to the currently opened TTool diagram", 0); + actions[TML_PRAGMA] = new TAction("tml_pragma", "Add a TML pragma", IconManager.imgic6006, IconManager.imgic6007,"TML pragma", "Add a TML pragma to the currently opened TTool diagram", 0); actions[PERFORMANCE_PRAGMA] = new TAction("performance_pragma", "Add a performance property to a diagram", IconManager.imgic6004, IconManager.imgic6005, "Performance property", "Add a performance property to the currently opened TTool diagram", 0); actions[AVATAR_FIREWALL] = new TAction("avatar_firewall", "Add an avatar firewall to a diagram", IconManager.imgic7001, IconManager.imgic7001, "Add an avatar firewall", "Add an avatar firewall to the currently opened TTool diagram", 0); diff --git a/src/main/java/ui/tmlcompd/TMLComponentTaskDiagramPanel.java b/src/main/java/ui/tmlcompd/TMLComponentTaskDiagramPanel.java index df9aa63dd80c22cfab7316dd35256262fa4da3df..3c410b2478ff76e7e00d790355c84701234b3cf4 100755 --- a/src/main/java/ui/tmlcompd/TMLComponentTaskDiagramPanel.java +++ b/src/main/java/ui/tmlcompd/TMLComponentTaskDiagramPanel.java @@ -285,6 +285,23 @@ public class TMLComponentTaskDiagramPanel extends TDiagramPanel implements TDPWi return ll; } + public List<TMLPragma> getPragmaList() { + List<TMLPragma> ll = new LinkedList<TMLPragma>(); + TGComponent tgc; + + Iterator<TGComponent> iterator = componentList.listIterator(); + + while (iterator.hasNext()) { + tgc = iterator.next(); + + if (tgc instanceof TMLPragma) { + ll.add((TMLPragma) tgc); + } + } + + return ll; + } + public List<TMLCPrimitiveComponent> getPrimitiveComponentList() { List<TMLCPrimitiveComponent> ll = new LinkedList<TMLCPrimitiveComponent>(); TGComponent tgc; diff --git a/src/main/java/ui/tmlcompd/TMLComponentTaskDiagramToolBar.java b/src/main/java/ui/tmlcompd/TMLComponentTaskDiagramToolBar.java index 9ec8239c69fa4ba1e895d35ae23f25f1ad5331ae..06896e70ee0758881de6b11c260ad6eee0b11198 100755 --- a/src/main/java/ui/tmlcompd/TMLComponentTaskDiagramToolBar.java +++ b/src/main/java/ui/tmlcompd/TMLComponentTaskDiagramToolBar.java @@ -68,6 +68,7 @@ public class TMLComponentTaskDiagramToolBar extends TToolBar { mgui.actions[TGUIAction.TMLCTD_EDIT].setEnabled(b); mgui.actions[TGUIAction.UML_NOTE].setEnabled(b); + mgui.actions[TGUIAction.TML_PRAGMA].setEnabled(b); mgui.actions[TGUIAction.TMLCTD_CCOMPONENT].setEnabled(b); mgui.actions[TGUIAction.TMLCTD_CREMOTECOMPONENT].setEnabled(b); mgui.actions[TGUIAction.TMLCTD_CPORT].setEnabled(b); @@ -87,16 +88,7 @@ public class TMLComponentTaskDiagramToolBar extends TToolBar { mgui.actions[TGUIAction.ACT_SHOW_ZOOM].setEnabled(b); mgui.updateZoomInfo(); - - /*mgui.actions[TGUIAction.TMLTD_TASK].setEnabled(b); - mgui.actions[TGUIAction.TMLTD_CHANNEL].setEnabled(b); - mgui.actions[TGUIAction.TMLTD_EVENT].setEnabled(b); - mgui.actions[TGUIAction.TMLTD_REQ].setEnabled(b); - mgui.actions[TGUIAction.TMLTD_ASSOC].setEnabled(b); - mgui.actions[TGUIAction.TMLTD_CONNECTOR].setEnabled(b); - mgui.actions[TGUIAction.ACT_TOGGLE_CHANNELS].setEnabled(b); - mgui.actions[TGUIAction.ACT_TOGGLE_EVENTS].setEnabled(b); - mgui.actions[TGUIAction.ACT_TOGGLE_REQUESTS].setEnabled(b);*/ + } protected void setButtons() { @@ -110,6 +102,11 @@ public class TMLComponentTaskDiagramToolBar extends TToolBar { button = this.add(mgui.actions[TGUIAction.UML_NOTE]); button.addMouseListener(mgui.mouseHandler); + this.addSeparator(); + + button = this.add(mgui.actions[TGUIAction.TML_PRAGMA]); + button.addMouseListener(mgui.mouseHandler); + this.addSeparator(); button = this.add(mgui.actions[TGUIAction.TMLCTD_CCOMPONENT]); diff --git a/src/main/java/ui/tmlcompd/TMLPragma.java b/src/main/java/ui/tmlcompd/TMLPragma.java new file mode 100644 index 0000000000000000000000000000000000000000..fa1efd73674fc72d4c1060382e0f90ee851b0d5c --- /dev/null +++ b/src/main/java/ui/tmlcompd/TMLPragma.java @@ -0,0 +1,335 @@ +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ + +package ui.tmlcompd; + +import myutil.Conversion; +import myutil.GraphicLib; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import ui.*; +import ui.util.IconManager; +import ui.window.JDialogTMLPragma; + +import javax.swing.*; + +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; + +/** + * Class TMLPragma + * Like a Note but with Pragma + * Creation: 22/10/2019 + * + * @author Ludovic APVRILLE + * @version 1.0 22/10/2019 + */ +public class TMLPragma extends TGCScalableWithoutInternalComponent { + + protected String[] values; + protected List<String> properties; + protected int textX = 10; + protected int textY = 5; + //protected int marginY = 20; + protected int marginX = 10; + protected int limit = 15; + public List<String> syntaxErrors; + protected Graphics myg; + + protected Color myColor; + + private Font myFont;//, myFontB; + // private int maxFontSize = 30; +// private int minFontSize = 4; + private int currentFontSize = -1; + // private final String[] pPragma = {"A[]", "A<>", "E[]", "E<>"}; + //public Map<String, String> verifMap = new HashMap<String, String>(); + + protected Graphics graphics; + + public TMLPragma(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { + super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); + width = 200; + height = 30; + minWidth = 80; + minHeight = 10; + properties = new LinkedList<String>(); + oldScaleFactor = tdp.getZoom(); + + nbConnectingPoint = 0; + //addTGConnectingPointsComment(); + int len = makeTGConnectingPointsComment(16); + int decw = 0; + int dech = 0; + for (int i = 0; i < 2; i++) { + connectingPoint[len] = new TGConnectingPointComment(this, 0, 0, true, true, 0.0 + decw, 0.0 + dech); + connectingPoint[len + 1] = new TGConnectingPointComment(this, 0, 0, true, true, 0.5 + decw, 0.0 + dech); + connectingPoint[len + 2] = new TGConnectingPointComment(this, 0, 0, true, true, 1.0 + decw, 0.0 + dech); + connectingPoint[len + 3] = new TGConnectingPointComment(this, 0, 0, true, true, 0.0 + decw, 0.5 + dech); + connectingPoint[len + 4] = new TGConnectingPointComment(this, 0, 0, true, true, 1.0 + decw, 0.5 + dech); + connectingPoint[len + 5] = new TGConnectingPointComment(this, 0, 0, true, true, 0.0 + decw, 1.0 + dech); + connectingPoint[len + 6] = new TGConnectingPointComment(this, 0, 0, true, true, 0.5 + decw, 1.0 + dech); + connectingPoint[len + 7] = new TGConnectingPointComment(this, 0, 0, true, true, 0.9 + decw, 1.0 + dech); + len += 8; + } + + moveable = true; + editable = true; + removable = true; + + name = "Pragma"; + syntaxErrors = new ArrayList<String>(); + value = ""; + + myImageIcon = IconManager.imgic6000; + } + + public String[] getValues() { + return values; + } + + public List<String> getProperties() { + return properties; + } + + @Override + public void internalDrawing(Graphics g) { + Font f = g.getFont(); + Font fold = f; + + /*if (!tdp.isScaled()) { + graphics = g; + }*/ + + if (((rescaled) && (!tdp.isScaled())) || myFont == null) { + currentFontSize = tdp.getFontSize() + 1; + // + // myFont = f.deriveFont((float)currentFontSize); + //myFontB = myFont.deriveFont(Font.BOLD); + + if (rescaled) { + rescaled = false; + } + } + + if (values == null) { + makeValue(); + } + + // int h = g.getFontMetrics().getHeight(); + Color c = g.getColor(); + + if (!(this.tdp.isScaled())) { + int desiredWidth = minWidth; + desiredWidth = Math.max(desiredWidth, 2 * g.getFontMetrics().stringWidth("Performance Pragma") + marginX + textX); + + for (int i = 0; i < values.length; i++) { + desiredWidth = Math.max(desiredWidth, g.getFontMetrics().stringWidth(values[i]) + marginX + textX); + } + + int desiredHeight = (properties.size() + 2) * currentFontSize + textY + 1; + + //TraceManager.addDev("resize: " + desiredWidth + "," + desiredHeight); + + if ((desiredWidth != width) || (desiredHeight != height)) { + resize(desiredWidth, desiredHeight); + } + } + + g.drawLine(x, y, x + width, y); + g.drawLine(x, y, x, y + height); + g.drawLine(x, y + height, x + width - limit, y + height); + g.drawLine(x + width, y, x + width, y + height - limit); + + g.setColor(ColorManager.PRAGMA_BG); + int[] px1 = {x + 1, x + width, x + width, x + width - limit, x + 1}; + int[] py1 = {y + 1, y + 1, y + height - limit, y + height, y + height}; + g.fillPolygon(px1, py1, 5); + g.setColor(c); + + int[] px = {x + width, x + width - 4, x + width - 10, x + width - limit}; + int[] py = {y + height - limit, y + height - limit + 3, y + height - limit + 2, y + height}; + g.drawPolygon(px, py, 4); + + if (g.getColor() == ColorManager.NORMAL_0) { + g.setColor(ColorManager.PRAGMA); + } + g.fillPolygon(px, py, 4); + + g.setColor(Color.black); + + int i = 1; + Font heading = new Font("heading", Font.BOLD, 14); + g.setFont(heading); + g.drawString("Pragmas", x + textX, y + textY + currentFontSize); + g.setFont(fold); + for (String s : properties) { + g.drawString(s, x + textX, y + textY + (i + 1) * currentFontSize); + //drawVerification(s, g, x + textX, y + textY + (i + 1) * currentFontSize); + if (syntaxErrors.contains(s)) { + Color ctmp = g.getColor(); + g.setColor(Color.red); + g.drawLine(x + textX / 2, y + textY * 3 / 2 + i * currentFontSize, x + width - textX / 2, y + textY * 3 / 2 + (i + 1) * currentFontSize); + g.drawLine(x + width - textX / 2, y + textY * 3 / 2 + i * currentFontSize, x + textX / 2, y + textY * 3 / 2 + (i + 1) * currentFontSize); + g.setColor(ctmp); + } + i++; + } + +/* for (int i = 0; i<values.length; i++) { + //TraceManager.addDev("x+texX=" + (x + textX) + " y+textY=" + y + textY + i* h + ": " + values[i]); + g.drawString(values[i], x + textX, y + textY + (i+1)* currentFontSize); + } +*/ + g.setColor(c); + + } + + private void makeValue() { + values = Conversion.wrapText(value); + properties.clear(); + for (String s : values) { + if (s.isEmpty()) { + //Ignore + } else { + //Warning Message + properties.add(s); + } + } + //checkMySize(); + } + + + @Override + public boolean editOndoubleClick(JFrame frame) { + String oldValue = value; + + JDialogTMLPragma jdp = new JDialogTMLPragma(frame, "Setting the pragmas", value); + //jdn.setLocation(200, 150); + GraphicLib.centerOnParent(jdp); + + jdp.setVisible(true); // blocked until dialog has been closed + + String s = jdp.getText(); + if ((s != null) && (s.length() > 0) && (!s.equals(oldValue))) { + //String tmp = s; + setValue(s); + makeValue(); + return true; + } + return false; + } + + public TGComponent isOnMe(int x1, int y1) { + if (GraphicLib.isInRectangle(x1, y1, x, y, width, height)) { + return this; + } + return null; + } + + @Override + public void rescale(double scaleFactor) { + values = null; + + super.rescale(scaleFactor); + } + + @Override + public int getType() { + return TGComponentManager.TML_PRAGMA; + } + + @Override + protected String translateExtraParam() { + if (values == null) { + makeValue(); + } + StringBuffer sb = new StringBuffer("<extraparam>\n"); + for (int i = 0; i < values.length; i++) { + sb.append("<Line value=\""); + sb.append(GTURTLEModeling.transformString(values[i])); + sb.append("\" />\n"); + } + sb.append("</extraparam>\n"); + return new String(sb); + } + + + @Override + public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException { + value = ""; + values = null; + try { + NodeList nli; + Node n1, n2; + Element elt; + String s; + + for (int i = 0; i < nl.getLength(); i++) { + n1 = nl.item(i); + // + if (n1.getNodeType() == Node.ELEMENT_NODE) { + nli = n1.getChildNodes(); + for (int j = 0; j < nli.getLength(); j++) { + n2 = nli.item(j); + // + if (n2.getNodeType() == Node.ELEMENT_NODE) { + elt = (Element) n2; + if (elt.getTagName().equals("Line")) { + // + s = elt.getAttribute("value"); + if (s.equals("null")) { + s = ""; + } + value += GTURTLEModeling.decodeString(s) + "\n"; + } + } + } + } + } + + } catch (Exception e) { + throw new MalformedModelingException(); + } + } +} diff --git a/src/main/java/ui/util/IconManager.java b/src/main/java/ui/util/IconManager.java index 0be85756176b46ef2a2d33eae1409cff6b3db4a1..b50c51f237b69ce8de5e02cf6975f2eaceefaa15 100755 --- a/src/main/java/ui/util/IconManager.java +++ b/src/main/java/ui/util/IconManager.java @@ -166,6 +166,7 @@ public class IconManager { //pragmas public static ImageIcon imgic6000, imgic6001, imgic6002, imgic6003, imgic6004, imgic6005; + public static ImageIcon imgic6006, imgic6007; //Security public static ImageIcon imgic7000, imgic7001; @@ -658,6 +659,8 @@ public class IconManager { private static String icon6003 = "toolbarButtonGraphics/general/safepragma24.gif"; private static String icon6004 = "toolbarButtonGraphics/general/performancepragma16.gif"; private static String icon6005 = "toolbarButtonGraphics/general/performancepragma24.gif"; + private static String icon6006 = "toolbarButtonGraphics/general/tmlpragma16.gif"; + private static String icon6007 = "toolbarButtonGraphics/general/tmlpragma24.gif"; //Security stuff private static String icon7000 = "tmlcrypto.gif"; @@ -1185,6 +1188,8 @@ public class IconManager { imgic6003 = getIcon(icon6003); imgic6004 = getIcon(icon6004); imgic6005 = getIcon(icon6005); + imgic6006 = getIcon(icon6006); + imgic6007 = getIcon(icon6007); imgic7000 = getIcon(icon7000); diff --git a/src/main/java/ui/window/JDialogTMLPragma.java b/src/main/java/ui/window/JDialogTMLPragma.java new file mode 100644 index 0000000000000000000000000000000000000000..14dbce8913f5059389aea53c271686e738e50780 --- /dev/null +++ b/src/main/java/ui/window/JDialogTMLPragma.java @@ -0,0 +1,416 @@ +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ + +package ui.window; + +import ui.util.IconManager; + +import javax.swing.*; +import javax.swing.text.BadLocationException; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.ComponentOrientation; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Frame; +import java.awt.Insets; +import java.awt.Point; +import java.awt.event.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Class JDialogPragma + * Dialog for entering a note + * Creation: 06/12/2003 + * + * @author Ludovic APVRILLE, Letitia LI + * @version 1.0 06/12/2003 + */ +public class JDialogTMLPragma extends JDialogBase implements ActionListener { + + protected String text; + + //components + protected JTextArea textarea; + protected JButton close; + protected JButton cancel; + protected JMenuBar menuBar; + protected JMenu help; + protected JPopupMenu helpPopup; + //public Map<String, List<String>> blockAttributeMap = new HashMap<String, List<String>>(); + + /* + * Creates new form + */ + public JDialogTMLPragma(Frame f, String title, String _text) { + super(f, title, true); + text = _text; + + initComponents(); + pack(); + } + //Suggestion Panel code from: http://stackoverflow.com/questions/10873748/how-to-show-autocomplete-as-i-type-in-jtextarea + + public class SuggestionPanel { + //Form list of all blocks + //For each block, create a list of all states and signals + + private JList<String> list; + private JPopupMenu popupMenu; + private String subWord; + private final int insertionPosition; + + public SuggestionPanel(JTextArea textarea, int position, String subWord, Point location, int linePosition) { + this.insertionPosition = position; + this.subWord = subWord; + popupMenu = new JPopupMenu(); + popupMenu.removeAll(); + popupMenu.setOpaque(false); + popupMenu.setBorder(null); + + popupMenu.add(list = createSuggestionList(linePosition, position, subWord), BorderLayout.CENTER); + //Show popupMenu only if there are matching suggestions + if (list.getModel().getSize() > 0) { + popupMenu.show(textarea, location.x, textarea.getBaseline(0, 0) + location.y); + } + } + + public void hide() { + popupMenu.setVisible(false); + if (suggestion == this) { + suggestion = null; + } + } + + private JList<String> createSuggestionList(int linePosition, final int position, final String subWord) { + List<String> matches = new ArrayList<String>(); + if (linePosition < 6) { + matches.add("PERIOD "); + } + String[] data = new String[matches.size()]; + data = matches.toArray(data); + JList<String> list = new JList<>(data); + list.setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY, 1)); + list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + list.setSelectedIndex(0); + list.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + if (e.getClickCount() == 2) { + insertSelection(); + } + } + }); + + return list; + } + + public boolean insertSelection() { + //Note that it will not add if the selection will not fit on the current line + if (!popupMenu.isVisible()) { + return false; + } + if (list.getSelectedValue() != null) { + try { + final String selectedSuggestion = (list.getSelectedValue()).substring(subWord.length()); + textarea.getDocument().insertString(insertionPosition, selectedSuggestion, null); + return true; + } catch (BadLocationException e1) { + e1.printStackTrace(); + } + hideSuggestion(); + } + return false; + } + + public void moveUp() { + int index = Math.max(list.getSelectedIndex() - 1, 0); + selectIndex(index); + } + + public void moveDown() { + int index = Math.min(list.getSelectedIndex() + 1, list.getModel().getSize() - 1); + selectIndex(index); + } + + private void selectIndex(int index) { + final int position = textarea.getCaretPosition(); + list.setSelectedIndex(index); + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + textarea.setCaretPosition(position); + } + }); + } + } + + private SuggestionPanel suggestion; + + protected void showSuggestionLater() { + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + showSuggestion(); + } + + }); + } + + protected void showSuggestion() { + hideSuggestion(); + final int position = textarea.getCaretPosition(); + Point location; + try { + location = textarea.modelToView(position).getLocation(); + } catch (BadLocationException e2) { + e2.printStackTrace(); + return; + } + String text = textarea.getText(); + int start = Math.max(0, position - 1); + while (start > 0) { + if (!text.substring(start, start + 1).equals("(") && !text.substring(start, start + 1).equals(")") && !text.substring(start, start + 1).equals(",")) { + start--; + } else { + start++; + break; + } + } + if (start > position) { + return; + } + + final String subWord = text.substring(start, position); + + if (subWord.length() < 1) { + return; + } + start = Math.max(0, position - 1); + while (start > 0) { + //Find previous new line position + if (!String.valueOf(text.charAt(start)).matches(".")) { + break; + } else { + start--; + } + } + suggestion = new SuggestionPanel(textarea, position, subWord, location, position - start - 1); + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + textarea.requestFocusInWindow(); + } + }); + } + + private void hideSuggestion() { + if (suggestion != null) { + suggestion.hide(); + } + } + + protected void initComponents() { + Container c = getContentPane(); + Font f = new Font("Helvetica", Font.PLAIN, 14); + setFont(f); + c.setLayout(new BorderLayout()); + //setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + + helpPopup = new JPopupMenu(); + //JTextArea jft = new JTextArea("UPPAAL pragmas"); + //helpPopup.add(jft); + JLabel t = new JLabel(""); + JLabel header = new JLabel(" TML Pragma"); + Font headerFont = new Font(t.getFont().getName(), Font.BOLD, t.getFont().getSize() + 2); + header.setFont(headerFont); + helpPopup.add(header); + //Text + helpPopup.add(new JLabel(" TML Pragmas allow us to set general properties: ")); + helpPopup.add(new JLabel(" - the period of the whole application")); + + JLabel example = new JLabel(" Examples:"); + example.setFont(headerFont); + helpPopup.add(example); + + Font exFont = new Font(t.getFont().getName(), Font.ITALIC, t.getFont().getSize()); + JLabel t1 = new JLabel(" PERIOD 50ms"); + t1.setFont(exFont); + helpPopup.add(t1); + + JLabel t2 = new JLabel(" PERIOD 10000cycles"); + t2.setFont(exFont); + helpPopup.add(t2); + + helpPopup.add(new JLabel(" PERIOD 10000ns")); + helpPopup.setPreferredSize(new Dimension(400, 150)); + + textarea = new JTextArea(); + + textarea.setEditable(true); + textarea.setMargin(new Insets(10, 10, 10, 10)); + textarea.setTabSize(3); + textarea.append(text); + textarea.setFont(new Font("times", Font.PLAIN, 12)); + JMenuBar menuBar = new JMenuBar(); + menuBar.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); + help = new JMenu("?"); + menuBar.add(help); + setJMenuBar(menuBar); + textarea.addKeyListener(new KeyListener() { + @Override + public void keyTyped(KeyEvent e) { + if (e.getKeyChar() == KeyEvent.VK_ENTER || e.getKeyChar() == KeyEvent.VK_TAB) { + if (suggestion != null) { + if (suggestion.insertSelection()) { + e.consume(); + final int position = textarea.getCaretPosition(); + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + try { + textarea.getDocument().remove(position - 1, 1); + } catch (BadLocationException e) { + e.printStackTrace(); + } + } + }); + } + } + } + } + + @Override + public void keyReleased(KeyEvent e) { + if (e.getKeyCode() == KeyEvent.VK_DOWN && suggestion != null) { + suggestion.moveDown(); + } else if (e.getKeyCode() == KeyEvent.VK_UP && suggestion != null) { + suggestion.moveUp(); + } else if (Character.isWhitespace(e.getKeyChar())) { + hideSuggestion(); + } else if (Character.isLetter(e.getKeyChar())) { + showSuggestionLater(); + } + } + + @Override + public void keyPressed(KeyEvent e) { + if (e.getKeyCode() == KeyEvent.VK_DOWN && suggestion != null) { + e.consume(); + } else if (e.getKeyCode() == KeyEvent.VK_UP && suggestion != null) { + e.consume(); + } + } + }); + + + JScrollPane jsp = new JScrollPane(textarea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); + jsp.setPreferredSize(new Dimension(300, 300)); + c.add(jsp, BorderLayout.CENTER); + + + close = new JButton("Ok", IconManager.imgic25); + cancel = new JButton("Cancel", IconManager.imgic27); + + help.setPreferredSize(new Dimension(30, 30)); + + close.setPreferredSize(new Dimension(150, 30)); + cancel.setPreferredSize(new Dimension(150, 30)); + + close.addActionListener(this); + cancel.addActionListener(this); + help.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + help(); + } + }); + + helpPopup.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "closeJlabel"); + helpPopup.getActionMap().put("closeJlabel", new AbstractAction() { + @Override + public void actionPerformed(ActionEvent e) { + helpPopup.setVisible(false); + } + }); + + JPanel jp = new JPanel(); + jp.add(cancel); + jp.add(close); + + c.add(jp, BorderLayout.SOUTH); + + } + + public void actionPerformed(ActionEvent evt) { + //String command = evt.getActionCommand(); + + // Compare the action command to the known actions. + if (evt.getSource() == cancel) { + cancel(); + } else if (evt.getSource() == close) { + close(); + } + } + + public void cancel() { + dispose(); + } + + public void close() { + text = textarea.getText(); + dispose(); + } + + public void help() { + if (!helpPopup.isVisible()) { + helpPopup.show(help, 20, 20); + } else { + helpPopup.setVisible(false); + } + } + + public String getText() { + return text; + } +} diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/tmlpragma16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/tmlpragma16.gif new file mode 100755 index 0000000000000000000000000000000000000000..da2072099059dffc74a9aa0610854d5acdc66324 Binary files /dev/null and b/src/main/resources/ui/util/toolbarButtonGraphics/general/tmlpragma16.gif differ diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/tmlpragma24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/tmlpragma24.gif new file mode 100755 index 0000000000000000000000000000000000000000..0fb7ffb93507bf7aa0ddb6be226a4c60762d97d2 Binary files /dev/null and b/src/main/resources/ui/util/toolbarButtonGraphics/general/tmlpragma24.gif differ