Exemple #1
0
 private void TitleLabel_Click(object sender, EventArgs e)
 {
     ColorTrans.Start();
 }
Exemple #2
0
        public void DrawState()
        {
            if (ShowingMenu == true)
            {
                ShowingMenu = false;
                ModeChange();
            }

            switch (APIForm.combnum)
            {
            case -5:
            {
                AirStateLabel.Text   = "트래픽 초과";
                AirCommentLabel.Text = "monZi 요청 트래픽 초과";
                AirDetailLabel.Text  = "서버 요청이 급격히 증가하여 현재 접근이 불가합니다." + Constants.vbCr + "(여기를 클릭하여 도움말 페이지 열기)";
                titleStr             = APIForm.guititle;
                LocationLabel.Text   = My.Settings.LocationName;
                themecol             = Color.FromArgb(49, 27, 146);
                DashPic.Image        = My.Resources.dash_maintenance;
                break;
            }

            case -4:
            {
                AirStateLabel.Text   = "점검중";
                AirCommentLabel.Text = "점검중/사용 불가 상태입니다";
                AirDetailLabel.Text  = "해당 측정소에서 대기 상태를 받아올 수 없습니다." + Constants.vbCr + "'측정소명으로 검색'을 통해 다른 측정소를 지정하세요." + Constants.vbCr + "(여기를 클릭하여 주변 측정소 정보 조회)";
                titleStr             = APIForm.guititle;
                LocationLabel.Text   = My.Settings.LocationName;
                themecol             = Color.FromArgb(49, 27, 146);
                DashPic.Image        = My.Resources.dash_maintenance;
                break;
            }

            case -3:
            {
                AirStateLabel.Text   = "위치 설정";
                AirCommentLabel.Text = "위치를 지정해 주세요";
                titleStr             = "monZi";
                LocationLabel.Text   = "여기를 눌러 위치를 지정";
                AirDetailLabel.Text  = "대기 상태를 업데이트 받을 위치를" + Constants.vbCr + "좌측 아래 위치명 부분을 눌러 설정하세요";
                themecol             = Color.FromArgb(55, 71, 79);
                DashPic.Image        = null;
                break;
            }

            case -2:
            {
                AirStateLabel.Text   = "오프라인";
                AirCommentLabel.Text = "인터넷에 연결되지 않았네요";
                titleStr             = "인터넷 연결 안됨";
                LocationLabel.Text   = "";
                AirDetailLabel.Text  = "인터넷 연결을 확인한 뒤 새로고침해 주세요" + Constants.vbCr + "(3분 간격으로 자동 체크합니다)";
                themecol             = Color.FromArgb(55, 71, 79);
                DashPic.Image        = null;
                break;
            }

            case -1:
            {
                AirStateLabel.Text   = "오류";
                AirCommentLabel.Text = "새로고침 혹은" + Constants.vbCr + "새로 위치를 지정해 보세요";
                titleStr             = "오류 발생";
                LocationLabel.Text   = "";
                AirDetailLabel.Text  = "인터넷 연결 문제, 혹은 측정소 점검" + Constants.vbCr + "등으로 인한 접근 제한이 원인일 수 있습니다." + Constants.vbCr + "(문제가 지속될시 업데이트를 확인하세요)";
                themecol             = Color.FromArgb(55, 71, 79);
                DashPic.Image        = null;
                break;
            }

            case 0:
            {
                firstShwon           = false;
                AirStateLabel.Text   = "로드 중";
                AirCommentLabel.Text = "잠시만 기다려 주세요";
                titleStr             = "로드 중";
                LocationLabel.Text   = "로드 중";
                AirDetailLabel.Text  = "정보를 불러오고 있는 중입니다.";
                themecol             = Color.FromArgb(55, 71, 79);
                DashPic.Image        = null;
                break;
            }

            case 1:
            {
                AirStateLabel.Text   = "최고";
                AirCommentLabel.Text = "신선한 공기 마음껏 마시세요~";
                themecol             = Color.FromArgb(30, 136, 229);
                DashPic.Image        = My.Resources.dash_1;
                break;
            }

            case 2:
            {
                AirStateLabel.Text   = "좋음";
                AirCommentLabel.Text = "환기하셔도 좋습니다!";
                themecol             = Color.FromArgb(43, 201, 207);

                if (My.Settings.AirStd == "AK")
                {
                    DashPic.Image = My.Resources.dash_1;
                }
                else
                {
                    DashPic.Image = My.Resources.dash_2_8;
                }
                break;
            }

            case 3:
            {
                AirStateLabel.Text   = "양호";
                AirCommentLabel.Text = "괜찮은 날이네요!";
                themecol             = Color.FromArgb(49, 159, 158);
                DashPic.Image        = My.Resources.dash_3_8;
                break;
            }

            case 4:
            {
                AirStateLabel.Text   = "보통";
                AirCommentLabel.Text = "그럭저럭 괜찮은 날이네요!";
                themecol             = Color.FromArgb(11, 182, 82);

                if (My.Settings.AirStd == "AK")
                {
                    DashPic.Image = My.Resources.dash_3_8;
                }
                else
                {
                    DashPic.Image = My.Resources.dash_4_8;
                }
                break;
            }

            case 5:
            {
                AirStateLabel.Text   = "나쁨";
                AirCommentLabel.Text = "열린 창문이 있다면 닫아주세요~";
                themecol             = Color.FromArgb(239, 108, 0);

                if (My.Settings.AirStd == "AK")
                {
                    DashPic.Image = My.Resources.dash_6_8;
                }
                else
                {
                    DashPic.Image = My.Resources.dash_5_8;
                }
                break;
            }

            case 6:
            {
                AirStateLabel.Text   = "매우 나쁨";
                AirCommentLabel.Text = "외출시 마스크 꼭 챙기세요!";
                themecol             = Color.FromArgb(229, 57, 53);

                if (My.Settings.AirStd == "AK")
                {
                    DashPic.Image = My.Resources.dash_2;
                }
                else
                {
                    DashPic.Image = My.Resources.dash_6_8;
                }
                break;
            }

            case 7:
            {
                AirStateLabel.Text   = "극도로 나쁨";
                AirCommentLabel.Text = "주의해 주세요!";
                themecol             = Color.FromArgb(86, 9, 7);
                DashPic.Image        = My.Resources.dash_7_8;
                break;
            }

            case 8:
            {
                AirStateLabel.Text   = "최악";
                AirCommentLabel.Text = "가능하다면 외출을 삼가주세요!";
                themecol             = Color.FromArgb(18, 18, 18);
                DashPic.Image        = My.Resources.dash_2;
                break;
            }
            }

            string pm10lvl = "-";
            string pm25lvl = "-";

            switch (APIForm.pm10gnum)
            {
            case 1:
            {
                pm10lvl = "최고";
                break;
            }

            case 2:
            {
                pm10lvl = "좋음";
                break;
            }

            case 3:
            {
                pm10lvl = "양호";
                break;
            }

            case 4:
            {
                pm10lvl = "보통";
                break;
            }

            case 5:
            {
                pm10lvl = "나쁨";
                break;
            }

            case 6:
            {
                pm10lvl = "매우 나쁨";
                break;
            }

            case 7:
            {
                pm10lvl = "극도로 나쁨";
                break;
            }

            case 8:
            {
                pm10lvl = "최악";
                break;
            }
            }

            switch (APIForm.pm25gnum)
            {
            case 1:
            {
                pm25lvl = "최고";
                break;
            }

            case 2:
            {
                pm25lvl = "좋음";
                break;
            }

            case 3:
            {
                pm25lvl = "양호";
                break;
            }

            case 4:
            {
                pm25lvl = "보통";
                break;
            }

            case 5:
            {
                pm25lvl = "나쁨";
                break;
            }

            case 6:
            {
                pm25lvl = "매우 나쁨";
                break;
            }

            case 7:
            {
                pm25lvl = "극도로 나쁨";
                break;
            }

            case 8:
            {
                pm25lvl = "최악";
                break;
            }
            }

            if (My.Settings.FadeEnabled & !firstShwon)
            {
                targcol = themecol;
                ColorTrans.Start();
            }
            else
            {
                firstShwon = false;
                SetColor(themecol);
            }

            if (!(APIForm.combnum == 0 | APIForm.combnum == -1 | APIForm.combnum == -2 | APIForm.combnum == -3 | APIForm.combnum == -4 | APIForm.combnum == -5))
            {
                titleStr            = APIForm.guititle;
                LocationLabel.Text  = My.Settings.LocationName;
                AirDetailLabel.Text = "미세먼지(pm10): " + APIForm.pm10num + "㎍/㎥ (" + pm10lvl + ")"
                                      + Constants.vbCr + "초미세먼지(pm2.5): " + APIForm.pm25num + "㎍/㎥ (" + pm25lvl + ")" + Constants.vbCr; // _
                                                                                                                                        // + "마지막 측정: " + APIForm.NowChk
                UpdateLabel.Text = "업데이트: " + APIForm.APIupdTime + Constants.vbCr + "측정: " + Convert.ToInt16(Mid(APIForm.NowChk, 9, 2)).ToString + "일 " + Mid(APIForm.NowChk, 12);
            }
            else if (APIForm.combnum == 0)
            {
                UpdateLabel.Text = "업데이트 중";
            }
            else
            {
                UpdateLabel.Text = "업데이트" + Constants.vbCr + "되지 않음";
            }

            TitleLabel.Text = titleStr;

            if (!My.Settings.CustomAPI == null /* TODO Change to default(_) if this is not a reference type */)
            {
                LocationLabel.Text = My.Settings.CustomAPI;
            }

            this.ValidateChildren();
        }
