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) StringFile_NameLast file name opened.private longFile_ReadCharacters read from input streamprotected @Nullable StringHome_DirectoryThe simulators home directory.private BufferedReaderIninput streamprivate static PatternIs_Digitmatches a single digits (including hex digits).private static PatternIs_Digitsmatches a string of digits (including hex digits).private static LoggerLoggerclass Logger instanceprivate static @NonNls StringM_Headerprivate static intMF_Divisorstatic StringNew_LineNew lines in simulated RS232 files are always written with DOS line endings.private WriterOutoutput streamprivate CalculatorOwnerCalculator to which the interface is connected toprivate static PatternParse_MParse Memory lineprivate static @NonNls StringProgram_Headerstatic @NonNls StringSetting_NameFile name for settings.private static StringTAGclass Logger tag.
-
Constructor Summary
Constructors Modifier Constructor Description protectedSerial(Calculator Owner)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidClose()Close files and all streams attached to them.voidCreate(Interface.File_Type Type, @NotNull String File_Name)create new file for tape IOprotected abstract WriterCreate_Stream(@NotNull String Filename)Create a new file for output.abstract longFile_Size()Get file Size@NotNull StringHome_Directory()The simulators home directory.voidHome_Directory(@Nullable String Home_Directory)The simulators home directory.Interface.File_TypeOpen(@NotNull String File_Name)open file and return typevoidOpen(Interface.File_Type Type, @NotNull String File_Name)open file of given typeprotected abstract ReaderOpen_Stream(@NotNull String Filename)Create a new file for input.voidParse_M()Parse text files for memory informations.voidParse_Steps()Parse text files for memory informations.voidPrint_M()Writes memory register to simulated cassette interface.voidPrint_New_Line()pring a new line. a public version is needed for All Text filevoidPrint_Steps()Print program stepsprivate intStore_Opcode(int Step_Number, short Opcode)store a step to stepsprivate intStore_Token(int Step_Number, short Opcode)store a step to steps@NotNull StringtoString()-
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_ErrorClose 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_Errorcreate 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_ErrorGet 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_Erroropen 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_ErrorParse text files for memory informations.
- Throws:
Op_Error- operation error
-
Parse_Steps
public void Parse_Steps() throws Op_ErrorParse text files for memory informations.
- Throws:
Op_Error- operation error
-
Print_M
public void Print_M() throws Op_ErrorWrites memory register to simulated cassette interface.- Throws:
Op_Error- could not write steps
-
Print_New_Line
public void Print_New_Line() throws Op_Errorpring 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_ErrorPrint 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
-
-