Project Orbiter MMU (oMMU) development thread

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
5,738
Reaction score
57
Points
123
Location
Dallas, TX
Thanks. So not sure how to use. I saw the github stuff. I downloaded the zip. I am unzipped in my orbiter2016 directory/orbitersdk/samples folder.


I am more than willing to try her out
 
Last edited:

Woo482

Moderator
Moderator
Addon Developer
GFX Staff
Joined
Feb 13, 2008
Messages
3,048
Reaction score
0
Points
61
Location
Earth?
I'll see if I can put together an example on how to use it, it might reach the weekend before I have the chance though
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
5,738
Reaction score
57
Points
123
Location
Dallas, TX
Any update? I have a ground vessel or two that I want to try to add this in
 

Face

Addon Developer
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,111
Reaction score
43
Points
73
Location
Vienna
Any update? I have a ground vessel or two that I want to try to add this in
It's open-source now, you can hack on it...

Oh, you mean the example, sorry.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
5,738
Reaction score
57
Points
123
Location
Dallas, TX
Thanks. So I think I have stuff wrong. I looked at your PB example and got the stuuf and added into my test version.

BUT I think the links on my end
maybe wrong.

So in my orbitersdk/library the oMMU_API.lib file is there and in the include the oMMU_API.h is there. I have included them in my solution also.

 

jangofett287

Heat shield 'tester'
Joined
Oct 14, 2010
Messages
1,140
Reaction score
2
Points
38
You need to add the libs to the linker settings, not the project files.

The slightly cheating method is to add
Code:
#pragma comment(lib, "oMMU_API")
to your cpp file.

The proper way is to edit the project settings.
Right click LER2016 and select properties.
In the list on the left open up the linker category and select Input
Add "ommu_API.lib;" to the start of the Additional Dependencies box
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
5,738
Reaction score
57
Points
123
Location
Dallas, TX
Thanks.
So I did this:

Code:
int LER2016::clbkConsumeBufferedKey(DWORD key, bool down, char *kstate) {
	// only process keydown events
	if (!down) return 0;

	

		
		if (key == OAPI_KEY_4) {	// rotate- 
			TURN_STATE = 1;
			return 1;
		}
		if (key == OAPI_KEY_3) {	// WHEELLOCK
			if (WHEELLOCK == 0) WHEELLOCK = 1;
			else WHEELLOCK = 0;
			return 1;
		}
		if (key == OAPI_KEY_V) {
			SelectCockpitView(CAM);
			CAM = CAM + 1;
			if (CAM > 4) CAM = 0;
			return 1;
		}

		if (key == OAPI_KEY_E)
		{
			SeparateMMU();

		}
		if (key == OAPI_KEY_J)
		{
			ENTER_EVA1();

		}
		if (key == OAPI_KEY_7)
		{
			if (lighton == 0) lighton = 1;
			else lighton = 0;
			return 1;
		}

		//ommu//
		if (key == OAPI_KEY_J) {
			oMMU_API::oMMUCrew newMember;
			newMember.age = 22;
			newMember.role = "Capt";
			newMember.name = "Jane Doe";
			newMember.pulse = 124;
			newMember.weight = 140;
			newMember.evaMesh = "blah.msh"; // TODO : Change this to your mesh.
			crew->AddCrew(newMember);
		}
		else if (key == OAPI_KEY_E) {
			crew->BeginEVA(selectedSlot, 0, true);
		}

		if (key == OAPI_KEY_1) {
			selectedSlot--;
			if (selectedSlot < 1)
				selectedSlot = crewLimit;
		}
		if (key == OAPI_KEY_2) {
			selectedSlot++;
			if (selectedSlot > crewLimit)
				selectedSlot = 1;
		}


	return 0;
}
Error: 6 IntelliSense: namespace "oMMU_API" has no member "oMMUCrew" c:\Orbiter2016\Orbitersdk\samples\LER2016CHairotOMMU\LER2016base.CPP 579 14 LER2016

