(no subject)
Mar. 5th, 2019 08:35 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
The main language I use for my test system at work is a test management package that provides a way to call lower-level language functions. It is oddly selective in what it allows you to do. Things like
One of the things it provides is datalogging: you call a low-level routine, pass it a number by reference, and it chucks the number into an ASCII file. The number is associated as a value, with a key, and the key is the name of the datalogging routine.
So a chunk of datalog code would look like:
measure input_voltage_1
input_voltage_1 datalog()
and so forth.
Which is fine, but that means for every measurement I have to correctly type in what the measurement is, and that gets old fast because I'm measuring like 800 things. (Seriously. Actually more.)
I was poking around in the program's documentation today and found that because it's sort of vaguely object-oriented, I can mess around with the inherited attributes and with overloading them, and realized that I can dynamically generate names, that I can use to overwrite the names of the datalogging routine.
As a result, I converted 1023 lines of code into 7 lines of code, and the really cool part is that 256 of those lines were names I had to type in by hand, and now there aren't any names I have to type in by hand. It generates the whole works for me, because it knows what it just measured and uses that to produce the key.
I'm ridiculously pleased with this, mostly because of the massive scope of error reduction.
And I'm pretty sure this is the sort of thing that is completely meaningless to my manager, because I'm the only person who would ever use complicated stuff like this.
if (variable OR 64)always return '1', because it analyzes clauses as booleans, even though you think you're bitmasking, for instance. (And if this is covered in the documentation, I haven't found it.)
One of the things it provides is datalogging: you call a low-level routine, pass it a number by reference, and it chucks the number into an ASCII file. The number is associated as a value, with a key, and the key is the name of the datalogging routine.
So a chunk of datalog code would look like:
measure input_voltage_1
input_voltage_1 datalog()
and so forth.
Which is fine, but that means for every measurement I have to correctly type in what the measurement is, and that gets old fast because I'm measuring like 800 things. (Seriously. Actually more.)
I was poking around in the program's documentation today and found that because it's sort of vaguely object-oriented, I can mess around with the inherited attributes and with overloading them, and realized that I can dynamically generate names, that I can use to overwrite the names of the datalogging routine.
As a result, I converted 1023 lines of code into 7 lines of code, and the really cool part is that 256 of those lines were names I had to type in by hand, and now there aren't any names I have to type in by hand. It generates the whole works for me, because it knows what it just measured and uses that to produce the key.
I'm ridiculously pleased with this, mostly because of the massive scope of error reduction.
And I'm pretty sure this is the sort of thing that is completely meaningless to my manager, because I'm the only person who would ever use complicated stuff like this.