Exemplo n.º 1
0
 public StatusFlags(YabeMainDialog yabeFrm)
 {
     this.yabeFrm = yabeFrm;
     Icon         = yabeFrm.Icon; // gets Yabe Icon
     InitializeComponent();
     treeView1.ImageList = Flags_imageList1;
 }
        private void AddPropertyRefentry(BacnetDeviceObjectPropertyReference bopr, int IdxRemove)
        {
            String newText;

            if (bopr.deviceIndentifier.type != BacnetObjectTypes.OBJECT_DEVICE)
            {
                newText = bopr.objectIdentifier.ToString().Substring(7) + " - " + ((BacnetPropertyIds)bopr.propertyIdentifier).ToString().Substring(5) + " on localDevice";
            }
            else
            {
                newText = bopr.objectIdentifier.ToString().Substring(7) + " - " + ((BacnetPropertyIds)bopr.propertyIdentifier).ToString().Substring(5) + " on DEVICE:" + bopr.deviceIndentifier.instance.ToString();
            }

            if (IdxRemove != -1)
            {
                listReferences.Items.RemoveAt(IdxRemove); // remove an old entry
            }
            ListViewItem lvi = new ListViewItem();

            // add a new one
            lvi.Text       = newText;
            lvi.Tag        = bopr;
            lvi.ImageIndex = YabeMainDialog.GetIconNum(bopr.objectIdentifier.type);
            listReferences.Items.Add(lvi);
        }
Exemplo n.º 3
0
        // yabeFrm is also declared into Yabe Main class
        // This is usefull for plugin developpement inside Yabe project, before exporting it
        public void Init(YabeMainDialog yabeFrm) // This is the unique mandatory method for a Yabe plugin
        {
            this.yabeFrm = yabeFrm;
            // Create the Menu Item
            ToolStripMenuItem MenuItem = new ToolStripMenuItem();

            MenuItem.Text = "List Analog Values";
            MenuItem.Tag  = new BacnetObjectTypes[]
            { BacnetObjectTypes.OBJECT_ANALOG_VALUE };   // all objects types with COV_Increment property
            MenuItem.Click += new EventHandler(MenuItem_Click);
            yabeFrm.pluginsToolStripMenuItem.DropDownItems.Add(MenuItem);
        }
Exemplo n.º 4
0
        // yabeFrm is also declared into Yabe Main class
        // This is usefull for plugin developpement inside Yabe project, before exporting it

        public void Init(YabeMainDialog yabeFrm) // This is the unique mandatory method for a Yabe plugin
        {
            this.yabeFrm = yabeFrm;

            // Creates the Menu Item
            ToolStripMenuItem MenuItem = new ToolStripMenuItem();

            MenuItem.Text   = "List OutOfService";
            MenuItem.Click += new EventHandler(MenuItem_Click);

            // Add It as a sub menu (pluginsToolStripMenuItem is the only public Menu member)
            yabeFrm.pluginsToolStripMenuItem.DropDownItems.Add(MenuItem);
        }
        // yabeFrm is also declared into Yabe Main class
        // This is usefull for plugin developpement inside Yabe project, before exporting it

        public void Init(YabeMainDialog yabeFrm) // This is the unique mandatory method for a Yabe plugin
        {
            this.yabeFrm = yabeFrm;

            // Create the Menu Item
            ToolStripMenuItem MenuItem = new ToolStripMenuItem();

            MenuItem.Text = "List COV_Increment";
            // Add It as a sub menu (pluginsToolStripMenuItem is the only public Menu member)
            yabeFrm.pluginsToolStripMenuItem.DropDownItems.Add(MenuItem);

            // Create SubMenu Item
            ToolStripMenuItem SubMenuItem = new ToolStripMenuItem();

            SubMenuItem.Text = "on all Objects";
            SubMenuItem.Tag  = new BacnetObjectTypes[]
            { BacnetObjectTypes.OBJECT_ANALOG_INPUT,
              BacnetObjectTypes.OBJECT_ANALOG_VALUE,
              BacnetObjectTypes.OBJECT_ANALOG_OUTPUT,
              BacnetObjectTypes.OBJECT_LOOP,
              BacnetObjectTypes.OBJECT_PULSE_CONVERTER };    // all objects types with COV_Increment property

            SubMenuItem.Click += new EventHandler(MenuItem_Click);
            MenuItem.DropDownItems.Add(SubMenuItem);

            SubMenuItem        = new ToolStripMenuItem();
            SubMenuItem.Text   = "on Analog Input Objects";
            SubMenuItem.Tag    = new BacnetObjectTypes[] { BacnetObjectTypes.OBJECT_ANALOG_INPUT };
            SubMenuItem.Click += new EventHandler(MenuItem_Click);
            MenuItem.DropDownItems.Add(SubMenuItem);

            SubMenuItem        = new ToolStripMenuItem();
            SubMenuItem.Text   = "on Analog Output Objects";
            SubMenuItem.Tag    = new BacnetObjectTypes[] { BacnetObjectTypes.OBJECT_ANALOG_OUTPUT };
            SubMenuItem.Click += new EventHandler(MenuItem_Click);
            MenuItem.DropDownItems.Add(SubMenuItem);

            SubMenuItem        = new ToolStripMenuItem();
            SubMenuItem.Text   = "on Analog Value Objects";
            SubMenuItem.Tag    = new BacnetObjectTypes[] { BacnetObjectTypes.OBJECT_ANALOG_VALUE };
            SubMenuItem.Click += new EventHandler(MenuItem_Click);
            MenuItem.DropDownItems.Add(SubMenuItem);
        }
