Package net.sourceforge.uiq3.fa6
Class Serial
- java.lang.Object
-
- net.sourceforge.uiq3.fx603p.Interface
-
- net.sourceforge.uiq3.fa6.Serial
-
-
Field Summary
Fields Modifier and Type Field Description (package private) String
File_Name
Last file name opened.private long
File_Read
Characters read from input streamprotected @Nullable String
Home_Directory
The simulators home directory.private BufferedReader
In
input streamprivate static Pattern
Is_Digit
matches a single digits (including hex digits).private static Pattern
Is_Digits
matches a string of digits (including hex digits).private static Logger
Logger
class Logger instanceprivate static @NonNls String
M_Header
private static int
MF_Divisor
static String
New_Line
New lines in simulated RS232 files are always written with DOS line endings.private Writer
Out
output streamprivate Calculator
Owner
Calculator to which the interface is connected toprivate static Pattern
Parse_M
Parse Memory lineprivate static @NonNls String
Program_Header
static @NonNls String
Setting_Name
File name for settings.private static String
TAG
class Logger tag.
-
Constructor Summary
Constructors Modifier Constructor Description protected
Serial(Calculator Owner)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
Close()
Close files and all streams attached to them.void
Create(Interface.File_Type Type, @NotNull String File_Name)
create new file for tape IOprotected abstract Writer
Create_Stream(@NotNull String Filename)
Create a new file for output.abstract long
File_Size()
Get file Size@NotNull String
Home_Directory()
The simulators home directory.void
Home_Directory(@Nullable String Home_Directory)
The simulators home directory.Interface.File_Type
Open(@NotNull String File_Name)
open file and return typevoid
Open(Interface.File_Type Type, @NotNull String File_Name)
open file of given typeprotected abstract Reader
Open_Stream(@NotNull String Filename)
Create a new file for input.void
Parse_M()
Parse text files for memory informations.void
Parse_Steps()
Parse text files for memory informations.void
Print_M()
Writes memory register to simulated cassette interface.void
Print_New_Line()
pring a new line. a public version is needed for All Text filevoid
Print_Steps()
Print program stepsprivate int
Store_Opcode(int Step_Number, short Opcode)
store a step to stepsprivate int
Store_Token(int Step_Number, short Opcode)
store a step to steps@NotNull String
toString()
-
Methods inherited from class net.sourceforge.uiq3.fx603p.Interface
Convert_To_Alpha, Convert_To_Java, Convert_To_Java, Convert_To_Java, Convert_To_Token, Is_Enabled, Set_Enable
-
-
-
-
Field Detail
-
Is_Digit
private static final Pattern Is_Digit
matches a single digits (including hex digits).
-
Is_Digits
private static final Pattern Is_Digits
matches a string of digits (including hex digits).
-
Logger
private static final Logger Logger
class Logger instance
-
MF_Divisor
private static final int MF_Divisor
- See Also:
- Constant Field Values
-
M_Header
@NonNls private static final @NonNls String M_Header
- See Also:
- Constant Field Values
-
Parse_M
private static final Pattern Parse_M
Parse Memory line
-
Program_Header
@NonNls private static final @NonNls String Program_Header
- See Also:
- Constant Field Values
-
TAG
private static final String TAG
class Logger tag.
-
New_Line
public static final String New_Line
New lines in simulated RS232 files are always written with DOS line endings.- See Also:
- Constant Field Values
-
Setting_Name
@NonNls public static final @NonNls String Setting_Name
File name for settings.- See Also:
- Constant Field Values
-
Owner
private final Calculator Owner
Calculator to which the interface is connected to
-
File_Read
private long File_Read
Characters read from input stream
-
In
@Nullable private BufferedReader In
input stream
-
Out
@Nullable private Writer Out
output stream
-
File_Name
String File_Name
Last file name opened. Remembered to impove error messages.
-
Home_Directory
@Nullable protected @Nullable String Home_Directory
The simulators home directory. The usual positions are:- Windows
- "C:/Documents and Settings/user_id/FX-603P/"
- OS X
- "/User/user_id/FX-603P/"
- Unix
- "/home/user_id/FX-603P/"
- Symbian
- "D:/others/FX-603P/"
- Android
- "/mnt/sdcard/Android/data/net.sourceforge.uiq3.fx603p"
-
-
Constructor Detail
-
Serial
protected Serial(Calculator Owner)
- Parameters:
Owner
- Calculator to which the interface is connected to
-
-
Method Detail
-
Close
public void Close() throws Op_Error
Close files and all streams attached to them.- Throws:
Op_Error
- Something went wrong
-
Create
public void Create(@NotNull Interface.File_Type Type, @NotNull @NotNull String File_Name) throws Op_Error
create new file for tape IO
- Parameters:
Type
- File Type.File_Name
- file name to create- Throws:
Op_Error
- Something went wrong
-
Create_Stream
@Nullable protected abstract Writer Create_Stream(@NotNull @NotNull String Filename) throws Op_Error
Create a new file for output.- Parameters:
Filename
- filename.- Returns:
- data stream to write to.
- Throws:
Op_Error
- io error.
-
File_Size
public abstract long File_Size() throws Op_Error
Get file Size- Returns:
- File size
- Throws:
Op_Error
- any file io error
-
Home_Directory
@NotNull public @NotNull String Home_Directory()
The simulators home directory. The usual positions are:- Windows
- "C:/Documents and Settings/user_id/FX-603P/"
- OS X
- "/User/user_id/FX-603P/"
- Unix
- "/home/user_id/FX-603P/"
- Symbian
- "D:/others/FX-603P/"
- Android
- "/mnt/sdcard/Android/data/net.sourceforge.uiq3.fx603p/"
- Returns:
- The home directory to be used.
-
Home_Directory
public void Home_Directory(@Nullable @Nullable String Home_Directory)
The simulators home directory. The usual positions are:- Windows
- "C:/Documents and Settings/user_id/FX-603P/"
- OS X
- "/User/user_id/FX-603P/"
- Unix
- "/home/user_id/FX-603P/"
- Symbian
- "D:/others/FX-603P/"
- Android
- "/mnt/sdcard/Android/data/net.sourceforge.uiq3.fx603p/"
- Parameters:
Home_Directory
- The home directory to be used.
-
Open
public void Open(@NotNull Interface.File_Type Type, @NotNull @NotNull String File_Name) throws Op_Error
open file of given type
- Parameters:
Type
- File Type.File_Name
- File name to open- Throws:
Op_Error
- Something went wrong
-
Open
@NotNull public Interface.File_Type Open(@NotNull @NotNull String File_Name) throws Op_Error
open file and return type
- Parameters:
File_Name
- File name to open- Returns:
- the file type of the file
- Throws:
Op_Error
- Something went wrong
-
Open_Stream
@NotNull protected abstract Reader Open_Stream(@NotNull @NotNull String Filename) throws Op_Error
Create a new file for input.- Parameters:
Filename
- filename.- Returns:
- data stream to read from.
- Throws:
Op_Error
- io error.
-
Parse_M
public void Parse_M() throws Op_Error
Parse text files for memory informations.
- Throws:
Op_Error
- operation error
-
Parse_Steps
public void Parse_Steps() throws Op_Error
Parse text files for memory informations.
- Throws:
Op_Error
- operation error
-
Print_M
public void Print_M() throws Op_Error
Writes memory register to simulated cassette interface.- Throws:
Op_Error
- could not write steps
-
Print_New_Line
public void Print_New_Line() throws Op_Error
pring a new line. a public version is needed for All Text file
- Throws:
Op_Error
- on i/o errors
-
Print_Steps
public void Print_Steps() throws Op_Error
Print program steps- Throws:
Op_Error
- could not print the program
-
Store_Opcode
private int Store_Opcode(int Step_Number, short Opcode)
store a step to steps
- Parameters:
Step_Number
- free step to store the token toOpcode
- Opcode to store- Returns:
- Next free step nummer
-
Store_Token
private int Store_Token(int Step_Number, short Opcode)
store a step to steps
- Parameters:
Step_Number
- free step to store the token toOpcode
- Opcode to store- Returns:
- Next free step nummer
-
-