Example #1
0
 //adds a unit to group[16] (broadcast/ single unit control group) and sets its forced lightlevel to the scene
 public void AddressGoToScene(LightingUnit Unit, double scene)
 {
     Unit.ForcedLightlevel = scene / 100;
     AddUnitToGroup(Unit, 16);
     _groups[16].isGroupUsed = true;
 }
Example #2
0
 public QuadTreeNode(LightingUnit lightObject)
 {
     this.LightUnit = lightObject;
 }
Example #3
0
 //Removes unit from a single group
 public void RemoveUnitFromGroup(LightingUnit UnitToRemove, int GroupToRemoveFrom)
 {
     _groups[GroupToRemoveFrom].RemoveUnit(UnitToRemove);
 }
Example #4
0
 public void Setup()
 {
     group = new DALIGroup();
     unit  = new LightingUnit(0, 0, 2);
 }
Example #5
0
    /// <summary>
    /// Displays updated lighting unit information.
    /// </summary>
    public void LightingUnitUpdated()
    {
        List <LightingUnit> bulbs = lightingUnitHandler.GetComponent <LightingUnitPlacementHandler>().LightBulbs;
        int hits = 0;

        for (int i = 0; i < bulbs.Count; i++)
        {
            hits += bulbs[i].hits;
        }

        float covering = ((float)hits / (float)spatialProcessing.GetComponent <SpatialObserverHandler>().CombinedMesh.triangles.Length) * 100;

        string desc = (int)covering + " % of the room is strongly illuminated (red colored)";

        if (bulbs.Where(b => b.unitType == "Type A").Count() > 0)
        {
            desc += "\n - " + bulbs.Where(b => b.unitType == "Type A").Count() + " Type A, energy consumption of " + (LightingUnit.GetLightingUnitTypeValues("Type A")[2] / (Mathf.PI * LightingUnit.GetLightingUnitTypeValues("Type A")[0] * LightingUnit.GetLightingUnitTypeValues("Type A")[0])).ToString("F1") + " with an estimated durability of " + LightingUnit.GetLightingUnitTypeValues("Type A")[1] + " years";
        }

        if (bulbs.Where(b => b.unitType == "Type B").Count() > 0)
        {
            desc += "\n - " + bulbs.Where(b => b.unitType == "Type B").Count() + " Type B, energy consumption of " + (LightingUnit.GetLightingUnitTypeValues("Type B")[2] / (Mathf.PI * LightingUnit.GetLightingUnitTypeValues("Type B")[0] * LightingUnit.GetLightingUnitTypeValues("Type B")[0])).ToString("F1") + " with an estimated durability of " + LightingUnit.GetLightingUnitTypeValues("Type B")[1] + " years";
        }

        if (bulbs.Where(b => b.unitType == "Type C").Count() > 0)
        {
            desc += "\n - " + bulbs.Where(b => b.unitType == "Type C").Count() + " Type C, energy consumption of " + (LightingUnit.GetLightingUnitTypeValues("Type C")[2] / (Mathf.PI * LightingUnit.GetLightingUnitTypeValues("Type C")[0] * LightingUnit.GetLightingUnitTypeValues("Type C")[0])).ToString("F1") + " with an estimated durability of " + LightingUnit.GetLightingUnitTypeValues("Type C")[1] + " years";
        }

        desc += "\nTotal energy consumption per illuminated unit: " + (((LightingUnit.GetLightingUnitTypeValues("Type A")[2] / (Mathf.PI * LightingUnit.GetLightingUnitTypeValues("Type A")[0] * LightingUnit.GetLightingUnitTypeValues("Type A")[0])) * bulbs.Where(b => b.unitType == "Type A").Count()) + ((LightingUnit.GetLightingUnitTypeValues("Type B")[2] / (Mathf.PI * LightingUnit.GetLightingUnitTypeValues("Type B")[0] * LightingUnit.GetLightingUnitTypeValues("Type B")[0])) * bulbs.Where(b => b.unitType == "Type B").Count()) + ((LightingUnit.GetLightingUnitTypeValues("Type C")[2] / (Mathf.PI * LightingUnit.GetLightingUnitTypeValues("Type C")[0] * LightingUnit.GetLightingUnitTypeValues("Type C")[0])) * bulbs.Where(b => b.unitType == "Type C").Count())).ToString("F1");
        desc += "\nAir tap on light bulbs for configuration!";

        SetPanelText("Eco Feedback", desc);
    }
