Exemple #1
0
        rplan ui2plan()
        {
            DateTime starttm = DateTime.Parse(dt1_plan.Text + " " + dt2_plan.Text);
            int      cycle   = 0;

            int.TryParse(text_plancycle.Text, out cycle);
            cycleunit unit = str2unit(cb_planunit.Text);
            string    msg  = text_planmsg.Text.Trim();

            if (string.IsNullOrWhiteSpace(msg))
            {
                plan_log_func("!E: msg cannot be null or empty!");
                return(null);
            }
            if (plan_msghash.ContainsKey(msg))
            {
                if (!plan_override)
                {
                    plan_log_func("!E: <" + msg + "> already exists!");
                    return(null);
                }
                plan_del(msg);
            }
            return(new rplan(plan_log_func, starttm, cycle, unit, msg, plan_panel.add(msg, null, plan_click)));
        }
Exemple #2
0
        public static List <string> cycleunitlist()
        {
            List <string> list = new List <string>();

            for (cycleunit unit = 0; unit < cycleunit.max; unit++)
            {
                list.Add(unit.ToString());
            }
            return(list);
        }
Exemple #3
0
 void init(Action <string> log, DateTime starttm, int cycle, cycleunit unit, string msg, TextBox tb)
 {
     this.tb        = tb;
     this.log       = log;
     this.starttm   = starttm;
     this.cycle     = cycle;
     this.unit      = unit;
     this.msg       = msg;
     t              = new Thread(sched_task);
     t.IsBackground = true;
     t.Start();
 }
Exemple #4
0
        public static cycleunit str2unit(string s)
        {
            cycleunit unit;

            for (unit = 0; unit < cycleunit.max; unit++)
            {
                if (unit.ToString() == s)
                {
                    break;
                }
            }
            return(unit);
        }
Exemple #5
0
 public rplan(Action <string> log, DateTime starttm, int cycle, cycleunit unit, string msg, TextBox tb)
 {
     init(log, starttm, cycle, unit, msg, tb);
 }