Page 1 of 6

Posted: Sat 02 May 2015, 20:22
by greengeek
Just a crazy thought that pops into my head - I wonder if there is some way that one PC could send an "xdotool" command to another? eg: PC1 detects you clicking the "F" key on one keyboard ("Fire !") and as a result it sends an "xdotool key F" command to PC2 which controls the Firing Control Subsystem.

How could it send such a command? Via SSH? Or via some other network software? Or will there be a need for some degree of hardware interlinking here - will one PC have to have a direct connection into another PC? (eg PC1 drives a solenoid or relay which activates a key on a keyboard that is connected to a usb port on another PC?). This would potentially be an untidy spider web of tangled cables but it's definitely possible to tap into usb keyboard devices for special purposes. I tried it here

Posted: Sat 02 May 2015, 20:25
by starhawk
Screw Ethernet, I've got something better now.

Friend of mine told me how to do the RS-232 (COMport) bit. Programming it up will be a bit of a PITA but I'm going to do that anyways, so whatever.

It's very simple, hardware-wise. Take the systems' COM Ports. Tie the TXD pin of each port to the RXD pin of the port on the next computer in line. Tie the GND pins together (common electrical ground is very important here, since it's the reference that the everything else relies on).

Software-wise -- each computer gets a name. Each 'packet' of data (for lack of a better term) contains a 'header' with the name of the intended recipient system. Each computer, when it gets a packet, examines the header. If it matches, then the computer reads the rest of the packet and acts on it. If the header does not match, then the system passes the packet along to the next computer. It's a bucket-brigade sort of scheme.

Since all along I've been planning on sending very simple text data, this will actually work pretty well. At 115200 baud (that's a bit over a hundred and fifteen thousand characters per second) the otherwise-significant latency induced by the bucket-brigade method shouldn't even be noticeable to the user. Mind you, if I was going at 300 baud like an old modem... that would be different. I think I can do a little better than that ;)

Keep in mind that this method is far, far less harebrained than what I'd originally come up with... I'm not even going to put that one up, it's actually kind of embarrassing how bad it was.

So. Next question.

Assuming that I will be using bash and GTKDialog, how do I get a full screen black background and borderless dynamic (changeable) images onto a monitor...? How do I specify the position of the images? (I assume it's XY coordinates starting from a 0,0 point? Where's 0,0?)

Posted: Sun 03 May 2015, 10:31
by Packetteer
starhawk wrote
Assuming that I will be using bash and GTKDialog, how do I get a full screen black background and borderless dynamic (changeable) images onto a monitor...? How do I specify the position of the images? (I assume it's XY coordinates starting from a 0,0 point? Where's 0,0?)
Unless Linux is totally different then Windows (which it probably is)
traditionally 0,0 is the upper left corner of the screen.

Best Regards
John

RS232 serial port communication

Posted: Sun 03 May 2015, 12:11
by mister_electronico
I do not know exactly what you want to do, but I communicate with design electronic equipment through the serial port:

As you see in the following link.

https://misterelectronicoes.wordpress.c ... -homemade/

Currently I'm working hard to create and control panels for the presentation of these programs.

http://murga-linux.com/puppy/viewtopic.php?t=97961

and the rotary knob

http://murga-linux.com/puppy/viewtopic. ... 367#840367

This is it probably too simple pair the project you want to do, but like everything in this life can be improved.

Greatings

Posted: Sun 03 May 2015, 15:35
by starhawk
@mister_electronico -- Those are pretty cool, but indeed not applicable to what I'm doing. Read my first three posts, and you'll see quite plainly what I'm up to.

@Packetteer -- I seem to recall that in JWM, 0,0 is the center of the screen -- it's my memory, could be way off -- but that's why I asked.

Posted: Sun 03 May 2015, 23:00
by Ted Dog
The way I done something similar was to create one webpage on the server that contained all the elements you wish to control as a large screen then just show that part on which ever screen asked. Like

//Control.html?screen=1

//Control.html?screen=2 etc.

that way only ONE webpage exists, and that can keep up with all the variables and displays in a single 'program'

I wrote a single page 'shopping cart' that only showed the subset needed.

Posted: Sun 03 May 2015, 23:03
by starhawk
starhawk wrote:Assuming that I will be using bash and GTKDialog, how do I get a full screen black background and borderless dynamic (changeable) images onto a monitor...? How do I specify the position of the images? (I assume it's XY coordinates starting from a 0,0 point? Where's 0,0?)

some ideas

Posted: Mon 04 May 2015, 12:41
by mister_electronico
Some Ideas

check splash screen in:
http://murga-linux.com/puppy/viewtopic.php?t=38608

In this same page check to for:
How to store window size/placement


window borderless

http://www.murga-linux.com/puppy/viewto ... 490#701490


black background use one image for background black.


