2008-01-08

AutoDemo.wx.py

I've just finished implementing the ClipsJNI Auto Demo example in wxPython. This time it was easier to do a line by line (more or less) re-write of the Java code, but that's mostly because most of the GUI is controlled from within the Clips file.



Just as with the Wine Demo I had to modify some of the calls to the Clips engine. I added two functions that return Fact indexes instead of Fact addresses, but that's it.

The demo is here. If you've already got Python, wxPython and pyClips installed all you have to do is run python AutoDemo.wx.py at a command line and it should pop right up (same goes for the Wine Demo).

Once I've finished the Sudoku Demo I'll write up some instructions on how to use pyClips and wxPython in general. Where to start, where to get help and such things. Enjoy!

8 kommentarer:

Almost Earthling sa...

Ha...

I was also looking at the Sudoku Demo, that with the Wine Demo could make a nice screen shot for a possible new PyCLIPS homepage. But since you are already thinking about it, I think it might be better for me to try to correct the issues that I recently found in PyCLIPS (see RFE 1868029 in SF.net) also in order to return lists of facts to Python.

Thank you for putting such an effort into this!

F.

Johan Lindberg sa...

Hi Franz,

I'll try to finish the last demo as soon as possible. Now that you've shown me how, hopefully I can get it working without modifications to the .clp file as well.

Almost Earthling sa...

Well, I think that in this particular case (having facts returned instead of fact indexes) you would need to wait for the next release (or use the code now in SVN). The upcoming release will allow passing and returning facts and instances to CLIPS, even though not in the case of CLIPS function calls.

kidder-family sa...

Thank you very much for the nice job you did. I am new to expert system, I first started with CLIPS, and tried wxCLIPS for GUI, I spent some time but it is not updated for long time and have lots of short comings, so i gaveup with it.
Next i was searching on previous CLIPS support archives, and found some hint to use pyclips, if I am not mistaken you are the one advicing some guy to try. Then I started to familarize my self with python, wxpython, pyclips. I was looking for some example and i found your work to be supportive to start with.Currently I have created some GUI in wxpython which i did not yet link with clips. Once again thank you for your work, and keep it up.
Dereje (derejeng@gmail.com)

Johan Lindberg sa...

Thank you Dereje. I hope you manage to get your application up and running without too much problems. Also, note that Francesco is making some improvements to pyClips which, once released, will make it even easier to integrate a wxPython GUI with Clips.

Johan Lindberg sa...

Hi again Franz,

I snatched the new code from SVN some hours after you updated it.

Even though most of your conversation with Gary about this issue was over my head I believe that these changes will indeed make it a bit easier to work with pyClips. Any ideas on when a new release will be made?

Almost Earthling sa...

Hi Johan...

I just read your last comment: I have to admit that I was a little bit in a hurry to release the new version of the code with the changes that would let you avoid to write the get-wine-list-index function in the CLIPS part. And here it is: I tried to directly call get-wine-list from your code using PyCLIPS 1.0.6 (for which I also added a new test case, that's why it took me some more time to release it ;-) ) and it works as expected. I hope, this will make PyCLIPS a little more straightforward to use...

Please try it and let me know!

F.

Johan Lindberg sa...

Thanks Franz,

pyClips 1.0.6 works perfectly. I've modified the demos (Wine and Auto) so they are more or less exactly as their Java counterparts. Good work, and thanks for being so quick.