public TimeValues(MyBrewery myBrewRecipe, float initialTemperature)
 {
     this.downTime          = 10F;
     this.Start             = 0F;
     this.MyBrewRecipe      = myBrewRecipe;
     HeatingCharacteristics = new Heating(myBrewRecipe, initialTemperature);
 }
        public IActionResult DeleteConfirm(Heating heating)
        {
            var heatingDelete = _heatingService.Delete(heating);

            TempData["DangerMessage"] = heatingDelete.Message;
            return(RedirectToAction("Index", "Heating"));
        }
        /// <summary>
        /// Initializes the ModuleClient and sets up the callback to receive
        /// messages containing temperature information
        /// </summary>
        static async Task Init()
        {
            MqttTransportSettings mqttSetting = new MqttTransportSettings(TransportType.Mqtt_Tcp_Only);

            ITransportSettings[] settings = { mqttSetting };

            // Open a connection to the Edge runtime
            IoTHubModuleClient = await ModuleClient.CreateFromEnvironmentAsync(settings);

            await IoTHubModuleClient.OpenAsync();

            Console.WriteLine("IoT Hub module client initialized.");

            // Register callback to be called when a message is received by the module
            //await ioTHubModuleClient.SetInputMessageHandlerAsync("input1", PipeMessage, ioTHubModuleClient);

            //initialize Raspberry
            _raspberryPins = new Pins();
            _raspberryPins.ConnectGpio();
            _raspberryPins.LoopGpioPins();

            _paradox1738 = new Paradox1738();
            _paradox1738.ParadoxSecurity();
            _paradox1738.IRSensorsReading();

            //Receive Netatmo data
            _receiveNetatmoData = new ReceiveNetatmoData();
            _receiveNetatmoData.ReceiveData();

            //read from ome temperature sensors
            _homeTemperature = new HomeTemperature();
            _homeTemperature.ReadTemperature();

            //Starting schedulers
            _co2Scheduler = new Co2();
            _co2Scheduler.CheckCo2Async();

            _saunaHeating = new SaunaHeating();
            _saunaHeating.CheckHeatingTime();

            _heatingScheduler = new Heating();
            _heatingScheduler.ReduceHeatingSchedulerAsync();

            //Receive IoTHub commands
            _receiveData = new ReceiveData();
            _receiveData.ReceiveCommandsAsync();

            //query WiFiProbes
            _wiFiProbes = new WiFiProbes();
            _wiFiProbes.QueryWiFiProbes();

            //shelly's
            TelemetryDataClass.isOutsideLightsOn = await Shelly.GetShellyState(Shelly.OutsideLight);

            SomeoneAtHome.CheckLightStatuses();

            //Send data to IoTHub
            _sendData = new SendTelemetryData();
            _sendData.SendTelemetryEventsAsync();
        }
        public IActionResult Create(Heating heating)
        {
            var heatingResult = _heatingService.Add(heating);

            TempData["SuccessMessage"] = heatingResult.Message;
            return(RedirectToAction("Index", "Admin"));
        }
    protected override void Start()
    {
        base.Start();

        currentImpactCollider = null;
        currentHitPoint       = Vector3.zero;
        heatScript            = GetComponent <Heating>();
    }
Exemple #6
0
    public static float FindClosestHeatFactor(Heating heatScript, Vector3 worldCheckLocation)
    {
        if (heatScript != null)
        {
            return(heatScript.ClosestHeatAtPointNormalized(worldCheckLocation));
        }

        return(1.0f);
    }
 public async Task <object> GetHeatingData()
 {
     try
     {
         return(new { data = await Heating.GetData() });
     }
     catch (Exception e)
     {
         return(new { error = e.Message });
     }
 }
Exemple #8
0
    // Use this for initialization
    public void Initialize()
    {
        if (!target)
        {
            target = transform.parent.parent.gameObject;
        }

        heatScript = target.GetComponent <Heating>();

        ProjectTarget();

        heatFactor = DeformableBase.FindClosestHeatFactor(heatScript, target.transform.InverseTransformPoint(transform.position));

        ts_transform       = new ts_Transform(transform);
        ts_targetTransform = new ts_Transform(target.transform);
    }
