The Pendulum Bond Graph is repeated again in Figure 1. below down. Here all component documents are closed. In the Model View on the left, we can see the root pendulum with four children. Similarly in the middle part of the screen, we see the Bond Graph model of the Pendulum with all the corresponding word model components closed. If we press the small'+' button ahead of an icon in the tree, e.g., ahead of the Rod, the corresponding tree expands. Simultaneously the Rod word model in Bond Graphs opens showing its internal document (Figure 2). By clicking x near the document title in the tab, the document closes, and similarly, the corresponding icon in the tree collapses (Figure 1 below).
Figure 1. Pendulum with closed components
Figure 2. Pendulum with Rod component opened
To store a project's hierarchical model the BondSim uses the Microsoft's Compound File Systems. It consists of storages and streams. The storage is similar to common directories and the streams similar to files contain the data stored as a sequence of bytes. The root storage contains a stream which stores the root project data. It maps into a file, e.g. "simxxx.bnd". The user does not communicate with these files directly, but by the common project names such as "Pendulum", etc. If the corresponding file already exists, it can be opened by command "Project/Open...". The program finds from the project list the corresponding project file and open it. However, if there is no such a project, the command "Project/New..." is used. The program asks for a new project name as described in Pendulum and create an empty document and a new project file.
The document is used for developing the model of the project by creating word model components and connecting them by the bonds, as shown in Pendulum Bond Graph model. To continue developing the model we open the components documents and edit them (see document). To open a component we may also expand the corresponding branch in the Model View as described above in the Figure. When we finish editing the component's document, we may close it by clicking "x" at the right of the document tab title. The program now asks if we want to save, save to all, do not save, or close it. What does it mean?
To every component, starting from the Project corresponds a storage object. Every such storage contains a stream object, which stores the component's document and possible other storage objects. Thus, there is a 1:1 relationship between the storage and its stream on one hand, and the component and their document on the other. Thus, when closing a document, if we select save, the document is stored in the corresponding stream only. On the other hand, if we select save to all, every document starting from the closed one and going downward to the model root is saved in the corresponding stream until the opened file is saved. Of course we may select do not save, or even reject the complete operation by selecting the cancel button. Note that until project file is stored on the disk, or other storage medium, the project is not really stored.