CityScope / CS_Cooper-Hewitt

meta repo/sandbox repo for keeping everything related to the Cooper Hewitt exhibition
5 stars 2 forks source link

UDP merger of slider + scanner #58

Closed RELNO closed 5 years ago

RELNO commented 5 years ago

To simplify restarting procedure for museum crew and overall reducing micro processes, we'll aim to combine UDP stream in the following way:

Camera => Scanner [py] => UDP string <= COM port [py]<= Slider

Listening to this stream would be on a single port and the UDP string would change to:

{
    "grid": [
        [0, 0],
                 ...
        [24, 3]
    ],
    "slider": [0.5]
}

This should not break current listeners. If either scanner or slider are broken, UDP sender should still deliver data on other fields.

RELNO commented 5 years ago

https://github.com/RELNO/CityScope_Scanner_Python/commit/d2d9258b928f66432fcc29acf9de8decb8131370 adds slider parser and sender to UDP. Currently getting random [0-1] slider values, awaits slider class for real data.

RELNO commented 5 years ago

[Update]: https://github.com/RELNO/CityScope_Scanner_Python/commit/99325b33071009a6994b0582b4692035567f9c73 [NOTE: on a 'dev' branch] now includes multiproccesing for scanner/slider/udp sender. This means that if each of the first two has a hardware/software fail, the other will keep sending the last UDP message; i.e if scanner camera is broken, slider will still work and vice versa.

Also, slider has now 3 decimal places, to reduce 'steps' encountered in y-day test. @agrignard @popabczhang this might be a breaking change for you, as you may expect 2 decimal places.

yasushisakai commented 5 years ago

does this relate to the -1 and -2 code from @Carsonsmuts?

RELNO commented 5 years ago

@yasushisakai not sure what these codes are

Carsonsmuts commented 5 years ago

@RELNO I have not implemented that yet. Just to fill you in, we were talking today about potentially letting apps know when the button is pushed or the slider is down(restarting)

So for example.....

If Pushed : Value = -2.0 If SliderDown: Value = -1.0 All values: 0.0000 to 1.0000

Again, I have not touched your code yet, nor have I implemented these other values.

RELNO commented 5 years ago

Got it thanks. On my end this means no more than a 2nd int object in or alongside the scanner float.

RELNO commented 5 years ago

Slider+scanner played nice together today, @Carsonsmuts please pull request the edits so we can close this

RELNO commented 5 years ago

merged here: https://github.com/RELNO/CityScope_Scanner_Python/commit/e79b42745afca60f528a79091234aeb6f1ac8a3a

Closing