NAF GUI First Steps - edwardkort/WWIDesigner GitHub Wiki
NafOptimizationRunner (under com.wwidesigner.gui) is a proof-of-concept of both the implemented core engine and the JIDE libraries as the basis of a stand-alone GUI application. As implemented, it supports:
- Opening instrument, tuning, and constraints, XML files
- Editing instrument, tuning, and constraints, XML files
- Calculating predicted tuning for a given instrument and target tuning
- Optimizing an instrument for a specific tuning using a variety optimizers
- Using those optimized instruments to calculated expected tuning and saving them for future use
Prerequisites for Use
- Sync to the github master
- Install the JIDE and JDAF libraries as indicated in .classpath
You may run NafOptimizationRunner either as a Java application within Eclipse or by creating an executable jar file (File/export in Eclipse).
Using the Application
- Files (instrument and tuning XML) must be opened for use.
- After the first use, the program will "remember" both the most recent files used and the directory used to open files.
- Open at least one instrument and one tuning file. The program will parse and validate those files, putting them in the appropriate branch of the Study tree
- In the Study tree, click on (select) one instrument and one tuning file (the UI will enforce singe selection of each).
- The evaluation tools on the Tool menu item will now be active. Calculate tuning displays an instrument tuning table in a new window, comparing predicted and target tuning. Each click of the menu item will make a new frame, but you will need to move the top one to see the ones below. Graph tuning displays a graph of instrument impedance vs. frequency for the notes in the tuning. Sketch instrument displays a scaled diagram of the current instrument.
- You can either open a Constraints file, or use default constraints: for the NAF study model, select a constraints set from the Study tree.
- Select an optimizer in the Study tree.
- The Tool-->Optimize instrument menu item will now be active. Clicking on the menu item will perform the specified optimization. A new instrument will be created in the main window and added to the Study tree. The Console view will also reflect output from System.out and System.err.
- Select the new instrument (called Untitled?) in the Study tree and click Tool-->Calculate tuning or Tool-->Graph tuning to see how well we did.
- To compare the optimized instrument with the original, select the original instrument in the Study view and the optimized instrument in the editor pane, and click on Tool-->Compare instruments.
Other things you can do include:
- Edit, in place, any of the instrument and tuning files in the main window. Those edits will be used in subsequent calculations (tuning and optimization) without having to do a save.
- Toggle between dialog and raw XML views of a file in the editor pane.
- Play with toggling the visibility of the Study and Console views
- Play with docking and undocking the Study and Console views
Next Steps
- Add progress bars to the application
- Add utilities for creating starting instrument and tuning files based on criteria.
- Add other instruments (optimizers and constraint sets)
Overall Impressions
Ok, I'm pretty stoked! I intend to use the application, over the next several days, to design real instruments.
The JDAF library has a fairly steep learning curve. But you will notice that there are very few lines of UI code that I had to write to create the application. I think that it is worth moving forward with JDAF until/if we seriously bump our heads.