Code:
	bool LER2016::clbkDrawHUD(int mode, const HUDPAINTSPEC *hps, oapi::Sketchpad *skp)
	{
		// draw the default HUD
		VESSEL3::clbkDrawHUD(mode, hps, skp);
		int s = hps->H;
		double d = (s*0.00130208);
		int sw = ((hps->W));
		int lw = (int)(16 * sw / 1024);
		int lwoffset = sw - (18 * lw);
		int hlw = (int)(lw / 2);


		int roxl = 0;
		int royl = 0;
		int roy2 = 0;

		double ds = s;
		double dsw = sw;
		double sc_ratio = ds / dsw;


		if (sc_ratio < 0.7284)
		{
			roxl = (lw * 10);
			royl = (int)(-88 * d);
			roy2 = (int)(-70 * d);
		}
		int wd = (int)(152 * d);
		int wc = (int)(168 * d);
		int w0 = (int)(184 * d);
		int w1 = (int)(200 * d);
		int w2 = (int)(216 * d);
		int w3 = (int)(232 * d);
		int w4 = (int)(248 * d);
		int w5 = (int)(264 * d);
		int w6 = (int)(280 * d);
		int w7 = (int)(296 * d);
		int w8 = (int)(312 * d);
		int w9 = (int)(328 * d);
		int w10 = (int)(344 * d);
		int w11 = (int)(360 * d);


		{
			skp->SetTextColor(0x0066FF66);
			char abuf[256];
			sprintf(abuf, "Current Ground Speed %0.2f", targetSpeed);
			skp->Text((10 + roxl), (w9 + royl), abuf, strlen(abuf));
		}

		
		{
			skp->SetTextColor(0x0066FF66);
			char abuf[256];
			sprintf(abuf, "Turn Angle: %d", (TurnANGLE));
			skp->Text((10 + roxl), (w10 + royl), abuf, strlen(abuf));
		}

		CString cbuf;
		auto lhs = hps->W * 0.1;
		auto top = hps->H * 0.3;
		skp->Text(lhs, top, "Selected crew member: ", 23);

		oMMUCrew selectedMember;
		auto crewStatus = crew->GetCrewState(selectedSlot, selectedMember);
		if (crewStatus == oMMUStatus::OK) {
			cbuf.Format("(Slot %i of %i) %s %s", selectedSlot, crewLimit, selectedMember.role.GetBuffer(), selectedMember.name.GetBuffer());
			selectedMember.role.ReleaseBuffer();
			selectedMember.name.ReleaseBuffer();
		}
		else {
			cbuf.Format("(Slot %i of %i) <<EMPTY>>", selectedSlot, crewLimit);
		}
		skp->Text(lhs, top + 16, cbuf.GetString(), cbuf.GetLength());

		skp->Text(lhs, top + 32, "E - Begin EVA, 1 - Previous Seat, 2 - Next Seat, J - Add Crew Member", 69);
		return true;
	}
8 IntelliSense: identifier "oMMUCrew" is undefined c:\Orbiter2016\Orbitersdk\samples\LER2016CHairotOMMU\LER2016base.CPP 954 3 LER2016
7 IntelliSense: identifier "CString" is undefined c:\Orbiter2016\Orbitersdk\samples\LER2016CHairotOMMU\LER2016base.CPP 949 3 LER2016
5 IntelliSense: cannot open source file "oMMU_Data.h" c:\Orbiter2016\Orbitersdk\include\oMMU_API.h 2 1 LER2016
in my h:
Code:
class LER2016 : public VESSEL3 {
public:
	LER2016(OBJHANDLE hObj, int fmodel);
...
private:


	oMMU *crew;
	int selectedSlot = 1;
	int crewLimit = 3;

};
Error 3 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\orbiter2016\orbitersdk\samples\ler2016chairotommu\LER2016.h 167 1 LER2016
Error 2 error C2143: syntax error : missing ';' before '*' c:\orbiter2016\orbitersdk\samples\ler2016chairotommu\LER2016.h 167 1 LER2016
Error 4 error C1083: Cannot open include file: 'oMMU_Data.h': No such file or directory C:\ORBITER2016\Orbitersdk\include\oMMU_API.h 2 1 LER2016


So Where should the oMMU_Data.h be?
 

jangofett287

Heat shield 'tester'
Joined
Oct 14, 2010
Messages
1,140
Reaction score
2
Points
38
BUG oMMU_Data.h is missing from the pre-compiled release .zip file.

In the mean time open this link
https://raw.githubusercontent.com/amaudsley/oMMU/alpha-1/oMMU API/oMMU_Data.h
then hit CTRL+S and save it as oMMU_Data.h next to oMMU_API.h

---------- Post added at 03:51 ---------- Previous post was at 03:48 ----------

Code:
/*** Orbiter MMU API ***/
/* Part of the Orbiter MMU package - Version 1
 *
 * Copyright 2017-2019 Adam "Woo482" Maudsley
 * All rights reserved. Do not redestribute.
*/
Also that copyright header probably needs changing...
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
5,738
Reaction score
57
Points
123
Location
Dallas, TX
Thanks.

So maybe I am doing it wrong. So I have the OMMU_Core.dll and oMMU_MMU.dll in the modules folder.

