Re: Code Contributions to the software
Posted: Tue Jun 16, 2015 8:49 am
As the code presentation is of personal taste, I obviously leave it in a better shape, given my taste
The thing that's annoying with the version of vs that i use is when you use autocomplete for something like
.videoProessing
and it fill in .videoCapture because you hit tab too soon, you have to erase the entire method to get it provide autocomplete again. would be nice if it provided it for you hit tab with a partial name, even if you didn't just type it in from the beginning. is this improved in the latest versions?
I've done a major overhaul of the code base so far. perhaps unnecesssary, but having like 10,000 lines of code in the main form handler made it hard for me to follow sometimes. so i broke it up into a number classes. i also replaced the homogoneyestimation code with some stuff I wrote (based on least squares fitting to get the rotation angle and then it's simple to find the offset -- not fully tested, but i expect it to). also most of the state is stored in datagridview objects as strings. this required a lot of parsing and valiation of variables which i didn't like. i've reimplemented everything using BindingList<objects> bound to the datagrids so that you can edit an object or the table and be assured that the data is always valid and consistent. i also used this approach to enable for an arbitrary number of measurement filter sets - so you can create one specific to each type of component in the tape if you want. the placement jobs are much easier now as you just have component objects that populate the components table and you put them into another object to group them to populate the job table. you then just pass a list of selected components to be placed.
i've modified the tinyg firmware (bitch to do given how it was written) to read from the ADC (\SS2 pin) when you read the 'adc' configuration parameter. untested but that approach should work. I've removed support for spi2 in the process (identical to spi1 but used \ss2 instead of \ss1). I will use this to interface with the pressure sensor that I've installed to detect if a pickup was successful or not.
I've changed the UI so that the cameras are always on so you can see what's gong on - i notice sometimes i have to adjust the thersholds on the filters - not sure why - but it's easy to spot that when you see how the computations are being made. It's also in a separate window than the main one. I've consolidated the calibration functions into a new page, and broke out three classes
VideoCapture -> VideoProcessing
and a static class VideoDetection
the code is still too rough to release but it's coming together ok. Once it's operational again, I will start adding additional functions like using the upward camera to determine how off center the pickup of a component was - and to correct for it when it places it. This includes passives like 0402s. I posted this but have not had time to follow up
http://stackoverflow.com/questions/3065 ... of-objects
-r
The thing that's annoying with the version of vs that i use is when you use autocomplete for something like
.videoProessing
and it fill in .videoCapture because you hit tab too soon, you have to erase the entire method to get it provide autocomplete again. would be nice if it provided it for you hit tab with a partial name, even if you didn't just type it in from the beginning. is this improved in the latest versions?
I've done a major overhaul of the code base so far. perhaps unnecesssary, but having like 10,000 lines of code in the main form handler made it hard for me to follow sometimes. so i broke it up into a number classes. i also replaced the homogoneyestimation code with some stuff I wrote (based on least squares fitting to get the rotation angle and then it's simple to find the offset -- not fully tested, but i expect it to). also most of the state is stored in datagridview objects as strings. this required a lot of parsing and valiation of variables which i didn't like. i've reimplemented everything using BindingList<objects> bound to the datagrids so that you can edit an object or the table and be assured that the data is always valid and consistent. i also used this approach to enable for an arbitrary number of measurement filter sets - so you can create one specific to each type of component in the tape if you want. the placement jobs are much easier now as you just have component objects that populate the components table and you put them into another object to group them to populate the job table. you then just pass a list of selected components to be placed.
i've modified the tinyg firmware (bitch to do given how it was written) to read from the ADC (\SS2 pin) when you read the 'adc' configuration parameter. untested but that approach should work. I've removed support for spi2 in the process (identical to spi1 but used \ss2 instead of \ss1). I will use this to interface with the pressure sensor that I've installed to detect if a pickup was successful or not.
I've changed the UI so that the cameras are always on so you can see what's gong on - i notice sometimes i have to adjust the thersholds on the filters - not sure why - but it's easy to spot that when you see how the computations are being made. It's also in a separate window than the main one. I've consolidated the calibration functions into a new page, and broke out three classes
VideoCapture -> VideoProcessing
and a static class VideoDetection
the code is still too rough to release but it's coming together ok. Once it's operational again, I will start adding additional functions like using the upward camera to determine how off center the pickup of a component was - and to correct for it when it places it. This includes passives like 0402s. I posted this but have not had time to follow up
http://stackoverflow.com/questions/3065 ... of-objects
-r