Exemplo n.º 6
0
 public OutOfService(YabeMainDialog yabeFrm)
 {
     this.yabeFrm = yabeFrm;
     Icon         = yabeFrm.Icon; // gets Yabe Icon
     InitializeComponent();
 }
 public Reliability(YabeMainDialog yabeFrm)
 {
     this.yabeFrm = yabeFrm;
     Icon         = yabeFrm.Icon; // gets Yabe Icon
     InitializeComponent();
 }
Exemplo n.º 8
0
 public AnalogValues(YabeMainDialog yabeFrm)
 {
     this.yabeFrm = yabeFrm;
     Icon         = yabeFrm.Icon; // gets Yabe Icon
     InitializeComponent();
 }
Exemplo n.º 9
0
        private void FillTreeNode()
        {
            int icon;

            TAlarmList.Nodes.Clear();

            TAlarmList.BeginUpdate();

            // Only one network read request to get the object name
            int _retries = comm.Retries;

            comm.Retries = 1;

            // fill the Treenode
            foreach (BacnetGetEventInformationData alarm in Alarms)
            {
                if ((alarm.acknowledgedTransitions.ToString() != "111") || (alarm.eventState != BacnetEventNotificationData.BacnetEventStates.EVENT_STATE_NORMAL))
                {
                    TreeNode currentTn;

                    String nameStr = null;

                    lock (DevicesObjectsName)
                        DevicesObjectsName.TryGetValue(new Tuple <String, BacnetObjectId>(adr.FullHashString(), alarm.objectIdentifier), out nameStr);

                    if (nameStr == null)
                    {
                        // Get the property Name, network activity, time consuming
                        IList <BacnetValue> name;
                        bool retcode = comm.ReadPropertyRequest(adr, alarm.objectIdentifier, BacnetPropertyIds.PROP_OBJECT_NAME, out name);

                        if (retcode)
                        {
                            nameStr = name[0].Value.ToString();
                            lock (DevicesObjectsName)
                                DevicesObjectsName.Add(new Tuple <String, BacnetObjectId>(adr.FullHashString(), alarm.objectIdentifier), nameStr);
                        }
                    }

                    icon = YabeMainDialog.GetIconNum(alarm.objectIdentifier.type);
                    if (nameStr != null)
                    {
                        if (!Properties.Settings.Default.DisplayIdWithName)
                        {
                            currentTn = new TreeNode(nameStr, icon, icon);
                        }
                        else
                        {
                            currentTn = new TreeNode(nameStr + " (" + System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(alarm.objectIdentifier.ToString()) + ")", icon, icon);
                        }

                        currentTn.ToolTipText = alarm.objectIdentifier.ToString();
                    }
                    else
                    {
                        currentTn = new TreeNode(alarm.objectIdentifier.ToString(), icon, icon);
                    }

                    currentTn.Tag = alarm;
                    TAlarmList.Nodes.Add(currentTn);

                    if (Properties.Settings.Default.DescriptionInAlarmSummary)
                    {
                        String Descr = "";
                        try
                        {
                            // Get the Description, network activity, time consuming
                            IList <BacnetValue> name;
                            bool retcode = comm.ReadPropertyRequest(adr, alarm.objectIdentifier, BacnetPropertyIds.PROP_DESCRIPTION, out name);

                            if (retcode)
                            {
                                Descr = name[0].Value.ToString();
                            }
                        }
                        catch { }

                        currentTn.Nodes.Add(new TreeNode("Description : " + Descr, Int32.MaxValue, Int32.MaxValue));
                    }

                    icon = Int32.MaxValue; // out bound
                    currentTn.Nodes.Add(new TreeNode("Alarm state : " + GetEventStateNiceName(alarm.eventState.ToString()), icon, icon));


                    TreeNode tn2         = new TreeNode("Ack Required :", icon, icon);
                    bool     ackrequired = false;
                    for (int i = 0; i < 3; i++)
                    {
                        if (alarm.acknowledgedTransitions.ToString()[i] == '0')
                        {
                            BacnetEventNotificationData.BacnetEventEnable bee = (BacnetEventNotificationData.BacnetEventEnable)(1 << i);
                            String text = GetEventEnableNiceName(bee.ToString()) + " since " + alarm.eventTimeStamps[i].Time.ToString();
                            tn2.Nodes.Add(new TreeNode(text, icon, icon));
                            ackrequired = true;
                        }
                    }

                    if (!ackrequired)
                    {
                        tn2 = new TreeNode("No Ack Required, already done", icon, icon);
                    }
                    currentTn.Nodes.Add(tn2);
                }
            }

            // set back the request retries number
            comm.Retries = _retries;

            TAlarmList.EndUpdate();

            TAlarmList.ExpandAll();

            if (TAlarmList.Nodes.Count == 0)
            {
                LblInfo.Visible = true;
                LblInfo.Text    = "Empty event list ... all is OK";
            }
        }
Exemplo n.º 10
0
 public COV_Increment(YabeMainDialog yabeFrm)
 {
     this.yabeFrm = yabeFrm;
     Icon         = yabeFrm.Icon; // gets Yabe Icon
     InitializeComponent();
 }