Instead of drawing diagrams with plain rectangular boxes, you can replace boxes with arbitrary icons or images of meaningful objects. There are three distinct places in the process of modeling and simulation where you may set the icons. Each successive stage overrides any settings of earlier stages.
Stages where icons can be set:
The following document is divided into three sections corresponding to the three ways that icons can be set. Please see the appropriate section.
Regardless of the actual size of the source image, the size of the box, or which method you use, CSIM ensures that the image appears the same size as the box you place it on. For example, you can assign the same image to several boxes of differing sizes. The image will be stretched, shrunk, or squeezed accordingly for each box.
Most popular image formats are accepted, including JPEG, GIF, PNG, BMP, TIFF, PPM, etc.. Most platforms have the necessary run-time libraries to display these formats. However, without image-support libraries, only PPM format can be accepted. In such cases, either install the missing libraries, such as from Netpbm, or convert your images to PPM through an image tool, such as Gimp, XV, PhotoShop, or ImageMagick.
A set of useful icon images is provided within CSIM's distribution package under the $CSIM_MODEL_LIBS/icons directory. These images are complimentary. You can use or add your own images. The following table lists the existing images with their file names.
Network Symbols:
host.ppm |
host_server.ppm |
ids.ppm |
|
firewall.ppm |
bridge.ppm |
radio_terminal.ppm |
radio_channel.ppm |
router.ppm |
satelite.ppm |
satelite_ground.ppm |
switch.ppm |
NetworkController.ppm.scz |
Server.ppm.scz |
csco_router.ppm.scz |
Logic Symbols:
andgate.ppm |
nandgate.ppm |
notgate.ppm |
orgate.gif |
norgate.ppm |
xorgate.gif |
xnorgate.ppm |
clockgen.ppm |
Standard Queuing/Server Symbols:
std_box0.ppm |
std_db0.ppm |
std_delay0.ppm |
std_diam0.ppm |
std_diamond0.ppm |
std_in0.ppm |
std_out0.ppm |
std_qserver0.ppm |
std_queue0.ppm |
std_sink0.ppm |
std_src0.ppm |
In some cases icons have been made to look best on the default black screen background. However, for other background colors, such as on white paper print-outs, a second set of the same icons has been provided with reverse colors. Such is the case with the standard queuing icons below.
std_box.ppm |
std_db.ppm |
std_delay.ppm |
std_diam.ppm |
std_diamond.ppm |
std_in.ppm |
std_out.ppm |
std_qserver.ppm |
std_queue.ppm |
std_sink.ppm |
std_src.ppm |
Another set of icons accompanies the new Analog Circuit library. Under $CSIM_MODEL_LIBS/analog_circuits/images are the following schematic symbols:
resistor.ppm |
capacitor.ppm |
inductor.ppm |
switch.ppm |
battery.ppm |
diode.ppm |
zenior.ppm |
SCR.ppm |
LED.ppm |
photodiode.ppm |
transformer.ppm |
JFET.ppm |
MOSFET.ppm |
npn_transistor.ppm |
pnp_transistor.ppm |
DEFINE_DEVICE_TYPE: i486x PORT_LIST( clk, addr, data_io, rw ); DEFAULT_ICON( $CSIM_MODEL_LIBS/icons/host.ppm ); . . .Simply name the image file to be rendered whenever a device of this type is snapped down (added to a diagram). This becomes the default icon for the given model type. The icon will appear automatically and immediately anywhere the model is instantiated, unless overridden by a subsequent properties setting.
You can use this option to give particular instances of a model distinct icons. Remember this is under a box's properties dialog.
You can change icon-images during simulation run-time with the following built-in routines in your models:
A set of network-related icon images is provided with every CSIM distribution under csim/model_libs/icons. You can set your boxes to be displayed in the GUI as an arbitrary icon, by naming an image file under the Properties / Attributes / Icon dialog.
The following is a detailed description of the image-display routines:
Use as, for example:
CSIM_SET_IMAGE_ICON( MY_NAME, "imagefile.ppm" );
You could change the icon of other boxes in your modeled diagram.
Example:
CSIM_SET_IMAGE_ICON( "/platoon1/radio8", "radio.jpg" );
CSIM_CLEAR_IMAGE_ICON( MY_NAME ); Or CSIM_CLEAR_IMAGE_ICON( "/platoon1/radio8" );