Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //public void Initialize()
- //{
- // string filename = "input.txt";
- // house = Reader.Reader.ReadHouse(filename);
- // int x = this.label2.Left;
- // int y = 30;
- // int cnt = 0;
- // Label textAver = new Label();
- // textAver.Text = "Average:";
- // Label textTotal = new Label();
- // textTotal.Text = "Total:";
- // Label textName = new Label();
- // textName.Text = "Name of the resource:";
- // Label textCurrent = new Label();
- // textCurrent.Text = "Current:";
- // textAver.Top = 50 + y;
- // textName.Top = 50 + y;
- // textTotal.Top = 50 + y;
- // textCurrent.Top = 50 + y;
- // textName.Left = x;
- // x += 100;
- // textTotal.Left = x;
- // x += 100;
- // textAver.Left = x;
- // x += 100;
- // textCurrent.Left = x;
- // this.Controls.Add(textAver);
- // this.Controls.Add(textTotal);
- // this.Controls.Add(textName);
- // this.Controls.Add(textCurrent);
- // y += 30;
- // x = this.label2.Left;
- // for (int i = 0; i < this.house.mainCounter.Count; i++)
- // {
- // ++cnt;
- // AddLabel(50 + y, x, this.house.mainCounter[i].getResource().ToString() + ":", "name" + (cnt).ToString());
- // AddLabel(50 + y, x + 100, "0.0000", "total" + (cnt).ToString());
- // AddLabel(50 + y, x + 200, "0.0000", "aver" + (cnt).ToString());
- // AddLabel(50 + y, x + 300, "0.0000", "curr" + (cnt).ToString());
- // y += 30;
- // }
- // x = 450;
- // y = 30;
- // for (int i = 0; i < this.house.rooms.Count; i++)
- // {
- // AddRooms(this.house.rooms[i], i + 1, ref x, ref y);
- // }
- //}
- //void AddLabel(int top, int left, string text, string name)
- //{
- // Label cur = new Label();
- // cur.Top = top;
- // cur.Left = left;
- // cur.Text = text;
- // cur.Name = name;
- // if (cur.Text.Length > 20) cur.Size = new Size(300, cur.Size.Height);
- // this.Controls.Add(cur);
- //}
- //void AddRooms(Room room, int cnt, ref int x, ref int y)
- //{
- // AddLabel(y, x, "Room " + cnt, "room" + cnt);
- // y += 25;
- // AddLabel(y, x, "Indication of room counters: ", "room_counter" + cnt);
- // y += 25;
- // AddLabel(y, x, "Temperature: ", "room_temperature" + cnt);
- // AddLabel(y, x + 100, "0.0000", "temp" + cnt);
- // for (int i = 0; i < room.listOfCounter.Count; ++i)
- // {
- // AddLabel(30 + y, x, this.house.mainCounter[i].getResource().ToString() + ":", "name" + (cnt).ToString());
- // AddLabel(30 + y, x + 100, "0.0000", "room_total" + (cnt).ToString());
- // y += 30;
- // }
- // y += 30;
- //}
- //public void Update(Room room, int ind)
- //{
- // for (int i = 0; i < room.listOfCounter.Count; i++)
- // {
- // string roomTotal = "room_total" + (ind + 1).ToString();
- // string temperature = "temp" + (ind + 1).ToString();
- // double temp = room.GetCurrentTemperature();
- // double total = room.listOfCounter[i].getResource().Value;
- // for (int j = 0; j < this.Controls.Count; j++)
- // {
- // if (this.Controls[j] is Label)
- // {
- // if (this.Controls[j].Name.CompareTo(roomTotal) == 0)
- // {
- // Controls[j].Text = total.ToString("f4");
- // }
- // if (this.Controls[j].Name.CompareTo(temperature) == 0)
- // {
- // Controls[j].Text = temp.ToString("f4");
- // }
- // }
- // }
- // }
- //}
- //public void Update()
- //{
- // this.house.UpdateLog();
- // int cnt = 0;
- // for (int i = 0; i < this.house.rooms.Count; ++i)
- // Update(house.rooms[i], i);
- // for (int i = 0; i < this.house.mainCounter.Count; i++)
- // {
- // cnt++;
- // double average, last, current;
- // average = this.house.logs[i].GetAverage();
- // last = this.house.logs[i].GetTotal();
- // current = this.house.logs[i].GetLast();
- // string avname = "aver" + (cnt).ToString();
- // string curname = "curr" + (cnt).ToString();
- // string totalname = "total" + (cnt).ToString();
- // for(int j=0; j<this.Controls.Count; j++)
- // {
- // if (this.Controls[j] is Label)
- // {
- // if (this.Controls[j].Name.CompareTo(avname) == 0)
- // {
- // this.Controls[j].Text = average.ToString("f4");
- // }
- // if (this.Controls[j].Name.CompareTo(curname) == 0)
- // {
- // this.Controls[j].Text = current.ToString("f4");
- // }
- // if (this.Controls[j].Name.CompareTo(totalname) == 0)
- // {
- // this.Controls[j].Text = last.ToString("f4");
- // }
- // }
- // }
- // }
- //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement