diff --git a/modeling/MicroWaveOven_SimpleAsynchronous.xml b/modeling/MicroWaveOven_SimpleAsynchronous.xml index a22b62c91e60d4fb6fd9c75762c4b31e5fb76b7e..8a72a14aa40ebe1f60d8ea06c29bbe471aff1bcb 100644 --- a/modeling/MicroWaveOven_SimpleAsynchronous.xml +++ b/modeling/MicroWaveOven_SimpleAsynchronous.xml @@ -2861,12 +2861,48 @@ <Modeling type="ADD" nameTab="Avatar Deployment" > <ADDDiagramPanel name="Avatar Deployment Diagram" minX="10" maxX="1400" minY="10" maxY="900" attributes="0" masterClockFrequency="200" > -<COMPONENT type="5361" id="1312" > -<cdparam x="423" y="511" /> -<sizeparam width="200" height="200" minWidth="100" minHeight="50" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<COMPONENT type="5355" id="1321" > +<cdparam x="580" y="601" /> +<sizeparam width="674" height="210" minWidth="100" minHeight="35" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="Memory1" value="name" /> +<TGConnectingPoint num="0" id="1297" /> +<TGConnectingPoint num="1" id="1298" /> +<TGConnectingPoint num="2" id="1299" /> +<TGConnectingPoint num="3" id="1300" /> +<TGConnectingPoint num="4" id="1301" /> +<TGConnectingPoint num="5" id="1302" /> +<TGConnectingPoint num="6" id="1303" /> +<TGConnectingPoint num="7" id="1304" /> +<TGConnectingPoint num="8" id="1305" /> +<TGConnectingPoint num="9" id="1306" /> +<TGConnectingPoint num="10" id="1307" /> +<TGConnectingPoint num="11" id="1308" /> +<TGConnectingPoint num="12" id="1309" /> +<TGConnectingPoint num="13" id="1310" /> +<TGConnectingPoint num="14" id="1311" /> +<TGConnectingPoint num="15" id="1312" /> +<TGConnectingPoint num="16" id="1313" /> +<TGConnectingPoint num="17" id="1314" /> +<TGConnectingPoint num="18" id="1315" /> +<TGConnectingPoint num="19" id="1316" /> +<TGConnectingPoint num="20" id="1317" /> +<TGConnectingPoint num="21" id="1318" /> +<TGConnectingPoint num="22" id="1319" /> +<TGConnectingPoint num="23" id="1320" /> +<extraparam> +<info stereotype="RAM" nodeName="Memory1" /> +<attributes byteDataSize="4" index="0" /> +</extraparam> +</COMPONENT> +<SUBCOMPONENT type="5362" id="1296" > +<father id="1321" num="0" /> +<cdparam x="655" y="661" /> +<sizeparam width="422" height="40" minWidth="75" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> -<infoparam name="Timer0" value="name" /> +<cdrectangleparam minX="0" maxX="252" minY="0" maxY="170" /> +<infoparam name="TGComponent" value="Design::ControlPanel/in LEDOn() #--# Controller/out startCooking()" /> <TGConnectingPoint num="0" id="1288" /> <TGConnectingPoint num="1" id="1289" /> <TGConnectingPoint num="2" id="1290" /> @@ -2875,260 +2911,317 @@ <TGConnectingPoint num="5" id="1293" /> <TGConnectingPoint num="6" id="1294" /> <TGConnectingPoint num="7" id="1295" /> -<TGConnectingPoint num="8" id="1296" /> -<TGConnectingPoint num="9" id="1297" /> -<TGConnectingPoint num="10" id="1298" /> -<TGConnectingPoint num="11" id="1299" /> -<TGConnectingPoint num="12" id="1300" /> -<TGConnectingPoint num="13" id="1301" /> -<TGConnectingPoint num="14" id="1302" /> -<TGConnectingPoint num="15" id="1303" /> -<TGConnectingPoint num="16" id="1304" /> -<TGConnectingPoint num="17" id="1305" /> -<TGConnectingPoint num="18" id="1306" /> -<TGConnectingPoint num="19" id="1307" /> -<TGConnectingPoint num="20" id="1308" /> -<TGConnectingPoint num="21" id="1309" /> -<TGConnectingPoint num="22" id="1310" /> -<TGConnectingPoint num="23" id="1311" /> +<extraparam> +<info value="Design::ControlPanel/in LEDOn() #--# Controller/out startCooking()" channelName="ControlPanel/in LEDOn() #--# Controller/out startCooking()" referenceDiagram="Design" /> +</extraparam> +</SUBCOMPONENT> + +<COMPONENT type="5361" id="1346" > +<cdparam x="326" y="475" /> +<sizeparam width="200" height="200" minWidth="100" minHeight="50" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="Timer0" value="name" /> +<TGConnectingPoint num="0" id="1322" /> +<TGConnectingPoint num="1" id="1323" /> +<TGConnectingPoint num="2" id="1324" /> +<TGConnectingPoint num="3" id="1325" /> +<TGConnectingPoint num="4" id="1326" /> +<TGConnectingPoint num="5" id="1327" /> +<TGConnectingPoint num="6" id="1328" /> +<TGConnectingPoint num="7" id="1329" /> +<TGConnectingPoint num="8" id="1330" /> +<TGConnectingPoint num="9" id="1331" /> +<TGConnectingPoint num="10" id="1332" /> +<TGConnectingPoint num="11" id="1333" /> +<TGConnectingPoint num="12" id="1334" /> +<TGConnectingPoint num="13" id="1335" /> +<TGConnectingPoint num="14" id="1336" /> +<TGConnectingPoint num="15" id="1337" /> +<TGConnectingPoint num="16" id="1338" /> +<TGConnectingPoint num="17" id="1339" /> +<TGConnectingPoint num="18" id="1340" /> +<TGConnectingPoint num="19" id="1341" /> +<TGConnectingPoint num="20" id="1342" /> +<TGConnectingPoint num="21" id="1343" /> +<TGConnectingPoint num="22" id="1344" /> +<TGConnectingPoint num="23" id="1345" /> <extraparam> <info stereotype="Timer" nodeName="Timer0" /> <attributes index="1" nIrq="2" /> </extraparam> </COMPONENT> -<COMPONENT type="5360" id="1337" > +<COMPONENT type="5360" id="1371" > <cdparam x="909" y="102" /> <sizeparam width="200" height="200" minWidth="100" minHeight="50" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="Copro0" value="name" /> -<TGConnectingPoint num="0" id="1313" /> -<TGConnectingPoint num="1" id="1314" /> -<TGConnectingPoint num="2" id="1315" /> -<TGConnectingPoint num="3" id="1316" /> -<TGConnectingPoint num="4" id="1317" /> -<TGConnectingPoint num="5" id="1318" /> -<TGConnectingPoint num="6" id="1319" /> -<TGConnectingPoint num="7" id="1320" /> -<TGConnectingPoint num="8" id="1321" /> -<TGConnectingPoint num="9" id="1322" /> -<TGConnectingPoint num="10" id="1323" /> -<TGConnectingPoint num="11" id="1324" /> -<TGConnectingPoint num="12" id="1325" /> -<TGConnectingPoint num="13" id="1326" /> -<TGConnectingPoint num="14" id="1327" /> -<TGConnectingPoint num="15" id="1328" /> -<TGConnectingPoint num="16" id="1329" /> -<TGConnectingPoint num="17" id="1330" /> -<TGConnectingPoint num="18" id="1331" /> -<TGConnectingPoint num="19" id="1332" /> -<TGConnectingPoint num="20" id="1333" /> -<TGConnectingPoint num="21" id="1334" /> -<TGConnectingPoint num="22" id="1335" /> -<TGConnectingPoint num="23" id="1336" /> +<TGConnectingPoint num="0" id="1347" /> +<TGConnectingPoint num="1" id="1348" /> +<TGConnectingPoint num="2" id="1349" /> +<TGConnectingPoint num="3" id="1350" /> +<TGConnectingPoint num="4" id="1351" /> +<TGConnectingPoint num="5" id="1352" /> +<TGConnectingPoint num="6" id="1353" /> +<TGConnectingPoint num="7" id="1354" /> +<TGConnectingPoint num="8" id="1355" /> +<TGConnectingPoint num="9" id="1356" /> +<TGConnectingPoint num="10" id="1357" /> +<TGConnectingPoint num="11" id="1358" /> +<TGConnectingPoint num="12" id="1359" /> +<TGConnectingPoint num="13" id="1360" /> +<TGConnectingPoint num="14" id="1361" /> +<TGConnectingPoint num="15" id="1362" /> +<TGConnectingPoint num="16" id="1363" /> +<TGConnectingPoint num="17" id="1364" /> +<TGConnectingPoint num="18" id="1365" /> +<TGConnectingPoint num="19" id="1366" /> +<TGConnectingPoint num="20" id="1367" /> +<TGConnectingPoint num="21" id="1368" /> +<TGConnectingPoint num="22" id="1369" /> +<TGConnectingPoint num="23" id="1370" /> <extraparam> <info stereotype="MWMR-CoPro" nodeName="Copro0" /> <attributes srcid="1" tgtid="2" plaps="3" fifoToCoprocDepth="4" fifoFromCoprocDepth="5" nToCopro="6" nFromCopro="7" nConfig="8" nStatus="9" useLLSC="false" /> </extraparam> </COMPONENT> -<COMPONENT type="5359" id="1362" > +<COMPONENT type="5359" id="1396" > <cdparam x="756" y="341" /> <sizeparam width="200" height="200" minWidth="100" minHeight="50" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="ICU0" value="name" /> -<TGConnectingPoint num="0" id="1338" /> -<TGConnectingPoint num="1" id="1339" /> -<TGConnectingPoint num="2" id="1340" /> -<TGConnectingPoint num="3" id="1341" /> -<TGConnectingPoint num="4" id="1342" /> -<TGConnectingPoint num="5" id="1343" /> -<TGConnectingPoint num="6" id="1344" /> -<TGConnectingPoint num="7" id="1345" /> -<TGConnectingPoint num="8" id="1346" /> -<TGConnectingPoint num="9" id="1347" /> -<TGConnectingPoint num="10" id="1348" /> -<TGConnectingPoint num="11" id="1349" /> -<TGConnectingPoint num="12" id="1350" /> -<TGConnectingPoint num="13" id="1351" /> -<TGConnectingPoint num="14" id="1352" /> -<TGConnectingPoint num="15" id="1353" /> -<TGConnectingPoint num="16" id="1354" /> -<TGConnectingPoint num="17" id="1355" /> -<TGConnectingPoint num="18" id="1356" /> -<TGConnectingPoint num="19" id="1357" /> -<TGConnectingPoint num="20" id="1358" /> -<TGConnectingPoint num="21" id="1359" /> -<TGConnectingPoint num="22" id="1360" /> -<TGConnectingPoint num="23" id="1361" /> +<TGConnectingPoint num="0" id="1372" /> +<TGConnectingPoint num="1" id="1373" /> +<TGConnectingPoint num="2" id="1374" /> +<TGConnectingPoint num="3" id="1375" /> +<TGConnectingPoint num="4" id="1376" /> +<TGConnectingPoint num="5" id="1377" /> +<TGConnectingPoint num="6" id="1378" /> +<TGConnectingPoint num="7" id="1379" /> +<TGConnectingPoint num="8" id="1380" /> +<TGConnectingPoint num="9" id="1381" /> +<TGConnectingPoint num="10" id="1382" /> +<TGConnectingPoint num="11" id="1383" /> +<TGConnectingPoint num="12" id="1384" /> +<TGConnectingPoint num="13" id="1385" /> +<TGConnectingPoint num="14" id="1386" /> +<TGConnectingPoint num="15" id="1387" /> +<TGConnectingPoint num="16" id="1388" /> +<TGConnectingPoint num="17" id="1389" /> +<TGConnectingPoint num="18" id="1390" /> +<TGConnectingPoint num="19" id="1391" /> +<TGConnectingPoint num="20" id="1392" /> +<TGConnectingPoint num="21" id="1393" /> +<TGConnectingPoint num="22" id="1394" /> +<TGConnectingPoint num="23" id="1395" /> <extraparam> <info stereotype="ICU" nodeName="ICU0" /> <attributes index="1" nIrq="2" /> </extraparam> </COMPONENT> -<COMPONENT type="5355" id="1387" > -<cdparam x="543" y="92" /> -<sizeparam width="200" height="200" minWidth="100" minHeight="35" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<COMPONENT type="5355" id="1439" > +<cdparam x="427" y="92" /> +<sizeparam width="451" height="201" minWidth="100" minHeight="35" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="Memory0" value="name" /> -<TGConnectingPoint num="0" id="1363" /> -<TGConnectingPoint num="1" id="1364" /> -<TGConnectingPoint num="2" id="1365" /> -<TGConnectingPoint num="3" id="1366" /> -<TGConnectingPoint num="4" id="1367" /> -<TGConnectingPoint num="5" id="1368" /> -<TGConnectingPoint num="6" id="1369" /> -<TGConnectingPoint num="7" id="1370" /> -<TGConnectingPoint num="8" id="1371" /> -<TGConnectingPoint num="9" id="1372" /> -<TGConnectingPoint num="10" id="1373" /> -<TGConnectingPoint num="11" id="1374" /> -<TGConnectingPoint num="12" id="1375" /> -<TGConnectingPoint num="13" id="1376" /> -<TGConnectingPoint num="14" id="1377" /> -<TGConnectingPoint num="15" id="1378" /> -<TGConnectingPoint num="16" id="1379" /> -<TGConnectingPoint num="17" id="1380" /> -<TGConnectingPoint num="18" id="1381" /> -<TGConnectingPoint num="19" id="1382" /> -<TGConnectingPoint num="20" id="1383" /> -<TGConnectingPoint num="21" id="1384" /> -<TGConnectingPoint num="22" id="1385" /> -<TGConnectingPoint num="23" id="1386" /> +<TGConnectingPoint num="0" id="1415" /> +<TGConnectingPoint num="1" id="1416" /> +<TGConnectingPoint num="2" id="1417" /> +<TGConnectingPoint num="3" id="1418" /> +<TGConnectingPoint num="4" id="1419" /> +<TGConnectingPoint num="5" id="1420" /> +<TGConnectingPoint num="6" id="1421" /> +<TGConnectingPoint num="7" id="1422" /> +<TGConnectingPoint num="8" id="1423" /> +<TGConnectingPoint num="9" id="1424" /> +<TGConnectingPoint num="10" id="1425" /> +<TGConnectingPoint num="11" id="1426" /> +<TGConnectingPoint num="12" id="1427" /> +<TGConnectingPoint num="13" id="1428" /> +<TGConnectingPoint num="14" id="1429" /> +<TGConnectingPoint num="15" id="1430" /> +<TGConnectingPoint num="16" id="1431" /> +<TGConnectingPoint num="17" id="1432" /> +<TGConnectingPoint num="18" id="1433" /> +<TGConnectingPoint num="19" id="1434" /> +<TGConnectingPoint num="20" id="1435" /> +<TGConnectingPoint num="21" id="1436" /> +<TGConnectingPoint num="22" id="1437" /> +<TGConnectingPoint num="23" id="1438" /> <extraparam> <info stereotype="RAM" nodeName="Memory0" /> <attributes byteDataSize="4" index="3" /> </extraparam> </COMPONENT> - -<COMPONENT type="5353" id="1412" > +<SUBCOMPONENT type="5362" id="1405" > +<father id="1439" num="0" /> +<cdparam x="428" y="133" /> +<sizeparam width="324" height="40" minWidth="75" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="0" maxX="127" minY="0" maxY="161" /> +<infoparam name="TGComponent" value="Design::Controller/out ringBell() #--# Bell/in ring()" /> +<TGConnectingPoint num="0" id="1397" /> +<TGConnectingPoint num="1" id="1398" /> +<TGConnectingPoint num="2" id="1399" /> +<TGConnectingPoint num="3" id="1400" /> +<TGConnectingPoint num="4" id="1401" /> +<TGConnectingPoint num="5" id="1402" /> +<TGConnectingPoint num="6" id="1403" /> +<TGConnectingPoint num="7" id="1404" /> +<extraparam> +<info value="Design::Controller/out ringBell() #--# Bell/in ring()" channelName="Controller/out ringBell() #--# Bell/in ring()" referenceDiagram="Design" /> +</extraparam> +</SUBCOMPONENT> +<SUBCOMPONENT type="5362" id="1414" > +<father id="1439" num="1" /> +<cdparam x="439" y="183" /> +<sizeparam width="424" height="40" minWidth="75" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="0" maxX="27" minY="0" maxY="161" /> +<infoparam name="TGComponent" value="Design::Controller/out startMagnetron() #--# Magnetron/in startM()" /> +<TGConnectingPoint num="0" id="1406" /> +<TGConnectingPoint num="1" id="1407" /> +<TGConnectingPoint num="2" id="1408" /> +<TGConnectingPoint num="3" id="1409" /> +<TGConnectingPoint num="4" id="1410" /> +<TGConnectingPoint num="5" id="1411" /> +<TGConnectingPoint num="6" id="1412" /> +<TGConnectingPoint num="7" id="1413" /> +<extraparam> +<info value="Design::Controller/out startMagnetron() #--# Magnetron/in startM()" channelName="Controller/out startMagnetron() #--# Magnetron/in startM()" referenceDiagram="Design" /> +</extraparam> +</SUBCOMPONENT> + +<COMPONENT type="5353" id="1464" > <cdparam x="308" y="368" /> <sizeparam width="250" height="50" minWidth="100" minHeight="50" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="Vgmn0" value="name" /> -<TGConnectingPoint num="0" id="1388" /> -<TGConnectingPoint num="1" id="1389" /> -<TGConnectingPoint num="2" id="1390" /> -<TGConnectingPoint num="3" id="1391" /> -<TGConnectingPoint num="4" id="1392" /> -<TGConnectingPoint num="5" id="1393" /> -<TGConnectingPoint num="6" id="1394" /> -<TGConnectingPoint num="7" id="1395" /> -<TGConnectingPoint num="8" id="1396" /> -<TGConnectingPoint num="9" id="1397" /> -<TGConnectingPoint num="10" id="1398" /> -<TGConnectingPoint num="11" id="1399" /> -<TGConnectingPoint num="12" id="1400" /> -<TGConnectingPoint num="13" id="1401" /> -<TGConnectingPoint num="14" id="1402" /> -<TGConnectingPoint num="15" id="1403" /> -<TGConnectingPoint num="16" id="1404" /> -<TGConnectingPoint num="17" id="1405" /> -<TGConnectingPoint num="18" id="1406" /> -<TGConnectingPoint num="19" id="1407" /> -<TGConnectingPoint num="20" id="1408" /> -<TGConnectingPoint num="21" id="1409" /> -<TGConnectingPoint num="22" id="1410" /> -<TGConnectingPoint num="23" id="1411" /> +<TGConnectingPoint num="0" id="1440" /> +<TGConnectingPoint num="1" id="1441" /> +<TGConnectingPoint num="2" id="1442" /> +<TGConnectingPoint num="3" id="1443" /> +<TGConnectingPoint num="4" id="1444" /> +<TGConnectingPoint num="5" id="1445" /> +<TGConnectingPoint num="6" id="1446" /> +<TGConnectingPoint num="7" id="1447" /> +<TGConnectingPoint num="8" id="1448" /> +<TGConnectingPoint num="9" id="1449" /> +<TGConnectingPoint num="10" id="1450" /> +<TGConnectingPoint num="11" id="1451" /> +<TGConnectingPoint num="12" id="1452" /> +<TGConnectingPoint num="13" id="1453" /> +<TGConnectingPoint num="14" id="1454" /> +<TGConnectingPoint num="15" id="1455" /> +<TGConnectingPoint num="16" id="1456" /> +<TGConnectingPoint num="17" id="1457" /> +<TGConnectingPoint num="18" id="1458" /> +<TGConnectingPoint num="19" id="1459" /> +<TGConnectingPoint num="20" id="1460" /> +<TGConnectingPoint num="21" id="1461" /> +<TGConnectingPoint num="22" id="1462" /> +<TGConnectingPoint num="23" id="1463" /> <extraparam> <info stereotype="VGMN" nodeName="Vgmn0" /> <attributes index="0" nbAttachedInitiat="1" nbAttachedTarget="2" minLatency="4" fifoDepth="3" /> </extraparam> </COMPONENT> -<COMPONENT type="5351" id="1455" > +<COMPONENT type="5351" id="1507" > <cdparam x="159" y="89" /> <sizeparam width="250" height="200" minWidth="150" minHeight="100" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="CPU0" value="name" /> -<TGConnectingPoint num="0" id="1431" /> -<TGConnectingPoint num="1" id="1432" /> -<TGConnectingPoint num="2" id="1433" /> -<TGConnectingPoint num="3" id="1434" /> -<TGConnectingPoint num="4" id="1435" /> -<TGConnectingPoint num="5" id="1436" /> -<TGConnectingPoint num="6" id="1437" /> -<TGConnectingPoint num="7" id="1438" /> -<TGConnectingPoint num="8" id="1439" /> -<TGConnectingPoint num="9" id="1440" /> -<TGConnectingPoint num="10" id="1441" /> -<TGConnectingPoint num="11" id="1442" /> -<TGConnectingPoint num="12" id="1443" /> -<TGConnectingPoint num="13" id="1444" /> -<TGConnectingPoint num="14" id="1445" /> -<TGConnectingPoint num="15" id="1446" /> -<TGConnectingPoint num="16" id="1447" /> -<TGConnectingPoint num="17" id="1448" /> -<TGConnectingPoint num="18" id="1449" /> -<TGConnectingPoint num="19" id="1450" /> -<TGConnectingPoint num="20" id="1451" /> -<TGConnectingPoint num="21" id="1452" /> -<TGConnectingPoint num="22" id="1453" /> -<TGConnectingPoint num="23" id="1454" /> +<TGConnectingPoint num="0" id="1483" /> +<TGConnectingPoint num="1" id="1484" /> +<TGConnectingPoint num="2" id="1485" /> +<TGConnectingPoint num="3" id="1486" /> +<TGConnectingPoint num="4" id="1487" /> +<TGConnectingPoint num="5" id="1488" /> +<TGConnectingPoint num="6" id="1489" /> +<TGConnectingPoint num="7" id="1490" /> +<TGConnectingPoint num="8" id="1491" /> +<TGConnectingPoint num="9" id="1492" /> +<TGConnectingPoint num="10" id="1493" /> +<TGConnectingPoint num="11" id="1494" /> +<TGConnectingPoint num="12" id="1495" /> +<TGConnectingPoint num="13" id="1496" /> +<TGConnectingPoint num="14" id="1497" /> +<TGConnectingPoint num="15" id="1498" /> +<TGConnectingPoint num="16" id="1499" /> +<TGConnectingPoint num="17" id="1500" /> +<TGConnectingPoint num="18" id="1501" /> +<TGConnectingPoint num="19" id="1502" /> +<TGConnectingPoint num="20" id="1503" /> +<TGConnectingPoint num="21" id="1504" /> +<TGConnectingPoint num="22" id="1505" /> +<TGConnectingPoint num="23" id="1506" /> <extraparam> <info stereotype="CPU" nodeName="CPU0" /> <attributes nbOfIrq="6" iCacheWays="0" iCacheSets="0" iCacheWords="0" dCacheWays="0" dCacheSets="0" dCacheWords="0" /> </extraparam> </COMPONENT> -<SUBCOMPONENT type="5352" id="1421" > -<father id="1455" num="0" /> +<SUBCOMPONENT type="5352" id="1473" > +<father id="1507" num="0" /> <cdparam x="182" y="131" /> <sizeparam width="154" height="40" minWidth="75" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="0" maxX="96" minY="0" maxY="160" /> <infoparam name="TGComponent" value="Design::ControlPanel" /> -<TGConnectingPoint num="0" id="1413" /> -<TGConnectingPoint num="1" id="1414" /> -<TGConnectingPoint num="2" id="1415" /> -<TGConnectingPoint num="3" id="1416" /> -<TGConnectingPoint num="4" id="1417" /> -<TGConnectingPoint num="5" id="1418" /> -<TGConnectingPoint num="6" id="1419" /> -<TGConnectingPoint num="7" id="1420" /> +<TGConnectingPoint num="0" id="1465" /> +<TGConnectingPoint num="1" id="1466" /> +<TGConnectingPoint num="2" id="1467" /> +<TGConnectingPoint num="3" id="1468" /> +<TGConnectingPoint num="4" id="1469" /> +<TGConnectingPoint num="5" id="1470" /> +<TGConnectingPoint num="6" id="1471" /> +<TGConnectingPoint num="7" id="1472" /> <extraparam> <info value="Design::ControlPanel" taskName="ControlPanel" referenceTaskName="Design" /> </extraparam> </SUBCOMPONENT> -<SUBCOMPONENT type="5352" id="1430" > -<father id="1455" num="1" /> +<SUBCOMPONENT type="5352" id="1482" > +<father id="1507" num="1" /> <cdparam x="255" y="199" /> <sizeparam width="110" height="40" minWidth="75" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="0" maxX="140" minY="0" maxY="160" /> <infoparam name="TGComponent" value="Design::Door" /> -<TGConnectingPoint num="0" id="1422" /> -<TGConnectingPoint num="1" id="1423" /> -<TGConnectingPoint num="2" id="1424" /> -<TGConnectingPoint num="3" id="1425" /> -<TGConnectingPoint num="4" id="1426" /> -<TGConnectingPoint num="5" id="1427" /> -<TGConnectingPoint num="6" id="1428" /> -<TGConnectingPoint num="7" id="1429" /> +<TGConnectingPoint num="0" id="1474" /> +<TGConnectingPoint num="1" id="1475" /> +<TGConnectingPoint num="2" id="1476" /> +<TGConnectingPoint num="3" id="1477" /> +<TGConnectingPoint num="4" id="1478" /> +<TGConnectingPoint num="5" id="1479" /> +<TGConnectingPoint num="6" id="1480" /> +<TGConnectingPoint num="7" id="1481" /> <extraparam> <info value="Design::Door" taskName="Door" referenceTaskName="Design" /> </extraparam> </SUBCOMPONENT> -<CONNECTOR type="5350" id="1456" > +<CONNECTOR type="5350" id="1508" > <cdparam x="619" y="331" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector from Memory0 to Vgmn0" value="{info}" /> -<P1 x="593" y="292" id="1377" /> -<P2 x="495" y="368" id="1397" /> +<P1 x="539" y="293" id="1429" /> +<P2 x="495" y="368" id="1449" /> <AutomaticDrawing data="true" /> </CONNECTOR> -<CONNECTOR type="5350" id="1457" > +<CONNECTOR type="5350" id="1509" > <cdparam x="284" y="289" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector from CPU0 to Vgmn0" value="{info}" /> -<P1 x="284" y="289" id="1437" /> -<P2 x="370" y="368" id="1396" /> +<P1 x="284" y="289" id="1489" /> +<P2 x="370" y="368" id="1448" /> <AutomaticDrawing data="true" /> </CONNECTOR> diff --git a/src/ui/AvatarDesignPanel.java b/src/ui/AvatarDesignPanel.java index f52f11ff7bbe434f2c071b5294f0b4ed85bba1b0..2960eb41b117a31f62cf229dffcb67c1a72f9587 100644 --- a/src/ui/AvatarDesignPanel.java +++ b/src/ui/AvatarDesignPanel.java @@ -424,5 +424,9 @@ public class AvatarDesignPanel extends TURTLEPanel { return abdp.getAllNonMappedAvatarBlockNames(_name, _tadp, ref, name); } + public ArrayList<String> getAllNonMappedAvatarChannelNames(String _name, ADDDiagramPanel _tadp, boolean ref, String name) { + return abdp.getAllNonMappedAvatarChannelNames(_name, _tadp); + } + } \ No newline at end of file diff --git a/src/ui/MainGUI.java b/src/ui/MainGUI.java index c58edc388f52407c0a325061bc9595930bfc574e..ab679b07ef0dd63a8fb80520731790fe6379a1d3 100755 --- a/src/ui/MainGUI.java +++ b/src/ui/MainGUI.java @@ -1314,6 +1314,22 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Pe return list; } + + public Vector<String> getAllNonMappedAvatarChannelNames(ADDDiagramPanel tadp, String ref, String name) { + TURTLEPanel tp; + Vector<String> list = new Vector<String>(); + boolean b; + + for(int i=0; i<tabs.size(); i++) { + tp = (TURTLEPanel)(tabs.elementAt(i)); + if (tp instanceof AvatarDesignPanel) { + b = (mainTabbedPane.getTitleAt(i).compareTo(ref) == 0); + list.addAll(((AvatarDesignPanel)tp).getAllNonMappedAvatarChannelNames(mainTabbedPane.getTitleAt(i), tadp, b, name)); + } + } + + return list; + } public Vector<String> getAllCompositeComponent(TMLComponentTaskDiagramPanel tcdp) { TURTLEPanel tp; @@ -7711,6 +7727,8 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Pe actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.ADD_TIMERNODE); } else if (command.equals(actions[TGUIAction.ADD_BLOCKARTIFACT].getActionCommand())) { actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.ADD_ARTIFACT); + } else if (command.equals(actions[TGUIAction.ADD_CHANNELARTIFACT].getActionCommand())) { + actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.ADD_CHANNELARTIFACT); } else if (command.equals(actions[TGUIAction.TCD_ASSOCIATION].getActionCommand())) { actionOnButton(TGComponentManager.CONNECTOR, TGComponentManager.CONNECTOR_ASSOCIATION); diff --git a/src/ui/TGComponentManager.java b/src/ui/TGComponentManager.java index 5acf23e40790fdeaade3f3eae70fa216962a8fd3..9e9907ff7f2a0ff7a4670fdfa76f52dfab24c54d 100755 --- a/src/ui/TGComponentManager.java +++ b/src/ui/TGComponentManager.java @@ -397,6 +397,7 @@ public class TGComponentManager { public static final int ADD_ICUNODE = 5359; public static final int ADD_COPROMWMRNODE = 5360; public static final int ADD_TIMERNODE = 5361; + public static final int ADD_CHANNELARTIFACT = 5362; // AVATAR CD -> starts at 5400 public static final int ACD_BLOCK = 5400; @@ -601,6 +602,9 @@ public class TGComponentManager { case ADD_ARTIFACT: tgc = new ADDBlockArtifact(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case ADD_CHANNELARTIFACT: + tgc = new ADDChannelArtifact(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); break; // Others @@ -1146,6 +1150,8 @@ public class TGComponentManager { return ADD_CPUNODE; } else if (tgc instanceof ADDBlockArtifact) { return ADD_ARTIFACT; + } else if (tgc instanceof ADDChannelArtifact) { + return ADD_CHANNELARTIFACT; } else if (tgc instanceof ADDBusNode) { return ADD_BUSNODE; } else if (tgc instanceof ADDTTYNode) { diff --git a/src/ui/TGUIAction.java b/src/ui/TGUIAction.java index 102d4f90f6aba989ee223386bfb4537b875670f5..21d7355a2ad689025a37179df10a2a3e080d426b 100755 --- a/src/ui/TGUIAction.java +++ b/src/ui/TGUIAction.java @@ -378,6 +378,7 @@ public class TGUIAction extends AbstractAction { public static final int ADD_ICUNODE = 408; public static final int ADD_COPROMWMRNODE = 409; public static final int ADD_TIMERNODE = 410; + public static final int ADD_CHANNELARTIFACT = 411; @@ -545,7 +546,7 @@ public class TGUIAction extends AbstractAction { //Action for the help button created by Solange public static final int PRUEBA_1 = 205; - public static final int NB_ACTION = 411; + public static final int NB_ACTION = 412; private static final TAction [] actions = new TAction[NB_ACTION]; @@ -753,6 +754,7 @@ public class TGUIAction extends AbstractAction { actions[ADD_BUSNODE] = new TAction("add-add-busnode", "Add a Bus", IconManager.imgic1102, IconManager.imgic1102, "Bus", "Add a bus node to the currently opened AVATAR deployment diagram", 0); actions[ADD_TTYNODE] = new TAction("add-add-tty", "Add a TTY node", IconManager.imgic1108, IconManager.imgic1108, "TTY", "Add a tty node to the currently opened AVATAR deployment diagram", 0); actions[ADD_BLOCKARTIFACT] = new TAction("add-add-blockartifact", "Map an AVATAR block", IconManager.imgic702, IconManager.imgic702, "Map an AVATAR block", "Map an AVATAR block onto a node in the currently opened AVATAR deployment diagram", 0); + actions[ADD_CHANNELARTIFACT] = new TAction("add-add-channelartifact", "Map an AVATAR Channel", IconManager.imgic702, IconManager.imgic702, "Map an AVATAR channel", "Map an AVATAR channel onto a memory in the currently opened AVATAR deployment diagram", 0); actions[ADD_BRIDGENODE] = new TAction("add-add-bridgenode", "Add a Bridge", IconManager.imgic1104, IconManager.imgic1104, "Bridge node", "Add a bridge node to the currently opened AVATAR deployment diagram", 0); actions[ADD_RAMNODE] = new TAction("add-add-ramnode", "Add a RAM", IconManager.imgic1108, IconManager.imgic1108, "RAM", "Add a hardware accelerator node to the currently opened AVATAR deployment diagram", 0); actions[ADD_ROMNODE] = new TAction("add-add-romnode", "Add a ROM", IconManager.imgic1108, IconManager.imgic1108, "ROM", "Add a memory node to the currently opened AVATAR deployment diagram", 0); diff --git a/src/ui/avatarbd/AvatarBDPanel.java b/src/ui/avatarbd/AvatarBDPanel.java index 83a429a4766e6d2cd8e205cbe8f47301b25e110c..d3b706bc35a90f1f4f736546a39714efc01a9b66 100644 --- a/src/ui/avatarbd/AvatarBDPanel.java +++ b/src/ui/avatarbd/AvatarBDPanel.java @@ -581,7 +581,7 @@ public class AvatarBDPanel extends TDiagramPanel { public ArrayList<String> getAllNonMappedAvatarBlockNames(String _topName, ADDDiagramPanel _tadp, boolean ref, String _name) { - Iterator iterator = componentList.listIterator(); + //Iterator iterator = componentList.listIterator(); ArrayList<String> list = new ArrayList<String>(); String name; @@ -602,6 +602,27 @@ public class AvatarBDPanel extends TDiagramPanel { return list; } + public ArrayList<String> getAllNonMappedAvatarChannelNames(String _topName, ADDDiagramPanel _tadp) { + + Iterator iterator = componentList.listIterator(); + ArrayList<String> list = new ArrayList<String>(); + String name; + TGComponent tgc; + + while(iterator.hasNext()) { + tgc = (TGComponent)(iterator.next()); + if (tgc instanceof AvatarBDPortConnector) { + AvatarBDPortConnector port = (AvatarBDPortConnector)tgc; + name = port.getChannelName(); + if (!_tadp.isChannelMapped(_topName, name)) { + list.add(_topName + "::" + name); + } + } + } + + return list; + } + } diff --git a/src/ui/avatarbd/AvatarBDPortConnector.java b/src/ui/avatarbd/AvatarBDPortConnector.java index 76d1c3ff929b0a2a7c3d0a3bbd2ec69803101a43..4b763b8f4cf9e4157a437ec9e532a5ca034c92a0 100644 --- a/src/ui/avatarbd/AvatarBDPortConnector.java +++ b/src/ui/avatarbd/AvatarBDPortConnector.java @@ -685,5 +685,31 @@ public class AvatarBDPortConnector extends TGConnectorWithCommentConnectionPoint return isLossy; } + public String getChannelName() { + String sig1 = ""; + String sig2 = ""; + if (inSignalsAtOrigin.size() > 0) { + sig1 = inSignalsAtOrigin.get(0); + } else if (outSignalsAtOrigin.size() > 0) { + sig1 = outSignalsAtOrigin.get(0); + } + if (outSignalsAtDestination.size() > 0) { + sig2 = outSignalsAtDestination.get(0); + } else if (inSignalsAtDestination.size() > 0) { + sig2 = inSignalsAtDestination.get(0); + } + + String b1 = ""; + String b2 = ""; + AvatarBDBlock b = getAvatarBDBlock1(); + if (b != null) { b1 = b.getBlockName();} + b = getAvatarBDBlock2(); + if (b != null) { b2 = b.getBlockName();} + + return b1 + "/" + sig1 + " #--# " + b2 + "/" + sig2; + + + } + } diff --git a/src/ui/avatardd/ADDChannelArtifact.java b/src/ui/avatardd/ADDChannelArtifact.java new file mode 100755 index 0000000000000000000000000000000000000000..c4fe8a666414ecdeb767f2ce8a4eeadfbc639939 --- /dev/null +++ b/src/ui/avatardd/ADDChannelArtifact.java @@ -0,0 +1,284 @@ +/**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. + +/** + * Class ADDChannelArtifact + * Artifact of an avatar deployment diagram + * Creation: 25/08/2014 + * @version 1.0 25/08/2014 + * @author Ludovic APVRILLE + * @see + */ + +package ui.avatardd; + +import java.awt.*; +import java.util.*; +import javax.swing.*; + +import org.w3c.dom.*; + +import myutil.*; +import ui.*; +import ui.window.*; + +public class ADDChannelArtifact extends TGCWithoutInternalComponent implements SwallowedTGComponent { + protected int lineLength = 5; + protected int textX = 5; + protected int textY = 15; + protected int textY2 = 35; + protected int space = 5; + protected int fileX = 20; + protected int fileY = 25; + protected int cran = 5; + + protected String oldValue = ""; + protected String referenceDiagram = "referenceToDiagram"; + protected String channelName = "channelName"; + + public ADDChannelArtifact(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 = 75; + height = 40; + minWidth = 75; + + nbConnectingPoint = 0; + addTGConnectingPointsComment(); + + moveable = true; + editable = true; + removable = true; + + value = "AvatarDesign::channel"; + channelName = "channel"; + referenceDiagram = "AvatarDesign"; + + makeFullValue(); + + myImageIcon = IconManager.imgic702; + } + + + public void internalDrawing(Graphics g) { + + if (oldValue.compareTo(value) != 0) { + setValue(value, g); + } + + g.drawRect(x, y, width, height); + Color c = g.getColor(); + g.setColor(ColorManager.CPU_BOX_2); + g.fillRect(x+1, y+1, width-1, height-1); + g.setColor(c); + + //g.drawRoundRect(x, y, width, height, arc, arc); + g.drawLine(x+width-space-fileX, y + space, x+width-space-fileX, y+space+fileY); + g.drawLine(x+width-space-fileX, y + space, x+width-space-cran, y+space); + g.drawLine(x+width-space-cran, y+space, x+width-space, y+space + cran); + g.drawLine(x+width-space, y+space + cran, x+width-space, y+space+fileY); + g.drawLine(x+width-space, y+space+fileY, x+width-space-fileX, y+space+fileY); + g.drawLine(x+width-space-cran, y+space, x+width-space-cran, y+space+cran); + g.drawLine(x+width-space-cran, y+space+cran, x + width-space, y+space+cran); + + g.drawImage(IconManager.img9, x+width-space-fileX + 3, y + space + 7, null); + + g.drawString(value, x + textX , y + textY); + + } + + public void setValue(String val, Graphics g) { + oldValue = value; + int w = g.getFontMetrics().stringWidth(value); + int w1 = Math.max(minWidth, w + 2 * textX + fileX + space); + + //System.out.println("width=" + width + " w1=" + w1 + " w2=" + w2 + " value=" + value); + if (w1 != width) { + width = w1; + resizeWithFather(); + } + //System.out.println("width=" + width + " w1=" + w1 + " value=" + value); + } + + public void resizeWithFather() { + if ((father != null) && ((father instanceof ADDRAMNode))) { + //System.out.println("cdRect comp"); + setCdRectangle(0, father.getWidth() - getWidth(), 0, father.getHeight() - getHeight()); + //setCd(Math.min(x, father.getWidth() - getWidth()), Math.min(y, father.getHeight() - getHeight())); + setMoveCd(x, y); + } + } + + + public boolean editOndoubleClick(JFrame frame) { + String tmp; + boolean error = false; + + JDialogAvatarChannelArtifact dialog = new JDialogAvatarChannelArtifact(frame, "Setting artifact attributes", this); + dialog.setSize(650, 350); + GraphicLib.centerOnParent(dialog); + dialog.show(); // blocked until dialog has been closed + + if (!dialog.isRegularClose()) { + return false; + } + + if (dialog.getReferenceDiagram() == null) { + return false; + } + + if (dialog.getReferenceDiagram().length() != 0) { + tmp = dialog.getReferenceDiagram(); + referenceDiagram= tmp; + + + } + + if (dialog.getChannelName().length() != 0) { + channelName = dialog.getChannelName(); + + /*if (!TAttribute.isAValidId(tmp, false, false)) { + error = true; + } else { + channelName = tmp; + }*/ + } + + + /*if (error) { + JOptionPane.showMessageDialog(frame, + "Name is non-valid", + "Error", + JOptionPane.INFORMATION_MESSAGE); + }*/ + + makeFullValue(); + + + return !error; + + } + + private void makeFullValue() { + value = referenceDiagram + "::" + channelName; + } + + public TGComponent isOnMe(int _x, int _y) { + if (GraphicLib.isInRectangle(_x, _y, x, y, width, height)) { + return this; + } + return null; + } + + public int getType() { + return TGComponentManager.ADD_CHANNELARTIFACT; + } + + protected String translateExtraParam() { + StringBuffer sb = new StringBuffer("<extraparam>\n"); + sb.append("<info value=\"" + value + "\" channelName=\"" + channelName + "\" referenceDiagram=\""); + sb.append(referenceDiagram); + sb.append("\" />\n"); + sb.append("</extraparam>\n"); + return new String(sb); + } + + public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException{ + //System.out.println("*** load extra synchro ***"); + try { + + NodeList nli; + Node n1, n2; + Element elt; + int t1id; + String svalue = null, sname = null, sreferenceTask = null; + String prio; + + for(int i=0; i<nl.getLength(); i++) { + n1 = nl.item(i); + //System.out.println(n1); + if (n1.getNodeType() == Node.ELEMENT_NODE) { + nli = n1.getChildNodes(); + for(int j=0; i<nli.getLength(); i++) { + n2 = nli.item(i); + //System.out.println(n2); + if (n2.getNodeType() == Node.ELEMENT_NODE) { + elt = (Element) n2; + if (elt.getTagName().equals("info")) { + svalue = elt.getAttribute("value"); + sname = elt.getAttribute("channelName"); + sreferenceTask = elt.getAttribute("referenceDiagram"); + + } + if (svalue != null) { + value = svalue; + } + if (sname != null){ + channelName = sname; + } + if (sreferenceTask != null) { + referenceDiagram = sreferenceTask; + } + } + } + } + } + + } catch (Exception e) { + throw new MalformedModelingException(); + } + makeFullValue(); + } + + public DesignPanel getDesignPanel() { + return tdp.getGUI().getDesignPanel(value); + } + + public String getReferenceDiagram() { + return referenceDiagram; + } + + public void setReferenceDiagram(String _referenceDiagram) { + referenceDiagram = _referenceDiagram; + makeFullValue(); + } + + public String getChannelName() { + return channelName; + } + +} diff --git a/src/ui/avatardd/ADDDiagramPanel.java b/src/ui/avatardd/ADDDiagramPanel.java index b66df628c0fa01bd2c75fd30df8e14f6288c4611..d61ac3d163a533dc0a9d8e17d8ee42285d77a821 100755 --- a/src/ui/avatardd/ADDDiagramPanel.java +++ b/src/ui/avatardd/ADDDiagramPanel.java @@ -262,6 +262,31 @@ public class ADDDiagramPanel extends TDiagramPanel implements TDPWithAttributes return false; } + public boolean isChannelMapped(String _ref, String _name) { + ListIterator iterator = componentList.listIterator(); + TGComponent tgc; + ADDMemoryNode node; + Vector v; + ADDChannelArtifact artifact; + int i; + String name = _ref + "::" + _name; + + while(iterator.hasNext()) { + tgc = (TGComponent)(iterator.next()); + if (tgc instanceof ADDRAMNode) { + v = ((ADDRAMNode)(tgc)).getArtifactList(); + for(i=0; i<v.size(); i++) { + artifact = (ADDChannelArtifact)(v.get(i)); + if (artifact.getValue().equals(name)) { + return true; + } + } + } + } + + return false; + } + /*public void renameMapping(String oldName, String newName) { ListIterator iterator = getListOfNodes().listIterator(); TMLArchiNode node; diff --git a/src/ui/avatardd/ADDDiagramToolBar.java b/src/ui/avatardd/ADDDiagramToolBar.java index 8432974b3c448866d52bdb872f4ab4685ec2009b..feebc50c5347710926d788eae639b3f2724abbbc 100755 --- a/src/ui/avatardd/ADDDiagramToolBar.java +++ b/src/ui/avatardd/ADDDiagramToolBar.java @@ -68,7 +68,8 @@ public class ADDDiagramToolBar extends TToolBar { mgui.actions[TGUIAction.ADD_CPUNODE].setEnabled(b); mgui.actions[TGUIAction.ADD_BUSNODE].setEnabled(b); mgui.actions[TGUIAction.ADD_BRIDGENODE].setEnabled(b); - mgui.actions[TGUIAction.ADD_BLOCKARTIFACT].setEnabled(b); + mgui.actions[TGUIAction.ADD_BLOCKARTIFACT].setEnabled(b); + mgui.actions[TGUIAction.ADD_CHANNELARTIFACT].setEnabled(b); mgui.actions[TGUIAction.ADD_TTYNODE].setEnabled(b); mgui.actions[TGUIAction.ADD_RAMNODE].setEnabled(b); mgui.actions[TGUIAction.ADD_ROMNODE].setEnabled(b); @@ -139,7 +140,9 @@ public class ADDDiagramToolBar extends TToolBar { button = this.add(mgui.actions[TGUIAction.ADD_BRIDGENODE]); button.addMouseListener(mgui.mouseHandler); button = this.add(mgui.actions[TGUIAction.ADD_RAMNODE]); - button.addMouseListener(mgui.mouseHandler); + button.addMouseListener(mgui.mouseHandler); + button = this.add(mgui.actions[TGUIAction.ADD_CHANNELARTIFACT]); + button.addMouseListener(mgui.mouseHandler); button = this.add(mgui.actions[TGUIAction.ADD_ROMNODE]); button.addMouseListener(mgui.mouseHandler); diff --git a/src/ui/avatardd/ADDRAMNode.java b/src/ui/avatardd/ADDRAMNode.java index 848b83c7af84a6783385b962880d1c1bca093274..c6569bcc2ea227922a76acf13989582214bb79b3 100755 --- a/src/ui/avatardd/ADDRAMNode.java +++ b/src/ui/avatardd/ADDRAMNode.java @@ -58,7 +58,7 @@ import ui.window.*; import tmltranslator.*; -public class ADDRAMNode extends ADDMemoryNode implements WithAttributes { +public class ADDRAMNode extends ADDMemoryNode implements SwallowTGComponent, WithAttributes { public ADDRAMNode(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); @@ -113,6 +113,55 @@ public class ADDRAMNode extends ADDMemoryNode implements WithAttributes { return TGComponentManager.ADD_RAMNODE; } + public boolean acceptSwallowedTGComponent(TGComponent tgc) { + //TraceManager.addDev("Accept swallowed?"); + if (tgc instanceof ADDBlockArtifact) { + return true; + } + + return false; + } + + public boolean addSwallowedTGComponent(TGComponent tgc, int x, int y) { + //TraceManager.addDev("Add swallowed?"); + //Set its coordinates + if (tgc instanceof ADDChannelArtifact) { + tgc.setFather(this); + tgc.setDrawingZone(true); + ((ADDChannelArtifact)tgc).resizeWithFather(); + //TraceManager.addDev("Add swallowed!!!"); + addInternalComponent(tgc, 0); + return true; + } + + return false; + + } + + public void removeSwallowedTGComponent(TGComponent tgc) { + removeInternalComponent(tgc); + } + + + public Vector getArtifactList() { + Vector v = new Vector(); + for(int i=0; i<nbInternalTGComponent; i++) { + if (tgcomponent[i] instanceof ADDChannelArtifact) { + v.add(tgcomponent[i]); + } + } + return v; + } + + public void hasBeenResized() { + for(int i=0; i<nbInternalTGComponent; i++) { + if (tgcomponent[i] instanceof ADDChannelArtifact) { + ((ADDChannelArtifact)tgcomponent[i]).resizeWithFather(); + } + } + + } + diff --git a/src/ui/window/JDialogAvatarChannelArtifact.java b/src/ui/window/JDialogAvatarChannelArtifact.java new file mode 100755 index 0000000000000000000000000000000000000000..3c27b4de2bd19980b90ea9d80e7856832807eb6c --- /dev/null +++ b/src/ui/window/JDialogAvatarChannelArtifact.java @@ -0,0 +1,228 @@ +/**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. + * + * /** + * Class JDialogAvatarChannelArtifact + * Dialog for managing channel artifacts on memory nodes + * Creation: 25/08/2014 + * @version 1.0 25/08/2014 + * @author Ludovic APVRILLE + * @see + */ + +package ui.window; + +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; +//import javax.swing.event.*; +import java.util.*; + +import ui.*; + +import ui.avatardd.*; + + +public class JDialogAvatarChannelArtifact extends javax.swing.JDialog implements ActionListener { + + private boolean regularClose; + private boolean emptyList = false; + + private JPanel panel2; + private Frame frame; + private ADDChannelArtifact artifact; + + //protected JTextField taskName; + protected JComboBox referenceDiagram; + + // Main Panel + private JButton closeButton; + private JButton cancelButton; + + /** Creates new form */ + public JDialogAvatarChannelArtifact(Frame _frame, String _title, ADDChannelArtifact _artifact) { + super(_frame, _title, true); + frame = _frame; + artifact = _artifact; + + initComponents(); + myInitComponents(); + pack(); + } + + private void myInitComponents() { + } + + private void initComponents() { + Container c = getContentPane(); + GridBagLayout gridbag0 = new GridBagLayout(); + GridBagLayout gridbag1 = new GridBagLayout(); + GridBagLayout gridbag2 = new GridBagLayout(); + GridBagConstraints c0 = new GridBagConstraints(); + GridBagConstraints c1 = new GridBagConstraints(); + GridBagConstraints c2 = new GridBagConstraints(); + + setFont(new Font("Helvetica", Font.PLAIN, 14)); + c.setLayout(gridbag0); + + setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + + + panel2 = new JPanel(); + panel2.setLayout(gridbag2); + panel2.setBorder(new javax.swing.border.TitledBorder("Artifact attributes")); + panel2.setPreferredSize(new Dimension(550, 250)); + + c1.gridwidth = 1; + c1.gridheight = 1; + c1.weighty = 1.0; + c1.weightx = 1.0; + c1.fill = GridBagConstraints.HORIZONTAL; + panel2.add(new JLabel("channel: "), c2); + c1.gridwidth = GridBagConstraints.REMAINDER; //end row + Vector<String> list = artifact.getTDiagramPanel().getMGUI().getAllNonMappedAvatarChannelNames((ADDDiagramPanel)(artifact.getTDiagramPanel()), artifact.getReferenceDiagram(), artifact.getChannelName()); + int index = 0; + if (list.size() == 0) { + list.add("No more task to map"); + emptyList = true; + } else { + index = indexOf(list, artifact.getValue()); + } + referenceDiagram = new JComboBox(list); + referenceDiagram.setSelectedIndex(index); + //referenceTaskName.setEditable(true); + //referenceTaskName.setFont(new Font("times", Font.PLAIN, 12)); + panel2.add(referenceDiagram, c1); + + + /*c1.gridwidth = 1; + c1.gridheight = 1; + c1.weighty = 1.0; + c1.weightx = 1.0; + c1.fill = GridBagConstraints.HORIZONTAL; + panel2.add(new JLabel("Name:"), c2); + c1.gridwidth = GridBagConstraints.REMAINDER; //end row + taskName = new JTextField(artifact.getTaskName(), 30); + taskName.setEditable(true); + taskName.setFont(new Font("times", Font.PLAIN, 12)); + panel2.add(taskName, c1);*/ + + // main panel; + c0.gridheight = 10; + c0.weighty = 1.0; + c0.weightx = 1.0; + c0.gridwidth = GridBagConstraints.REMAINDER; //end row + c.add(panel2, c0); + + c0.gridwidth = 1; + c0.gridheight = 1; + c0.fill = GridBagConstraints.HORIZONTAL; + closeButton = new JButton("Save and Close", IconManager.imgic25); + //closeButton.setPreferredSize(new Dimension(600, 50)); + closeButton.addActionListener(this); + c.add(closeButton, c0); + c0.gridwidth = GridBagConstraints.REMAINDER; //end row + cancelButton = new JButton("Cancel", IconManager.imgic27); + cancelButton.addActionListener(this); + c.add(cancelButton, c0); + } + + public void actionPerformed(ActionEvent evt) { + /* if (evt.getSource() == typeBox) { + boolean b = ((Boolean)(initValues.elementAt(typeBox.getSelectedIndex()))).booleanValue(); + initialValue.setEnabled(b); + return; + }*/ + + + String command = evt.getActionCommand(); + + // Compare the action command to the known actions. + if (command.equals("Save and Close")) { + closeDialog(); + } else if (command.equals("Cancel")) { + cancelDialog(); + } + } + + public void closeDialog() { + regularClose = true; + dispose(); + } + + public void cancelDialog() { + dispose(); + } + + public boolean isRegularClose() { + return regularClose; + } + + public String getReferenceDiagram() { + if (emptyList) { + return null; + } + String tmp = (String)(referenceDiagram.getSelectedItem()); + int index = tmp.indexOf("::"); + if (index == -1) { + return tmp; + } + return tmp.substring(0, index); + } + + public String getChannelName() { + String tmp = (String)(referenceDiagram.getSelectedItem()); + int index = tmp.indexOf("::"); + if (index == -1) { + return tmp; + } + return tmp.substring(index+2, tmp.length()); + } + + + public int indexOf(Vector<String> _list, String name) { + int i = 0; + for(String s : _list) { + if (s.equals(name)) { + return i; + } + i++; + } + return 0; + } + +}