Tokolos Posted November 14, 2008 Report Share Posted November 14, 2008 I would like to give back to the community a tool I developed based on ACSim that allows me to visually simulate my custom Midibox(s). I call it GUISim.GUISim Brief Description:GUISim graphically simulates a MIDIBox with core, input controls and visual outputs. It uses SDL and UIP to create the midibox module simulations. I have used the great work audiocommander has done with ACSim and want to give him credit here for allowing use of his work for modification or functionality expanding.This proof of concept version is fully functional for my own prototyping and I am continually adding to it as I need to simulate additional modules.:Simulated MIDIboxOutput Modules2x40 LCD character display A set of LEDs mapped to a virtual DOUTx4 showing the state of each pin visually as a LEDSimulated MIDIbox Input ModulesOne DINx4 Module connected as:8 Rotary Encoders16 Pushbuttons[*]A set of LEDs mapped to a virtual DOUTx4 showing the state of each pin visually as a LEDHow to use it:IMPORTANT:You need to have your CodeBlocks development environment and toolchain already working before you can use this. Follow the instructions for setting up ACSim first if you do not alread have it running. Link - http://www.midibox.org/dokuwiki/doku.php?id=mios_c_simulator_-_debuggerGUISim is meant to be used as a user template for CodeBlocks, so the steps are:Copy and unzip the file (http://www.netmpu.com/CB_SDCC_Skeleton_GUI_Simulator_v0.1_Windows.zip) into the user templates directory of your CodeBlocks installation. (Mine is at C:\Documents and Settings\tokolos\Application Data\codeblocks\UserTemplates.)Run Codeblocks, create a new project and select the new GUI user templateHave fun, and please give me feedbackLinks:Link to the complete GUISim/ACSim template (you only need this one zip in order to use ithttp://www.netmpu.com/CB_SDCC_Skeleton_GUI_Simulator_v0.1_Windows.zipDemonstration of using GUISimhttp://www.netmpu.com/GUISimulator.htmScreenshot of GUISimhttp://www.netmpu.com/GUI_Simulator_v0.1_image.jpgPicture of simulator running: Quote Link to comment Share on other sites More sharing options...
stryd_one Posted November 14, 2008 Report Share Posted November 14, 2008 Great work!!! Awesome!Love the animated demo too.Makes me wonder if IUP/SDL is a good framework for a cross-platform sim for mios32 ...Kickass.One thing though - I notice it's setup for the old toolchain... Quote Link to comment Share on other sites More sharing options...
Tokolos Posted November 14, 2008 Author Report Share Posted November 14, 2008 Thanks for the compliment stryd_one.Yes, I have used the original toolchain I downloaded and need to update to the latest. (Do not want to loose out on any enhancements or bug fixes ;) ).I am in process of switching all my pc's over to Ubuntu Linux (love it) and will convert this tool also to Linux as a result.Having looked at various platforms I have decided on SDL and IUP (notice I spelled it correct this time..) as they both do support several platforms. Why SDL for graphical output handling?Most other graphic options I looked at either used OpenGL (which I believe is a overkill for what I wanted to do, or are based on DirectX which would forever tie into Windows and is also an overkill). So SDL it was. SDL is that it provides only the very basic graphical support and you need to add what you need to it based on your functional requirement. I just had to add the freetype library to handle fonts. So that was very simple and a good logical choice for me.Why IUP for Input handlingSimilar to the graphics requirement I needed a simple and easy to use platform to handle dialogs that are cross-platform supported. Although possible to do with SDL (with a LOT of work), it would not have justified the effort. I chose IUP because it can be easily programmed in C, but as an added benefit it allows you to define what your layout should look like outside of the C program in a configuration file (look at the the file InputSurface.led in the template for example). This has the benefit to play around and proto-type your layout without having to re-compile the program everytime. Once you are satisfied you can choose to compile the .led file into regular C code and include into yout program, or you can just distribute the .led file as part of the template (as I have done).In summary: SDL supports Linux, Windows , Mac and others where IUP supports GTK+, Motif and Microsoft Windows, so that will be all goodness for us Midiboxers that want to standardize on Linux , while still being able to support the other platforms also (Midiboxers, is that what we are called?).Regards Quote Link to comment Share on other sites More sharing options...
bugfight Posted November 14, 2008 Report Share Posted November 14, 2008 coolness, i've been meaning to make such a thing and now i don't have to...thanks for sharing.i'll try it out "soon" Quote Link to comment Share on other sites More sharing options...
stryd_one Posted November 14, 2008 Report Share Posted November 14, 2008 Wow, bugfight even crawled out of his lab to reply, you must have impressed! :DGreat to hear there's a linux port on the way. I think it's safe to say that the majority of development these days is happening on OSX and Linux. Several devs are bailing out on windows at the moment ;) Thanks for sharing, it sounds like you had suitable objectives in mind when you selected the GUI libs.And yes, we be midiboxers :) Quote Link to comment Share on other sites More sharing options...
Tokolos Posted November 14, 2008 Author Report Share Posted November 14, 2008 Here is the link to skeleton working with the new toolchainhttp://www.netmpu.com/CB_SDCC_Skeleton_GUISim_v0.1_Windows_New_Toolchain.zipJust put this under User Templates of Codeblocks and use as before Quote Link to comment Share on other sites More sharing options...
stryd_one Posted November 15, 2008 Report Share Posted November 15, 2008 That was quick! Quote Link to comment Share on other sites More sharing options...
audiocommander Posted November 16, 2008 Report Share Posted November 16, 2008 Hi Tokolos!that's great work! :D...and exactly what I hoped for would happen -And we should definitely give this project a folder on the midibox svn server...Thanks for sharing!Best,MichaelEdit:whoops, the new toolchain fix was really fast...btw: a temporary job/project of mine will hopefully end after this winter term (march/april 09). I'll surely add a Mac-OS / Cocoa GUI module to this one ;) Quote Link to comment Share on other sites More sharing options...
stryd_one Posted November 16, 2008 Report Share Posted November 16, 2008 And we should definitely give this project a folder on the midibox svn server...Agreed. Tokolog, you can PM TK to ask for access, or if you like I'll upload it for you. Quote Link to comment Share on other sites More sharing options...
stryd_one Posted November 24, 2008 Report Share Posted November 24, 2008 This project is now available on SVN:GUISim_skeleton/ Quote Link to comment Share on other sites More sharing options...
Pablop Posted June 11, 2009 Report Share Posted June 11, 2009 Hi!I'm having trouble using MClock_Timer(); in GUISim. Something as simple as:void Timer(void) __wparam{ ++counter; }doesn't work in guisim, but it does in the midibox..Is there something I have to set especially for timer to work on guisim?Thanx a lotPablo Quote Link to comment Share on other sites More sharing options...
audiocommander Posted June 11, 2009 Report Share Posted June 11, 2009 Hi,I haven't used GUISim, but as far as I can see the timer routine isn't implemented in the main runloop, though it's already in the underlying code.This should fix it:Open GUISIM_windows.c and add the following code to the function [tt]void LCD_SDL_RUN(void)[/tt], near the end inside the [tt]while(!LCD_SDL_stop_program)[/tt] loop: // poll Timer() if(debug_user_timer.TIMER_ENABLED) { Timer(); }I'd put it after the Tick(); and before DISPLAY_Tick();This should hopefully do the trick ;-)Hope that helps,best,Michael Quote Link to comment Share on other sites More sharing options...
Pablop Posted June 12, 2009 Report Share Posted June 12, 2009 Audiocommander,I wrote your spell and it became alive... Your're a magician!Thank you a lot!Pablo Quote Link to comment Share on other sites More sharing options...
audiocommander Posted June 13, 2009 Report Share Posted June 13, 2009 good to hear :-)...yay, I finally managed to break the svn spell and commited the change :DCheers,Michael Quote Link to comment Share on other sites More sharing options...
yoho Posted October 6, 2009 Report Share Posted October 6, 2009 Has anyone succeeded in porting this for XCode? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.