#robotics Logs

Dec 17 2019

#robotics Calendar

12:54 AM rue_mohr: this program I wrote has a network of interconnected variables that I'm surprized hasn't become sentient
12:59 AM mrdata: does it do its job?
01:01 AM mrdata: https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRuVD4ryUbmRCIOqlgVsNtKTUt6PT4FVbwwSCTj89s3Zl1GWArf&s
01:34 AM rue_mohr: ok I have the function down to 216 lines...
01:35 AM rue_mohr: heh
01:35 AM rue_mohr: nice ones
01:36 AM rue_mohr: but the best part i that its almost completely re-arranged into rendering, getting input, and parsing it
01:41 AM rue_mohr: for (a = 0; a == 0; a = getche()) usleep(5000);
01:48 AM rue_mohr: ok, I got rid of the variable called 'lenny'
03:04 AM rue_mohr: ok I think I can just about split the huge ugly function in half tommmorow
03:05 AM rue_mohr: but its 1am, and I was suppsoed to get to bed in good order for work tommoorw
03:06 AM rue_mohr: started with a fucntion 316 lines, ending with one thats 184
05:21 AM chisight: yay for negative programmer productivity!
06:18 AM deshipu: nothing negative about it
06:30 AM chisight: the absurd lines of code metric is negative.
06:31 AM veverak: depends
06:33 AM chisight: -132 looks like a negative number to me. maybe there is another new math that somehow says -132 is positive but i don't know it.
06:35 AM veverak: I was more refering to the "absurd" part of the sentence
06:08 PM Tom_itx is now known as Tom_L
09:59 PM rue_mohr: zhanx,
10:00 PM zhanx: me
10:00 PM rue_mohr: so
10:00 PM rue_mohr: interactive program
10:00 PM rue_mohr: and programming
10:00 PM rue_mohr: I'm writing this thing
10:00 PM rue_mohr: and trying to work out how to wrap it
10:01 PM zhanx: snap plugins
10:01 PM rue_mohr: seems to me, (tell me what you think)
10:01 PM rue_mohr: general process is that you draw something for the user,
10:01 PM rue_mohr: you set up event handlers
10:01 PM rue_mohr: the event handlers modify some data
10:02 PM rue_mohr: and sooner or later you redraw/restart
10:02 PM zhanx: http://snap4arduino.rocks/
10:02 PM rue_mohr: it bothers me how much of programs are drawing tthings for users, setting up events and handling them
10:06 PM rue_mohr: hmm
10:06 PM rue_mohr: web pages seem to do this pretty smoothly on simple things
10:06 PM rue_mohr: but all the events are navigation to other pages
10:06 PM rue_mohr: hmm
10:07 PM rue_mohr: Its funny, cause I'm building a program for doing state machines
10:07 PM rue_mohr: and this interactiveness of the softare is basically a state machine
10:08 PM rue_mohr: part of my issue is that I'm drawing from a data object that really should be two objects
10:08 PM rue_mohr: and
10:08 PM rue_mohr: a pile of variables that should be more
10:08 PM rue_mohr: it all seems valid, but its messy as hell
10:09 PM SpeedEvil is now known as Guest32197
11:02 PM rue_mohr: draw, collect events, process events, modify draw data
11:02 PM rue_mohr: k
11:03 PM rue_mohr: the trick being that event handlers basically need access to *everything*
11:03 PM rue_mohr: and you dispise globals
11:03 PM rue_mohr: well, part of the gui thing is having the same event for multiple objects
11:04 PM rue_mohr: focus object
11:04 PM rue_mohr: so the event reciever tells you what recieved what event
11:04 PM rue_mohr: X is broken cause it does not allow you to define custom events
11:05 PM rue_mohr: but events need to have a global understanding
11:05 PM rue_mohr: so we cant just create them on the fly
11:05 PM rue_mohr: but if we do within our program, we should be abel to have any object subscribe to that event
11:06 PM rue_mohr: question is tho, how do we allow an event handler to modify prettymuch anything without globalizing all the variables
11:06 PM rue_mohr: and does an event hander REALLY need to be a seperate function
11:06 PM rue_mohr: it does it you want to trim another 180 lines off this function
11:06 PM rue_mohr: true dat.
11:07 PM rue_mohr: its pretty slim now, about all you can boil down are the custom popup boxes
11:07 PM rue_mohr: we should make a more generic popup box
11:07 PM rue_mohr: diaglog box
11:07 PM rue_mohr: hmm
11:08 PM rue_mohr: wow you escallated that fast
11:09 PM rue_mohr: this event handler is a state machine
11:09 PM rue_mohr: we agree
11:09 PM rue_mohr: its if-else
11:09 PM rue_mohr: should it be switch
11:09 PM rue_mohr: it would need to be nested
11:11 PM rue_mohr: if you want to make isolated functions for all this, the call params are going to go insane
11:29 PM rue_mohr: it overall picture is a pile of user event masks
11:29 PM rue_mohr: so, you ahve the main menu
11:29 PM rue_mohr: that takes you to the editing menu
11:29 PM rue_mohr: and that pops up the occasional value entry menu
11:30 PM rue_mohr: you want melt this program all into one event handler dont ya?
11:30 PM rue_mohr: well, it would allow you to tthrow different event contexts simotaniously
11:31 PM rue_mohr: menu modes
11:31 PM rue_mohr: hmm
11:32 PM rue_mohr: this is good state machine excersize for ya
11:33 PM rue_mohr: would it get worse if we boiled it down to one loop
11:33 PM rue_mohr: I think we need to clasify our objects better
11:33 PM rue_mohr: k
11:34 PM rue_mohr: w have a FSM
11:34 PM rue_mohr: we have an fsm project
11:34 PM rue_mohr: we have simulation
11:35 PM rue_mohr: and we have ... interface stuff
11:36 PM rue_mohr: so, from pronterface, you should know that a proper set of value into dialog boxes is really important
11:36 PM rue_mohr: hehe stupid percent
11:38 PM rue_mohr: thats not a bad outlook
11:38 PM rue_mohr: variables for the target object, vs variables for the interface to that object