Example #6
0
    /// <summary>
    /// Handles the lighting recommendation completion event.
    /// </summary>
    /// <param name="source"></param>
    /// <param name="args"></param>
    public void LightingRecommendationCompletedEventHandler(object source, System.EventArgs args)
    {
        string desc = (int)lightingUnitHandler.GetComponent <LightingUnitPlacementHandler>().Covering + " % of the room is strongly illuminated (red colored)";

        textPanel.SetActive(false);

        List <LightingUnit> bulbs = lightingUnitHandler.GetComponent <LightingUnitPlacementHandler>().LightBulbs;

        if (bulbs.Where(b => b.unitType == "Type A").Count() > 0)
        {
            desc += "\n - " + bulbs.Where(b => b.unitType == "Type A").Count() + " Type A, energy consumption of " + (LightingUnit.GetLightingUnitTypeValues("Type A")[2] / (Mathf.PI * LightingUnit.GetLightingUnitTypeValues("Type A")[0] * LightingUnit.GetLightingUnitTypeValues("Type A")[0])).ToString("F1") + " with an estimated durability of " + LightingUnit.GetLightingUnitTypeValues("Type A")[1] + " years";
        }

        if (bulbs.Where(b => b.unitType == "Type B").Count() > 0)
        {
            desc += "\n - " + bulbs.Where(b => b.unitType == "Type B").Count() + " Type B, energy consumption of " + (LightingUnit.GetLightingUnitTypeValues("Type B")[2] / (Mathf.PI * LightingUnit.GetLightingUnitTypeValues("Type B")[0] * LightingUnit.GetLightingUnitTypeValues("Type B")[0])).ToString("F1") + " with an estimated durability of " + LightingUnit.GetLightingUnitTypeValues("Type B")[1] + " years";
        }

        if (bulbs.Where(b => b.unitType == "Type C").Count() > 0)
        {
            desc += "\n - " + bulbs.Where(b => b.unitType == "Type C").Count() + " Type C, energy consumption of " + (LightingUnit.GetLightingUnitTypeValues("Type C")[2] / (Mathf.PI * LightingUnit.GetLightingUnitTypeValues("Type C")[0] * LightingUnit.GetLightingUnitTypeValues("Type C")[0])).ToString("F1") + " with an estimated durability of " + LightingUnit.GetLightingUnitTypeValues("Type C")[1] + " years";
        }

        desc += "\nTotal energy consumption per illuminated unit: " + (((LightingUnit.GetLightingUnitTypeValues("Type A")[2] / (Mathf.PI * LightingUnit.GetLightingUnitTypeValues("Type A")[0] * LightingUnit.GetLightingUnitTypeValues("Type A")[0])) * bulbs.Where(b => b.unitType == "Type A").Count()) + ((LightingUnit.GetLightingUnitTypeValues("Type B")[2] / (Mathf.PI * LightingUnit.GetLightingUnitTypeValues("Type B")[0] * LightingUnit.GetLightingUnitTypeValues("Type B")[0])) * bulbs.Where(b => b.unitType == "Type B").Count()) + ((LightingUnit.GetLightingUnitTypeValues("Type C")[2] / (Mathf.PI * LightingUnit.GetLightingUnitTypeValues("Type C")[0] * LightingUnit.GetLightingUnitTypeValues("Type C")[0])) * bulbs.Where(b => b.unitType == "Type C").Count())).ToString("F1");

        desc += "\nAir tap on light bulbs for configuration!";

        SetPanelText("Eco Feedback", desc);

        textPanel.SetActive(true);
        textPanel.GetComponentInParent <SolverHandler>().UpdateSolvers = false;
    }
Example #7
0
 //changes what unit is currently being displayed
 public void ChangeCurrentLightingUnit(LightingUnit Unit)
 {
     LightunitInfo.Visible = true;
     CurrentUnit           = Unit;
 }
Example #8
0
 public void RemoveUnit(LightingUnit Unit)
 {
     GroupOfLights.Remove(Unit);
 }