예제 #1
0
        public void InsertVariation(PhysicalAndPanelPoint selectedPoint, CriticalityVariation variationToInsert)
        {
            int selectedPointIndex = points.IndexOf(selectedPoint);

            this.Insert(selectedPointIndex, variationToInsert);
            this.CalculateCharacteristicValues();
            this.CalculatePoints();
        }
예제 #2
0
        public void AddVariationToolStripMenu_Click(object sender, EventArgs e)
        {
            VariationToInsert = null;
            AddVariationForm subForm = new AddVariationForm(this);

            subForm.ShowDialog();
            if (VariationToInsert != null)
            {
                criticalityVariationsPoints.InsertVariation(selectedPoint, VariationToInsert);
                this.Refresh();
                CriticalityVariationsEventArgs cve =
                    new CriticalityVariationsEventArgs((CriticalityVariations)(criticalityVariationsPoints));
                OnCriticalityChange(this, cve);
            }
        }
예제 #3
0
        public void updateVariations(PhysicalAndPanelPoint selectedPoint)
        {
            int selectedPointIndex = points.IndexOf(selectedPoint);

            if (selectedPointIndex >= 0)
            {
                if (selectedPointIndex == 0)
                {
                    this.CalculateCharacteristicValues(CharacteristicValues.initial - offset.Y / heigthScale);
                }
                else  //selectedPointIndex > 0
                {
                    CriticalityVariation selectedCv = this[selectedPointIndex - 1];
                    selectedCv.length    += offset.X / widthScale;
                    selectedCv.variation -= offset.Y / heigthScale;
                    this.CalculateCharacteristicValues();
                }
                this.CalculatePoints();
            }
        }