Exemple #9
0
    public void EnableCut(Transform cuttingSrc, Collider cuttingSrcCollider)
    {
        canCut            = true;
        cuttingSrcExtents = cuttingSrcCollider.bounds.extents.magnitude;
        this.cuttingSrc   = cuttingSrc.GetComponent <CuttingTool>();
        hits = 0;

        Heating heatScript = GetComponent <Heating>();

        hitsToCut = (heatScript != null ? (int)(19.0f * (1.0f - DeformableBase.FindClosestHeatFactor(heatScript, cuttingSrc.position))) + 1 : defaultHitsToCut);

        if (deformableMesh)
        {
            deformableMesh.enabled = false;
        }
    }
        public IActionResult Edit(Heating heating)
        {
            if (ModelState.IsValid)
            {
                var heatingUpdated = new Heating
                {
                    Id   = heating.Id,
                    Name = heating.Name
                };
                var heatingUpdate = _heatingService.Update(heatingUpdated);
                TempData["WarningMessage"] = heatingUpdate.Message;
                return(RedirectToAction("Index", "Heating"));
            }

            return(View(heating));
        }
        public static List <Heating> GetHeatingListFromListItems
            (List <SelectListItem> heatingList)
        {
            var heatingModelList = new List <Heating>();

            foreach (var item in heatingList)
            {
                if (item.Selected)
                {
                    var heating = new Heating
                    {
                        ID          = Convert.ToInt32(item.Value),
                        HeatingType = item.Text
                    };
                    heatingModelList.Add(heating);
                }
            }

            return(heatingModelList);
        }
    public static void CreateDevices(Device[] devices)
    {
        for (int i = 0; i < 3; i++)
        {
            devices[i]      = new Window(new Blind(50));
            devices[i].Name = "Window " + (i + 1);
        }
        devices[3]      = new Door(true);
        devices[3].Name = "Door";

        devices[4]      = new GarageDoor(true, 0);
        devices[4].Name = "Garage door";

        devices[5]      = new Light(false);
        devices[5].Name = "Light";

        devices[6]      = new Heating(true, 20);
        devices[6].Name = "Heating 1";

        devices[7]      = new Heating(true, 20);
        devices[7].Name = "Heating 2";
    }
Exemple #13
0
        void setInitVars()
        {
            foreach (CelestialBody body in PlanetMap.Keys)
            {
                PlanetMap[body].SetBodyKSun((float)Heating.calculateBodyKSun(body.orbit.radius));

                for (int AltLayer = 0; AltLayer < PlanetMap[body].LiveMap.Count; AltLayer++)
                {
                    foreach (Cell cell in Cell.AtLevel(KWSSettings.gridLevel))
                    {
                        PlanetMap[body].SetInitTempOfCell(FlightGlobals.getExternalTemperature
                                                              (PlanetMap[body].LiveMap[AltLayer][cell].Altitude, body), AltLayer, cell);

                        PlanetMap[body].SetInitPressureOfCell((float)FlightGlobals.getStaticPressure
                                                                  (PlanetMap[body].LiveMap[AltLayer][cell].Altitude, body), AltLayer, cell);

                        PlanetMap[body].SetInitDensityOfCell((float)FlightGlobals.getAtmDensity
                                                                 (PlanetMap[body].LiveMap[AltLayer][cell].Pressure), AltLayer, cell);
                    }
                }
            }
        }
Exemple #14
0
        void WeatherDataUI(int windowID)
        {
            CelestialBody   body = FlightGlobals.currentMainBody;
            PlanetSimulator pSim = KWSKSPButtToucher.KSPHeadMaster.PlanetMap[body];
            Cell            cell = KSPWeatherFunctions.getCellAtLocation(body, FlightGlobals.ActiveVessel.GetWorldPos3D());

            GUILayout.BeginVertical();
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Body Up"))
            {
                if (i < KWSKSPButtToucher.KSPHeadMaster.PlanetMap.Keys.Count - 1)
                {
                    i++;
                }
            }
            ;
            if (GUILayout.Button("Body Down"))
            {
                if (i > 0)
                {
                    i--;
                }
            }
            ;
            GUILayout.EndHorizontal();

            CelestialBody testBody = KWSKSPButtToucher.KSPHeadMaster.PlanetMap.ElementAt(i).Key;

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Layer Up"))
            {
                if (AltLayer < KWSKSPButtToucher.KSPHeadMaster.PlanetMap[testBody].LiveMap.Count - 1)
                {
                    AltLayer++;
                }
            }
            if (GUILayout.Button("Layer Down"))
            {
                if (AltLayer > 0)
                {
                    AltLayer--;
                }
            }
            GUILayout.EndHorizontal();
            //Debug.Log("1");
            //GUILayout.Label("CellID: " + CellIDLabel); CellIDLabel = GUILayout.TextField(CellIDLabel, 10); CellIDInt = int.Parse(CellIDLabel);
            GUILayout.Label("Body: " + testBody.name);
            GUILayout.Label("Layer: " + AltLayer);
            GUILayout.Label("Current location: " + FlightGlobals.ActiveVessel.GetWorldPos3D().ToString());
            //GUILayout.Label("Temperature: " + WeatherFunctions.getCellTemperature(FlightGlobals.currentMainBody, WeatherFunctions.getCellAtLocation(FlightGlobals.currentMainBody, FlightGlobals.ActiveVessel.GetWorldPos3D())));
            GUILayout.Label("Temperature: " + ((KSPHeadMaster.PlanetMap[testBody].LiveMap[AltLayer][cell].Temperature - 273.15)).ToString("0.0000"));
            GUILayout.Label("Pressure: " + KSPHeadMaster.PlanetMap[testBody].LiveMap[AltLayer][cell].Pressure.ToString("0.000000000"));
            GUILayout.Label("Density: " + KSPHeadMaster.PlanetMap[testBody].LiveMap[AltLayer][cell].Density);
            //Debug.Log("2");
            GUILayout.Label("Cell Latitude: " + WeatherFunctions.getLatitude(cell));
            GUILayout.Label("Cell Longitude: " + WeatherFunctions.getLongitude(cell));
            GUILayout.Label("Cell Altitude: " + KSPHeadMaster.PlanetMap[testBody].LiveMap[AltLayer][cell].Altitude);
            GUILayout.Label("isOcean?: " + KSPWeatherFunctions.isOcean(testBody, cell));
            GUILayout.Label("Albedo: " + KSPHeadMaster.PlanetMap[testBody].LiveMap[AltLayer][cell].Albedo);
            GUILayout.Label("Daytime?: " + Heating.isSunlight(KSPHeadMaster.PlanetMap[testBody], AltLayer, cell) + " " + Heating.getSunlightAngle(KSPHeadMaster.PlanetMap[testBody], AltLayer, cell));
            GUILayout.Label("Shortwave Abs: " + KWSKSPButtToucher.KSPHeadMaster.PlanetMap[testBody].LiveMap[AltLayer][cell].SWAbsorbed);
            GUILayout.Label("Shortwave Out: " + KWSKSPButtToucher.KSPHeadMaster.PlanetMap[testBody].LiveMap[AltLayer][cell].SWTransmitted);
            GUILayout.Label("Longwave In: " + KWSKSPButtToucher.KSPHeadMaster.PlanetMap[testBody].LiveMap[AltLayer][cell].LWIn);
            //Debug.Log("3");
            //GUILayout.Label("Cell Pos: " + Cell.KWSBODY[FlightGlobals.currentMainBody][CellIDInt].CellPosition);

            GUILayout.EndVertical();

            GUI.DragWindow();
        }
        public DebugGUI(Heating heat)
        {
            GameObject sun = GameObject.Find("Sun");

            GUILayout.Label("Body KSun: " + Heating.calculateBodyKSun(sun.transform.position.magnitude));
        }