Exemple #3
0
        private void ColorTrans_Tick(object sender, EventArgs e)
        {
            Color nowcol = MainPanel.BackColor;
            int   delta  = 7;

            var CR = Convert.ToInt16(nowcol.R);
            var CG = Convert.ToInt16(nowcol.G);
            var CB = Convert.ToInt16(nowcol.B);

            if (CR > Convert.ToInt16(targcol.R))
            {
                CR -= delta;
                if (CR < Convert.ToInt16(targcol.R))
                {
                    CR = Convert.ToInt16(targcol.R);
                }
            }
            else if (CR < Convert.ToInt16(targcol.R))
            {
                CR += delta;
                if (CR > Convert.ToInt16(targcol.R))
                {
                    CR = Convert.ToInt16(targcol.R);
                }
            }

            if (CG > Convert.ToInt16(targcol.G))
            {
                CG -= delta;
                if (CG < Convert.ToInt16(targcol.G))
                {
                    CG = Convert.ToInt16(targcol.G);
                }
            }
            else if (CG < Convert.ToInt16(targcol.G))
            {
                CG += delta;
                if (CG > Convert.ToInt16(targcol.G))
                {
                    CG = Convert.ToInt16(targcol.G);
                }
            }

            if (CB > Convert.ToInt16(targcol.B))
            {
                CB -= delta;
                if (CB < Convert.ToInt16(targcol.B))
                {
                    CB = Convert.ToInt16(targcol.B);
                }
            }
            else if (CB < Convert.ToInt16(targcol.B))
            {
                CB += delta;
                if (CB > Convert.ToInt16(targcol.B))
                {
                    CB = Convert.ToInt16(targcol.B);
                }
            }

            // TitleLabel.Text = CR.ToString + ", " + CG.ToString + ", " + CB.ToString
            SetColor(Color.FromArgb(CR, CG, CB));

            if (CR == Convert.ToInt16(targcol.R) & CG == Convert.ToInt16(targcol.G) & CB == Convert.ToInt16(targcol.B))
            {
                ColorTrans.Stop();
            }
        }
