Custom Forms in Software from RP Photonics
Some of our software supports custom forms:
The Principle of Custom Forms
Custom forms are forms which can be tailored to your specialized needs. They are not defined in the software itself, but rather within scripts. (Below we show you some simple examples.) In contrast to the source code of our software, such scripts can be viewed, modified or made from scratch by any user. That opens very interesting options:
- Some users do not want to spend too much time on technical details. These can use custom forms made by others – for example, by their colleagues, or by RP Photonics within the technical support. For them, it is very simple to work with the software, utilizing only a graphical user interface: just put the input values into such a form, then “execute” it (e.g. by pressing F8), and you get the outputs displayed in the same form and/or in the generated graphical diagrams.
- Power users can make their own custom forms. It is not that difficult – see an example below. For an easy start, you can take some existing form and modify it.
You will love these custom forms! They provide an amazing combination of flexibility and ease of use. As a power user, you will probably soon make custom forms for all sorts of purposes – possibly even outside the specific technical context of the software.
Example 1 with RP Fiber Power: Fiber Amplifier
Below you see a custom form made with RP Fiber Power for calculations on Yb-doped fiber amplifiers, which is provided with the software as a demo file. If one opens that script, the software immediately goes into “custom form mode”, i.e., it displays that form. If you enter some input values and “execute” the form, you see the following:
The input values are stored in a separate data file. You can easily switch between different data sets.
The software can also one or more graphical diagrams (not shown here) – just as you can get with any scripts.
Here you can see part of the code defining the above form:
Custom form: -------------------------------------------------------------- $font: "Arial", bold, size = 24 Fiber Amplifier for Pulses $font: "Courier New", size = 11, space = 2.1 $box "Fiber", size = (630, 0) Fiber type: ###################################### $input (combobox: (FiberList$)) fiber$ Length: ######### Numerical steps: ###### (in z direction) $input L_f:d6:"m", min = 0, max = 1000 $input No_z_steps:f0, min = 10, max = 500 $box end $box "Operation parameters", size = (630, 0) Pump power: left: ############ at ############ $input P_p_l_in:d6:"W", min = 0, default = 0 $input l_p_l:d6:"(n)m", default = 0 right: ############ at ############ $input P_p_r_in:d6:"W", min = 0, default = 0 $input l_p_r:d6:"(n)m", default = 0 Pumping time: ############ (0 = continuous pumping) $input t_pump:d6:"s", min = 0, default = 0, hint = "time interval before pulse where we pump the amplifier" --------------------------------------------------------------
You can see here that it is not very difficult to define such a form. You could easily add some more input fields and get additional things calculated and displayed.
Of course, all relevant details are well explained in the PDF manual as well as in the context-sensitive online help system. If you encounter any problems, you will get help via the technical support.
Several demo files for RP Fiber Power contain custom forms; they are designed for calculations on fiber amplifiers, tapered fibers, actively Q-switched Nd:YAG lasers, regenerative amplifiers, generation of parabolic pulses, etc.
Example 2 with RP Fiber Power: Regenerative Amplifier
The following screen shot shows another example for custom form, made for calculations on regenerative amplifiers. This form is also provided with the software as a demo file. It makes extensive use of tab controls, allowing one to enter quite some number of inputs data and see output data on a limited space on the screen.
Example 3 with RP Resonator: Focusing of a Laser Beam
The following screenshot shows a simple form for calculating the propagation of a laser beam through one or two lenses:
One simply enters the initial beam parameters, the focal lengths of the two lenses and their positions, and the software calculates the evolution of beam radius. It can even show the beam graphically, using the nice feature that images can be displayed where the color of each pixel is determined by a mathematical expression – in this case, using the Gaussian intensity profile with a z-dependent value of the beam radius.
Example 4 with RP Resonator: Bow-tie Ring Resonator
This examples concerns a bow-tie ring resonator:
Here, a background image is used, and the input fields are positioned such that the user immediately sees to which arm length or angle some input corresponds.
Example 5 with RP Coating: AR Coating
Nice Features of Custom Forms
Custom forms can have many very handy features, some of which are listed in the following:
- All input and output values can be nicely formatted, e.g. rounded to some number of valid digits and with proper units. For example, the user may simply enter “1.53um” or even just “1.53u” into an input field for an optical wavelength, and the software will turn that into “1530 nm”.
- Input fields can be made such that all outputs will be immediately recalculated when such an input is modified.
- There are certain function keys with which you can ramp values up and down with different step sizes.
- Multiple fields can grouped into a box with a border and some heading text, or into tab control containing multiple tabs. (For example, the screen shot above contains the tabs “Gain medium”, “Pump and signal” and “Resonator”.) In that way, you can have a lot of input fields without occupying too much space on the form. (You may even have nested tab controls, multiple boxes within a tab control, etc.) However, you can also just make a very long form, and the software will provide a scrollbar for accessing all parts of it.
- For inputs, there are not only the usual text fields, but also combo boxes and radio buttons (for selecting values), track bars and check boxes.
- Output fields can be text fields, but also one can have colored bars, where both the length and color of a bar can be calculated. For example, make a bar which graphically indicates what percentage of pump power is converted to signal power, or which turns from green to orange or red once the fiber might get overheated.
- For text fields, the text color and the background color can be calculated. For example, you can change the color of a text field as soon as some value exceeds a certain limit.
- It is possible to display images (loaded from files) in a form – for example, as background images or for illustrating certain input fields. Alternatively, the image content can be calculated, using a mathematical expression which defines the color for each pair of x and y coordinates.
- One can create buttons with which additional functions can be accessed, e.g. saving some results to a file.
- It is possible to save multiple input data sets into files and load them back into the form later on. So you may easily switch between parameter sets for different fiber amplifiers, for example, while still using a single script defining the form.
- You can conveniently generate recurring parts of forms with loops – for example, one loop for 5 tab sheets, even with the parameters for one stage of an amplifier.
- Parts of a form can be dynamically disabled or even hidden. For example, don't show input fields for quantities which are not relevant based on other settings.
Due to such features, it is a real fun to work with this software!
Also keep in mind that custom forms are in no way limited to some specific set of calculations. The script language supported by our software is extremely powerful and allows you to implement basically any calculations. So you may start using such custom forms even for calculations totally outside the technical context of this software or even outside the area of physics.