コード例 #1
0
 public TextInputWithKeyListener(T subject, IVS <string, T> fnGetStringCurrently, IVS <string, T> displayString,
                                 IVS <IToolTip, T> toolTip, Action <T, string> actionToDo, IEnumerable <Action <ITimeStep> > events, Func <T, string, string> effectOfAction,
                                 Func <string, string> stringCleaner, Func <T, string, string> stringChecker, params string[] keys) :
     base(subject, fnGetStringCurrently, displayString, toolTip, actionToDo, effectOfAction, stringCleaner, stringChecker, keys)
 {
     this.events = events;
 }
コード例 #2
0
ファイル: Squirtle.cs プロジェクト: ThomasFranque/WooP
        public Squirtle(string name) : base(name)
        {
            EntityTypes =
                new EntityTypes(Typings.Water, Typings.None);

            IVs = new IVS(1);
        }
コード例 #3
0
ファイル: IVSsettings.cs プロジェクト: 542072859/df_envimet
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            bool _IVSon     = true;
            bool _IVSmemory = true;

            DA.GetData(0, ref _IVSon);
            DA.GetData(1, ref _IVSmemory);

            Active ivsOn  = (_IVSon) ? Active.YES : Active.NO;
            Active ivsMem = (_IVSmemory) ? Active.YES : Active.NO;

            IVS ivs = new IVS(ivsOn, ivsMem);

            DA.SetData(0, ivs);
        }
コード例 #4
0
 public static TextInputWithKeyListener <T> Quick(T subject, IVS <string, T> getString, string label, ToolTip tip,
                                                  Action <T, string> changeAction, params Action <ITimeStep>[] events)
 {
     return(new(subject, getString, M.m <T>(label), M.m <T>(tip), changeAction, events, null, s => s, (x, s) => null));
 }
コード例 #5
0
 public CodeDisplayArea(T subject, IVS <string, T> fnGetStringCurrently, IVS <string, T> fnGetLineNumberCurrently, IVS <string, T> displayString, IVS <IToolTip, T> toolTip,
                        params string[] keys) : base(subject, displayString, toolTip, keys)
 {
     _fnGetStringCurrently     = fnGetStringCurrently;
     _fnGetLineNumberCurrently = fnGetLineNumberCurrently;
 }
コード例 #6
0
ファイル: Config.cs プロジェクト: 542072859/df_envimet
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            MainSettings         _mainSettings  = null;
            List <Configuration> otherSettings_ = new List <Configuration> ();
            bool _runIt = false;

            DA.GetData(0, ref _mainSettings);
            DA.GetDataList(1, otherSettings_);
            DA.GetData(2, ref _runIt);

            SimpleForcingSettings simpleForcingSettings = null;
            TThread          tThread          = null;
            TimeSteps        timeSteps        = null;
            ModelTiming      modelTiming      = null;
            SoilConfig       soilConfig       = null;
            Sources          sources          = null;
            Turbulence       turbulence       = null;
            OutputSettings   outputSettings   = null;
            Cloud            cloud            = null;
            Background       background       = null;
            SolarAdjust      solarAdjust      = null;
            BuildingSettings buildingSettings = null;
            IVS          ivs          = null;
            ParallelCPU  parallelCPU  = null;
            SOR          sor          = null;
            InflowAvg    inflowAvg    = null;
            Facades      facades      = null;
            PlantSetting plantSetting = null;
            LBC          lbc          = null;
            FullForcing  fullForcing  = null;

            if (_runIt)
            {
                try
                {
                    foreach (Configuration o in otherSettings_)
                    {
                        Type obj = o.GetType();

                        if (obj == typeof(SimpleForcingSettings))
                        {
                            simpleForcingSettings = o as SimpleForcingSettings;
                        }
                        else if (obj == typeof(TThread))
                        {
                            tThread = o as TThread;
                        }
                        else if (obj == typeof(TimeSteps))
                        {
                            timeSteps = o as TimeSteps;
                        }
                        else if (obj == typeof(ModelTiming))
                        {
                            modelTiming = o as ModelTiming;
                        }
                        else if (obj == typeof(SoilConfig))
                        {
                            soilConfig = o as SoilConfig;
                        }
                        else if (obj == typeof(Sources))
                        {
                            sources = o as Sources;
                        }
                        else if (obj == typeof(Turbulence))
                        {
                            turbulence = o as Turbulence;
                        }
                        else if (obj == typeof(OutputSettings))
                        {
                            outputSettings = o as OutputSettings;
                        }
                        else if (obj == typeof(Cloud))
                        {
                            cloud = o as Cloud;
                        }
                        else if (obj == typeof(Background))
                        {
                            background = o as Background;
                        }
                        else if (obj == typeof(SolarAdjust))
                        {
                            solarAdjust = o as SolarAdjust;
                        }
                        else if (obj == typeof(BuildingSettings))
                        {
                            buildingSettings = o as BuildingSettings;
                        }
                        else if (obj == typeof(IVS))
                        {
                            ivs = o as IVS;
                        }
                        else if (obj == typeof(ParallelCPU))
                        {
                            parallelCPU = o as ParallelCPU;
                        }
                        else if (obj == typeof(SOR))
                        {
                            sor = o as SOR;
                        }
                        else if (obj == typeof(InflowAvg))
                        {
                            inflowAvg = o as InflowAvg;
                        }
                        else if (obj == typeof(Facades))
                        {
                            facades = o as Facades;
                        }
                        else if (obj == typeof(PlantSetting))
                        {
                            plantSetting = o as PlantSetting;
                        }
                        else if (obj == typeof(LBC))
                        {
                            lbc = o as LBC;
                        }
                        else if (obj == typeof(FullForcing))
                        {
                            fullForcing = o as FullForcing;
                        }
                    }


                    Simx simx = new Simx(_mainSettings)
                    {
                        SimpleForcing    = simpleForcingSettings,
                        TThread          = tThread,
                        TimeSteps        = timeSteps,
                        ModelTiming      = modelTiming,
                        SoilSettings     = soilConfig,
                        Sources          = sources,
                        Turbulence       = turbulence,
                        OutputSettings   = outputSettings,
                        Cloud            = cloud,
                        Background       = background,
                        SolarAdjust      = solarAdjust,
                        BuildingSettings = buildingSettings,
                        IVS          = ivs,
                        ParallelCPU  = parallelCPU,
                        SOR          = sor,
                        InflowAvg    = inflowAvg,
                        Facades      = facades,
                        PlantSetting = plantSetting,
                        LBC          = lbc,
                        FullForcing  = fullForcing
                    };

                    simx.WriteSimx();
                    DA.SetData(0, Path.Combine(Path.GetDirectoryName(_mainSettings.Inx), _mainSettings.Name + ".simx"));
                }
                catch
                {
                    this.AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, "Please provide a valid mainSettings.");
                }
            }
        }
