Let's take a trivial piece of scheme code:
(lambda (design) (= #t #t))
Doesn't do much, does it? Don't need an editor to help you develop it? No. Not really. But it's a start. The following python code generated the above expression...and it should go without saying that this is really intended to be driven by a GUI and not manipulated by hand...but still...cool, eh?
>>> from tpcl.data import Import
>>> blocks = Import.LoadBlocks('tpcl/data/base_blocks.xml')
>>> exp = Representation.TpclExpression(blocks["INITIAL_BLOCK"]["Lambda Design"])
>>> bool = Representation.TpclExpression(blocks["BOOL"]["="])
>>> t1 = Representation.TpclExpression(blocks["VAL"]["#t"])
>>> t2 = Representation.TpclExpression(blocks["VAL"]["#t"])
>>> exp.InsertExpression(17, bool)
>>> Setting offset of expression to 17
>>> bool.InsertExpression(20, t1)
>>> Setting offset of expression to 20
>>> bool.InsertExpression(24, t2)
>>> Setting offset of expression to 23
>>> str(exp)
'(lambda (design) (= #t #t))'
-Fro
Wednesday, August 1, 2007
Tuesday, July 31, 2007
Expression Editor
I went ahead and threw together a possible layout for the TPCL Expression Editor in wxGlade today. It was based heavily off of the mockups I did before my project was chosen. A screenshot is shown below:

I'm also working on a way to make the expression editor useful for those who don't really program. That is to say, it will simply be a matter of pointing, clicking and selecting what you need. And if that's all you do there should be no errors in your code. Code snippets should be available in plenty and pre-constructed blocks of code should provide common functionality quickly and easily. Lofty goals, eh?
Right now I feel like the way I'm going about it is too brute force and inelegant, but I'll get this working in a basic prototype form and if I still feel issues I'll go back to the drawing board and do some more research.
-Fro

I'm also working on a way to make the expression editor useful for those who don't really program. That is to say, it will simply be a matter of pointing, clicking and selecting what you need. And if that's all you do there should be no errors in your code. Code snippets should be available in plenty and pre-constructed blocks of code should provide common functionality quickly and easily. Lofty goals, eh?
Right now I feel like the way I'm going about it is too brute force and inelegant, but I'll get this working in a basic prototype form and if I still feel issues I'll go back to the drawing board and do some more research.
-Fro
GSoC Status Report: 7/23/07 - 7/29/07
Not so much to report on this one. No list of accomplishments. I spend the first part of the week failing to get a context menu working for the tree view. The way wxPython sends its mouse events defies my ability to grasp. I can't prevent the selectionchanging and selectionchanged events from firing before the right click event and so can't veto it. Feh. That frustrated me to no end. So I'll get back to that later from a different angle after I get the TPCL Expression Editor working. Oy. I mean. I even messed with where I bind the handlers and didn't get the results that I wanted. Meh.
I also went ahead and provided support for multiple categories now that tpserver-cpp supports them as well. They're included in the RDE and in the generated code. So that's kind of cool.
The end of the week was spent working on figuring out how to get the StyledTextCtrl to recognize keywords for the TPCL Expression Editor without me having to handle styling events with a lexer of my own. Thankfully I found something that should work.
Now I'm working on getting the TPCL EE up and running. It looks to be a bit bigger of a project than I had imagined before, but I'm confident that I'll make good progress this week.
-Fro
Oh. And since mithro is always prodding me to post new and fabulous screenshots of the RDE, here's a shot of the feedback the RDE gives on errors:
I also went ahead and provided support for multiple categories now that tpserver-cpp supports them as well. They're included in the RDE and in the generated code. So that's kind of cool.
The end of the week was spent working on figuring out how to get the StyledTextCtrl to recognize keywords for the TPCL Expression Editor without me having to handle styling events with a lexer of my own. Thankfully I found something that should work.
Now I'm working on getting the TPCL EE up and running. It looks to be a bit bigger of a project than I had imagined before, but I'm confident that I'll make good progress this week.
-Fro
Oh. And since mithro is always prodding me to post new and fabulous screenshots of the RDE, here's a shot of the feedback the RDE gives on errors:
Monday, July 23, 2007
Oy, the commits
I am quite terrible about checking my commits. I'll charge on in and commit something that breaks everything else, simply because I forgot to add a new file. It's getting rather silly now. Every time I create new files I forget to add them to git. Meh. And then I make posts about how awesomely everything works. And it doesn't work when it gets checked out. Feh.
-Fro
-Fro
GSoC Status Report: 7/9/07 - 7/22/07
This status report will cover two weeks instead of one since I missed the last report.
Things that were accomplished this period are:
Things that were accomplished this period are:
- Switching to the Elementtree library for XML input and output
- Updated the XML persistence file format
- Added a global configuration manager which provides a means of tracking recent projects and other handy info like that
- Ability to rename objects
- Added project validation - All attributes must be filled in and TPCL code must be valid. Syntax is checked for the TPCL code and also all procedures and symbols used are verified as being valid.
- Changed how we monitor changes entered in the edit windows - no more funky delayed behaviour
- Added the ability to duplicate objects - handy for making a bunch of components that do pretty much the same thing to varying degrees.
- The TPCL Expression Editor - fun, fun
- Support for more types of game objects.
Friday, July 20, 2007
RDE Fully Functional
I'm sure that there are bugs just waiting to be discovered with more rigorous use. And the fact that game objects only support one category at the moment (which is also the case with tpserver-cpp) keeps things from being perfect, the RDE is at a state that I'm quite happy with now. I just went through a quick run of duplicating the Minisec objects from tpserver-cpp in the RDE from scratch. I found a few small bugs along the way, but they were easily fixed. The generated code worked without a hitch.
TPCL syntax checking and code validation is in place so that people don't have to deal with cryptic error messages from the servers when they try to run their code. The RDE even checks to make sure that the project doesn't have any errors before generating code.
I'm can now turn my attention towards developing the TPCL expression editor. That will be quite fun, I think, and also quite challenging, but at least a lot of the work is already in place with the StyledTextCtrl that I'm using to display the TPCL code. It already provides facilities for code completion and the like so extending it to incorporate what will basically be code-snippits-on-steroids shouldn't be too bad.
Woot.
-Fro
TPCL syntax checking and code validation is in place so that people don't have to deal with cryptic error messages from the servers when they try to run their code. The RDE even checks to make sure that the project doesn't have any errors before generating code.
I'm can now turn my attention towards developing the TPCL expression editor. That will be quite fun, I think, and also quite challenging, but at least a lot of the work is already in place with the StyledTextCtrl that I'm using to display the TPCL code. It already provides facilities for code completion and the like so extending it to incorporate what will basically be code-snippits-on-steroids shouldn't be too bad.
Woot.
-Fro
Sunday, July 8, 2007
GSoC Status Report 7/2-7/8
This week was pretty uneventful. The Fourth of July ended up taking a lot of time, both before and after, so it turned out to be a bit of a holiday week. The things that I accomplished were:
- Fixed deletion behavior. Objects that are deleted now propagate the event to all other objects so that they can remove associations to it.
- Changed the method for loading edit panels, a new wxPanel isn't generated every new selection, a pre-existing one is simply filled with new data (thanks mithro)
- Refactored the code to separate GUI stuff from the guts. Also separated the various representations of game objects a bit. More work needs to be done on the XML view, but it's better than it was. This was fairly easy to do since there was already a lot of separation and decoupling between different elements of the program.
- Started work on adding icons to the tree control - this allows immediate feedback for modification events and allows more expressive visual elements to be incorporated into the RDE.
- Adding support for other object types, perhaps resources, solar systems and planets.
- Doing basic error checking on game objects to ensure that all fields are filled in before allowing code to be generated, I may also incorporate Scheme syntax checking as well if it isn't all too difficult.
- Allowing for the renaming of objects (this will likely involve extracting the object save routine from the individual objects and making it a general method)
- Finally talking to llnz to get his ideas on the generated code for tpserver-cpp
- Getting back to mithro about the interactions between the RDE and tpserver-py
Subscribe to:
Posts (Atom)
