コード例 #1
0
ファイル: GEMSMaterial.cs プロジェクト: xj361685640/opengems
        public override object EditValue(ITypeDescriptorContext context, System.IServiceProvider provider, object value)
        {
            if (context == null || provider == null || context.Instance == null)
            {
                return(base.EditValue(provider, value));
            }

            GEMSSingle currentSingle = context.Instance as GEMSSingle;

            if (currentSingle != null)
            {
                MaterialListForm from = new MaterialListForm(currentSingle);

                if (from.ShowDialog( ) == System.Windows.Forms.DialogResult.OK)
                {
                    value = currentSingle.SingleMaterial;

                    if (currentSingle.CurrentEO != null)
                    {
                        currentSingle.CurrentEO = null;
                        currentSingle.SingleDataChangedAlarm(GEMSSingle.SingleDataChangedEventArgs.DataChangeType.EOChanged);
                    }
                }
                from.Dispose( );
            }

            return(value);
        }
コード例 #2
0
ファイル: CurrentOutput.cs プロジェクト: xj361685640/opengems
        public override SingleEO Clone(GEMSSingle parentSingle)
        {
            CurrentOutput co = new CurrentOutput(parentSingle);

            co.Positive = this.Positive;

            return(co);
        }
コード例 #3
0
 public VoltageExcitation(XPathNavigator navigator, GEMSSingle single)
     : base(navigator, single)
 {
     //Excitation Value information
     navigator.MoveToChild("Voltage", string.Empty);
     excitationVoltage = new Voltage(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
     navigator.MoveToParent();
 }
コード例 #4
0
        public override SingleEO Clone(GEMSSingle parentSingle)
        {
            VoltageOutput vo = new VoltageOutput(parentSingle);

            vo.Positive = this.Positive;

            return(vo);
        }
コード例 #5
0
ファイル: PointOutput.cs プロジェクト: xj361685640/opengems
        public PointOutput(XPathNavigator navigator, GEMSSingle single)
            : base(single)
        {
            //Basic information
            navigator.MoveToChild("TimeDomain", String.Empty);
            uint fieldEnableFlag = uint.Parse(navigator.GetAttribute("tdEnabled", string.Empty));

            RetrieveEachDirectionFieldEnableFlag(fieldEnableFlag);
        }
コード例 #6
0
        public override SingleEO Clone(GEMSSingle parentSingle)
        {
            VoltageExcitation ve = new VoltageExcitation(parentSingle);

            ve.TimeDelay         = new Time(this.TimeDelay.Value, this.TimeDelay.Unit);
            ve.Positive          = this.Positive;
            ve.PhaseFrequency    = new Frequency(this.PhaseFrequency.Value, this.PhaseFrequency.Unit);
            ve.PhaseDelay        = this.PhaseDelay;
            ve.ExcitationVoltage = new Voltage(this.ExcitationVoltage.Value, this.ExcitationVoltage.Unit);

            return(ve);
        }
コード例 #7
0
        public override SingleEO Clone(GEMSSingle parentSingle)
        {
            CurrentExcitation ce = new CurrentExcitation(parentSingle);

            ce.TimeDelay         = new Time(this.TimeDelay.Value, this.TimeDelay.Unit);
            ce.Positive          = this.Positive;
            ce.PhaseFrequency    = new Frequency(this.PhaseFrequency.Value, this.PhaseFrequency.Unit);
            ce.PhaseDelay        = this.PhaseDelay;
            ce.ExcitationCurrent = new Current(this.ExcitationCurrent.Value, this.ExcitationCurrent.Unit);

            return(ce);
        }
コード例 #8
0
        public override void PaintValue(PaintValueEventArgs e)
        {
            GEMSSingle single = e.Context.Instance as GEMSSingle;

            if (single != null)
            {
                SolidBrush brush = new SolidBrush(single.SingleColor);

                e.Graphics.FillRectangle(brush, e.Bounds);

                brush.Dispose( );
            }
            else
            {
                base.PaintValue(e);
            }
        }
コード例 #9
0
        public static SingleEO Load(XPathNavigator navigator, GEMSSingle parent)
        {
            SingleEO singleEO = null;

            switch (parent.CreateOperation.Name)
            {
            case GeometryOperation.GeometryOperationType.CreateLine:          //Voltage Excitation or Output
                if (navigator.MoveToChild("VoltageExcitation", string.Empty))
                {
                    singleEO = new VoltageExcitation(navigator, parent);
                }
                else if (navigator.MoveToChild("VoltageOutput", string.Empty))
                {
                    singleEO = new VoltageOutput(navigator, parent);
                }

                break;

            case GeometryOperation.GeometryOperationType.CreatePoint:         //FieldPointOutPut
                if (navigator.MoveToChild("FieldOnPointOutput", string.Empty))
                {
                    //((Point)operations[0]).BFieldOutput = true;
                    singleEO = new PointOutput(navigator, parent);
                }
                break;

            case GeometryOperation.GeometryOperationType.CreateRectangle:  //Current Excitation or Output
            case GeometryOperation.GeometryOperationType.CreateRound:      //Current Excitation or Output
                if (navigator.MoveToChild("CurrentExcitation", string.Empty))
                {
                    singleEO = new CurrentExcitation(navigator, parent);
                }
                else if (navigator.MoveToChild("CurrentOutput", string.Empty))
                {
                    singleEO = new CurrentOutput(navigator, parent);
                }
                break;

            default:
                break;
            }

            return(singleEO);
        }
コード例 #10
0
        /// <summary>
        /// Create an single object with same information of original single
        /// </summary>
        public GEMSSingle Clone(int newId)
        {
            //Create a new single with information copyed from the specified single
            GEMSSingle newSingle = new GEMSSingle(newId, this.parent);

            //Basic information
            newSingle.name        = this.Name + "_" + newId.ToString( );
            newSingle.pec         = this.PEC;
            newSingle.singleColor = this.BaseSingleColor;

            //Material
            newSingle.material = this.material;

            //Excitation or Output
            if (currentEO != null)
            {
                newSingle.currentEO = this.currentEO.Clone(newSingle);
            }

            //Operation
            newSingle.operations = new List <GeometryOperation> ( );

            //Copy each operation mementoes
            foreach (GeometryOperation operation in this.operations)
            {
                GeometryOperation newOperation = operation.Clone(parent.CreateNewOperationId( ), newSingle);
                newSingle.operations.Add(newOperation);

                if (newOperation is GeometryCreateOperation)
                {
                    newSingle.createOperation = newOperation as GeometryCreateOperation;
                }

                //Add the operation to the list of GEMS Project
                Parent.AddOperation(newOperation);
            }

            //Create the model for new single
            newSingle.UpdatePrimaryModel( );
            newSingle.UpdateSingleEOSymbolModel( );

            return(newSingle);
        }
コード例 #11
0
        public override object EditValue(ITypeDescriptorContext context, System.IServiceProvider provider, object value)
        {
            if (context == null || provider == null || context.Instance == null)
            {
                return(base.EditValue(provider, value));
            }

            GEMSSingle single = context.Instance as GEMSSingle;

            if (single != null)
            {
                TransparentSettingForm form = new TransparentSettingForm(single.SingleColor);

                if (form.ShowDialog( ) == System.Windows.Forms.DialogResult.OK)
                {
                    value = form.Transparency;
                }
                form.Dispose( );
            }
            return(value);
        }
コード例 #12
0
        public SingleExcitation(XPathNavigator navigator, GEMSSingle single)
            : base(single)
        {
            //Basic information
            positive = int.Parse(navigator.GetAttribute("positive", string.Empty));

            //TimeDelay information
            navigator.MoveToChild("TimeDelay", string.Empty);
            timeDelay = new Time(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            navigator.MoveToParent();

            //PhaseDelay information
            navigator.MoveToChild("PhaseDelay", string.Empty);
            phaseDelay = float.Parse(navigator.GetAttribute("value", string.Empty));

            //Frequency information
            navigator.MoveToFirstChild();
            phaseFrequency = new Frequency(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            navigator.MoveToParent();
            navigator.MoveToParent();
        }
コード例 #13
0
ファイル: SingleOutput.cs プロジェクト: xj361685640/opengems
 public SingleOutput(XPathNavigator navigator, GEMSSingle single)
     : base(single)
 {
 }
コード例 #14
0
 public VoltageOutput(XPathNavigator navigator, GEMSSingle single)
     : base(single)
 {
     //Basic information
     positive = int.Parse(navigator.GetAttribute("positive", string.Empty));
 }
コード例 #15
0
 public VoltageOutput(GEMSSingle single)
     : base(single)
 {
 }
コード例 #16
0
 public CurrentExcitation(GEMSSingle single)
     : base(single)
 {
 }
コード例 #17
0
ファイル: PointOutput.cs プロジェクト: xj361685640/opengems
        public override SingleEO Clone(GEMSSingle parentSingle)
        {
            PointOutput po = new PointOutput(parentSingle);

            return(po);
        }
コード例 #18
0
 public SingleEO(GEMSSingle single)
 {
     this.parent = single;
 }
コード例 #19
0
ファイル: PointOutput.cs プロジェクト: xj361685640/opengems
 public PointOutput(GEMSSingle single)
     : base(single)
 {
 }
コード例 #20
0
 public VoltageExcitation(GEMSSingle single)
     : base(single)
 {
 }
コード例 #21
0
 public abstract SingleEO Clone(GEMSSingle parentSignal);
コード例 #22
0
ファイル: CurrentOutput.cs プロジェクト: xj361685640/opengems
 public CurrentOutput(GEMSSingle single)
     : base(single)
 {
 }
コード例 #23
0
 public SingleExcitation(GEMSSingle signal)
     : base(signal)
 {
 }
コード例 #24
0
ファイル: SingleOutput.cs プロジェクト: xj361685640/opengems
 public SingleOutput(GEMSSingle single)
     : base(single)
 {
 }