fsm:tools
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
fsm:tools [2007/12/22 14:45] – external edit 127.0.0.1 | fsm:tools [2020/11/23 17:23] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Tools usable with the OSInet FSM ====== | ====== Tools usable with the OSInet FSM ====== | ||
- | |||
- | |||
- | |||
===== Generating FSM from UML State machine diagrams ===== | ===== Generating FSM from UML State machine diagrams ===== | ||
Line 12: | Line 9: | ||
However, in the long run, Dia has dedicated UML formatting, and hence seems a more logical choice, although it is far less easy to use. So the maintained converter, at least for now, uses Dia files. | However, in the long run, Dia has dedicated UML formatting, and hence seems a more logical choice, although it is far less easy to use. So the maintained converter, at least for now, uses Dia files. | ||
- | |||
==== OOo Draw to FSM ==== | ==== OOo Draw to FSM ==== | ||
- | |||
- | |||
=== A FSM subset for OOo Draw === | === A FSM subset for OOo Draw === | ||
Line 32: | Line 26: | ||
* output conditions | * output conditions | ||
* action | * action | ||
- | |||
=== Sample data === | === Sample data === | ||
This following excerpt represents the useful part of a two-state transition diagram: | This following excerpt represents the useful part of a two-state transition diagram: | ||
- | < | + | |
+ | < | ||
| | ||
< | < | ||
Line 61: | Line 55: | ||
[..snip..] | [..snip..] | ||
</ | </ | ||
- | |||
- | |||
=== Parsing the graph === | === Parsing the graph === | ||
Supposing for now that the OOo document has already been unzipped to directory '' | Supposing for now that the OOo document has already been unzipped to directory '' | ||
- | <php> | + | |
+ | <code php> | ||
error_reporting(E_ALL|E_STRICT); | error_reporting(E_ALL|E_STRICT); | ||
- | | + | |
$doc = new DOMDocument(); | $doc = new DOMDocument(); | ||
$doc-> | $doc-> | ||
$doc-> | $doc-> | ||
- | |||
$xpath = new DOMXPath($doc); | $xpath = new DOMXPath($doc); | ||
$xpath-> | $xpath-> | ||
Line 86: | Line 78: | ||
. ' | . ' | ||
$result = $xpath-> | $result = $xpath-> | ||
- | |||
foreach ($result as $node) | foreach ($result as $node) | ||
{ | { | ||
Line 111: | Line 102: | ||
} | } | ||
} | } | ||
- | </php> | + | </code> |
From there on, it's a simple matter of merging the two trees and generating the resulting FSM XML file. | From there on, it's a simple matter of merging the two trees and generating the resulting FSM XML file. | ||
- | |||
==== Dia UML to FSM ==== | ==== Dia UML to FSM ==== |
fsm/tools.1198334707.txt.gz · Last modified: 2020/11/23 17:23 (external edit)