2017年10月30日 星期一

自動控制-人機介面觀點

可以開放但是要避開危險, 危險避開就能動作(避免操作員誤觸)
也許寫程式的人都會誤觸了更何況操作員

2017年4月24日 星期一

c# #ifdef 實現 已解決

c# 中無法使用#ifdef 他把這個原本在C中的定義換成#if


所以變成


#if _DEBUG
Consol.debug("this is test");
#endif

2017年3月27日 星期一

2017年3月20日 星期一

C# get all control like button

 List<Control> list = new List<Control>();

            GetAllControl(this, list);

            foreach (Control control in list)
            {
                if (control.GetType() == typeof(Button))
                {
                    //all btn
                }
            }

        private void GetAllControl(Control c , List<Control> list)
        {
            foreach (Control control in c.Controls)
            {
                list.Add(control);

                if (control.GetType() == typeof(Panel))
                    GetAllControl(control , list);
            }
        }