本文整理汇总了C++中Model::GetLastChannel方法的典型用法代码示例。如果您正苦于以下问题:C++ Model::GetLastChannel方法的具体用法?C++ Model::GetLastChannel怎么用?C++ Model::GetLastChannel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model
的用法示例。
在下文中一共展示了Model::GetLastChannel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateModelsList
void xLightsFrame::UpdateModelsList()
{
std::string name, start_channel;
int end_channel;
wxArrayString model_names;
Model *model;
ListBoxElementList->DeleteAllItems();
PreviewModels.clear();
AllModels.clear();
wxString msg;
int num_group_models = 0;
int itemCount = 0;
// Set models in selected modelgroups as part of display.
for(wxXmlNode* e=ModelGroupsNode->GetChildren(); e!=NULL; e=e->GetNext() )
{
if (e->GetName() == "modelGroup")
{
if(e->GetAttribute("selected") == "1")
{
wxArrayString ModelsInGroup=wxSplit(e->GetAttribute("models"),',');
for(int i=0;i<ModelsInGroup.size();i++)
{
for(wxXmlNode* e=ModelsNode->GetChildren(); e!=NULL; e=e->GetNext() )
{
if (e->GetName() == "model")
{
name=e->GetAttribute("name");
if (name == ModelsInGroup[i])
{
bool model_already_added = false;
for(int k = 0; k < model_names.size(); k++)
{
if( model_names[k] == name )
{
model_already_added = true;
break;
}
}
if( !model_already_added )
{
model = AllModels.createModel(e, NetInfo);
if (model->GetLastChannel() >= NetInfo.GetTotChannels()) {
msg += wxString::Format("%s - last channel: %u\n",name, model->GetLastChannel());
}
if (Model::IsMyDisplay(e))
{
long itemIndex = ListBoxElementList->InsertItem(ListBoxElementList->GetItemCount(),name);
start_channel = e->GetAttribute("StartChannel");
model->SetModelStartChan(start_channel);
wxString string_type = e->GetAttribute("StringType");
int parm1 = wxAtoi(e->GetAttribute("parm1"));
int parm2 = wxAtoi(e->GetAttribute("parm2"));
wxString display_as = e->GetAttribute("DisplayAs");
end_channel = model->GetLastChannel()+1;
ListBoxElementList->SetItem(itemIndex,1,start_channel);
ListBoxElementList->SetItem(itemIndex,2, wxString::Format(wxT("%i"),end_channel));
ListBoxElementList->SetItemPtrData(itemIndex,(wxUIntPtr)model);
PreviewModels.push_back(model);
}
model_names.push_back(name);
num_group_models++;
}
}
}
}
}
}
}
}
if( num_group_models == 0 )
{
for(wxXmlNode* e=ModelsNode->GetChildren(); e!=NULL; e=e->GetNext() )
{
if (e->GetName() == "model")
{
name=e->GetAttribute("name");
if (!name.empty())
{
model = AllModels.createModel(e, NetInfo);
if (model->GetLastChannel() >= NetInfo.GetTotChannels()) {
msg += wxString::Format("%s - last channel: %u\n",name, model->GetLastChannel());
}
if (Model::IsMyDisplay(e))
{
long itemIndex = ListBoxElementList->InsertItem(ListBoxElementList->GetItemCount(),name);
start_channel = e->GetAttribute("StartChannel");
model->SetModelStartChan(start_channel);
wxString string_type = e->GetAttribute("StringType");
int parm1 = wxAtoi(e->GetAttribute("parm1"));
int parm2 = wxAtoi(e->GetAttribute("parm2"));
wxString display_as = e->GetAttribute("DisplayAs");
end_channel = model->GetLastChannel()+1;
ListBoxElementList->SetItem(itemIndex,1,start_channel);
ListBoxElementList->SetItem(itemIndex,2, wxString::Format(wxT("%i"),end_channel));
ListBoxElementList->SetItemPtrData(itemIndex,(wxUIntPtr)model);
PreviewModels.push_back(model);
//.........这里部分代码省略.........