Exemple #4
0
        // 상태 그리기
        public void DrawState()
        {
            DashPic.Image = null;

            switch (APIForm.combnum)
            {
            case -4:
            {
                AirStateLabel.Text  = "점검중";
                AirDetailLabel.Text = "해당 측정소에서 대기 상태를" + Constants.vbCr + "받아올 수 없습니다." + Constants.vbCr + "메인 창을 열어 장소를 변경하세요.";
                TitleLabel.Text     = APIForm.guititle;
                themecol            = Color.FromArgb(49, 27, 146);
                DashPic.Image       = My.Resources.dash_maintenance;
                Icon = My.Resources.ico_er;
                break;
            }

            case -3:
            {
                AirStateLabel.Text  = "위치 설정";
                AirDetailLabel.Text = "메인 창을 열어" + Constants.vbCr + "위치를 지정해 주세요";
                themecol            = Color.FromArgb(55, 71, 79);
                break;
            }

            case -2:
            {
                TitleLabel.Text     = "monZi 오류";
                AirStateLabel.Text  = "오프라인";
                AirDetailLabel.Text = "인터넷 연결을 확인한 뒤" + Constants.vbCr + "새로고침해 주세요" + Constants.vbCr + "(3분 간격으로 자동 체크합니다)";
                themecol            = Color.FromArgb(55, 71, 79);
                Icon = My.Resources.ico_er;
                break;
            }

            case -1:
            {
                TitleLabel.Text     = "monZi 오류";
                AirStateLabel.Text  = "오류 발생";
                AirDetailLabel.Text = "인터넷 연결 문제, 혹은 측정소 점검 등으로 인한 접근 제한이 원인일 수 있습니다.";
                themecol            = Color.FromArgb(55, 71, 79);
                Icon = My.Resources.ico_er;
                break;
            }

            case 0:
            {
                AirStateLabel.Text  = "로드 중";
                AirDetailLabel.Text = "이 상태가 지속된다면" + Constants.vbCr + "프로그램을 다시 시작해 주세요";
                themecol            = Color.FromArgb(55, 71, 79);
                break;
            }

            case 1:
            {
                AirStateLabel.Text = "최고";
                themecol           = Color.FromArgb(30, 136, 229);
                DashPic.Image      = My.Resources.dash_1;
                Icon = My.Resources.ico_gr1;
                break;
            }

            case 2:
            {
                AirStateLabel.Text = "좋음";
                themecol           = Color.FromArgb(43, 201, 207);

                if (My.Settings.AirStd == "AK")
                {
                    DashPic.Image = My.Resources.dash_1;
                }
                else
                {
                    DashPic.Image = My.Resources.dash_2_8;
                }

                Icon = My.Resources.ico_gr2;
                break;
            }

            case 3:
            {
                AirStateLabel.Text = "양호";
                themecol           = Color.FromArgb(49, 159, 158);
                DashPic.Image      = My.Resources.dash_3_8;
                Icon = My.Resources.ico_gr3;
                break;
            }

            case 4:
            {
                AirStateLabel.Text = "보통";
                themecol           = Color.FromArgb(11, 182, 82);

                if (My.Settings.AirStd == "AK")
                {
                    DashPic.Image = My.Resources.dash_3_8;
                }
                else
                {
                    DashPic.Image = My.Resources.dash_4_8;
                }

                Icon = My.Resources.ico_gr4;
                break;
            }

            case 5:
            {
                AirStateLabel.Text = "나쁨";
                themecol           = Color.FromArgb(239, 108, 0);

                if (My.Settings.AirStd == "AK")
                {
                    DashPic.Image = My.Resources.dash_6_8;
                }
                else
                {
                    DashPic.Image = My.Resources.dash_5_8;
                }

                Icon = My.Resources.ico_gr5;
                break;
            }

            case 6:
            {
                AirStateLabel.Text = "매우 나쁨";
                themecol           = Color.FromArgb(229, 57, 53);

                if (My.Settings.AirStd == "AK")
                {
                    DashPic.Image = My.Resources.dash_2;
                }
                else
                {
                    DashPic.Image = My.Resources.dash_6_8;
                }

                Icon = My.Resources.ico_gr6;
                break;
            }

            case 7:
            {
                AirStateLabel.Text = "극도로 나쁨";
                themecol           = Color.FromArgb(86, 9, 7);
                DashPic.Image      = My.Resources.dash_7_8;
                Icon = My.Resources.ico_gr7;
                break;
            }

            case 8:
            {
                AirStateLabel.Text = "최악";
                themecol           = Color.FromArgb(18, 18, 18);
                DashPic.Image      = My.Resources.dash_2;
                Icon = My.Resources.ico_gr8;
                break;
            }
            }

            Text = AirStateLabel.Text + " - monZi 위젯";
            if (My.Settings.FadeEnabled)
            {
                targcol = themecol;
                ColorTrans.Start();
            }
            else
            {
                SetColor(themecol);
            }



            if (!(APIForm.combnum == 0 | APIForm.combnum == -1 | APIForm.combnum == -2 | APIForm.combnum == -3 | APIForm.combnum == -4))
            {
                TitleLabel.Text     = My.Settings.LocationName;
                AirDetailLabel.Text = "pm10(2.5): " + APIForm.pm10num + "(" + APIForm.pm25num + ") ㎍/㎥" + Constants.vbCr + APIForm.NowChk;
            }

            this.ValidateChildren();
        }