Пример #1
0
        public override void LoadAll(IO.ComponentData Compound)
        {
            base.LoadAll(Compound);

            for (int i = 0; i < Joints.Length; i++)
            {
                j[i] = Compound.GetInt("J" + i.ToString());
            }

            for (int i = 0; i < Wires.Length; i++)
            {
                w[i] = Compound.GetInt("W" + i.ToString());
            }

            connectedLeft  = Compound.GetBool("Left");
            connectedUp    = Compound.GetBool("Up");
            connectedRight = Compound.GetBool("Right");
            connectedDown  = Compound.GetBool("Down");

            leftUp    = Compound.GetBool("LeftUp");
            leftRight = Compound.GetBool("LeftRight");
            leftDown  = Compound.GetBool("LeftDown");
            upRight   = Compound.GetBool("UpRight");
            upDown    = Compound.GetBool("UpDown");
            rightDown = Compound.GetBool("RightDown");

            left  = (PortState)Compound.GetInt("PortLeft");
            up    = (PortState)Compound.GetInt("PortUp");
            right = (PortState)Compound.GetInt("PortRight");
            down  = (PortState)Compound.GetInt("PortDown");
        }
Пример #2
0
 /// <summary>
 /// Called when a scheme is being loaded
 /// </summary>
 /// <param name="Compound">Use this to read data</param>
 public virtual void LoadAll(IO.ComponentData Compound)
 {
     ID = Compound.GetInt("ID");
     Graphics.Position = Compound.GetVector2("Position");
     Graphics.Size     = Compound.GetVector2("Size");
     Graphics.Visible  = Compound.GetBool("Visible");
     rotation          = (Rotation)Compound.GetInt("Rotation");
     isRemovable       = Compound.GetBool("Removable");
 }
Пример #3
0
        private String connectedWiresData;//, containingComponentsData;
        public override void LoadAll(IO.ComponentData Compound)
        {
            base.LoadAll(Compound);

            connectedWiresData = Compound.GetString("ConnectedWires");
            //containingComponentsData = Compound.GetString("ContainingComponents");

            CanBeGround      = Compound.GetBool("CanGround");
            CanProvidePower  = Compound.GetBool("CanPower");
            isGround         = Compound.GetBool("IsGround");
            isProvidingPower = Compound.GetBool("IsPower");

            SendingVoltage = Compound.GetDouble("SendingVoltage");
            SendingCurrent = Compound.GetDouble("SendingCurrent");
        }
Пример #4
0
        public override void LoadAll(IO.ComponentData Compound)
        {
            base.LoadAll(Compound);

            j0 = Compound.GetInt("J0");
            j1 = Compound.GetInt("J1");
            w  = Compound.GetInt("W");
            (Logics as Logics.PulseFormerLogics).cycle = Compound.GetBool("Cycle");
            double td = Compound.GetDouble("MaxRes");

            if (Double.IsNaN(td))
            {
                td = MaxResistance;
            }
            MaxResistance = (float)td;

            String s = Compound.GetString("Pulses");
            var    a = s.Split(';');

            float[] t = new float[a.Length];
            for (int i = 0; i < a.Length; i++)
            {
                try
                {
                    t[i] = (float)Convert.ToDouble(a[i]);
                }
                catch
                {
                    t[i] = 0;
                }
            }
            (Logics as Logics.PulseFormerLogics).pulses = t;
        }
Пример #5
0
        public override void LoadAll(IO.ComponentData Compound)
        {
            base.LoadAll(Compound);

            for (int i = 0; i < Joints.Length; i++)
            {
                j[i] = Compound.GetInt("J" + i.ToString());
            }

            for (int i = 0; i < Wires.Length; i++)
            {
                w[i] = Compound.GetInt("W" + i.ToString());
            }

            sw          = Compound.GetBool("Swapped");
            OrigSwapped = Compound.GetBool("OrigSwapped");
        }
Пример #6
0
        public override void LoadAll(IO.ComponentData Compound)
        {
            base.LoadAll(Compound);

            if (ID == 45)
            {
            }

            j1 = Compound.GetInt("J1");
            j2 = Compound.GetInt("J2");

            Resistance  = Compound.GetDouble("Resistance");
            IsConnected = Compound.GetBool("IsConnected");
            direction   = (WireDirection)Compound.GetInt("Direction");

            if (Compound.Contains("SendingVoltage"))
            {
                sendingVoltage          = Compound.GetDouble("SendingVoltage");
                sendingCurrent          = Compound.GetDouble("SendingCurrent");
                CanSendVoltageOrCurrent = Compound.GetBool("CanSendVoltage");
            }

            dp = Compound.GetString("DrawPath");
        }