コード例 #1
0
        //test school mode
        public void test_school()
        {
            List <SilenceTimeSectionFromServer> listSilenceTimeSection = new List <SilenceTimeSectionFromServer>();

            SilenceTimeSectionFromServer silenceTimeSection = new SilenceTimeSectionFromServer();

            //silenceTimeSection.type = "school";
            silenceTimeSection.type = "sleep";
            DateTime startTime = DateTime.Now.AddMinutes(-1);
            DateTime endTime   = DateTime.Now.AddMinutes(1);

            silenceTimeSection.start_hour = startTime.Hour;
            silenceTimeSection.start_min  = startTime.Minute;
            silenceTimeSection.end_hour   = endTime.Hour;
            silenceTimeSection.end_min    = endTime.Minute;
            //silenceTimeSection.start_hour = 14;
            //silenceTimeSection.start_min = 31;
            //silenceTimeSection.end_hour = 13;
            //silenceTimeSection.end_min = 34;
            silenceTimeSection.weekdays = "0,1,2,3,4,5,6";
            silenceTimeSection.enable   = 1;
            silenceTimeSection.id       = 9854;
            listSilenceTimeSection.Add(silenceTimeSection);
            InitialSilenceTimeSection(listSilenceTimeSection, false);
        }
コード例 #2
0
 void DumpSilenceTimeData(List <SilenceTimeSectionFromServer> listSilenceTimeSectionFromServer)
 {
     for (int i = 0; i < listSilenceTimeSectionFromServer.Count; ++i)
     {
         SilenceTimeSectionFromServer data = listSilenceTimeSectionFromServer[i];
         if (data.enable != 0)
         {
             GuLog.Info("<><SilenceTimeData>type:" + data.type + "   enable:" + data.enable + "    begin:" + data.start_hour + ":" + data.start_min + "    end:" + data.end_hour + ":" + data.end_min + "    days:" + data.weekdays);
         }
     }
 }
コード例 #3
0
 public SilenceTimeSection(SilenceTimeSectionFromServer data)
 {
     sectionType = getTypeByString(data.type);
     beginHour   = data.start_hour;
     beginMinute = data.start_min;
     endHour     = data.end_hour;
     endMinute   = data.end_min;
     SetWeekDaysbyString(data.weekdays);
     isOn = (data.enable != 0);
     id   = data.id;
 }
コード例 #4
0
        public void test_schoolBak()
        {
            //List<SilenceTimeSection> listSilenceTimeSection = new List<SilenceTimeSection>();

            //SilenceTimeSection silenceTimeSection = new SilenceTimeSection();
            ////silenceTimeSection.sectionType = SilenceTimeSection.SectionType.Study;
            //silenceTimeSection.sectionType = SilenceTimeSection.SectionType.Sleep;
            //DateTime startTime = DateTime.Now.AddMinutes(3);
            //DateTime endTime = DateTime.Now.AddMinutes(4);
            //silenceTimeSection.beginHour = startTime.Hour;
            //silenceTimeSection.beginMinute = startTime.Minute;
            //silenceTimeSection.endHour = endTime.Hour;
            //silenceTimeSection.endMinute = endTime.Minute;
            //silenceTimeSection.days = 63;
            //silenceTimeSection.isOn = true;
            //silenceTimeSection.id = 9854;
            //listSilenceTimeSection.Add(silenceTimeSection);
            //InitialSilenceTimeSection(listSilenceTimeSection);

            List <SilenceTimeSectionFromServer> listSilenceTimeSection = new List <SilenceTimeSectionFromServer>();

            SilenceTimeSectionFromServer silenceTimeSection = new SilenceTimeSectionFromServer();

            //silenceTimeSection.type = "school";
            silenceTimeSection.type = "sleep";
            DateTime startTime = DateTime.Now.AddMinutes(3);
            DateTime endTime   = DateTime.Now.AddMinutes(4);

            silenceTimeSection.start_hour = startTime.Hour;
            silenceTimeSection.start_min  = startTime.Minute;
            silenceTimeSection.end_hour   = endTime.Hour;
            silenceTimeSection.end_min    = endTime.Minute;
            silenceTimeSection.weekdays   = "0,1,2,3,4,5,6";
            silenceTimeSection.enable     = 1;
            silenceTimeSection.id         = 9854;
            listSilenceTimeSection.Add(silenceTimeSection);
            InitialSilenceTimeSection(listSilenceTimeSection, false);
        }