What type of machine you ask? A machine that measures wedge and roundness of lenses.
I've already written software for the machine and it is in production, but it is brittle and prone to lock ups when they dont do things in the right order. I'm trying to come up with the best way to architect it so that its stable and maintainable.
Here's the quick twenty second run down. There are two modes, setup and run. In setup mode the operator can manually move any of the 6 different motors using one of the 6 different momentary toggle switches on the control panel. They get everything homed in, then they turn it to run mode, load a lense, and press go. The machine will automatically bring in the three indicators, find the edge of the lense, and then rotate the spindle and measure all the way around the wedge.
I ended with a very poor non-design of having a class that raised an event that says when a switch has changed state, which switch it was, and what its new state is. Then I do a lot of ifs and stuff to determine what the machine can do. As you can imagine, this is very very bad.
Does anyone have any good ideas on how to structure this? I have some of my own, but I want to hear some from those that may be a little more experienced with this type of application development.