JTOOLS SHELL APPLICATION
JTools Table of Contents
Project Location: \JTools_ShellApp
This is my Generic Shell Application for running NxCore. This application
features a completely detachable GUI, logging, real time simulation, delayed
simulation and a variety of other options. It is the application I usually
start with to build any new NxCore based application.
The following should serve as a small guide on the primary components of the
Shell Application.
The Main Application Window:
|
- Compact - Shrink app window to just stats or to show all.
- NxCore Status - Current Status of NxCore.
- Tape Time (EST) - Current time on NxCore tape (or realtime).
- System Time - Current time on your system.
- Msg/Sec - Current Messages per Second processing statistic.
- Full - Run full blast (as fast as possible).
- RT Sim - Run in a real time simulation mode.
- Step - Run in step mode, pausing after each NxCore message.
- Next - When running in step mode, use the Next button to step
through the next NxCore callback message.
- Start NxCore - Start NxCore processing.
- Stop NxCore - Stop NxCore processing.
- Settings - Goto settings and preference dialog.
- Enable Event Logging - Global toggle to turn all file logging and
messages to the Activity Debugger on or off.
- Show in Activity Debugger - Toggle for messages to be shown in the
Activity Debugger.
- Write to File - Write Activity messages to file.
- Show NxCore Milliseconds - Milliseconds are shown for the NxCore
timestamps.
- Reset Log Name to NxTape Name - If set, the log file generated will
be dated according to the NxCore tape date (as opposed to the system date). The
NxCore tape date becomes available when the TAPEOPEN status message if received
in the NxCore callback.
- Activity Monitor - Window were all messages are sent for immediate
viewing.
|
The Settings and Preferences Window:
|
- Start NxCore Processing On Application Launch - If set, the
application will automatically start NxCore on launch.
- Close Application On Tape Complete - If set, the application will
close when NxCore processing is complete.
- Save/Restore Application Screen Position - If set, the applications
screen position and size are saved/restored on application exit and launch.
- NxCore DLL to use - Path and Filename to the NxCore DLL.
- Realtime - Run in realtime mode from NxAccess, regardless of whether
a tape filename is set or not.
When running in real time, the user must have a NxAccess account and have
NxAccess running on the same machine as the application.
If NxAccess and the appplication run 24 hours a day, the application will
automatically roll with NxAccess at 12:00 Midnight EST and begin processing the
new day.
- Historical - Run from a historical tape file.
- Tape File to Use - Tape file to run (if Historical is chosen as the
running mode). This may be a full NxCore tapefile or an NxCore generated State
File.
- RT-Sim Pause - When running in real-time simulation mode, this is
the amount of time to pause (in milliseconds) between each NxCore callback
message. You can speed up or slow down the simulation with this setting.
- Exclude Quotes - Exclude all exchange quotes in NxCore processing.
- Exclude Level2 Quotes - Exclude all level2 market maker quotes
(depth in futures) in NxCore processing.
- Exclude OPRA - Exclude all OPRA (options) from NxCore processing.
- Exclude CRC - Exclude CRC Checking.
- Delayed - If set, the application will simulate a delayed feed.
- Delay Minutes - The number of minutes the feed is to be delayed (if
Delayed is set).
- Delay Resolution - The number of microseconds to wait before check
the current amount of passed time, in seconds. Used only if Delayed is set.
- Update NxTime In GUI Every: - Specifies the interval in which to
update the NxCore time in the GUI.
- MAIN WINDOW - Background and foreground colors of the main
application window.
- ACTIVITY WIN - Background and foreground color of the application
activity monitor.
- READONLY CTL - Background and foreground colors for read-only edit
controls within the application.
- EDITABLE CTL - Background and foreground colors for editable edit
controls within the application.
|
The INI configuration File:
Each application reads and writes the configuration information to its own INI
file. The INI file is a human readable text file and as such, can safely be
modified in any text editor, outside of the application. This also makes it
possible to script the application(s) for batch mode processing by simply
modifying the INI file and launching the application.
Look and Feel:
As the applications use the standard Windows controls, you may wish to have a
slightly more modern looking GUI. To do so, look in the file stdafx.h, at the
very end. Un-comment the control manifest file specification. Recompile the
application and you will have a new look and feel:
Standard look, without the control manifest file:
|
More modern look using the control manifest file:
|
And to get your own unique look to any application, modify the Color Properties
(when running the application) in the settings and preferences dialog and have
fun!
Detached GUI:
The GUI in the Shell Application is completely detached from the actual NxCore
functionality. GUI functionality becomes available through the use of specific
callback functions provided to the NxCore interface. As such it becomes trivial
to convert the NxCore component into a console application, Windows service.
etc. Build and debug any application using the GUI and then, if no GUI is
required (or desired) for production take it down to where it needs to go,
quickly.
I have included another small project called JTools_ShellApp_Command which is
simply a straight C console application. The NxCore functionality and files are
identical to the GUI driven application. As opposed to eliminating the GUI
callbacks I simply re-coded them to use the C standard
printf("%s\n",str) to output the strings to the console...very basic.
It's even easier to eliminate the GUI completely by simply not providing the
callback functions to the interface.
Project Location: \JTools_ShellApp_Console
To run the console application, firs run the JTools_ShellApp.exe GUI
application. Set the preferences for what you want the console app to do (IE
run from tape file, etc). Exit the GUI app and copy the JTools_ShellApp.INI
file to the location of the console application. Now run the console
application. It will read and process data according to the specs in
JTools_ShellApp.ini.
Self Contained User/Application Data:
Because the shell application's NxCore interface uses/modifies only data passed
though the main NxCore UserData pointer (when ProcessTape() is called),
spinning multiple threads for the interface becomes trivial. As with the
Console application I have included another project called
"JTools_ShellApp_Dual". The interface has been duplicated so that the
user can easilly run two NxCore interfaces both feeding data to the same
application independently of one another. In the screenshot below, the 1'st
system is running an historical tape full blast with the 2'nd system is running
from NxAccess in real-time:
Project Location: \JTools_ShellApp_Dual
JTools Table of Contents
|