Пример #1
0
LoadTabGroupDlg::LoadTabGroupDlg(wxWindow* parent, const wxString& path, const wxArrayString& previousgroups) : LoadTabGroupBaseDlg(parent)
{
    for (size_t n=0; n < previousgroups.GetCount(); ++n) {
        InsertListItem(previousgroups.Item(n));
    }

    // Add any groups in the passed dir (which is probably the workspace dir)
    wxArrayString pwdfiles;
    wxDir::GetAllFiles ( path, &pwdfiles, wxT("*.tabgroup"), wxDIR_FILES );
    for (size_t n=0; n < pwdfiles.GetCount(); ++n) {
        InsertListItem(pwdfiles.Item(n));
    }
    WindowAttrManager::Load(this, wxT("LoadTabGroupDlg"), NULL);
}
void CDecPerformanceForm::ShowSummaryStatistics()
{
    // No point in showing summary statistics if only one or no results
    if (phase_cur >= 2) {
        timings_avg.frames		/= phase_cur;			// calculate average
        timings_avg.realtime_ns	/= phase_cur;
        timings_avg.runtime_ns	/= phase_cur;

        int list_index = list_results.GetItemCount();	// display min/max/avg
        InsertListItem(timings_min, list_index++, _T("Min."));
        InsertListItem(timings_max, list_index++, _T("Max."));
        InsertListItem(timings_avg, list_index++, _T("Avg."));
    }
}
Пример #3
0
void GetFiles(char dir[], int* numItems, int parentItem)
{
	char fileName[MAX_PATHNAME_LEN], searchPath[MAX_PATHNAME_LEN];
	strcpy (searchPath, dir); 
	strcat (searchPath, "\\*");
	
	if (!GetFirstFile (searchPath, 1, 1, 0, 0, 0, 0, fileName)) // has at least one file
	{
		InsertListItem (Main_pnl_handle, ERG_panel_loaded_mask_list, -1, fileName, (*numItems)++);
		while (!GetNextFile (fileName))
		{
			InsertListItem (Main_pnl_handle, ERG_panel_loaded_mask_list, -1, fileName, (*numItems)++);
		}
	}
}
Пример #4
0
void initRobotPanel(int panel, int rid)
{
	ROBOT* rb = &sys->rb[rid];
	
	curRobotId = rid;
	curRid = rb->firstRid;
	
	char* title[] = {"前段-製程槽","中段-製程槽","後段-製程槽"};
	SetCtrlAttribute(panel,PANEL_RB_TEXTMSG_22, ATTR_CTRL_VAL, title[rid]);
	
	for(int i = rb->firstRid; i <= rb->lastRid; i++)
	{
		//InsertListItem(panel, PANEL_RB_RING, i - rb->firstRid, sys->tk[sys->rtk[i].tid].name, i);
				char tmp[32];
		if(i <= rb->lastRid-1 && sys->rtk[i].tid == sys->rtk[i+1].tid)
		{
			sprintf(tmp,"%s-1", sys->tk[sys->rtk[i].tid].name);
			InsertListItem(panel, PANEL_RB_RING, i - rb->firstRid, tmp, i); 
			i++;
			sprintf(tmp,"%s-2", sys->tk[sys->rtk[i].tid].name);
			InsertListItem(panel, PANEL_RB_RING, i - rb->firstRid, tmp, i);
		}
		else
			InsertListItem(panel, PANEL_RB_RING, i - rb->firstRid, sys->tk[sys->rtk[i].tid].name, i);
	}
	
	if(curRobotId == RB01)
	{
		SetCtrlAttribute(panel,PANEL_RB_CMD_CLEAN, ATTR_VISIBLE, 1);
		InsertListItem(panel, PANEL_RB_RING, rb->lastRid - rb->firstRid + 1, "Clean", rb->lastRid + 1); 
		
		SetCtrlVal(panel, PANEL_RB_UNLOCKX, sys->rtk[rb->firstRid].MvPosH / 10000);
		SetCtrlVal(panel, PANEL_RB_UNLOCKY, sys->rtk[rb->firstRid].MvPosV / 10000);
		SetCtrlVal(panel, PANEL_RB_LOCKX, sys->rtk[rb->firstRid].MvLock / 10000);
		SetCtrlVal(panel, PANEL_RB_LOCKY, sys->rtk[rb->firstRid].MvPosV / 10000);
	}
	else
	{
		SetCtrlVal(panel, PANEL_RB_UNLOCKX, sys->rtk[rb->firstRid].MvPosH2 / 10000);
		SetCtrlVal(panel, PANEL_RB_UNLOCKY, sys->rtk[rb->firstRid].MvPosV2 / 10000);
		SetCtrlVal(panel, PANEL_RB_LOCKX, sys->rtk[rb->firstRid].MvLock2 / 10000);
		SetCtrlVal(panel, PANEL_RB_LOCKY, sys->rtk[rb->firstRid].MvPosV2 / 10000);

	}
	
	SetCtrlVal(panel, PANEL_RB_SAV_HI, rb->safeHight / 10000); 
	SetCtrlAttribute(panel,PANEL_RB_CMD_PUT, ATTR_VISIBLE, 0);
}
Пример #5
0
BOOL CDropListBox::Expand(PLIST_ITEM pItem)
{
	int i, nPos, nParentPos = GetItemIndex(pItem);
	ASSERT(nParentPos >= 0);
	if(nParentPos < 0 || pItem->GetChildCount() <= 0)
	{
		return FALSE;
	}
	for(i = pItem->GetChildCount() - 1; i >= 0; i--)
	{
		PLIST_ITEM pChild = pItem->GetChildAt(i);
		ASSERT(pChild);

		nPos = GetItemIndex(pChild);
		//already in the listbox
		if(nPos >= 0)
		{
			continue;
		}
		
		InsertListItem(nParentPos + 1, pChild);
	}

	pItem->state &= ~ACBIS_COLLAPSED;
	return TRUE;
}
Пример #6
0
void LoadTabGroupDlg::OnBrowse( wxCommandEvent& WXUNUSED(event) )
{
    wxString group = wxFileSelector(_("Select a tab group:"), wxT(""), wxT(""), tabgroupTag,
                                    wxString(_("Tab groups")) + wxT(" (*.tabgroup)|*.tabgroup"), wxFD_OPEN | wxFD_FILE_MUST_EXIST, this);
    if (!group.IsEmpty()) {
        // Need to insert/select the new item, otherwise it won't be used
        InsertListItem(group);
        EndModal(wxID_OK);
    }
}
Пример #7
0
int		UpdateList( int panelHandle )
{
	int			iIndex		=	0;
	
	DeleteListItem ( panelHandle, PANEL_COMMAND_NAME_LIST , 0 , -1 );
	
	for ( iIndex = 0 ; iIndex < giNumberOfItems; iIndex++ )
	{
		if ( strlen(gvtListOfCommands[iIndex].szCommandName) == 0 )
			break;
		
		InsertListItem( panelHandle , PANEL_COMMAND_NAME_LIST ,  -1 , gvtListOfCommands[iIndex].szCommandName , iIndex );   
	}	 
	
	giNumberOfItems = iIndex;
	
	InsertListItem( panelHandle , PANEL_COMMAND_NAME_LIST ,  -1 , "..." , iIndex );   
	
	return 0;
}
Пример #8
0
void PopulateList()
{
	char label[MAX_PATHNAME_LEN];
	char fileName[MAX_PATHNAME_LEN];
	int numItems = 1; 
	
	ClearListCtrl (Main_pnl_handle, ERG_panel_loaded_mask_list);
	InsertListItem (Main_pnl_handle, ERG_panel_loaded_mask_list, -1, "flat", 0);
	
	SplitPath (mask_path, NULL, NULL, fileName);
	Fmt (label, "%s<%s%s%s", "Project Directory (", fileName, ")");
	GetFiles(mask_path, &numItems, numItems-1);
}
Пример #9
0
void InitManipulateCallback(int menubar, int menuItem, void *callbackData, int panel)
{
    int i, height1, height2;
    channelPtr chan;

    channel_InitViewPanel();
    InstallCtrlCallback (chanview.p1, CHANVIEW_CHANNELS,
                         ManipulateSelectionCallback, 0);
    ClearListCtrl (chanview.p1, CHANVIEW_CHANNELS);
    for (i = 0; i < channelG.channels.nItems; i++)
    {
        chan = channellist_GetItem (i);
        if (!chan->curves.nItems)
            InsertListItem (chanview.p1, CHANVIEW_CHANNELS, -1, chan->label, i);
    }

    SetCtrlIndex (chanview.p1, CHANVIEW_CHANNELS, 0);
    GetCtrlVal (chanview.p1, CHANVIEW_CHANNELS, &i);
    chan = channellist_GetItem (i);
    InstallCtrlCallback (chanview.p1, CHANVIEW_GRAPH,
                         ManipulateGraphCallback, chan);

    channel_UpdateViewPanel(chan);

    SetCtrlAttribute (chanview.p1, CHANVIEW_GRAPH, ATTR_CTRL_MODE,
                      VAL_HOT);
    SetCtrlAttribute (chanview.p1, CHANVIEW_GRAPH, ATTR_NUM_CURSORS, 1);
    SetCursorAttribute (chanview.p1, CHANVIEW_GRAPH, 1, ATTR_CURSOR_MODE,
                        VAL_SNAP_TO_POINT);
    SetCursorAttribute (chanview.p1, CHANVIEW_GRAPH, 1,
                        ATTR_CROSS_HAIR_STYLE, VAL_SHORT_CROSS);
    SetCursorAttribute (chanview.p1, CHANVIEW_GRAPH, 1, ATTR_CURSOR_COLOR,
                        VAL_YELLOW);
    GetPanelAttribute (chanview.p1, ATTR_HEIGHT, &height1);

    chanview.p2 = LoadPanel (chanview.p1, "chanfncu.uir", MANIP);
    
    GetPanelAttribute (chanview.p2, ATTR_HEIGHT, &height2);
    SetPanelAttribute (chanview.p1, ATTR_HEIGHT, height1+height2+6);
    SetPanelPos (chanview.p2, height1, 6);

    InstallCtrlCallback (chanview.p2, MANIP_READING,
                         ManipulateReadingCallback, chan);

    DisplayPanel (chanview.p2);
    InstallPopup (chanview.p1);
    MessagePopup ("Manipulate Channel Message", "Only channels not connected to a curve may be edited");
}
Пример #10
0
void CExtensionListControl::SetExtensionData(const CExtensionData *ed)
{
    DeleteAllItems();

    int i = 0;
    POSITION pos = ed->GetStartPosition();
    while(pos != NULL)
    {
        CString ext;
        SExtensionRecord r;
        ed->GetNextAssoc(pos, ext, r);

        CListItem *item = new CListItem(this, ext, r);
        InsertListItem(i++, item);
    }

    SortItems();
}
Пример #11
0
int CVICALLBACK clbCommandNameChanged (int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
	int			iIndex								=	giCurrentItemIndex;
	
	char		szStringValue[LOW_STRING]			=	{0};

	char		*pTemp								=	NULL;
	
	switch (event)
	{
		case EVENT_COMMIT:

			bSaveChanges = 1;
			
			GetCtrlVal( panel , control , szStringValue );  
			
			StringUpperCase (szStringValue);
			RemoveSurroundingWhiteSpace (szStringValue);

			do
			{
				pTemp = strchr( szStringValue , ' ' );
				
				if ( pTemp == NULL )
					break;
				
				*pTemp = '_';
				
			}while(1);
			
			strcpy( gvtListOfCommands[iIndex].szCommandName , szStringValue );
			
			ReplaceListItem ( panel , PANEL_COMMAND_NAME_LIST , iIndex , szStringValue , iIndex );
			
			if ( iIndex == giNumberOfItems )
			{
				InsertListItem( panel , PANEL_COMMAND_NAME_LIST ,  -1 , "..." , iIndex ); 
				giNumberOfItems++;
			}
				
			break;
	}
	return 0;
}
void CDecPerformanceForm::OnPhaseComplete()
{
    if (!running)
        return ;

    Timings timings;		// Get current results of current phase
    if (time_filter) {
        time_filter->GetStats(&timings.runtime_ns, &timings.frames, &timings.realtime_ns);
    } else {
        timings.runtime_ns = view->last_stop_time_ns - view->last_start_time_ns;	// no time measure filter but we can measure the total streaming time
    }
    if (timings.runtime_ns <= 0)
        timings.runtime_ns = 1;							// avoid division by zero.

    timings_avg.runtime_ns	+= timings.runtime_ns;		// update average timings
    timings_avg.frames		+= timings.frames;
    timings_avg.realtime_ns += timings.realtime_ns;

    if (0 == phase_cur) {								// update min/max timings
        timings_min = timings;
        timings_max = timings;
    } else {
        if (timings.runtime_ns < timings_min.runtime_ns)
            timings_min = timings;
        if (timings.runtime_ns > timings_max.runtime_ns)
            timings_max = timings;
    }

    CString		phase_idx_str;							// display timings for the current phase
    phase_idx_str.Format(_T("%d"), phase_cur+1);
    InsertListItem(timings, phase_cur, phase_idx_str);

    phase_cur ++;
    if (phase_cur >= phase_count) {						// if we're done
        StopTiming();
    } else {
        view->OnStopClick();							// start the next run
        view->OnPlayClick();
    }
}
Пример #13
0
VOID
AddResourceItems(
    IN PDEVADVPROP_INFO dap,
    IN HWND hWndDevList)
{
    HKEY hKey;
    WCHAR szBuffer[100];
    WCHAR szDetail[100];
    BYTE szData[512];
    DWORD dwSize;
    PCM_RESOURCE_LIST ResourceList;
    LONG Result;
    ULONG ItemCount = 0, Index;

    wsprintf(szBuffer, L"SYSTEM\\CurrentControlSet\\Enum\\%s\\LogConf", dap->szDeviceID);
    Result = RegOpenKeyExW(HKEY_LOCAL_MACHINE, szBuffer, 0, KEY_READ, &hKey);
    if (Result != ERROR_SUCCESS)
    {
        /* failed to open device instance log conf dir */
        return;
    }

    dwSize = sizeof(szData);
    Result = RegQueryValueExW(hKey, L"BootConfig", NULL, NULL, szData, &dwSize);

    RegCloseKey(hKey);
    if (Result != ERROR_SUCCESS)
    {
        /* failed to query resources */
        return;
    }

    ResourceList = (PCM_RESOURCE_LIST)szData;

    for (Index = 0; Index < ResourceList->List[0].PartialResourceList.Count; Index++)
    {
         PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor = &ResourceList->List[0].PartialResourceList.PartialDescriptors[Index];
         if (Descriptor->Type == CmResourceTypeInterrupt)
         {
             if (LoadString(hDllInstance, IDS_RESOURCE_INTERRUPT, szBuffer, sizeof(szBuffer) / sizeof(szBuffer[0])))
             {
                 wsprintf(szDetail, L"0x%08x (%d)", Descriptor->u.Interrupt.Level, Descriptor->u.Interrupt.Vector);
                 InsertListItem(hWndDevList, ItemCount, szBuffer, szDetail);
                 ItemCount++;
             }
         }
         else if (Descriptor->Type == CmResourceTypePort)
         {
             if (LoadString(hDllInstance, IDS_RESOURCE_PORT, szBuffer, sizeof(szBuffer) / sizeof(szBuffer[0])))
             {
                 wsprintf(szDetail, L"%08lx - %08lx", Descriptor->u.Port.Start.LowPart, Descriptor->u.Port.Start.LowPart + Descriptor->u.Port.Length - 1);
                 InsertListItem(hWndDevList, ItemCount, szBuffer, szDetail);
                 ItemCount++;
             }
         }
         else if (Descriptor->Type == CmResourceTypeMemory)
         {
             if (LoadString(hDllInstance, IDS_RESOURCE_MEMORY_RANGE, szBuffer, sizeof(szBuffer) / sizeof(szBuffer[0])))
             {
                 wsprintf(szDetail, L"%08I64x - %08I64x", Descriptor->u.Memory.Start.QuadPart, Descriptor->u.Memory.Start.QuadPart + Descriptor->u.Memory.Length - 1);
                 InsertListItem(hWndDevList, ItemCount, szBuffer, szDetail);
                 ItemCount++;
             }
         }
         else if (Descriptor->Type == CmResourceTypeDma)
         {
             if (LoadString(hDllInstance, IDS_RESOURCE_DMA, szBuffer, sizeof(szBuffer) / sizeof(szBuffer[0])))
             {
                 wsprintf(szDetail, L"%08ld", Descriptor->u.Dma.Channel);
                 InsertListItem(hWndDevList, ItemCount, szBuffer, szDetail);
                 ItemCount++;
             }
         }
    }
}