10-09-2015 04:33 PM - edited 10-09-2015 04:35 PM
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.
When I complete a sequence, its socket frame color change for a moment to Green.
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!
Solved! Go to Solution.
10-09-2015 04:40 PM
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; }
10-10-2015 11:48 AM
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.
10-12-2015 07:43 AM
Great! Glad I could help!