Skip to content

Conversation

@tdpauw
Copy link

@tdpauw tdpauw commented Nov 3, 2017

This adds support for the different display models of the x3270 terminal emulator.

The x3270 emulator supports different display models defining the size of the screen as set by the manual pages:

 -model name
              The model of 3270 display to be emulated.  The model name is in two parts, either of which may be omitted:

              The first part is the base model, which is either 3278 or 3279.  3278 specifies a monochrome (green on black) 3270 display; 3279 specifies a color 3270 display.

              The second part is the model number, which specifies the number of rows and columns.  Model 4 is the default.

               Model Number   Columns   Rows
               ---------------------------------
                    2           80       24
                    3           80       32
                    4           80       43
                    5           132      27

The current implementation only supports model 2, as X3270.text always returns a length of 24*80.

This pull request extends the API of X3270 with a model attribute accepting the values 2, 3, 4 or 5. Buy default model is set to 2 to keep backwards compatibility.
Based on the model X3270.text fetches the correct screen size.

The RSpec tests have been extended to cover the different display models and the case of passing an unsupported model.

This has been tested against a mainframe using display model 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant