void cRooms::getRooms( JsonObject& root ) { JsonArray& RoomsTypes = root.createNestedArray("RTypes"); JsonArray& RoomsTemps = root.createNestedArray("RTs"); for (int i = 0; i<nRooms;i++){ RoomsTypes.add(Room[i].RoomType); } for (int i = 0; i<nRoomTypes;i++){ RoomsTemps.add(MasterSpTemps[i]); } root["SetType"] = SetType; }
void cRooms::getData( JsonObject& root ) { JsonArray& RoomsIsTemps = root.createNestedArray("RTi"); JsonArray& RoomsSPTemps = root.createNestedArray("RTs"); JsonArray& RoomsNeeds = root.createNestedArray("Rneed"); for (int i = 0; i<nRooms;i++){ RoomsIsTemps.add(Room[i].IsTemp.get()); RoomsSPTemps.add(Room[i].getSpTemp()); RoomsNeeds.add(Room[i].getNeed()); } root["Toutside"] = TempOutside.get(); root["Rn"] = static_cast<int>( active()); root["RTsHeating"] = getSpHeating(); root["RTitoR"] = IsTempHeatingLead.get(); root["RTitoSys"] = IsTempHeatingReturn.get(); root["RP"] = Pump.get(); root["RM"] = Mixer.get(); }
void cRooms::getOffsetTemp( JsonObject& root ) { JsonArray& temps = root.createNestedArray("RTo"); // Iterate over all sets (At home, away) for(int iSet = 0; iSet<nSetTypes; iSet++) { for(int iRoomType = 0; iRoomType<nRoomTypes; iRoomType++) // Iterate over all Roomtypes (Living, sleeping, hallway, bath, side) { for(int iDayType = 0; iDayType<nDayTypes; iDayType++) // Weekend, Workday { for(int iSwitch = 0; iSwitch<nSwitch; iSwitch++) // 4 switch times { temps.add(TempOffsetSchedule[iSet][iRoomType][iDayType][iSwitch].temp); } } } } }
void cRooms::getOffsetTime( JsonObject& root ) { JsonArray& times = root.createNestedArray("Rt"); // Iterate over all sets (At home, away) for(int iSet = 0; iSet<nSetTypes; iSet++) { for(int iRoomType = 0; iRoomType<nRoomTypes; iRoomType++) // Iterate over all Roomtypes (Living, sleeping, hallway, side) { for(int iDayType = 0; iDayType<nDayTypes; iDayType++) { for(int iSwitch = 0; iSwitch<nSwitch; iSwitch++) { times.add(TempOffsetSchedule[iSet][iRoomType][iDayType][iSwitch].time.totalseconds()); } } } } }