Meadville Space Center
Welcome, Guest. Please login or register.
August 08, 2020, 01:50:58 AM

Login with username, password and session length
Search:     Advanced search
Gemini 060615 released!
25068 Posts in 2094 Topics by 2266 Members
Latest Member: twa517
* Home Help Search Login Register
+  Meadville Space Center
|-+  Project Apollo - NASSP
| |-+  Project Apollo - NASSP Development
| | |-+  Programming (Moderators: movieman, dseagrav, Swatch, lassombra)
| | | |-+  MFD connector
« previous next »
Pages: 1 2 [3] Print
Author Topic: MFD connector  (Read 5848 times)
movieman
Moderator
Hero Member
****
Posts: 1710



View Profile
« Reply #30 on: January 15, 2008, 12:12:08 PM »

The call is probably hidden inside the MFDConnector code. It calls the vessel to get a pointer to the vessel end of the connector and wire it up to the MFD side of the connector.

I think you just need an MFDConnector in each MFD and to call the appropriate MFDConnector function to connect to the appropriate vessel.
Logged
lassombra
Moderator
Sr. Member
****
Posts: 410


View Profile Email
« Reply #31 on: January 15, 2008, 12:23:31 PM »

Ok, I found the call...  So, correct me if I'm way off base here:

The vessel makes the receiving connector when it instantiates the panel connector

GetVesselConnector grabs a reference to that connector.

ConnectTo then associates a two way connection (allowing for the down the road potential for two way communication which, simply put, won't ever be used).

Instead, we simply need to be shortcutting the ConnectTo step and just connect one way, not giving it a reference as to the return side?

If so, that can be easily done for the MFD connector only to simply verify it's got a panel connector and then connect.

So if I am correct in all the above, than we can change the connection code to:

bool MFDConnector::ConnectToVessel(VESSEL *v)
{
   Disconnect();
        Connector *vessel = GetVesselConnector(v, VIRTUAL_CONNECTOR_PORT, type);
   if (vessel)
   {
                connectedTo = vessel;
      return true;
   }
   return false;
}

and the disconnect code to:
void MFDConnector::Disconnect()
{
        if (connectedTo)
               connectedTo = 0;
}
Logged

My current Project Apollo work:

Quickstart to the Moon initiative (Quickstart_to_the_Moon): Done through earth orbit.  Working on new method of calculating TLI.

Checklist Controller: 
  • MFD Interface 99%(Minor cleanup and future features remain)
  • Panel Interface 99%
  • Excel interface and logic 99%
  • LEM Event code.0%
  • DSKY Interface code. Framework complete, creating "buttons"
  Approximately 80% done. (Checklist Controller
movieman
Moderator
Hero Member
****
Posts: 1710



View Profile
« Reply #32 on: January 15, 2008, 12:28:31 PM »

I don't think anything needs to change at the moment: the vessel connector will think it's only connected to the last MFD which connected to it, but since it's not sending messages to the MFDs, that won't matter.

At some point we may want to turn it into a 'MulticastConnector' which tracks everything that connects to it and sends messages to all of them when the vessel end wants to send a message (e.g. telling the MFDs that a checklist step has been completed).

I may be wrong, but under those restrictions I think the current code will just work.
Logged
lassombra
Moderator
Sr. Member
****
Posts: 410


View Profile Email
« Reply #33 on: January 15, 2008, 12:43:22 PM »

The current code simply fails when a second one tries to connect.  I don't think we have any reason to be using two way message system, as it has no use to the current implementation, and requires a whole new level of complexity in referencing the right connectors, etc.

I'll put in a new ConnectTo in the MFDConnector class that doesn't fail when there is already something connected and allows it to keep a "last reference" in case we want to down the road expand on that.
Logged

My current Project Apollo work:

Quickstart to the Moon initiative (Quickstart_to_the_Moon): Done through earth orbit.  Working on new method of calculating TLI.

Checklist Controller: 
  • MFD Interface 99%(Minor cleanup and future features remain)
  • Panel Interface 99%
  • Excel interface and logic 99%
  • LEM Event code.0%
  • DSKY Interface code. Framework complete, creating "buttons"
  Approximately 80% done. (Checklist Controller
movieman
Moderator
Hero Member
****
Posts: 1710



View Profile
« Reply #34 on: January 15, 2008, 01:07:22 PM »

I'd be tempted to add a 'bool allow_multiple = false' to the default connector ConnectTo function which disables that check if required, and set it to true when the MFDConnector calls it.
Logged
lassombra
Moderator
Sr. Member
****
Posts: 410


View Profile Email
« Reply #35 on: January 15, 2008, 01:38:28 PM »

Honestly, the connector is your code, so have fun with it.  I've made a quick and dirty hack that works for the MFD connector.  It works fine, but I don't know about it's future concerns.

In the meantime, I'm having fun trying to be able to include MFDConnector.h in ChecklistController.h which MFDConnector.h depends on...

It's an interesting situation that is requiring some creative thinking.
Logged

My current Project Apollo work:

Quickstart to the Moon initiative (Quickstart_to_the_Moon): Done through earth orbit.  Working on new method of calculating TLI.

Checklist Controller: 
  • MFD Interface 99%(Minor cleanup and future features remain)
  • Panel Interface 99%
  • Excel interface and logic 99%
  • LEM Event code.0%
  • DSKY Interface code. Framework complete, creating "buttons"
  Approximately 80% done. (Checklist Controller
movieman
Moderator
Hero Member
****
Posts: 1710



View Profile
« Reply #36 on: January 15, 2008, 11:15:19 PM »

Remember that a header file doesn't need to know the contents of a class if it's only processing pointers. So you can just add 'class MFDConnector' or whatever before the class that uses it, if it's only using pointers.
Logged
lassombra
Moderator
Sr. Member
****
Posts: 410


View Profile Email
« Reply #37 on: January 16, 2008, 02:08:01 AM »

Ahh, but the thing is I'm not using pointers.

Doesn't matter though, I figured out that MFDconnecter.h doesn't depend on the ChecklistController class, just on all the structures which are defined further up.  I just included MFDconnecter.h right before the ChecklistController class and all was well.
Logged

My current Project Apollo work:

Quickstart to the Moon initiative (Quickstart_to_the_Moon): Done through earth orbit.  Working on new method of calculating TLI.

Checklist Controller: 
  • MFD Interface 99%(Minor cleanup and future features remain)
  • Panel Interface 99%
  • Excel interface and logic 99%
  • LEM Event code.0%
  • DSKY Interface code. Framework complete, creating "buttons"
  Approximately 80% done. (Checklist Controller
Pages: 1 2 [3] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!