/** Create a new vector in the x entry and copy the current values * into it. */ SmartPtr<Vector> create_new_x_copy() { SmartPtr<const Vector> curr_x = GetComp(0); Set_x_NonConst(*curr_x->MakeNew()); x_NonConst()->Copy(*curr_x); return x_NonConst(); }
/** Create a new vector in the v_U entry and copy the current * values into it. */ SmartPtr<Vector> create_new_v_U_copy() { SmartPtr<const Vector> curr_v_U = GetComp(7); Set_v_U_NonConst(*curr_v_U->MakeNew()); v_U_NonConst()->Copy(*curr_v_U); return v_U_NonConst(); }
/** private method to return the const element from the compound * vector. This method will return NULL if none is currently * set. */ SmartPtr<const Vector> GetIterateFromComp(Index i) const { if (IsCompNull(i)) { return NULL; } return GetComp(i); }
/** Create a new vector in the y_d entry and copy the current * values into it. */ SmartPtr<Vector> create_new_y_d_copy() { SmartPtr<const Vector> curr_y_d = GetComp(3); Set_y_d_NonConst(*curr_y_d->MakeNew()); y_d_NonConst()->Copy(*curr_y_d); return y_d_NonConst(); }
/** Create a new vector in the v_L entry and copy the current * values into it. */ SmartPtr<Vector> create_new_v_L_copy() { SmartPtr<const Vector> curr_v_L = GetComp(6); Set_v_L_NonConst(*curr_v_L->MakeNew()); v_L_NonConst()->Copy(*curr_v_L); return v_L_NonConst(); }
/** Create a new vector in the s entry and copy the current values * into it. */ SmartPtr<Vector> create_new_s_copy() { SmartPtr<const Vector> curr_s = GetComp(1); Set_s_NonConst(*curr_s->MakeNew()); s_NonConst()->Copy(*curr_s); return s_NonConst(); }
/** Create a new vector in the y_c entry and copy the current * values into it. */ SmartPtr<Vector> create_new_y_c_copy() { SmartPtr<const Vector> curr_y_c = GetComp(2); Set_y_c_NonConst(*curr_y_c->MakeNew()); y_c_NonConst()->Copy(*curr_y_c); return y_c_NonConst(); }
void QFitRangeWidget::FillSpecificData() { int num = GetNumRange(); if ((num<0) || (GetComp()==0)) return; Int_t typ, naxis; Double_t left, right; GetComp()->GetRangeCondition(num,typ,naxis,left,right); RangeTypCmb->setCurrentIndex(typ); AxisNumSpin->setValue(naxis); if (typ!=3) LeftEdt->setText(QString::number(left)); if (typ!=2) RightEdt->setText(QString::number(right)); EnableEditsForRangeType(typ); }
void Clipboard::DeleteComps () { Iterator i; for (First(i); !Done(i); Next(i)) { GraphicComp* comp = GetComp(i); delete comp; } }
Clipboard* Clipboard::DeepCopy () { Clipboard* cbnew = new Clipboard; Iterator i; for (First(i); !Done(i); Next(i)) { cbnew->Append((GraphicComp*) GetComp(i)->Copy()); } return cbnew; }
Clipboard* Clipboard::Copy () { Clipboard* cbnew = new Clipboard; Iterator i; for (First(i); !Done(i); Next(i)) { cbnew->Append(GetComp(i)); } return cbnew; }
boolean Clipboard::Includes (GraphicComp* gc) { Iterator i; for (First(i); !Done(i); Next(i)) { if (GetComp(i) == gc) { return true; } } return false; }
void QFitRangeWidget::GetRangeData() { if (fbFillWidget || (GetComp()==0)) return; int num = GetNumRange(); if(num<0) return; Int_t typ = RangeTypCmb->currentIndex(); Int_t naxis = AxisNumSpin->value(); Double_t left=0., right=0.; bool isok1 = true, isok2 = true; if (typ!=3) left = LeftEdt->text().toDouble(&isok1); if (typ!=2) right = RightEdt->text().toDouble(&isok2); if (isok1 && isok2) { GetComp()->SetRangeCondition(num,typ,naxis,left,right); SetWidgetItemText(true); } }
/** * Add a list of component items to the BOM manager * Creates consolidated groups of components as required */ void BOM_TABLE_MODEL::SetComponents( SCH_REFERENCE_LIST aRefs, const TEMPLATE_FIELDNAMES& aTemplateFields ) { // Add default columns AddDefaultColumns(); // Extract all component fields for( unsigned int ii=0; ii<aRefs.GetCount(); ii++ ) { auto ref = aRefs.GetItem( ii ); auto cmp = ref.GetComp(); if( cmp ) { AddComponentFields( cmp ); } } // Add template fields if they are not already added for( auto field : aTemplateFields ) { BOM_COLUMN* col; col = ColumnList.GetColumnByTitle( field.m_Name ); if( !col ) { col = new BOM_COLUMN( ColumnList.NextFieldId(), BOM_COL_TYPE_USER, field.m_Name, true, false ); ColumnList.AddColumn( col ); } // Add template value for that field m_fieldTemplates[col->Id()] = field.m_Value; } // Group multi-unit components together m_components.clear(); m_fieldValues.clear(); // Iterate through each unique component for( unsigned int ii=0; ii<aRefs.GetCount(); ii++ ) { auto ref = aRefs.GetItem( ii ); bool found = false; for( auto& cmp : m_components ) { if( cmp->AddUnit( ref ) ) { found = true; break; } } if( !found ) { // Find the field:value map associated with this component wxString refDes = ref.GetComp()->GetField( REFERENCE )->GetText(); bool dataFound = false; BOM_FIELD_VALUES* values; for( auto& data : m_fieldValues ) { // Look for a match based on RefDes if( data->GetReference().Cmp( refDes ) == 0 ) { dataFound = true; values = &*data; } } if( !dataFound ) { values = new BOM_FIELD_VALUES( refDes, &m_fieldTemplates ); m_fieldValues.push_back( std::unique_ptr<BOM_FIELD_VALUES>( values ) ); } auto* newComponent = new BOM_TABLE_COMPONENT( nullptr, &ColumnList, values ); newComponent->AddUnit( ref ); m_components.push_back( std::unique_ptr<BOM_TABLE_COMPONENT>( newComponent ) ); } } SetBackupPoint(); }