SVG images you can create anything or panel with hot keys look this link:


http://en.wikipedia.org/wiki/File:Oscilloscope.svg

http://www.svgopen.org/2005/papers/Maki ... SVGFormat/

http://commons.wikimedia.org/wiki/File: ... _panel.svg

Posted: Mon 04 May 2015, 15:26
by starhawk
Thanks, mister_e -- all of that is very helpful :)

Can I create a borderless window, say, the size of the screen, and not have it try to argue with me?

Other Ideas

Posted: Mon 04 May 2015, 19:14
by mister_electronico
Other Ideas.

See this code:

Code: Select all

#! /bin/bash

export DIALOG='
<window title="Window" height-request="1800" width-request="2440">
  <vbox>
    <frame>
      <text>
        <label>trying fit the window to the window desktop.</label>
      </text>
    </frame>
    <hbox>
      <button ok>
      </button>
    </hbox>
  </vbox>
</window>'

gtkdialog4 --program=DIALOG 
This window fill all my desktop.

You must fit the line:

Code: Select all

<window title="Window" height-request="1800" width-request="2440">
height-request or width-request at you window desktop.

Anyway If for example you create a window without borderless that contains an SVG image with black background using a pixmap to fill the entire window and you simultaneously create a background image desktop of the same black color, do not you'll have to worry about the size of the window not appreciate the difference between the background-desktop and window program.

All this is an idea that I have never tried this.

I nerver argue with anybody, I am here for enjoy Puppy, for help and if I can ever help someone. :wink:

other try

Posted: Mon 04 May 2015, 20:10
by mister_electronico
starhawk check this code.

Code: Select all

export IMG23=/tmp/img23.svg
trap 'rm -rf $IMG23' EXIT
echo '  <svg id="svg1"> 
  <rect
     width="980.74536133"
     height="980.74542236"
     x="0.0"
     y="0.0"
     style="font-size:12;fill:#000000;fill-opacity:1.00;fill-rule:evenodd;stroke-width:3pt;"
     id="rect563" /> 
     </svg>' > $IMG23


export DIALOG='
<window title="Example Window" decorated="false">
  <vbox>
  <eventbox>
    <pixmap>
      <variable>PICTURE</variable>
      <input file>'$IMG23'</input>
    </pixmap>
    <action signal="button-press-event">Exit:</action>
  </eventbox>    
  </vbox>
</window>
'
gtkdialog --program=DIALOG
Save in one text file for example test.sh

# chmod 777 test.sh

# ./test.sh

The problem is the contour line of the window but this can be solved by picking a black theme in Gtk + 2.0 Change theme.

See you

Posted: Mon 04 May 2015, 20:50
by starhawk
Works, although (in Carolina Vanguard, which uses XFCE) I get a border anyways.

I'm not in TahrPup right now, and I've a different WM going on because of that, so it's probably fine.

Question?

Posted: Mon 04 May 2015, 21:17
by mister_electronico
Works, although (in Carolina Vanguard, which uses XFCE) I get a border anyways.
When you say "I get border anyways" Are you referring to this :

CONTINUE

Posted: Mon 04 May 2015, 21:19
by mister_electronico
If this is the problem the solution how I told you:


The problem is the contour line of the window but this can be solved by picking a black theme in Gtk + 2.0 Change theme.

I am using JWM.

Posted: Mon 04 May 2015, 21:23
by starhawk
You did say that, didn't you. :oops: Somehow I missed it.

lol

Posted: Mon 04 May 2015, 21:37
by mister_electronico
Do not worry often happens to me too. :lol:

Hi starhawk you try this.

Posted: Tue 05 May 2015, 11:28
by mister_electronico
Hi starhawk you try this.

I'm also interested in making control panels for my electronic equipment, so I started thinking about what you said.

Thanks to the code of the wonderful people on the forum "Gtkdialog tips" I could do this small example that can be a beginning to create more complex panels.

I have adapted the code for this small panel.

With the following results.

Hi starhawk you try this.

Posted: Tue 05 May 2015, 11:35
by mister_electronico
I hope he can be transferred to other computers without problems since it may different settings do not work desktops.

You have to download the compressed file, decompress and get into the /PANEL directory and run by:

./panel.sh

You may need to give permission

chmod 777 panel.sh


And itch with the mouse in the panel buttons.

I hope it useful for you, and tell me if it works.

Greatings.

no no no

Posted: Tue 05 May 2015, 11:54
by mister_electronico
mistake ... post.

Re: Hi starhawk you try this.

Posted: Tue 05 May 2015, 16:39
by greengeek
mister_electronico wrote:I hope it useful for you, and tell me if it works
Very clever. Works for me. Although I do notice that it requires a long press on the mouseclick button - if I do my normal click it does not respond so I have to hold my finger on the button a little bit longer than usual.