re arrange classes
This commit is contained in:
52
01_classes
Normal file
52
01_classes
Normal file
@@ -0,0 +1,52 @@
|
||||
This components discusses the c++ classes suggested for this project.
|
||||
|
||||
The radar class
|
||||
|
||||
This pertains to the radars, including controls, shaders, target data, text description,
|
||||
and status text.
|
||||
|
||||
This class shall consist of both a base class and subordinate classes for each radar.
|
||||
|
||||
The functions in this class shall be performed in thread 1 as they will directly
|
||||
interact with the shaders and the keyboard, which are all in thread 1.
|
||||
|
||||
Examples of data and functions for this class and it subordinates:
|
||||
|
||||
1. Shaders - functions that can be called by the initialization function that will compile,
|
||||
link, and load the shaders for each radar. The subordinates for each radar would have
|
||||
the specific shaders that are used for that radar. If a shader is to be used by more than
|
||||
one radar, that shader should be compiled, linked, and loaded by the base class before the
|
||||
shader loading functions for each of the subordinate classes' shader loading functions.
|
||||
Initially, I will have separate shaders for each radar to facilitate debugging and then
|
||||
(maybe) later, work on combining them.
|
||||
|
||||
2. Left hand panel text. Functions that display the description for each radar on the left hand
|
||||
panel. In addition, the control names and Keyboard Keys shall be displayed at the bottom
|
||||
of the left hand panel. Please note that in the future, this left hand panel may be moved
|
||||
to a second physical monitor.
|
||||
|
||||
3. Text status panel to be located below the radar scope panel. This will display the current
|
||||
control settings for the controls and the range and bearing and description of
|
||||
targets that are on or near the bearing and range cursor. The text status panel shall manage
|
||||
the hit-test. The hit test shall determine which (if any) targets are either directly the same
|
||||
rand and the same bearing as the cursor or close to it. The closeness shall be determined
|
||||
by a configuration variable. Since the cursor information as well as the target information
|
||||
is already in thread 1, this operatoin shall be performed by the CPU as the CPU will have
|
||||
all information on the target, including the name and description.
|
||||
|
||||
4. Target data. This will handle the target data that is presented by both the simulator
|
||||
and the raspberry pi data. All that data will be in the format of the
|
||||
struct target_data_to_thread_1_structure. The expectation is that the target's local
|
||||
cartesian offsets in meters relative to the radar. Note that this will be different
|
||||
for each radar and will dynamically change based on the police boat's radar position.
|
||||
I am expecting that the target data input functions may be common for all target data
|
||||
will all be the same for all radars and could be handled by the base class.
|
||||
Note that there will be a difference in handling the target data that is exclusive
|
||||
for the police boat will be the police boat's location and heading. This affects the
|
||||
radar display for the police boat. Perhaps I can suggest that the these three values
|
||||
should be furnished as uniforms to the shaders for the police boat: 1. int police_boat;
|
||||
1 is police boat and 0 is not, 2. flost police_location; in local coordinate space,
|
||||
and 3. float police_boat heading.
|
||||
|
||||
5. Run. This should be handled by only as a base class. It is triggered every 30th of a
|
||||
second to tell the shaders to execute.
|
||||
Reference in New Issue
Block a user