pigi
, if you are using a color monitor, the color of the stem indicates the type of data that the porthole consumes or produces, as summarized in table
2-5Printer
star can produce a textual representation of any type of particle. In addition, stars which input or output Matrix type particles have stems which are extra thick with colors corresponding to the four main types, float, int, complex, and fix.
The Xscope
star, and some other stars that generate output, accept "anytype" of input. However Xscope
isn't completely polymorphic, because it converts all inputs to float internally. So for a complex input, the magnitude will be plotted. If you want to plot both the real and imaginary parts you should use the ComplexReal
conversion star first.
In some situations automatic type conversions cannot be made. A common difficulty involves several outputs of different types feeding a Merge
star. Ptolemy must assign a specific type to the Merge
star's output, but in this case it will be unable to decide which type to use, so it will complain that it "can't determine DataType" for the output. The solution is to insert one or more type conversion stars, so that all the values arriving at the Merge
star have the same type. (The type conversion stars can be found in the "conversion" palette of the appropriate domain. It will be explained below how to find this.)
There are no automatic conversions between matrix particles and scalar particles; in fact the matrix particle types do not support automatic type conversion at all. Conversion stars need to be explicitly inserted between two stars that work on different Matrix types.
Some domains are more restrictive about particle type conversions than others. Assignment of types to ANYTYPE portholes and resolution of type conflicts is discussed further in section 4.6 of the Ptolemy Programmer's Manual, and in the Ptolemy Kernel Manual.