Exemple #16
0
 public void DesignHeating(Heating type)
 {
     BusinessClassBuilding.Heating = Heating.Autonomously;
 }
Exemple #17
0
 public void DesignHeating(Heating type)
 {
     EconomClassBuilding.Heating = Heating.Centralized;
 }
Exemple #18
0
 public IResult Add(Heating heating)
 {
     _heatingDal.Add(heating);
     return(new SuccessResult(Messages.HeatingAdded));
 }
Exemple #19
0
 public IResult Delete(Heating heating)
 {
     _heatingDal.Delete(heating);
     return(new SuccessResult(Messages.HeatingDeleted));
 }
Exemple #20
0
 public IResult Update(Heating heating)
 {
     _heatingDal.Update(heating);
     return(new SuccessResult(Messages.HeatingUpdated));
 }
Exemple #21
0
    public override void Execute()
    {
        //toggles the ability to accelerate, boost and rotate to false
        if (Control.GetCanAccel())
        {
            Control.ChangeCanAccel();
        }
        if (Control.GetCanBoost())
        {
            Control.ChangeCanBoost();
        }

        if (Control.GetCanRot())
        {
            Control.ChangeCanRot();
        }

        //moves the floor so the player is in the recovery lane
        floor.transform.position = Vector3.Lerp(floor.transform.position, newPos, lValues.GetSpeed() * Time.deltaTime);

        //if you are overheated
        if (Heating.GetIsOverheated())
        {
            //and the over heated timer is done
            if (lValues.GetTimePassed() > lValues.GetCrashTimer())
            {
                //set player to not overheating and change lanes to the top lane
                Heating.ChangeIsOverheated();
                machine.ChangeState <LaneFour>();
            }
        }
        //if you have crashed from a wheelie
        if (Crashing.GetIsCrashed())
        {
            //and the timer for crashing from a wheelie is done
            if (lValues.GetTimePassed() > lValues.GetCrashTimer())
            {
                //set player to not crashed from a wheelie and change lanes to the top lane
                Crashing.ChangeIsCrashed();

                machine.ChangeState <LaneFour>();
            }
        }
        //checked for if you crashed from landing on the right side of a ramp while rotated back
        //if (Crashing.GetIsBRotCrashed())
        //{
        //    if (lValues.GetTimePassed() > lValues.GetCrashTimer())
        //    {
        //        Crashing.ChangeIsBRotCrashed();

        //        machine.ChangeState<LaneFour>();
        //    }
        //}
        //checks if you crashed from landing on the track while rotated forward
        if (Crashing.GetIsFRotCrashed())
        {
            //if the timer for this type of crash is done
            if (lValues.GetTimePassed() > lValues.GetCrashTimer())
            {
                //set no longer crashed and change lanes
                Crashing.ChangeIsFRotCrashedFalse();

                machine.ChangeState <LaneFour>();
            }
        }
    }