NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Change color of socket frame in Parallel Mode

Solved!
Go to solution

Hello, good day everyone!

 

I'm runnning my sequences in Parallel Mode.

 

When I am running a sequence, its socket frame color change to Blue.

 

Image2.png

 

When I complete a sequence, its socket frame color change for a moment to Green.

 

Image3.png

 

I would like to modify that color programmatically from my TestStand sequence. I do not know if that it is possible.

 

Example: If the sequence is waiting for something, the color should change to Orange .

 

---

 

 

When I wanted to modify the text that appears in the big textbox of the socket, I needed to add some code to my paralleluutdlg.c, the PostParallelUUTDialogStatusMessage function.

 

http://forums.ni.com/t5/NI-TestStand/Parallel-model/m-p/345847/highlight/true#M10401

 

I am thinking maybe I would need to add something like that again for changing the color but I have found nothing related.

 

Thanks in advance!

 

0 Kudos
Message 1 of 4
(4,011 Views)
Solution
Accepted by topic author AlejandroMartinezMeza

Hi,

 

I actually recently added this functionality to my system. I did it by modifying the example shown in this NI knowledge base article. I am not sure if this is the best way to handle this, but it has worked well for me. I modified the function as shown below. You simply pass in your message and the hex color you would like to use.

 

Hopefully this helps, maybe someone more knowledgable can chime in to see if my handy work looks ok.

 

int DLLEXPORT _stdcall PostParallelUUTDialogStatusMessage(int dlgHandle, int testSocketIndex, int myColor, char *statusMsg)
{     int error = 0;
      ERRORINFO errorInfo;

      int panelId = dlgHandle;
      int childPanel = -1;

      PUUT_PanelData *panelData = NULL;
      TestSocketData *testSocketData = NULL;
	  
	  errChk( GetPanelAttribute (panelId, ATTR_FIRST_CHILD, &childPanel));
      errChk( GetPanelAttribute (panelId, ATTR_CALLBACK_DATA, &panelData));
     
	  testSocketData = &(panelData->testSocketDataArray[testSocketIndex]);  
	  SetCtrlAttribute (childPanel, testSocketData->ctrls[kTSCtrl_Bg],ATTR_FRAME_COLOR, myColor);
	  
	  SetCtrlAttribute (childPanel,testSocketData->ctrls[kTSCtrl_TestSocketIndex],ATTR_TEXT_BGCOLOR, myColor);
	  

 

      errChk( ResetTextBox (childPanel, testSocketData->ctrls[kTSCtrl_Status], statusMsg));

      Error:

      return error;
}

 

 

Message 2 of 4
(4,007 Views)

Hello ademedeiros!, thanks for the answer. That is exactly what I needed to do, even better because now I can change the message and the frame color of the socket with the same function.

0 Kudos
Message 3 of 4
(3,977 Views)

Great! Glad I could help!

0 Kudos
Message 4 of 4
(3,936 Views)