New modules for the Loopo Frontend

First of all, you should know something about Tcl/Tk and C++ if you really want to insert new modules into the Loopo Frontend.

Step 1: Insert a button into the main window

The code for this step is located in the file 'lib/MainWin.tcl', in the procedure 'ShowWindow.'.

Here you should insert the code that creates your new button.

The command for the button ist 'callback'. With its argument you can specify which tool should be invoked. You can choose every string you like. But the following ones are already used: scanpars2_start, dependences_start, scheduler_start, allocator_start, targgen_start, targout_start, dispo2_start.

Step2: Update the callback

The code that processes the callback is located in 'frontend/MainWin.cc', in the method 'mainwin::callback()'. There you add a new if-construct for your new tool.

The variable 'module' should contain a string that contains the long name of your tool. You should really set this variable.

For executing external tools, loopo uses the class execute. For more info on this class see 'frontend/Executor.h'. In brief: This class handles everything that has to do with executing. You can add arguments and execute the tool. An example:

Actual = new execute(yourToolsName);
SetExecutor(Actual); // This is a macro. See below
Actual->para(TmpDirName); // Add the name of the temporary directory
Actual->para(ProjName); // The name of the scanpars output file
The rest is done by the last few lines of 'mainwin::callback()'. The Execute-class searches for the tool in the bin directory of your loopo source tree.

Step3: Receive the tool finished message

Ifyou want to be informed wether your tool is finished, you should take a look at 'mainwin::appendlog'. There you should insert your code for a successfull run for your tool and another for a failure. Note: you although get into this method if your tool was killed by a signal (SegFault/BusError).

Final note

The internal structure is a little bit confusing. So this may change in future (hopefully). If you have further questions or even bug reports or any other suggestion, feel free send me some mail.

Andreas Dischinger