Author Topic: Announcing: a Graphical switch sender and lamp visualizer (for OSC mode)  (Read 8934 times)

MOcean

  • P3 Developers
  • *
  • Posts: 820
  • Michael Ocean
    • View Profile
Re: Announcing: a Graphical switch sender (for OSC mode)
« Reply #30 on: March 05, 2015, 10:25:46 PM »
Cool. Thanks. I'll send an email when this gets to be next again in my round-robin queue. Too many irons and not enough fire!

MOcean

  • P3 Developers
  • *
  • Posts: 820
  • Michael Ocean
    • View Profile
Re: Announcing: a Graphical switch sender (for OSC mode)
« Reply #31 on: March 18, 2015, 04:37:22 PM »
Pushing out the latest version of the updated client (which sends/receives lamp updates) and an "updated" version of the osc mode that responds to these requests.

Not the final version of this, by far... let me know all the problems that you find :)

https://github.com/mjocean/OscSwitchMatrixGUI

Thanks!

dave_h

  • Wizard
  • *****
  • Posts: 185
    • View Profile
Re: Announcing: a Graphical switch sender (for OSC mode)
« Reply #32 on: March 20, 2015, 05:43:53 AM »
Nice! First time I've tried this. Thanks.

Getting a KEY ERROR for lamp name  if I run with -i image.png ?

Code: [Select]
  File "smc.py", line 909, in <module>
    main()
  File "smc.py", line 782, in main
    bL = buttonMaker.makeLampMoveButton(sname, lamp_list)
  File "smc.py", line 338, in makeLampMoveButton
    number = lamps[lname].yaml_number
KeyError: 'N/A'

Code: [Select]
PRLamps:
    Mode1:
        number: L11
    Mode2:
        number: L12
    Mode3:
        number: L13
    Mode4:
        number: L14
    Mode5:
        number: L15
    Cards1:
        number: L16
    Cards2:
        number: L17
    Cards3:
        number: L18
    Cards4:
        number: L21
    Cards5:
        number: L22
    bonus1:
        number: L23
    bonus2:
        number: L24
    bonus3:
        number: L25
    bonus4:
        number: L26
    bonus5:
        number: L27
    ArrowModeStart:
        number: L28
    LaneD:
        number: L31
    LaneE:
        number: L32
    LaneA:
        number: L33
    LaneDR:
        number: L34
    Top_A:
        number: L35
    Top_S:
        number: L36
    Top_H:
        number: L37
    shootAgain:
        number: L38
    T1_Lamp:
        number: L41
    T2_Lamp:
        number: L42
    T3_Lamp:
        number: L43
    T4_Lamp:
        number: L44
    T5_Lamp:
        number: L45
    T6_Lamp:
        number: L46
    ArrowCellar:
        number: L47
    ArrowShed:
        number: L48
    ArrowRampLoop:
        number: L51
    ArrowOrbit:
        number: L52
    Cellar:
        number: L53
    cEllar:
        number: L54
    ceLlar:
        number: L55
    celLar:
        number: L56
    cellAr:
        number: L57
    cellaR:
        number: L58
    Scotty2Ball:
        number: L61
    WShedMBall:
        number: L62
    CellarMBall:
        number: L63
    deadbydawn:
        number: L64
    jackpotLeft:
        number: L65
    jackpotRight:
        number: L66
    SlingL:
        number: L67
    SlingR:
        number: L68
    Shed1Lock:
        number: L71
    Shed2Lock:
        number: L72
    Shed3Lock:
        number: L73
    Evil:
        number: L74
    eVil:
        number: L75
    evIl:
        number: L76
    eviL:
        number: L77
    gi01:
        number: G01
    gi02:
        number: G02
    gi03:
        number: G03

Curbfeeler

  • Wizard
  • *****
  • Posts: 239
  • Dan - Des Moines, IA
    • View Profile
Re: Announcing: a Graphical switch sender (for OSC mode)
« Reply #33 on: March 20, 2015, 10:59:37 AM »
Hey Michael, just saw this.  Road trip yesterday to get a Williams Fire! :)

So this works awesome.  I'll throw together a video soon.  Thanks so much for releasing it!

Dan

MOcean

  • P3 Developers
  • *
  • Posts: 820
  • Michael Ocean
    • View Profile
Re: Announcing: a Graphical switch sender (for OSC mode)
« Reply #34 on: March 20, 2015, 01:39:08 PM »
Thank you for posting the exact error and the yaml.  I was able to fix that error and the next one that appeared after I fixed that error, too :)

Oh, and I added support to make lamp display semi-transparent.  I knew I'd eventually fine a work-around for that!

Latest is on GitHub

- Michael

Nice! First time I've tried this. Thanks.

Getting a KEY ERROR for lamp name  if I run with -i image.png ?

Curbfeeler

  • Wizard
  • *****
  • Posts: 239
  • Dan - Des Moines, IA
    • View Profile
Re: Announcing: a Graphical switch sender (for OSC mode)
« Reply #35 on: March 20, 2015, 02:16:58 PM »
Got the latest.  All I can say is WOW.  I really like the transparency.  I also played just a bit with changing the RGB on a few of my inserts.  That's really neat as well.  This is mega-powerful!  Thanks again.

dave_h

  • Wizard
  • *****
  • Posts: 185
    • View Profile
Re: Announcing: a Graphical switch sender (for OSC mode)
« Reply #36 on: March 20, 2015, 03:54:21 PM »
Nice one, thanks Micheal! Works as it should, I think  8)

MOcean

  • P3 Developers
  • *
  • Posts: 820
  • Michael Ocean
    • View Profile
