Exemple #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());
            }
            w1 = Compound.GetInt("W1");
            w2 = Compound.GetInt("W2");
            w3 = Compound.GetInt("W3");
            w4 = Compound.GetInt("W4");

            var l = Logics as Logics.TeslaCoilLogics;

            l.Range            = (float)Compound.GetDouble("Range");
            l.Capacitance      = (float)Compound.GetDouble("Capacitance");
            l.DischargeVoltage = (float)Compound.GetDouble("DischargeVoltage");
            l.CurCharge        = (float)Compound.GetDouble("Charge");

            if (l.CurCharge < 0)
            {
                l.CurCharge = 0;
            }
        }
Exemple #2
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.PowerACLogics).voltage = Compound.GetDouble("Voltage");
            (Logics as Logics.PowerACLogics).period  = (float)Compound.GetDouble("Period");
        }
Exemple #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");
        }
Exemple #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;
        }
Exemple #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());
            }
            var d = Compound.GetDouble("Current");

            if (!Double.IsNaN(d))
            {
                MaxCurrent     = d;
                MaxVoltage     = Compound.GetDouble("Potential");
                MaxMagnetForce = (float)Compound.GetDouble("Force");
            }
        }
Exemple #6
0
        public override void LoadAll(IO.ComponentData Compound)
        {
            base.LoadAll(Compound);

            j0            = Compound.GetInt("J0");
            j1            = Compound.GetInt("J1");
            w             = Compound.GetInt("W");
            MaxResistance = Compound.GetDouble("MaxRes");
        }
Exemple #7
0
        public override void LoadAll(IO.ComponentData Compound)
        {
            base.LoadAll(Compound);

            j0 = Compound.GetInt("J0");
            j1 = Compound.GetInt("J1");
            j2 = Compound.GetInt("J2");
            j3 = Compound.GetInt("J3");
            w1 = Compound.GetInt("W1");
            w2 = Compound.GetInt("W2");
            w3 = Compound.GetInt("W3");

            if (Compound.Contains("Capacitance"))
            {
                (Logics as Logics.CapacitorLogics).Capacitance = Compound.GetDouble("Capacitance");

                (Logics as Logics.CapacitorLogics).MaxOutputVoltage = Compound.GetDouble("MaxVoltage");
            }
        }
Exemple #8
0
        public override void LoadAll(IO.ComponentData Compound)
        {
            base.LoadAll(Compound);

            j0 = Compound.GetInt("J0");
            j1 = Compound.GetInt("J1");
            w  = Compound.GetInt("W");

            res = (float)Compound.GetDouble("Resistance");
        }
Exemple #9
0
        public override void LoadAll(IO.ComponentData Compound)
        {
            base.LoadAll(Compound);

            fieldRadius = (float)Compound.GetDouble("Field");
            pole        = (MagnetPole)Compound.GetInt("Pole");

            con = Compound.GetInt("Connector");
            com = Compound.GetInt("ConComp");
        }
Exemple #10
0
        public override void LoadAll(IO.ComponentData Compound)
        {
            base.LoadAll(Compound);

            j0 = Compound.GetInt("J0");
            j1 = Compound.GetInt("J1");
            w  = Compound.GetInt("W");
            var a = Compound.GetDouble("Field");

            if (!Double.IsNaN(a))
            {
                fieldRadius = (float)a;
            }
        }
Exemple #11
0
        public override void LoadAll(IO.ComponentData Compound)
        {
            base.LoadAll(Compound);

            j0 = Compound.GetInt("J0");
            j1 = Compound.GetInt("J1");
            w  = Compound.GetInt("W");
            var a = Compound.GetDouble("Luminosity");

            if (!Double.IsNaN(a))
            {
                Luminosity = (float)a;
            }
        }
Exemple #12
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");
        }
Exemple #13
0
        public override void LoadAll(IO.ComponentData Compound)
        {
            base.LoadAll(Compound);

            j0 = Compound.GetInt("J0");
            j1 = Compound.GetInt("J1");
            w  = Compound.GetInt("W");
            String s = Compound.GetString("Target");

            (Logics as Logics.CoreLogics).Load(s);
            double acc = Compound.GetDouble("Accuracy");

            if (!Double.IsNaN(acc))
            {
                (Logics as Logics.CoreLogics).RequiredAccuracy = (float)acc;
            }
        }
        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());
            }

            left  = (PortState)Compound.GetInt("Left");
            up    = (PortState)Compound.GetInt("Up");
            right = (PortState)Compound.GetInt("Right");
            down  = (PortState)Compound.GetInt("Down");

            Range = (float)Compound.GetDouble("Range");
        }