IUS 1.0 Development

UpdateStatus is only called once in your callbacks, and never when the switch status changes. You probably have to add it to the dialog code that handles a mouseclick.

Code:
BOOL PayloadBayOp::DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	bool action = false;

	switch (uMsg) {
	case WM_INITDIALOG: {
							SWITCHPARAM sp = { SWITCHPARAM::THREESTATE, SWITCHPARAM::VERTICAL };
		UpdateDialog(hWnd);
	} return TRUE;
	case IDC_PLBD3:
		if (HIWORD(wParam) == BN_CLICKED) {
			int idx = (LOWORD(wParam) == IDC_PLBD3 ? 0 : 1);
			switch (lParam) {
			case 0:
				PYROPRI = BD_ON;
                                
				break;
			case 1:
				PYROPRI = BD_OFF;
				break;
			}
                    [COLOR="Red"]UpdateDialog(hWnd);[/COLOR]
		}
		break;
	}
	return oapiDefDialogProc(hWnd, uMsg, wParam, lParam);
}

Without that second UpdateDialog, your code for updating the callback will never get called.

As I understand it. If I switch the switch is will be either :
enum { BD_ON, BD_OFF } PYROPRI;

then check to see if PYROPRI is BD_ON if it is change the
static char *PLBDstr[2] = { " ", "\\\\\\\\\\", };
SetWindowText(GetDlgItem(hWnd, IDC_PLBD_TLKBK7), PLBDstr[0]);
Yes, the enum is either on or off. However, your UpdateDialog doesn't work like you probably intended-it always sets it the talkback text to " ", regardless of the state of PYROPRI.

The final SetWindowText is outside of any conditional, which means the final line (in red) is always run.

Code:
void PayloadBayOp::UpdateDialog(HWND hWnd)
{
	char cbuf[256];
	//int i;
	sprintf(cbuf, "IUSASE %s: Payload Bay Operation", sts->GetName());
	SetWindowText(hWnd, cbuf);
	 {
		int plbd_ctrl[1] = { IDC_PLBD3 };
	bool switchstatus = (PYROPRI == BD_ON);
		oapiSetSwitchState(GetDlgItem(hWnd, plbd_ctrl[1]), switchstatus ? 0 : 1, true);
	}

	oapiSetSwitchState(GetDlgItem(hWnd, IDC_PLBD3), PYROPRI == BD_ON ? 0 : PYROPRI == BD_OFF ? 1 : 2, true);

	static char *PLBDstr[2] = {  "       ",  "\\\\\\\\\\",  };
[COLOR="Red"]	SetWindowText(GetDlgItem(hWnd, IDC_PLBD_TLKBK7), PLBDstr[0]);[/COLOR]



}
 
Thanks. I added the update part.
Code:
BOOL PayloadBayOp::DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	bool action = false;

	switch (uMsg) {
	case WM_INITDIALOG: {
							SWITCHPARAM sp = { SWITCHPARAM::THREESTATE, SWITCHPARAM::VERTICAL };

						UpdateDialog(hWnd);
	} return TRUE;
	case IDC_PLBD3:
		if (HIWORD(wParam) == BN_CLICKED) {
			int idx = (LOWORD(wParam) == IDC_PLBD3 ? 0 : 1);
			switch (lParam) {
			case 0:
				PYROPRI = BD_ON;

				break;
			case 1:
				PYROPRI = BD_OFF;
				break;

			}
			UpdateDialog(hWnd);
		}
		break;
	}
	return oapiDefDialogProc(hWnd, uMsg, wParam, lParam);
}

Yes the Set Window text is set unconditional. I haven't got that figured to display either 1 or 2. But it show that "/////" and not blank.


I am not sure if it see the switch change?
 
Ok How can I see if the switch is clicked? I know I have the right switch and talkback ided.

I would have thought if I put a break in the debugger when I press a switch it would stop. But it doesn't
 
Shouldn't we be doing the ASE panel inside the cockpit? It would use the already tested and know stuff, and I'm sure we could talk to the ASE from there, even in a rudimentary way until we get the payload MDMs and stuff.
 
Where does that panel go ?
 
I guess inside the shuttle, right? Then wouldn't be part of the shuttle code?
 
I don't have the meshes to check what needs to be done. My concern would be to code the Shuttle panel to tell the IUSASE vessel what to do.
 
I could help with the panel mesh.
 
I could help with the panel mesh.

Could you make optimized talkback graphics for it? The stuff I had been rambling about for some months now without people understanding what goes on inside my :censored: head?
 
I could help with the panel mesh.
IUS Power Control Panel schematic from the STS-93 IUS/AXAF Deploy FDF:

IUS_PCP.jpg


Best photo:

IUS_PCP_photo.jpg
 
What is the difference between a GREY display and one that shows diagonal bars ?

---------- Post added at 11:49 PM ---------- Previous post was at 11:48 PM ----------

Could you make optimized talkback graphics for it? The stuff I had been rambling about for some months now without people understanding what goes on inside my :censored: head?

Need alittle more info from your head ?
 
What is the difference between a GREY display and one that shows diagonal bars ?
Both are TBs. Striped bars are BP TB while GRAY is gray (blank) TB. This photo of the RMS End Effector status TBs on A8U show both:

Talkbacks.jpg
 
What's the difference ? Blank, not used ?
No, blank as in no text or anything. Just a solid gray color. The "GRAY" is named after that.

During pre-launch the PLT is asked by the OTC to perform the APU pre-start procedure. If everything is right, the PLT will report back that he/she has "three gray talkbacks". This refers to the three APU Ready To Start talkbacks on R2. Normally they're barberpole but when the APUs are in the ready to start configuration they show blank talkbacks.
 
So the ones marked grey, are normally grey and the ones marked with diagonal lines, are normally barber pole ?
 
The way I understand talkbacks work is that they're simple primitives that's flipped when they're commanded to. Each side represent a certain status like barberpole when status is unknown or active.

---------- Post added at 02:09 AM ---------- Previous post was at 02:07 AM ----------

So the ones marked grey, are normally grey and the ones marked with diagonal lines, are normally barber pole ?
Yes. Lower switch position is barber pole while upper switch positions is gray.
 
Back
Top