Thanks guys.  Lamp visualization really does improve the usability of this.  I still want to add some additional features (disable/hide specific lamps and switches, for example), but I'll get to that eventually...

I'm just glad to push this out so you can enjoy it and so I can give some other projects some time :)

Rosh

  • P3 Developers
  • *
  • Posts: 667
  • Josh Kugler
    • View Profile
Moved to the latest version with the transparent placeholders, this is just way cool. 

I have sent Professor Ocean the change I had to make to support PDB based yamls, so I'm sure he will adjust things for those to work.

MOcean

  • P3 Developers
  • *
  • Posts: 820
  • Michael Ocean
    • View Profile
Ha!  My students don't even call me Professor Ocean... they just call me "Ocean"

Thanks for sending these.  I'll integrate them and commit to GitHub as soon as I get other stuff off my plate.

In response to your email: yes, I will be making a graphical lampshow editor based on this code.  Hopefully soon.  Trying to deal with some physical lamp issues at the moment.

Moved to the latest version with the transparent placeholders, this is just way cool. 

I have sent Professor Ocean the change I had to make to support PDB based yamls, so I'm sure he will adjust things for those to work.


Mark Jarzewiak

  • Wizard
  • *****
  • Posts: 244
  • Mark Jarzewiak
    • View Profile
Ha!  My students don't even call me Professor Ocean... they just call me "Ocean"

Thanks for sending these.  I'll integrate them and commit to GitHub as soon as I get other stuff off my plate.

In response to your email: yes, I will be making a graphical lampshow editor based on this code.  Hopefully soon.  Trying to deal with some physical lamp issues at the moment.

Moved to the latest version with the transparent placeholders, this is just way cool. 

I have sent Professor Ocean the change I had to make to support PDB based yamls, so I'm sure he will adjust things for those to work.

What he means (hopefully) is that Skeleton Game comes first!  That and i need to look into getting this running to see how cool it is.

uncivil engineer

  • Wizard
  • *****
  • Posts: 118
  • Alan
    • View Profile
Michael,
I am struggling to get the switch matrix client to talk to connect to my OSC enabled version of Flash.

I know the OSC mode is working in my flash code because I see the following in the log file:

Code: [Select]
2015-04-05 21:20:08,934 - game.modes - INFO - Added OSC_Mode  pri=1.
2015-04-05 21:20:08,934 - game - INFO - OSC Server listening on 10.211.55.7:9000
2015-04-05 21:20:08,937 - game - INFO - outHole: closed (1)
2015-04-05 21:20:08,940 - game.modes - INFO - Modes changed in last run loop cycle, now:
2015-04-05 21:20:08,940 - game.modes - INFO -   99  UtilitiesMode   -           
2015-04-05 21:20:08,940 - game.modes - INFO -   50  Sound           -           
2015-04-05 21:20:08,940 - game.modes - INFO -   8   DropTargetMode  -           
2015-04-05 21:20:08,940 - game.modes - INFO -   7   JetBumper       -           
2015-04-05 21:20:08,940 - game.modes - INFO -   6   BonusGameMode   -           
2015-04-05 21:20:08,941 - game.modes - INFO -   5   BaseGameMode    -           
2015-04-05 21:20:08,941 - game.modes - INFO -   3   Attract         -           
2015-04-05 21:20:08,941 - game.modes - INFO -   3   LampShowMode    -           
2015-04-05 21:20:08,941 - game.modes - INFO -   1   OSC_Mode        -           
2015-04-05 21:20:08,941 - game.modes - INFO -   0   ScoreDisplay    ScoreLayer 

I think the reason may be because I am running flash on a virtual instance of Windows 7 via parallels desktop.  When I try to run the switchMatrixClient, I get the following error:  [Errno 10061]  No connection could be made because the target machine actively refused it.

My instance of Windows 7 on my Mac is using shared network connection, so it gets kinda of a strange ip address (10.211.xxx.xxx).  I tried setting up my Windows 7 virtual machine on a bridged network connection so it would get a normal 192.168.xxx.xxx address, and this didn't help.

Any ideas how to get this running?  Could it be windows Defender?  Python is already on the exception list, so I don't think it is being blocked there.

MOcean

  • P3 Developers
  • *
  • Posts: 820
  • Michael Ocean
    • View Profile
Could you try running the graphical osc client also within the windows 7 instance?  Windows defender shouldn't block network requests coming in from the local host.  At least I don't think it does.

uncivil engineer

  • Wizard
  • *****
  • Posts: 118
  • Alan
    • View Profile
Michael,
Yes, I am running the client within the same windows 7 instance.  I have been running my flash code in one windows cmd shell, and I have been using a separate windows cmd shell to run the switchMatrixClient.

Tonight I will try to post a screen shot of what I am seeing.
--Uncivil Engineer

Rosh

  • P3 Developers
  • *
  • Posts: 667
  • Josh Kugler
    • View Profile
I had an issue with virtual hosts running on my system that led to issues with IP addresses, so you may want to double check that they are seeing it as the same IP, since the code grabs what it thinks it is by default.  If you are running in same instance, I would not see that as an issue, but something to check.  Not even sure if MOceans code cares about that.

In addition, if you are using the lamp feature, I have found you need to run things in a specific order.   

I've seen messages like the below and restarting the game would seem to resolve it.

Code: [Select]
Traceback (most recent call last):
  File "switchMatrixClient.py", line 228, in onLeftButtonUP
    sendOSC(event, False)
  File "switchMatrixClient.py", line 199, in sendOSC
    osc_client.send(osc_msg)
  File "/Library/Python/2.7/site-packages/OSC.py", line 1141, in send
    raise OSCClientError("while sending: %s" % str(e))
OSC.OSCClientError: while sending: [Errno 61] Connection refused