Ejemplo n.º 1
0
        protected override bool SetData(ManualAutoAddData data)
        {
            if (data == null)
            {
                return(false);
            }

            data   = data.DeepClone();
            dataID = data.dataID;

            //深夜時間帯の処理
            if (Settings.Instance.LaterTimeUse == true && DateTime28.IsLateHour(data.PgStartTime.Hour) == true)
            {
                data.ShiftRecDay(-1);
            }

            //曜日の処理、0~6bit目:日~土
            int val = 0;

            chbxList.ForEach(chbx => chbx.IsChecked = (data.dayOfWeekFlag & (0x01 << val++)) != 0);

            checkBox_keyDisabled.IsChecked = data.IsEnabled == false;

            UInt32 hh = data.startTime / (60 * 60);
            UInt32 mm = (data.startTime % (60 * 60)) / 60;
            UInt32 ss = data.startTime % 60;

            comboBox_startHH.SelectedIndex = (int)hh;
            comboBox_startMM.SelectedIndex = (int)mm;
            comboBox_startSS.SelectedIndex = (int)ss;

            //深夜時間帯の処理も含む
            UInt32 endTime = data.startTime + data.durationSecond;

            if (endTime >= comboBox_endHH.Items.Count * 60 * 60 || endTime >= 24 * 60 * 60 &&
                DateTime28.JudgeLateHour(data.PgStartTime.AddSeconds(data.durationSecond), data.PgStartTime) == false)
            {
                //正規のデータであれば、必ず0~23時台かつstartTimeより小さくなる。
                endTime -= 24 * 60 * 60;
            }
            hh = endTime / (60 * 60);
            mm = (endTime % (60 * 60)) / 60;
            ss = endTime % 60;

            comboBox_endHH.SelectedIndex = (int)hh;
            comboBox_endMM.SelectedIndex = (int)mm;
            comboBox_endSS.SelectedIndex = (int)ss;

            textBox_title.Text = data.title;

            UInt64 key = data.Create64Key();

            if (ChSet5.ChList.ContainsKey(key) == true)
            {
                comboBox_service.SelectedItem = ChSet5.ChList[key];
            }
            recSettingView.SetDefSetting(data.recSetting);

            return(true);
        }
Ejemplo n.º 2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (defKey != null)
            {
                //深夜時間帯の処理
                if (Settings.Instance.LaterTimeUse == true && DateTime28.IsLateHour(defKey.PgStartTime.Hour) == true)
                {
                    defKey.ShiftRecDay(-1);
                }

                if ((defKey.dayOfWeekFlag & 0x01) != 0)
                {
                    checkBox_week0.IsChecked = true;
                }
                if ((defKey.dayOfWeekFlag & 0x02) != 0)
                {
                    checkBox_week1.IsChecked = true;
                }
                if ((defKey.dayOfWeekFlag & 0x04) != 0)
                {
                    checkBox_week2.IsChecked = true;
                }
                if ((defKey.dayOfWeekFlag & 0x08) != 0)
                {
                    checkBox_week3.IsChecked = true;
                }
                if ((defKey.dayOfWeekFlag & 0x10) != 0)
                {
                    checkBox_week4.IsChecked = true;
                }
                if ((defKey.dayOfWeekFlag & 0x20) != 0)
                {
                    checkBox_week5.IsChecked = true;
                }
                if ((defKey.dayOfWeekFlag & 0x40) != 0)
                {
                    checkBox_week6.IsChecked = true;
                }

                checkBox_keyDisabled.IsChecked = defKey.IsEnabled == false;

                UInt32 hh = defKey.startTime / (60 * 60);
                UInt32 mm = (defKey.startTime % (60 * 60)) / 60;
                UInt32 ss = defKey.startTime % 60;

                comboBox_startHH.SelectedIndex = (int)hh;
                comboBox_startMM.SelectedIndex = (int)mm;
                comboBox_startSS.SelectedIndex = (int)ss;

                //深夜時間帯の処理も含む
                UInt32 endTime = defKey.startTime + defKey.durationSecond;
                if (endTime >= comboBox_endHH.Items.Count * 60 * 60 || endTime >= 24 * 60 * 60 &&
                    DateTime28.JudgeLateHour(defKey.PgStartTime.AddSeconds(defKey.durationSecond), defKey.PgStartTime) == false)
                {
                    //正規のデータであれば、必ず0~23時台かつstartTimeより小さくなる。
                    endTime -= 24 * 60 * 60;
                }
                hh = endTime / (60 * 60);
                mm = (endTime % (60 * 60)) / 60;
                ss = endTime % 60;

                comboBox_endHH.SelectedIndex = (int)hh;
                comboBox_endMM.SelectedIndex = (int)mm;
                comboBox_endSS.SelectedIndex = (int)ss;

                textBox_title.Text = defKey.title;

                UInt64 key = defKey.Create64Key();

                if (ChSet5.ChList.ContainsKey(key) == true)
                {
                    comboBox_service.SelectedItem = ChSet5.ChList[key];
                }
                recSettingView.SetDefSetting(defKey.recSetting, true);
            }
        }