コード例 #7
0
        private void Test_Task_1()
        {
            var resistor_1 = new Resistor()
            {
                TESTSTRING = "R1", R = 25
            };
            var resistor_2 = new Resistor()
            {
                TESTSTRING = "R2", R = 22
            };
            var resistor_3 = new Resistor()
            {
                TESTSTRING = "R3", R = 42
            };
            var resistor_4 = new Resistor()
            {
                TESTSTRING = "R4", R = 35
            };
            var resistor_5 = new Resistor()
            {
                TESTSTRING = "R5", R = 51
            };
            var resistor_6 = new Resistor()
            {
                TESTSTRING = "R6", R = 10
            };
            var resistor_7 = new Resistor()
            {
                TESTSTRING = "R7", R = 47
            };
            var ivs_1 = new IVS()
            {
                Voltage = 50
            };
            var ivs_2 = new IVS()
            {
                Voltage = 100
            };
            var node_1 = new Node()
            {
                Node_name = "Node_1"
            };
            var node_2 = new Node()
            {
                Node_name = "Node_2"
            };
            var node_3 = new Node()
            {
                Node_name = "Node_3"
            };
            var node_4 = new Node()
            {
                Node_name = "Node_4"
            };

            ivs_1[1].ConnectToPin(resistor_1[0]);
            node_1.Connect(ivs_1[0]);
            node_1.Connect(resistor_6[0]);
            node_1.Connect(resistor_7[0]);

            node_2.Connect(resistor_1[1]);
            node_2.Connect(resistor_6[1]);
            node_2.Connect(resistor_3[1]);
            node_2.Connect(resistor_4[0]);

            node_3.Connect(resistor_4[1]);
            node_3.Connect(resistor_5[1]);
            node_3.Connect(resistor_2[1]);

            ivs_2[1].ConnectToPin(resistor_2[0]);
            node_4.Connect(ivs_2[0]);
            node_4.Connect(resistor_7[1]);
            node_4.Connect(resistor_3[0]);
            node_4.Connect(resistor_5[0]);

            var nodes    = new List <Node>();
            var branches = new List <Branch>();

            FindBranchesAndNodes(node_1, nodes, branches);

            var fi = FindNodesPotential(nodes, branches);

            CalculateAmperage(nodes, branches, fi);
        }