jawaff / KinectController

Control your computer using your body. The KinectController turns the Kinect into a controller that allows configurable actions to be emulated when configurable gestures are triggered by the user.
0 stars 0 forks source link

Refactor config.jj so it validates the config file in a nicer manner. #32

Closed jawaff closed 8 years ago

jawaff commented 8 years ago

The config.jj for the most part should be handling error checking, parsing and interfacing with the main program. So we need to start pushing more of the code into the main part of the class and also start doing some error checking for some of the things we're parsing.

jawaff commented 8 years ago

A while ago this was done with just for the Angle rule. I got caught up working on mouse control and I didn't finish this. This will need to be thought out more probably.

The config.jj should for the most part just handle the parsing and utilize a set of premade tools from the main project. So the config package should probably be expanded by pushing the generated Java files into a 'generated' subpackage. From there we could place all of the tools within the parent config package.

These premade tools should include:

  1. Something that constructs different types of generic Esper Queries. This should later support Esper queries comprised of a series of gestures over time.
  2. Something that helps with validating the config file. I'm not sure what is necessary. The config.jj file already handles quite a bit of the syntax of the config file, but the values entered into the config file will also need to be validated. That kind of validation might be able to be pushed outside of config.jj?
  3. Something used to debug the config.jj file. I was thinking that it'd be cool to generate an html file that highlighted parts of the config file that were incorrect and display error/warning notes for the invalid lines. This would have to probably integrate with whatever system evolves from #2. Would a database be necessary to store the data needed for the validation?
  4. A tool that generates different types of Reactions for some gesture.
  5. A tool that creates premade gestures so that beginners can easily create config files and impossible gestures can be made -- the mouse control gesture is an example of this.
  6. Maybe a factory for gestures? I'm not sure what they could evolve into later on.
jawaff commented 8 years ago

I've been working on getting some of the above tools worked out. The 1st, 5th and 6th are the ones that are relevant to what I'm doing. I made rule installers and premade gesture factories and have been making the config.jj handle the parsing and validation of the parsed data.

jawaff commented 8 years ago

For now, the config.jj file is looking spectacular. I'll open up some newer issues if I finally decide to make a nice error reporting website generator for the given config files.