Advertisement
Guest User

Untitled

a guest
Dec 28th, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.78 KB | None | 0 0
  1.  
  2.  
  3.         //public void Initialize()
  4.         //{
  5.            
  6.         //    string filename = "input.txt";
  7.         //    house = Reader.Reader.ReadHouse(filename);
  8.         //    int x = this.label2.Left;
  9.         //    int y = 30;
  10.         //    int cnt = 0;
  11.         //    Label textAver = new Label();
  12.         //    textAver.Text = "Average:";
  13.         //    Label textTotal = new Label();
  14.         //    textTotal.Text = "Total:";
  15.         //    Label textName = new Label();
  16.         //    textName.Text = "Name of the resource:";
  17.         //    Label textCurrent = new Label();
  18.         //    textCurrent.Text = "Current:";
  19.         //    textAver.Top = 50 + y;
  20.         //    textName.Top = 50 + y;
  21.         //    textTotal.Top = 50 + y;
  22.         //    textCurrent.Top = 50 + y;
  23.         //    textName.Left = x;
  24.         //    x += 100;
  25.         //    textTotal.Left = x;
  26.         //    x += 100;
  27.         //    textAver.Left = x;
  28.         //    x += 100;
  29.         //    textCurrent.Left = x;
  30.         //    this.Controls.Add(textAver);
  31.         //    this.Controls.Add(textTotal);
  32.         //    this.Controls.Add(textName);
  33.         //    this.Controls.Add(textCurrent);
  34.         //    y += 30;
  35.         //    x = this.label2.Left;
  36.         //    for (int i = 0; i < this.house.mainCounter.Count; i++)
  37.         //    {
  38.         //        ++cnt;
  39.         //        AddLabel(50 + y, x, this.house.mainCounter[i].getResource().ToString() + ":", "name" + (cnt).ToString());
  40.         //        AddLabel(50 + y, x + 100, "0.0000", "total" + (cnt).ToString());
  41.         //        AddLabel(50 + y, x + 200, "0.0000", "aver" + (cnt).ToString());
  42.         //        AddLabel(50 + y, x + 300, "0.0000", "curr" + (cnt).ToString());
  43.         //        y += 30;
  44.         //    }
  45.         //    x = 450;
  46.         //    y = 30;
  47.         //    for (int i = 0; i < this.house.rooms.Count; i++)
  48.         //    {
  49.         //        AddRooms(this.house.rooms[i], i + 1, ref x, ref y);
  50.         //    }
  51.         //}
  52.  
  53.         //void AddLabel(int top, int left, string text, string name)
  54.         //{
  55.         //    Label cur = new Label();
  56.         //    cur.Top = top;
  57.         //    cur.Left = left;
  58.         //    cur.Text = text;
  59.         //    cur.Name = name;
  60.         //    if (cur.Text.Length > 20) cur.Size = new Size(300, cur.Size.Height);
  61.         //    this.Controls.Add(cur);
  62.         //}
  63.  
  64.         //void AddRooms(Room room, int cnt, ref int x, ref int y)
  65.         //{
  66.         //    AddLabel(y, x, "Room " + cnt, "room" + cnt);
  67.         //    y += 25;
  68.         //    AddLabel(y, x, "Indication of room counters: ", "room_counter" + cnt);
  69.         //    y += 25;
  70.         //    AddLabel(y, x, "Temperature: ", "room_temperature" + cnt);
  71.         //    AddLabel(y, x + 100, "0.0000", "temp" + cnt);
  72.         //    for (int i = 0; i < room.listOfCounter.Count; ++i)
  73.         //    {
  74.         //        AddLabel(30 + y, x, this.house.mainCounter[i].getResource().ToString() + ":", "name" + (cnt).ToString());
  75.         //        AddLabel(30 + y, x + 100, "0.0000", "room_total" + (cnt).ToString());
  76.         //        y += 30;
  77.         //    }
  78.         //    y += 30;
  79.         //}
  80.  
  81.         //public void Update(Room room, int ind)
  82.         //{
  83.         //    for (int i = 0; i < room.listOfCounter.Count; i++)
  84.         //    {
  85.         //        string roomTotal = "room_total" + (ind + 1).ToString();
  86.         //        string temperature = "temp" + (ind + 1).ToString();
  87.         //        double temp = room.GetCurrentTemperature();
  88.         //        double total = room.listOfCounter[i].getResource().Value;
  89.         //        for (int j = 0; j < this.Controls.Count; j++)
  90.         //        {
  91.         //            if (this.Controls[j] is Label)
  92.         //            {
  93.         //                if (this.Controls[j].Name.CompareTo(roomTotal) == 0)
  94.         //                {
  95.         //                    Controls[j].Text = total.ToString("f4");
  96.         //                }
  97.         //                if (this.Controls[j].Name.CompareTo(temperature) == 0)
  98.         //                {
  99.         //                    Controls[j].Text = temp.ToString("f4");
  100.         //                }
  101.         //            }
  102.         //        }
  103.         //    }
  104.         //}
  105.  
  106.         //public void Update()
  107.         //{
  108.         //    this.house.UpdateLog();
  109.         //    int cnt = 0;
  110.         //    for (int i = 0; i < this.house.rooms.Count; ++i)
  111.         //        Update(house.rooms[i], i);
  112.         //    for (int i = 0; i < this.house.mainCounter.Count; i++)
  113.         //    {
  114.         //        cnt++;
  115.         //        double average, last, current;
  116.         //        average = this.house.logs[i].GetAverage();
  117.         //        last = this.house.logs[i].GetTotal();
  118.         //        current = this.house.logs[i].GetLast();
  119.         //        string avname = "aver" + (cnt).ToString();
  120.         //        string curname = "curr" + (cnt).ToString();
  121.         //        string totalname = "total" + (cnt).ToString();
  122.         //        for(int j=0; j<this.Controls.Count; j++)
  123.         //        {
  124.         //            if (this.Controls[j] is Label)
  125.         //            {
  126.         //                if (this.Controls[j].Name.CompareTo(avname) == 0)
  127.         //                {
  128.         //                    this.Controls[j].Text = average.ToString("f4");
  129.         //                }
  130.         //                if (this.Controls[j].Name.CompareTo(curname) == 0)
  131.         //                {
  132.         //                    this.Controls[j].Text = current.ToString("f4");
  133.         //                }
  134.         //                if (this.Controls[j].Name.CompareTo(totalname) == 0)
  135.         //                {
  136.         //                    this.Controls[j].Text = last.ToString("f4");
  137.         //                }
  138.         //            }
  139.         //        }
  140.  
  141.         //    }
  142.         //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement