Пример #1
0
        private void PrintInfo()
        {
            listView1.Items.Clear();
            ChargeStation data = null;

            foreach (ChargeStation d in s)
            {
                string place = (string)listBox2.SelectedItem;
                if (d.StatNm.Equals(place))
                {
                    data = d;
                    string       id   = string.Format("{0}", d.ChgerId);
                    string       type = whattype(d);
                    string       stat = whatstat(d);
                    string[]     arr  = { id, type, stat };
                    ListViewItem a    = new ListViewItem(arr);
                    listView1.Items.Add(a);
                }
            }

            textBox1.Text = data.AddrDoro;
            textBox2.Text = data.UseTime;

            object[] ps = new object[] { data.Lat, data.Lng };
            MarkerInfo(data.Lat, data.Lng);
            hdoc.InvokeScript("setCenter", ps);
        }
Пример #2
0
        private void AddData(string data)
        {
            string[]      sp = data.Split('#');
            ChargeStation ch = new ChargeStation(sp[0], sp[1], sp[2], float.Parse(sp[3]), float.Parse(sp[4]), sp[5], int.Parse(sp[6])
                                                 , int.Parse(sp[7]), int.Parse(sp[8]), sp[9]);

            s.Add(ch);
        }
Пример #3
0
        private void AllData(string data)
        {
            string[]      sp = data.Split('#');
            ChargeStation ac = new ChargeStation(sp[0], sp[1], sp[2], float.Parse(sp[3]), float.Parse(sp[4]), sp[5], int.Parse(sp[6])
                                                 , int.Parse(sp[7]), int.Parse(sp[8]), sp[9]);

            chlist.Add(ac);
        }
Пример #4
0
 private int CheckState(ChargeStation ls)
 {
     foreach (ChargeStation ch in s)
     {
         if (ls.StatId.Equals(ch.StatId))
         {
             if (ch.Stat == 2)
             {
                 return(2);
             }
         }
     }
     return(ls.Stat);
 }
Пример #5
0
        private string whatstat(ChargeStation data)
        {
            switch (data.Stat)
            {
            case 1: return(string.Format("통신이상"));

            case 2: return(string.Format("충전대기"));

            case 3: return(string.Format("충전중"));

            case 4: return(string.Format("운영중지"));

            case 5: return(string.Format("점검중"));
            }
            return("없음");
        }
Пример #6
0
        private string whattype(ChargeStation data)
        {
            switch (data.ChgerType)
            {
            case 01: return(string.Format("DC차데모"));

            case 02: return(string.Format("AC완속"));

            case 03: return(string.Format("DC차데모+AC3상"));

            case 04: return(string.Format("DC콤보"));

            case 05: return(string.Format("DC차데모+DC콤보"));

            case 06: return(string.Format("DC차데모+AC3상+DC콤보"));

            case 07: return(string.Format("AC3상"));
            }
            return("없음");
        }
Пример #7
0
 internal void Add(ChargeStation ch)
 {
     stationlist.Add(ch);
 }
Пример #8
0
 public void Atimer(ChargeStation ch)
 {
     timer.Interval = 1000; // 1초
     timer.Tick    += new EventHandler(timer_Tick);
     timer.Start();
 }
Пример #9
0
        private void analyze(ChargeStation data)
        {
            for (int i = 0; i < client.lglist.Count; i++)
            {
                if (data.StatId.Equals(client.lglist[i].StatId))
                {
                    //MessageBox.Show(DateTime.Now.Hour.ToString());
                    //MessageBox.Show(string.Format("시간대 척도:{0} , 빈도수:{1}", client.lglist[i].UseTime,client.lglist[i].CountMax));
                    #region 시간대별 분석
                    if (0 <= DateTime.Now.Hour && DateTime.Now.Hour <= 2)
                    {
                        if (client.lglist[i].UseTime == 1)
                        {
                            if (0 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 5)
                            {
                                textBox5.Text = "원활";
                            }
                            else if (5 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 10)
                            {
                                textBox5.Text = "보통";
                            }
                            else if (10 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 15)
                            {
                                textBox5.Text = "혼잡";
                            }
                        }
                    }
                    else if (2 < DateTime.Now.Hour && DateTime.Now.Hour <= 4)
                    {
                        if (client.lglist[i].UseTime == 2)
                        {
                            if (0 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 5)
                            {
                                textBox5.Text = "원활";
                            }
                            else if (5 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 10)
                            {
                                textBox5.Text = "보통";
                            }
                            else if (10 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 15)
                            {
                                textBox5.Text = "혼잡";
                            }
                        }
                    }
                    else if (4 < DateTime.Now.Hour && DateTime.Now.Hour <= 6)
                    {
                        if (client.lglist[i].UseTime == 3)
                        {
                            if (0 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 5)
                            {
                                textBox5.Text = "원활";
                            }
                            else if (5 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 10)
                            {
                                textBox5.Text = "보통";
                            }
                            else if (10 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 15)
                            {
                                textBox5.Text = "혼잡";
                            }
                        }
                    }
                    else if (6 < DateTime.Now.Hour && DateTime.Now.Hour <= 8)
                    {
                        if (client.lglist[i].UseTime == 4)
                        {
                            if (0 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 5)
                            {
                                textBox5.Text = "원활";
                            }
                            else if (5 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 10)
                            {
                                textBox5.Text = "보통";
                            }
                            else if (10 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 15)
                            {
                                textBox5.Text = "혼잡";
                            }
                        }
                    }
                    else if (8 < DateTime.Now.Hour && DateTime.Now.Hour <= 10)
                    {
                        if (client.lglist[i].UseTime == 5)
                        {
                            if (0 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 5)
                            {
                                textBox5.Text = "원활";
                            }
                            else if (5 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 10)
                            {
                                textBox5.Text = "보통";
                            }
                            else if (10 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 15)
                            {
                                textBox5.Text = "혼잡";
                            }
                        }
                    }
                    else if (10 < DateTime.Now.Hour && DateTime.Now.Hour <= 12)
                    {
                        if (client.lglist[i].UseTime == 6)
                        {
                            if (0 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 5)
                            {
                                textBox5.Text = "원활";
                            }
                            else if (5 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 10)
                            {
                                textBox5.Text = "보통";
                            }
                            else if (10 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 15)
                            {
                                textBox5.Text = "혼잡";
                            }
                        }
                    }
                    else if (12 < DateTime.Now.Hour && DateTime.Now.Hour <= 14)
                    {
                        if (client.lglist[i].UseTime == 7)
                        {
                            if (0 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 5)
                            {
                                textBox5.Text = "원활";
                            }
                            else if (5 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 10)
                            {
                                textBox5.Text = "보통";
                            }
                            else if (10 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 15)
                            {
                                textBox5.Text = "혼잡";
                            }
                        }
                    }

                    else if (14 < DateTime.Now.Hour && DateTime.Now.Hour <= 16)
                    {
                        if (client.lglist[i].UseTime == 8)
                        {
                            if (0 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 5)
                            {
                                textBox5.Text = "원활";
                            }
                            else if (5 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 10)
                            {
                                textBox5.Text = "보통";
                            }
                            else if (10 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 15)
                            {
                                textBox5.Text = "혼잡";
                            }
                        }
                    }
                    else if (16 < DateTime.Now.Hour && DateTime.Now.Hour <= 18)
                    {
                        if (client.lglist[i].UseTime == 9)
                        {
                            if (0 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 5)
                            {
                                textBox5.Text = "원활";
                            }
                            else if (5 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 10)
                            {
                                textBox5.Text = "보통";
                            }
                            else if (10 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 15)
                            {
                                textBox5.Text = "혼잡";
                            }
                        }
                    }
                    else if (18 < DateTime.Now.Hour && DateTime.Now.Hour <= 20)
                    {
                        if (client.lglist[i].UseTime == 10)
                        {
                            if (0 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 5)
                            {
                                textBox5.Text = "원활";
                            }
                            else if (5 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 10)
                            {
                                textBox5.Text = "보통";
                            }
                            else if (10 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 15)
                            {
                                textBox5.Text = "혼잡";
                            }
                        }
                    }

                    else if (20 < DateTime.Now.Hour && DateTime.Now.Hour <= 22)
                    {
                        if (client.lglist[i].UseTime == 11)
                        {
                            if (0 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 5)
                            {
                                textBox5.Text = "원활";
                            }
                            else if (5 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 10)
                            {
                                textBox5.Text = "보통";
                            }
                            else if (10 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 15)
                            {
                                textBox5.Text = "혼잡";
                            }
                        }
                    }
                    else if (22 < DateTime.Now.Hour && DateTime.Now.Hour <= 24)
                    {
                        if (client.lglist[i].UseTime == 12)
                        {
                            if (0 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 5)
                            {
                                textBox5.Text = "원활";
                            }
                            else if (5 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 10)
                            {
                                textBox5.Text = "보통";
                            }
                            else if (10 < client.lglist[i].CountMax && client.lglist[i].CountMax <= 15)
                            {
                                textBox5.Text = "혼잡";
                            }
                        }
                    }
                    #endregion
                }
            }
        }