Author |
Message |
   
Brett
Citizen Username: Bmalibashksa
Post Number: 1595 Registered: 7-2003
| Posted on Thursday, April 7, 2005 - 9:29 am: |    |
Well here's a real shot in the dark: We’ve written a Java Telnet server for a Warehouse Distribution Center. We tested this using QVT/Term and the screens all formatted correctly. But when we connect to the Telnet server using an RF Gun the screen doesn’t parse correctly. The line 1;4H Title <- should print ‘Title’ on the first line starting on the fourth space. Instead it prints ‘4HTitle’. Skipping the 4H tag.
|
   
sullymw
Citizen Username: Sullymw
Post Number: 530 Registered: 5-2001
| Posted on Thursday, April 7, 2005 - 10:28 am: |    |
I am an old VT guy and I believe that you need an ESCAPE+[ before the 1;4H, like: ESC[1;4H
|
   
Tom Reingold
Supporter Username: Noglider
Post Number: 6209 Registered: 1-2003

| Posted on Thursday, April 7, 2005 - 11:35 am: |    |
I don't understand what your question is. I'm an old hand at terminal addressing and emulation. I used to code that stuff for a living. Fire away. |
   
Brett
Citizen Username: Bmalibashksa
Post Number: 1596 Registered: 7-2003
| Posted on Thursday, April 7, 2005 - 12:01 pm: |    |
Your saying I should lead it with ESC[ ? I've seen both ESC and CSI and I've also seen a bunch of Chars (<,>,[) |
   
Tom Reingold
Supporter Username: Noglider
Post Number: 6211 Registered: 1-2003

| Posted on Thursday, April 7, 2005 - 12:13 pm: |    |
I guess your terminal manual doesn't list ESC[ because it's implied. Yes, all those sequences start with ESC[ |
   
sullymw
Citizen Username: Sullymw
Post Number: 531 Registered: 5-2001
| Posted on Thursday, April 7, 2005 - 12:14 pm: |    |
CSI is "ESC[". ESC can't just be the letters ESC, it must actually be the real Escape character (ASCII 27 I think) |
   
Brett
Citizen Username: Bmalibashksa
Post Number: 1597 Registered: 7-2003
| Posted on Thursday, April 7, 2005 - 12:55 pm: |    |
So I should send 0xb1HTitle or 0xb1(some other char)HTitle to print Title? |
   
Tom Reingold
Supporter Username: Noglider
Post Number: 6213 Registered: 1-2003

| Posted on Thursday, April 7, 2005 - 1:05 pm: |    |
Escape (0x1b) and then left square bracket (0x5b) and then capital H. Did you write this in Windows or unix/linux? With unix (and linux) there are libraries (such as terminfo, curses) you should use which hide the terminal type. Then you can use any terminal at run time. Not sure how easy that is to do with Windows. When you use these libraries, you do things like position the cursor with a function call, rather than sending the actual escape sequences, which vary from one terminal type to the next. |
   
sullymw
Citizen Username: Sullymw
Post Number: 532 Registered: 5-2001
| Posted on Thursday, April 7, 2005 - 1:16 pm: |    |
0x1b followed by the text "[1;4HTitle" to position to row 1, column 4. Any of the text can be replaced by its hex counterpart. |
   
Brett
Citizen Username: Bmalibashksa
Post Number: 1598 Registered: 7-2003
| Posted on Thursday, April 7, 2005 - 1:21 pm: |    |
I’ll explain a little better. We have a Legacy system running in a Warehouse in Michigan (Conagra). They want to run this system in another warehouse. The telnet server was written in Java and is well over 2 Million lines of code. When you use a terminal Emulator (QVT/Term) or a Symbol RF gun., the screen displays well. But when I try to use a PerCon Falcon 325 RF gun the screen is wrong. I tracked down some of the original developers and they said “Well it’s not exactly VT220 we had to tweak it”. Now I need to figure out that tweak. Now luckily every String being sent to the RF device has to get parsed through a program called VT220 map, where things like the CGI and such are added. I’m guessing that this is the class that got tweaked. This line is where I’m starting: public static String getCursorPosition(int iRow,int iColm) { return (CSI + Integer.toString(iRow) + ";" +Integer.toString(iColm)+ "H" ); } The CSI variable is the question. ESC[ 1 ; 4H [ 1;4H 0x1B1;4H 0x1B[1;4H I’m lost
|
   
sullymw
Citizen Username: Sullymw
Post Number: 533 Registered: 5-2001
| Posted on Thursday, April 7, 2005 - 1:24 pm: |    |
the last one is correct, although you may need lower case '1b'. CSI is '0x1b['. I think if you just set the CSI variable to that, it will work |
   
Brett
Citizen Username: Bmalibashksa
Post Number: 1599 Registered: 7-2003
| Posted on Thursday, April 7, 2005 - 1:28 pm: |    |
Wow that worked!!!!! But now a lot of my text is followed by >21>121 |
   
sullymw
Citizen Username: Sullymw
Post Number: 534 Registered: 5-2001
| Posted on Thursday, April 7, 2005 - 1:34 pm: |    |
great....but I'm not sure what the >21>121 is. I've never seen that before. I know that the "H" replaced "f" in later versions of VT software. You may want to try replacing "H" with "f" just for the fun of it. MOL rocks, eh? |
   
Brett
Citizen Username: Bmalibashksa
Post Number: 1600 Registered: 7-2003
| Posted on Thursday, April 7, 2005 - 1:40 pm: |    |
It looks like some kind of screen lock. |
   
Brett
Citizen Username: Bmalibashksa
Post Number: 1601 Registered: 7-2003
| Posted on Thursday, April 7, 2005 - 1:44 pm: |    |
Narrowed it down a little. The screen Formats correctly but when the Cursor moves to the location for the first entry it's followed by 21>121. Just need to hunt that down. What is the Command for move Cursor to 3;6 |
   
sullymw
Citizen Username: Sullymw
Post Number: 535 Registered: 5-2001
| Posted on Thursday, April 7, 2005 - 2:02 pm: |    |
ESC[r;cH is the cursor position command. ESC[2J clears the screen |
   
Brett
Citizen Username: Bmalibashksa
Post Number: 1602 Registered: 7-2003
| Posted on Thursday, April 7, 2005 - 2:29 pm: |    |
Thanks, the ESC caommand was the answer. It looks like the system was using ">" and on your advice I changed it to "ESC[" The >21>12l Was negative / positive image |
   
sullymw
Citizen Username: Sullymw
Post Number: 536 Registered: 5-2001
| Posted on Thursday, April 7, 2005 - 2:31 pm: |    |
glad it worked! |
   
LibraryLady(ncjanow)
Supporter Username: Librarylady
Post Number: 2407 Registered: 5-2001

| Posted on Thursday, April 7, 2005 - 7:48 pm: |    |
Mr. LL says that this is the type of stuff that use to happen and you'd go down the aisle to the next cubicle and sak your buddy what to do. No more aisles, no more cubicles. MOL is the new virtual workplace! |