Ejemplo n.º 1
0
        private void gpioForm_Load(object sender, EventArgs e)
        {
            // Load configuration from file
            string errMsg;

            configFileName = gpioConfig.GetFileName(appDirs.ConfigDir, kpNum);
            if (File.Exists(configFileName) && !config.Load(configFileName, out errMsg))
            {
                ScadaUiUtils.ShowError(errMsg);
            }
            else
            {
                // Load the Form Controls
                ConfigToControls();

                gpioAmode.SelectedIndexChanged += new System.EventHandler(ModeSelect_SelectedIndexChanged);
                gpioBmode.SelectedIndexChanged += new System.EventHandler(ModeSelect_SelectedIndexChanged);
                gpioCmode.SelectedIndexChanged += new System.EventHandler(ModeSelect_SelectedIndexChanged);
                gpioDmode.SelectedIndexChanged += new System.EventHandler(ModeSelect_SelectedIndexChanged);

                // Set up a Timer
                Timer timer = new Timer
                {
                    Interval = (1 * 200) // 100 msec
                };
                timer.Tick += new EventHandler(Timer_Tick);
                timer.Start();
            }
        }
Ejemplo n.º 2
0
        private void LoadGpioConfig()
        {
            string errMsg;

            fatalError = !wiznetGpioCfg.Load(gpioConfig.GetFileName(AppDirs.ConfigDir, Number), out errMsg);

            if (fatalError)
            {
                state = "Load GPIO Settings not possible";
                throw new Exception(errMsg);
            }
            else
            {
                state = "GPIO Seetings Loaded";
            }
        }