Beispiel #1
0
        private const int GPIO_REFRESH = 100;      // expressed in milliseconds

        //private static Connection baseConnection;

        public KpWiznetLogic(int number)
            : base(number)
        {
            config        = new Config();
            wiznetSerCfg  = new SerConfig();
            wiznetGpioCfg = new gpioConfig();
            random        = new Random();
            CanSendCmd    = true;

            List <TagGroup> tagGroups = new List <TagGroup>();
            TagGroup        tagGroup  = new TagGroup("Group 1");

            tagGroup.KPTags.Add(new KPTag(1, "Tag 1"));
            tagGroup.KPTags.Add(new KPTag(2, "Tag 2"));
            tagGroup.KPTags.Add(new KPTag(3, "Tag 3"));
            tagGroup.KPTags.Add(new KPTag(4, "Tag 4"));
            tagGroup.KPTags.Add(new KPTag(5, "Tag 5"));
            tagGroups.Add(tagGroup);

            tagGroup = new TagGroup("Group 2");
            tagGroup.KPTags.Add(new KPTag(6, "Tag 6"));
            tagGroup.KPTags.Add(new KPTag(7, "Tag 7"));
            tagGroup.KPTags.Add(new KPTag(8, "Tag 8"));
            tagGroup.KPTags.Add(new KPTag(9, "Tag 9"));
            tagGroup.KPTags.Add(new KPTag(10, "Tag 10"));
            tagGroups.Add(tagGroup);

            InitKPTags(tagGroups);
        }
Beispiel #2
0
        private void SaveSerialConfig()
        {
            string errMsg;

            fatalError = !wiznetSerCfg.Save(SerConfig.GetFileName(AppDirs.ConfigDir, Number), out errMsg);

            if (fatalError)
            {
                state = "Save Serial Settings not possible.";
                throw new Exception(errMsg);
            }
            else
            {
                state = "Serial Settings Saved to File.";
            }
        }
Beispiel #3
0
        private void LoadSerialConfig()
        {
            string errMsg;

            fatalError = !wiznetSerCfg.Load(SerConfig.GetFileName(AppDirs.ConfigDir, Number), out errMsg);

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