I used the source.cpp and got the stuff to add to my LERvessel for testing.



So in my orbitersdk folder:

and in this folder:


Now 13 errors:
Error 3 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\orbiter2016\orbitersdk\samples\ler2016chairotommu\LER2016.h 167 1 LER2016
Error 16 error C3536: 'crewStatus': cannot be used before it is initialized C:\Orbiter2016\Orbitersdk\samples\LER2016CHairotOMMU\LER2016base.CPP 956 1 LER2016
Error 17 error C2678: binary '==' : no operator found which takes a left-hand operand of type 'int' (or there is no acceptable conversion) C:\Orbiter2016\Orbitersdk\samples\LER2016CHairotOMMU\LER2016base.CPP 956 1 LER2016
Error 6 error C2227: left of '->SetCrewLimit' must point to class/struct/union/generic type C:\Orbiter2016\Orbitersdk\samples\LER2016CHairotOMMU\LER2016base.CPP 84 1 LER2016
Error 15 error C2227: left of '->GetCrewState' must point to class/struct/union/generic type C:\Orbiter2016\Orbitersdk\samples\LER2016CHairotOMMU\LER2016base.CPP 955 1 LER2016
Error 12 error C2227: left of '->BeginEVA' must point to class/struct/union/generic type C:\Orbiter2016\Orbitersdk\samples\LER2016CHairotOMMU\LER2016base.CPP 589 1 LER2016
Error 10 error C2227: left of '->AddCrew' must point to class/struct/union/generic type C:\Orbiter2016\Orbitersdk\samples\LER2016CHairotOMMU\LER2016base.CPP 586 1 LER2016
Error 2 error C2143: syntax error : missing ';' before '*' c:\orbiter2016\orbitersdk\samples\ler2016chairotommu\LER2016.h 167 1 LER2016
Error 4 error C2065: 'crew' : undeclared identifier C:\Orbiter2016\Orbitersdk\samples\LER2016CHairotOMMU\LER2016base.CPP 83 1 LER2016
 

jangofett287

Heat shield 'tester'
Joined
Oct 14, 2010
Messages
1,140
Reaction score
2
Points
38
Ok. Just adding things to your project won't get you anywhere. In the listing on the right you need to remove dlgctrl.lib, ommu_api.lib, ommu_api.h and ommu_data.h. You also need to remove ommu_api.cpp. Then you need to make sure ommu_api.h and ommu_data.h are in orbitersdk\include. It looks like you've downloaded the entire library's source along side the pre-compiled version, which isn't going to help either.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
5,738
Reaction score
57
Points
123
Location
Dallas, TX
Thanks
So I did that and here is what I have in the include.

Still got those errors though
 

jangofett287

Heat shield 'tester'
Joined
Oct 14, 2010
Messages
1,140
Reaction score
2
Points
38
Then there's something else wrong with your setup and I'm not sure what. I wouldn't worry about that for the moment though because...

BUG oMMU_API.lib has been compiled with Link Time Code Generation enabled which means only the exact version of the MSVC toolchain used to compile it can be used to link it. I assume that's unintentional.
 

haze39

Member
Joined
Mar 23, 2008
Messages
30
Reaction score
0
Points
6
Ommu Release??

Hi

Still waiting anxioulsy for the OMMU release for Orbiter 2016..This is the Only reason why i am still using Orbiter 2010 P1..

Any planned release date yet?...

Kind regards
haze39
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
5,738
Reaction score
57
Points
123
Location
Dallas, TX
I hope this gets fixed. But like UMMu one still needed to add code to the vessel. I know that there was a add on that added UMMU to a vessel outside of the code.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
5,738
Reaction score
57
Points
123
Location
Dallas, TX
I wonder why it won't compile for me?

But looking at the code. I have questions. Is the eva info going to be in a cfg or hard coded? Like in UMMU the eva info was in the scn and cfg.

Things like slot info?
Code:
if (key == OAPI_KEY_J) {
			oMMU_API::oMMUCrew newMember;
			newMember.age = 22;
			newMember.role = "Capt";
			newMember.name = "Jane Doe";
			newMember.pulse = 124;
			newMember.weight = 140;
			newMember.evaMesh = "blah.msh"; // TODO : Change this to your mesh.
			crew->AddCrew(newMember);
		}
 

Woo482

Moderator
Moderator
Addon Developer
GFX Staff
Joined
Feb 13, 2008
Messages
3,048
Reaction score
0
Points
61
Location
Earth?
Sorry, I didn't realise it'd be so broken; I'll try and get things fixed up soon. The plan was MMUs to be configured via a config file, with override in the code if needed but that's not finished yet.
 
Top