Real World Instrumentation with Python" # by J

Total Page:16

File Type:pdf, Size:1020Kb

Real World Instrumentation with Python CHAPTER 13 User Interfaces 7KH3ULQFLSOHRI/HDVW$VWRQLVKPHQW0DNHDXVHU LQWHUIDFHDVFRQVLVWHQWDQGDVSUHGLFWDEOHDVSRVVLEOH ¢$QRQ\PRXV 8QOHVVDQDSSOLFDWLRQLVGHHSO\HPEHGGHGRUVSHFLILFDOO\GHVLJQHGWRUXQDVDEDFN JURXQGSURFHVVLWZLOOSUREDEO\QHHGVRPHW\SHRIXVHULQWHUIDFH,QWKLVFKDSWHUZH ZLOOH[SORUHGLIIHUHQWZD\VWRFRPPXQLFDWHZLWKDXVHU:H¦OOVWDUWE\H[DPLQLQJZKDW \RXFDQGRZLWKMXVWWKHFRPPDQGOLQH1H[WZH¦OOORRNDWKRZWRXVHDQ$16,FDSDEOH WHUPLQDOHPXODWRUSURJUDPWRGLVSOD\GDWDDQGDFFHSWLQSXWDQGWKHQWKHcursesVFUHHQ FRQWUROSDFNDJHIRU3\WKRQ$IWHUWKLVZH¦OOPRYHWRWKHUHDOPRIEULJKWFRORUVIDQF\ JUDSKVLPDJHVDQGGLDORJVZLWKDORRNDWWKH7N,QWHU*8,WRRONLWSURYLGHGZLWK WKHVWDQGDUG3\WKRQGLVWULEXWLRQ:H¦OODOVRWDNHDTXLFNWRXURIWKHZ[3\WKRQ*8, SDFNDJH Text-Based Interfaces 7H[WEDVHGLQWHUIDFHVDUHWKHIRXQGDWLRQRIDOOGLVSOD\EDVHGFRPSXWHUXVHULQWHUIDFHV ,VD\GLVSOD\EDVHGEHFDXVHWHFKQLFDOO\WKHILUVWLQWHUIDFHVZHUHSDQHOVIXOORIOLJKWVDQG VZLWFKHV3ULQWLQJWHUPLQDOVFDPHQH[WEXWLWZDVQ¦WXQWLOWKHDGYHQWRI&57WHUPLQDOV WKDWKXPDQPDFKLQHLQWHUIDFH +0, GHYLFHVEHJDQWRFRPHLQWRWKHLURZQ The Console 7KHPRVWVWUDLJKWIRUZDUGZD\WRLQWHUDFWZLWKDQ\SURJUDP3\WKRQRURWKHUZLVHLV WKURXJKWKHFRQVROHLQWHUIDFH8QGHU:LQGRZVWKLVLVWKHVRFDOOHG£'26ER[¤RUWKH £FPG SURPSW¤ DV LW¦V FXUUHQWO\ NQRZQ WKH :LQGRZV VKHOO DSSOLFDWLRQ LV FDOOHG FPGH[H 2QD8QL[RU/LQX[V\VWHPLWLVWKHVKHOOSURPSWIRUVKEDVKNVKWVFKRU ZKDWHYHUHOVH\RXPD\KDSSHQWREHXVLQJIRUDVKHOOLQWHUIDFH,IQRZLQGRZPDQDJHU LVDFWLYHWKHZKROHVFUHHQLVWKHFRQVROHEXWLWEHKDYHVMXVWOLNHWKHZLQGRZHGIRUP 487 6HQGLQJGDWDWRWKHVKHOOLQWKHIRUPRIVWULQJVLVHDV\¢WKDW¦VZKDWWKHprintVWDWHPHQW GRHV*HWWLQJLQSXWEDFNIURPDXVHULVQRWDVLQWXLWLYHO\REYLRXVPDLQO\EHFDXVH3\ WKRQGRHVQRWKDYHFURVVSODWIRUPHTXLYDOHQWVRIgetch()RUgetche() JHWFKDUDFWHU DQGJHWFKDUDFWHUZLWKHFKRUHVSHFWLYHO\ ,WGRHVKRZHYHUKDYHWKHraw_input()EXLOW LQPHWKRGZKLFKFDQKDQGOHPRVWRIWKHFRPPRQXVHULQSXWFKRUHVDQGLWZRUNVRQ DOOWKHSODWIRUPVWKDW3\WKRQVXSSRUWV6KRUWO\,¦OOVKRZ\RXKRZWRXVHFW\SHVDQGWKH &UXQWLPHOLEUDU\IRUERWK/LQX[DQG:LQGRZVEXWILUVWOHW¦VVHHKRZPXFKZHFDQGR ZLWKMXVWWKHFRQVROHLQWHUIDFH Example console display :KLOH\RXFRXOGDOZD\VMXVWXVHRFFDVLRQDOprintVWDWHPHQWVWRRXWSXWGDWDWRWKH FRQVROHLWPLJKWEHGLIILFXOWIRUDXVHUWRWHOOZKDW¦VKDSSHQLQJDVWKHGDWDVFUROOVE\ RQWKHVFUHHQ(VWDEOLVKLQJDWHPSODWHIRUWKHGDWDGLVSOD\DQGXVLQJDIL[HGIRUPDW PDNHVWKHGDWDHDVLHUWRUHDGDQGJUHDWO\UHGXFHVXVHUIUXVWUDWLRQ DQGWKDWXVHUPLJKW EH\RX ,I\RXZDQWWRXVHDIL[HGIRUPDWIRUGDWDRXWSXWWRWKHFRQVROH\RX¦OOQHHGDWOHDVWWZR WKLQJVVRPHZD\WRFOHDUWKHVFUHHQDQGDWHPSODWHWRFRQWDLQ\RXUGDWD:H¦OOORRN DWWKHWHPSODWHILUVW 8QOHVVZHUHVRUWWR$16,WHUPLQDOFRQWUROVWULQJV GLVFXVVHGLQWKHQH[WVHFWLRQ D SURJUDPGRHVQ¦WKDYHDQ\ZD\WRSRVLWLRQWKHFXUVRULQWKHFRQVROHZLQGRZ(DFKOLQH LQWKHGLVSOD\QHHGVWRWDNHFDUHRILWVRZQSRVLWLRQLQJDQGGDWDGLVSOD\IRUPDWWLQJ 7KHOLVWLQJIRUconsole1.pyVKRZVKRZWKLVLVGRQH #! /usr/bin/python # console1.py # # Demonstrates console output using the built-in print method. # # Source code from the book "Real World Instrumentation with Python" # By J. M. Hughes, published by O'Reilly. import time ainstat = ['OFF','OFF','OFF','OFF'] aindata = [0.0, 0.0, 0.0, 0.0] discstate = ['OFF','OFF','OFF','OFF','OFF','OFF','OFF','OFF'] discin = [0,0,0,0,0,0,0,0] print '\n' * 50 print "" print "System Status" print "" print "Analog Input 0 : %10s %f" % (ainstat[0], aindata[0]) print "Analog Input 1 : %10s %f" % (ainstat[1], aindata[1]) print "Analog Input 2 : %10s %f" % (ainstat[2], aindata[2]) print "Analog Input 3 : %10s %f" % (ainstat[3], aindata[3]) print "" print "Discrete Input 0: %3s %d" % (discstate[0], discin[0]) 488 | Chapter 13:ಗUser Interfaces print "Discrete Input 1: %3s %d" % (discstate[1], discin[1]) print "Discrete Input 2: %3s %d" % (discstate[2], discin[2]) print "Discrete Input 3: %3s %d" % (discstate[3], discin[3]) print "Discrete Input 4: %3s %d" % (discstate[4], discin[4]) print "Discrete Input 5: %3s %d" % (discstate[5], discin[5]) print "Discrete Input 6: %3s %d" % (discstate[6], discin[6]) print "Discrete Input 7: %3s %d" % (discstate[7], discin[7]) print "" time.sleep(2) 9HUWLFDOSRVLWLRQLQJLVEDVHGRQWKHRUGHULQZKLFKWKHOLQHVDUHSULQWHGRXWWRWKH FRQVROHDQGKRUL]RQWDOSRVLWLRQLQJLVGHWHUPLQHGE\KRZHDFKOLQHLVIRUPDWWHG7KH OLQHRIFRGHLPPHGLDWHO\IROORZLQJWKHIRXUYDULDEOHLQLWLDOL]DWLRQOLQHVprint "\n" * 50VLPXODWHVD£FOHDUVFUHHQ¤E\JHQHUDWLQJEODQNOLQHV,XVHGEHFDXVH,KDYH ODUJHFRPPDQGOLQHZLQGRZVEXWJHQHUDWLQJPRUHEODQNOLQHVWKDQWKHZLQGRZVXS SRUWVGRHVQRWKXUWDQ\WKLQJ7KHUHVXOWORRNVOLNHWKLV System Status Analog Input 0 : ACTIVE 0.000000 Analog Input 1 : OFF 0.000000 Analog Input 2 : ACTIVE 0.000000 Analog Input 3 : OFF 0.000000 Discrete Input 0: OFF 0 Discrete Input 1: OFF 1 Discrete Input 2: OFF 0 Discrete Input 3: OFF 0 Discrete Input 4: OFF 0 Discrete Input 5: OFF 0 Discrete Input 6: OFF 0 Discrete Input 7: OFF 0 6LQFHWKHUDZFRQVROH,2GRHVQ¦WKDYHDJHQHULFFOHDUVFUHHQIXQFWLRQDVHULHVRISULQW VWDWHPHQWVZLWKHPSW\VWULQJVFDQEHXVHGWRVFUROORIIDQ\WKLQJFXUUHQWO\RQWKHGLVSOD\ LQRUGHUWRPDNHURRPIRUQHZGDWD1RWHWKDWLIWKHZLQGRZLVODUJHUWKDQWKHQXPEHU RIOLQHVLQWKHWHPSODWHWKHWHPSODWHWH[WZLOOHQGXSDWWKHERWWRPRIWKHZLQGRZ WKH ODVWOLQHSULQWHGZLOOEHMXVWDERYHWKHSURPSW +RZHYHUWKHUHLVDQRWKHUZD\:HFDQILQGRXWZKDWW\SHRI26WKHFRGHLVUXQQLQJ XQGHUDQGWKHQXVHWKHDSSURSULDWHPHWKRGWRLVVXHDVFUHHQFOHDUFRPPDQGOLNHWKLV def clrDisp(numlines=50): if os.name == "posix": os.system('clear') elif os.name in ("nt", "dos", "ce"): os.system('CLS') else: print '\n' * numlines +HUHLVDQH[DPSOHRIWKLVWHFKQLTXH #! /usr/bin/python # console2.py Text-Based Interfaces | 489 # # Demonstrates console output using the built-in print method and # an OS-specific screen clear technique. # # Source code from the book "Real World Instrumentation with Python" # By J. M. Hughes, published by O'Reilly. import time import os ainstat = ['OFF','OFF','OFF','OFF'] aindata = [0.0, 0.0, 0.0, 0.0] discstate = ['OFF','OFF','OFF','OFF','OFF','OFF','OFF','OFF'] discin = [0,0,0,0,0,0,0,0] def clrDisp(numlines=50): if os.name == "posix": os.system('clear') elif os.name in ("nt", "dos", "ce"): os.system('CLS') else: print '\n' * numlines def drawData(): print "" print "System Status" print "" print "Analog Input 0 : %10s %f" % (ainstat[0], aindata[0]) print "Analog Input 1 : %10s %f" % (ainstat[1], aindata[1]) print "Analog Input 2 : %10s %f" % (ainstat[2], aindata[2]) print "Analog Input 3 : %10s %f" % (ainstat[3], aindata[3]) print "" print "Discrete Input 0: %3s %d" % (discstate[0], discin[0]) print "Discrete Input 1: %3s %d" % (discstate[1], discin[1]) print "Discrete Input 2: %3s %d" % (discstate[2], discin[2]) print "Discrete Input 3: %3s %d" % (discstate[3], discin[3]) print "Discrete Input 4: %3s %d" % (discstate[4], discin[4]) print "Discrete Input 5: %3s %d" % (discstate[5], discin[5]) print "Discrete Input 6: %3s %d" % (discstate[6], discin[6]) print "Discrete Input 7: %3s %d" % (discstate[7], discin[7]) print "" ainstat[1] = "ACTIVE" ainstat[3] = "ACTIVE" aindata[1] = 5.2 aindata[3] = 8.9 discstate[0] = "ON" discin[0] = 1 clrDisp() drawData() time.sleep(1.0) ainstat[1] = "OFF" ainstat[3] = "OFF" aindata[1] = 0.0 490 | Chapter 13:ಗUser Interfaces aindata[3] = 0.0 ainstat[0] = "ACTIVE" ainstat[2] = "ACTIVE" aindata[0] = 5.2 aindata[2] = 8.9 discstate[0] = "OFF" discin[0] = 0 discstate[1] = "ON" discin[1] = 1 clrDisp() drawData() time.sleep(1.0) 1RZZHKDYHWKHIRXQGDWLRQIRUDXVDEOHWH[WEDVHGGLVSOD\7RXSGDWHWKHGLVSOD\ WKHVFUHHQLVILUVWFOHDUHGXVLQJWKHDSSURSULDWHFRPPDQGDQGWKHQWKHOLQHVIURPWKH WHPSODWHDUHZULWWHQXVLQJWKHprintPHWKRG7KLVUHVXOWVLQTXLFNHUVFUHHQUHJHQHUDWLRQ WKDQWKHPXOWLSOHOLQHVPHWKRGDQGLWORRNVQLFHUWRR,IWKH26FDQQRWEHGHWHUPLQHG WKHIXQFWLRQGHIDXOWVWRWKHEODQNOLQHPHWKRGWRFOHDUWKHGLVSOD\)LJXUHVKRZV WKHIORZFKDUWIRUDWH[WEDVHGFRQVROHGDWDGLVSOD\EDVHGRQZKDWZH¦YHVHHQVRIDU Reading user input 1RZZHKDYHDPHDQVWRGLVSOD\GDWDEXWWKHUH¦VVWLOORQHWKLQJPLVVLQJXVHULQSXW )RUWXQDWHO\3\WKRQGRHVKDYHDRQHVL]HILWVDOOLQSXWPHWKRGWRUHDGLQSXWIURPWKH FRQVROH7KHraw_input()PHWKRGUHDGVDOLQHRILQSXWIURPWKHFRQVROHDQGUHWXUQVLW DVDVWULQJ$OLQHLQWKLVFDVHLVGHILQHGDV]HURRUPRUHFKDUDFWHUVWHUPLQDWHGZLWKDQ (2/7KH(2/ZLOOQRWEHDSSHQGHGWRWKHVWULQJUHWXUQHGE\raw_input() 7KHraw_input()PHWKRGFDQDOVRGLVSOD\DSURPSWVWULQJDQGLIWKHreadlinePRGXOH LVLQVWDOOHGLWZLOOXVHWKDWWRVXSSRUWLQSXWOLQHHGLWLQJDQGSURYLGHLQSXWKLVWRU\+HUH LVWKHWKLUGLWHUDWLRQRIWKHFRQVROHH[DPSOHZLWKraw_input()LQFRUSRUDWHGLQWRWKH FRGH #! /usr/bin/python # console3.py # # Demonstrates console output using the built-in print method and the # raw_input() method. # # Source code from the book "Real World Instrumentation with Python" # By J. M. Hughes, published by O'Reilly. import time import os ainstat = ['OFF','OFF','OFF','OFF'] aindata = [0.0, 0.0, 0.0, 0.0] discstate = ['OFF','OFF','OFF','OFF','OFF','OFF','OFF','OFF'] discin = [0,0,0,0,0,0,0,0] x = 0 def initData(): Text-Based Interfaces | 491 global ainstat, aindata, discstate, discin ainstat = ['OFF','OFF','OFF','OFF'] aindata = [0.0, 0.0, 0.0, 0.0] discstate = ['OFF','OFF','OFF','OFF','OFF','OFF','OFF','OFF'] discin = [0,0,0,0,0,0,0,0] def readData(): global ainstat, aindata, discstate, discin, x initData() discstate[x] = 'ON' discin[x] = 1 x += 1 if x > (len(discin) - 1): x = 0 def clrDisp(numlines=50): if os.name == "posix": os.system('clear') elif os.name in ("nt", "dos", "ce"): os.system('CLS') else: print '\n' * numlines def drawData(): print "" print "System Status" print "" print "Analog Input 0 : %10s %f" % (ainstat[0], aindata[0]) print "Analog Input 1 : %10s %f" % (ainstat[1], aindata[1]) print "Analog Input 2 : %10s %f" % (ainstat[2], aindata[2]) print "Analog Input 3 : %10s %f" % (ainstat[3], aindata[3]) print "" print "Discrete Input 0: %3s %d" % (discstate[0], discin[0]) print "Discrete Input 1: %3s %d" % (discstate[1], discin[1]) print "Discrete Input 2: %3s %d" % (discstate[2], discin[2])
Recommended publications
  • Administering Unidata on UNIX Platforms
    C:\Program Files\Adobe\FrameMaker8\UniData 7.2\7.2rebranded\ADMINUNIX\ADMINUNIXTITLE.fm March 5, 2010 1:34 pm Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta UniData Administering UniData on UNIX Platforms UDT-720-ADMU-1 C:\Program Files\Adobe\FrameMaker8\UniData 7.2\7.2rebranded\ADMINUNIX\ADMINUNIXTITLE.fm March 5, 2010 1:34 pm Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Notices Edition Publication date: July, 2008 Book number: UDT-720-ADMU-1 Product version: UniData 7.2 Copyright © Rocket Software, Inc. 1988-2010. All Rights Reserved. Trademarks The following trademarks appear in this publication: Trademark Trademark Owner Rocket Software™ Rocket Software, Inc. Dynamic Connect® Rocket Software, Inc. RedBack® Rocket Software, Inc. SystemBuilder™ Rocket Software, Inc. UniData® Rocket Software, Inc. UniVerse™ Rocket Software, Inc. U2™ Rocket Software, Inc. U2.NET™ Rocket Software, Inc. U2 Web Development Environment™ Rocket Software, Inc. wIntegrate® Rocket Software, Inc. Microsoft® .NET Microsoft Corporation Microsoft® Office Excel®, Outlook®, Word Microsoft Corporation Windows® Microsoft Corporation Windows® 7 Microsoft Corporation Windows Vista® Microsoft Corporation Java™ and all Java-based trademarks and logos Sun Microsystems, Inc. UNIX® X/Open Company Limited ii SB/XA Getting Started The above trademarks are property of the specified companies in the United States, other countries, or both. All other products or services mentioned in this document may be covered by the trademarks, service marks, or product names as designated by the companies who own or market them. License agreement This software and the associated documentation are proprietary and confidential to Rocket Software, Inc., are furnished under license, and may be used and copied only in accordance with the terms of such license and with the inclusion of the copyright notice.
    [Show full text]
  • Xterm Control Sequences
    Xterm Control Sequences EdwardMoy University of California, Berkeley Revised by Stephen Gildea XConsortium (1994) Thomas Dickey XFree86 Project (1996-2003) Definitions c The literal character c. C Asingle (required) character. Ps Asingle (usually optional) numeric parameter,composed of one of more digits. Pm Amultiple numeric parameter composed of anynumber of single numeric parameters, separated by ;char- acter(s). Individual values for the parameters are listed with Ps . Pt Atextparameter composed of printable characters. C1 (8-Bit) Control Characters The xterm program recognizes both 8-bit and 7-bit control characters. It generates 7-bit controls (by default) or 8-bit if S8C1T is enabled. The following pairs of 7-bit and 8-bit control characters are equivalent: ESC D Index(IND is 0x84) ESC E Next Line ( NEL is 0x85) ESC H TabSet ( HTS is 0x88) ESC M Reverse Index( RI is 0x8d) ESC N Single Shift Select of G2 Character Set ( SS2 is 0x8e): affects next character only ESC O Single Shift Select of G3 Character Set ( SS3 is 0x8f): affects next character only ESC P Device Control String ( DCS is 0x90) ESC V Start of Guarded Area ( SPA is 0x96) Xterm Control Sequences C1 (8-Bit) Control Characters ESC W End of Guarded Area ( EPA is 0x97) ESC X Start of String ( SOS is 0x98) ESC Z Return Terminal ID (DECID is 0x9a). Obsolete form of CSI c(DA). ESC [ Control Sequence Introducer ( CSI is 0x9b) ESC \ String Terminator ( ST is 0x9c) ESC ] Operating System Command ( OSC is 0x9d) ESC ^ Privacy Message ( PM is 0x9e) ESC _ Application Program Command ( APC is 0x9f) These control characters are used in the vtXXX emulation.
    [Show full text]
  • The Linux Command Line
    The Linux Command Line Second Internet Edition William E. Shotts, Jr. A LinuxCommand.org Book Copyright ©2008-2013, William E. Shotts, Jr. This work is licensed under the Creative Commons Attribution-Noncommercial-No De- rivative Works 3.0 United States License. To view a copy of this license, visit the link above or send a letter to Creative Commons, 171 Second Street, Suite 300, San Fran- cisco, California, 94105, USA. Linux® is the registered trademark of Linus Torvalds. All other trademarks belong to their respective owners. This book is part of the LinuxCommand.org project, a site for Linux education and advo- cacy devoted to helping users of legacy operating systems migrate into the future. You may contact the LinuxCommand.org project at http://linuxcommand.org. This book is also available in printed form, published by No Starch Press and may be purchased wherever fine books are sold. No Starch Press also offers this book in elec- tronic formats for most popular e-readers: http://nostarch.com/tlcl.htm Release History Version Date Description 13.07 July 6, 2013 Second Internet Edition. 09.12 December 14, 2009 First Internet Edition. 09.11 November 19, 2009 Fourth draft with almost all reviewer feedback incorporated and edited through chapter 37. 09.10 October 3, 2009 Third draft with revised table formatting, partial application of reviewers feedback and edited through chapter 18. 09.08 August 12, 2009 Second draft incorporating the first editing pass. 09.07 July 18, 2009 Completed first draft. Table of Contents Introduction....................................................................................................xvi
    [Show full text]
  • Spotline M110 Manual
    SpotLine TM M110 User Guide SpotLine M110 User Guide All Rights Reserved. This document, as well as the software and data described in it, is furnished under license and may only be used or copied in accordance with the terms of the license. Except as permitted by such license, no part of this document may be reproduced, stored in a retrieval system, or transmitted, in any form, or by any means, electronic, mechanical, optical, recording or otherwise, without the prior written permission of SpotLine Inc. SpotLine and SpotLine M110 are Trademarks of SpotLine Inc. The information in this document is furnished for informational purposes only, is subject to change without notice, and should not be construed as a commitment by SpotLine Inc., who assumes no liability for any errors or inaccuracies that may appear in this document. SpotLine Inc. 1131 Grandview Dr. So. San Francisco CA 94080 (650) 583-9605 (650) 583-9608 (fax) © Copyright 2002 SpotLine Inc. 2 FCC Statement This device complies with Part 15 of the FCC rules. Operation is subject to the following two conditions: (1) This device may not cause harmful interference, and (2) this device must accept any interference received, including interference that may cause undesired operation. This equipment had been tested and found to comply with the limits for a class B digital device pursuant to Part 15 of the FCC Rules. These limits are designed to provide reasonable protection against harmful interference in a residential installation. This equipment generates, uses and can radiate radio frequency energy, and if not installed and used in accordance with the instructions, may cause harmful interference to radio communications.
    [Show full text]
  • User Interface Technology Survey Technical Report CMU/SEI-87-TR-6 1987
    Technical Report CMU/SEI-87-TR-6 User Interface Technology Survey Technical Report CMU/SEI-87-TR-6 1987 User Interface Technology Survey] Unlimited distribution subject to the copyright. Software Engineering Institute Carnegie Mellon University Pittsburgh, Pennsylvania 15213 This report was prepared for the SEI Joint Program Office HQ ESC/AXS 5 Eglin Street Hanscom AFB, MA 01731-2116 The ideas and findings in this report should not be construed as an official DoD position. It is published in the interest of scientific and technical information exchange. FOR THE COMMANDER (signature on file) Thomas R. Miller, Lt Col, USAF, SEI Joint Program Office This work is sponsored by the U.S. Department of Defense. Copyright 1987 by Carnegie Mellon University. Permission to reproduce this document and to prepare derivative works from this document for internal use is granted, provided the copyright and \‘No Warranty\’ statements are included with all reproductions and derivative works. Requests for permission to reproduce this document or to prepare derivative works of this document for external and commercial use should be addressed to the SEI Licensing Agent. NO WARRANTY THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN \‘AS-IS\’ BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTIBILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. This work was created in the performance of Federal Government Contract Number F19628-95-C-0003 with Carnegie Mellon University for the operation of the Software Engineering Institute, a federally funded research and development center.
    [Show full text]
  • Man Pages Section 3: Curses Library Functions
    man pages section 3: Curses Library Functions Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054 U.S.A. Part No: 816–0215–10 May 2002 Copyright 2002 Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, CA 95054 U.S.A. All rights reserved. This product or document is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation. No part of this product or document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Third-party software, including font technology, is copyrighted and licensed from Sun suppliers. Parts of the product may be derived from Berkeley BSD systems, licensed from the University of California. UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd. Sun, Sun Microsystems, the Sun logo, docs.sun.com, AnswerBook, AnswerBook2, and Solaris are trademarks, registered trademarks, or service marks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc. The OPEN LOOK and Sun™ Graphical User Interface was developed by Sun Microsystems, Inc. for its users and licensees. Sun acknowledges the pioneering efforts of Xerox in researching and developing the concept of visual or graphical user interfaces for the computer industry. Sun holds a non-exclusive license from Xerox to the Xerox Graphical User Interface, which license also covers Sun’s licensees who implement OPEN LOOK GUIs and otherwise comply with Sun’s written license agreements.
    [Show full text]
  • Installing Platine Terminal on Unix Systems
    AXEL Platine Terminal Asynchronous AX3000 Models Installing Platine Terminals on UNIX Systems Dec. 1996 - Ref.: UNXE105/648-1 The reproduction of this material, in part or whole, is strictly prohibited. For additional information, please contact: Zone d'activité d'Orsay-Courtabœuf 16 Avenue du Québec BP 728 91962 LES ULIS Cedex France Tel.: (33) 1 69 28 27 27 Fax: (33) 1 69 28 82 04 The information in this document is subject to change without notice. AXEL assumes no responsibility for any errors that may appear in this document. All trademarks and registered trademarks are the property of their respective holders. © - 1995-1996 - AXEL - All Rights Reserved. 1 - SETTINGS FOR MOST UNIX VERSIONS..................................................1 1.1 - SETTING TERMINAL EMULATION......................................................2 1.1.1 - Selecting the Emulation on the AX3000 Platine Terminal ...............4 1.1.2 - Setting the Emulation on the UNIX System.....................................4 1.2 - LOCAL PRINTER .................................................................................5 1.2.1 - Connecting a Local Printer..............................................................5 1.2.2 - Using the Local Printer ...................................................................6 2 - SETTINGS FOR SCO UNIX/XENIX............................................................9 2.1 - SOFTWARE INSTALLATION .............................................................10 2.1.1 - Setting Terminal Parameters ........................................................10
    [Show full text]
  • ANSI Escape Code "ANSI Code" Redirects Redirects Here. for Other
    ANSI escape code "ANSI code" redirects here. For other uses, see ANSI (disambiguation). In computing, ANSI escape codes (or escape sequences) are a method using in-b and signaling to control the formatting, color, and other output options on video text terminals. To encod e this formatting information, certain sequences of bytes are embedded into the text, which the terminal loo ks for and interprets as commands, not as character codes. ANSI codes were introduced in the 1970s and became widespread in the minicomp uter/mainframe market by the early 1980s. They were used by the nascent bulletin board system market to of fer improved displays compared to earlier systems lacking cursor movement, leading to even more widespread uu se. Although hardware text terminals have become increasingly rare in the 21st cee ntury, the relevance of the ANSI standard persists because most terminal emulators interpret at least some ofof the ANSI escape sequences in the output text. One notable exception is the win32 console component of Microsof t Windows. Contents * * 1 History * * 2 Support * * 2.1 Windows and DOS * * 3 Sequence elements * * 4 Non-CSI codes * * 5 CSI codes * * 6 Colors * * 7 Examples * * 7.1 Example of use in shell scripting * * 8 Invalid and ambiguous sequences in use * * 9 See also * * 10 Notes * * 11 External links History[edit] Almost all manufacturers of video terminals added vendor-specific escape sequ ences to perform operations such as placing the cursor at arbitrary positions on the screen. One example is th e VT52 terminal, which allowed the cursor to be placed at an x,y location on the screen by sending the ESC c haracter, a y character, and then two characters representing with numerical values equal to the x,y locat ion plus 32 (thus starting at the ASCII space character and avoiding the control characters).
    [Show full text]
  • GNU Emacs FAQ Copyright °C 1994,1995,1996,1997,1998,1999,2000 Reuven M
    GNU Emacs FAQ Copyright °c 1994,1995,1996,1997,1998,1999,2000 Reuven M. Lerner Copyright °c 1992,1993 Steven Byrnes Copyright °c 1990,1991,1992 Joseph Brian Wells This list of frequently asked questions about GNU Emacs with answers ("FAQ") may be translated into other languages, transformed into other formats (e.g. Texinfo, Info, WWW, WAIS), and updated with new information. The same conditions apply to any derivative of the FAQ as apply to the FAQ itself. Ev- ery copy of the FAQ must include this notice or an approved translation, information on who is currently maintaining the FAQ and how to contact them (including their e-mail address), and information on where the latest version of the FAQ is archived (including FTP information). The FAQ may be copied and redistributed under these conditions, except that the FAQ may not be embedded in a larger literary work unless that work itself allows free copying and redistribution. [This version has been somewhat edited from the last-posted version (as of August 1999) for inclusion in the Emacs distribution.] 1 This is the GNU Emacs FAQ, last updated on 6 March 2005. The FAQ is maintained as a Texinfo document, allowing us to create HTML, Info, and TeX documents from a single source file, and is slowly but surely being improved. Please bear with us as we improve on this format. If you have any suggestions or questions, please contact the FAQ maintainers ([email protected]). 2 GNU Emacs FAQ Chapter 1: FAQ notation 3 1 FAQ notation This chapter describes notation used in the GNU Emacs FAQ, as well as in the Emacs documentation.
    [Show full text]
  • Linux Backspace/Delete Mini-HOWTO Sebastiano Vigna [email protected]
    Linux Backspace/Delete mini-HOWTO Sebastiano Vigna [email protected] Revision History Revision v1.6 19 Jan 2002 Included many comments from Alex Boldt and Chung-Rui Kao. Revision v1.5 3 May 2000 Updated for new distros and the tput trick. Revision v1.4 7 December 2000 Updated for Red Hat 7.0 and Helix Gnome conflicts. Revision v1.3 18 October 2000 Name change. Revision v1.2 15 October 2000 Updated. Added "What If Nothing Works" section. Revision v1.1 13 September 2000 Added tcsh fixes Revision v1.0 5 September 2000 First release Table of Contents Introduction ...........................................................................................................................3 How Keys Are Turned Into Actions ..................................................................................3 Why It Doesn’t (Always) Work ..........................................................................................4 X................................................................................................................................................4 What You Should Do When Writing Applications ........................................................5 What You Should Do On Your System.............................................................................5 What If Nothing Works .......................................................................................................9 More Hacking........................................................................................................................9 Conclusions..........................................................................................................................10
    [Show full text]
  • Linux Backspace/Delete Mini-HOWTO Sebastiano Vigna [email protected]
    Linux Backspace/Delete mini-HOWTO Sebastiano Vigna [email protected] Revision History Revision v1.6 19 Jan 2002 Included many comments from Alex Boldt and Chung-Rui Kao. Revision v1.5 3 May 2000 Updated for new distros and the tput trick. Revision v1.4 7 December 2000 Updated for Red Hat 7.0 and Helix Gnome conflicts. Revision v1.3 18 October 2000 Name change. Revision v1.2 15 October 2000 Updated. Added "What If Nothing Works" section. Revision v1.1 13 September 2000 Added tcsh fixes Revision v1.0 5 September 2000 First release 1. Introduction Every Linux user has been sooner or later trapped in a situation in which having working Backspace and Delete keys on the console and on X seemed impossible. This paper explains why this happens and suggests solutions. The notions given here are essentially distribution-independent: due to the widely different content of system configuration files in each distribution, I will try to give the reader enough knowledge to think up his/her own fixes, if necessary. I assume that the Backspace key should go back one character and then erase the character under the cursor. On the other hand, the Delete key should delete the character under the cursor, without moving it. If you think that the function of the two keys should be exchanged, in spite of the fact that most keyboards feature an arrow pointing to the left ( ) on the Backspace key, then this paper will not give you immediate solutions, but certainly you may find the explanations given here useful.
    [Show full text]
  • Configuring TN3270 13-1 Cisco’S Implementation of TN3270
    CHAPTER 13 Configuring TN3270 IBM 3270 display terminals are among the computing community’s most widely implemented and emulated for host-based computing. Information in this chapter will help you understand the TN3270 terminal emulation environment, and how to use and create files that will allow terminals connected to the communication servers to be used for TN3270 operation. For a complete description of the commands in this chapter, see the Communication Server Command Reference publication. Cisco’s Implementation of TN3270 The TN3270 terminal emulation software is based on software developed at the University of California, Berkeley. This software allows any terminal to be used as an IBM 3270-type terminal. Users with non-3270 terminals can take advantage of the emulation capabilities to perform the functions of an IBM 3270-type terminal. Specifically, Cisco’s implementation supports emulation of an IBM 3278-2 terminal providing an 80 by 24 display. True IBM 3270-type terminals use a character format referred to as extended binary-coded decimal interchange code (EBCDIC). EBCDIC consists of 8-bit coded characters and was originally developed by IBM. Emulation is made possible by termcap and curses functions developed by Berkeley UNIX system developers. These functions translate the keyboard and terminal characteristics for ASCII-type terminals into those expected by an IBM host. ASCII characters are listed in the “ASCII Character Set” appendix in the Communication Server Command Reference publication. Formally, a termcap is a two-part terminal-handling mechanism. It consists of a database and a subroutine library. The database describes the capabilities of each terminal to be supported; the subroutine library allows programs to query the database and to make use of the values it contains.
    [Show full text]