Ejemplo n.º 1
0
        private void UpdateList()
        {
            int  itemCount = 0;
            long logPosts  = 0;

            string filter = m_Filter.Text.ToLower().Trim();

            m_ItemsList.ListViewItemSorter = null;
            m_ItemsList.BeginUpdate();
            m_ItemsList.Items.Clear();
            foreach (string itemID in m_Database.GetItemsIDs())
            {
                if (filter.Length > 0 && !itemID.ToLower().Contains(filter))
                {
                    continue;
                }

                ListViewItem item  = new ListViewItem(itemID);
                int          posts = m_Database.GetItemRowCount(itemID);
                item.SubItems.Add(posts.ToString());
                m_ItemsList.Items.Add(item);
                itemCount++;
                logPosts += posts;
            }
            m_ItemsList.EndUpdate();

            m_ItemsList.ListViewItemSorter = m_Sorter;
            m_ItemsList.Sort();

            Text = Text + string.Format(" ({0} unique items, {1} log posts)", itemCount, logPosts);
        }
Ejemplo n.º 2
0
        private void FetchItemData(string itemID)
        {
            if (!m_Database.Exists(itemID))
            {
                return;
            }

            int count = m_Database.GetItemRowCount(itemID) - m_Ordered;

            if (count > 0)
            {
                int startIndex = m_Ordered;

                m_Ordered += count;

                m_Database.BeginGetItemRowsDP(itemID, 10000, startIndex, count, new QueuedReadRequestEventHandler(OnDataArrival));
            }
        }
Ejemplo n.º 3
0
        public void OnMenuBuilder(ZedGraphControl sender, ContextMenuStrip menuStrip, Point mousePt, ZedGraphControl.ContextMenuObjectState objState)
        {
            if (m_ItemDatabase == null)
            {
                return;
            }
            menuStrip.Items.Add(new ToolStripLabel("Threshold:"));
            ToolStripTextBox setThreshold = new ToolStripTextBox("Threshold");

            setThreshold.Text = m_Threshold?.Location.Y.ToString();

            setThreshold.KeyPress += (o, args) =>
            {
                if (((Keys)args.KeyChar) == Keys.Return)
                {
                    if (double.TryParse(setThreshold.Text, out var value))
                    {
                        SetThreshold(value);
                    }
                    else
                    {
                        SetThreshold(null);
                    }
                }
            };
            menuStrip.Items.Add(setThreshold);

            ToolStripMenuItem sendToModule = new ToolStripMenuItem("Send to module");

            sendToModule.Enabled = !string.IsNullOrEmpty(SelectedItem);


            IModule[] modules = m_Manager.GetModules();

            foreach (IModule module in modules)
            {
                if (module.SupportsSendToCalls)
                {
                    ToolStripMenuItem m = new ToolStripMenuItem(module.DisplayName, null, new EventHandler(OnSendToModule));
                    m.Tag = module;
                    sendToModule.DropDownItems.Add(m);
                }
            }

            menuStrip.Items.Add(sendToModule);

            menuStrip.Items.Add(new ToolStripSeparator());

            if (m_SelectedObject is LogGraphCurveItem selectedLine)
            {
                BuildLineMenu(selectedLine, menuStrip, DashStyle.Solid, DashStyle.Dash, DashStyle.Dot, DashStyle.DashDot, DashStyle.DashDotDot);
            }
            else
            {
                BuildAxisMenu(XAxis, menuStrip, "X-Axis", AxisType.Date, AxisType.DateAsOrdinal);
                BuildAxisMenu(YAxis, menuStrip, "Y-Axis", AxisType.Linear, AxisType.LinearAsOrdinal, AxisType.Log);
                //BuildAxisMenu(X2Axis, menuStrip, "X2-Axis");
                BuildAxisMenu(Y2Axis, menuStrip, "Y2-Axis", AxisType.Linear, AxisType.LinearAsOrdinal, AxisType.Log);
            }

            ToolStripLabel label = new ToolStripLabel("Grid item on X-Axis:");

            label.Font = new Font(label.Font, FontStyle.Underline);
            menuStrip.Items.Add(label);

            ToolStripComboBox maps = new ToolStripComboBox("Maps");

            maps.SelectedIndexChanged += new EventHandler(OnMappedItemChanged);
            maps.AutoSize              = true;
            maps.DropDownStyle         = ComboBoxStyle.DropDownList;
            maps.DropDownWidth         = 300;

            maps.Items.Add("None");
            maps.ToolTipText = $"Only values with less than {MaxEntriesInCurveToPopulateGridItems} entries are available.";
            maps.AutoToolTip = true;

            foreach (var curve in CurveList.Cast <LogGraphCurveItem>())
            {
                if (m_ItemDatabase.GetItemRowCount(curve.ItemID) > MaxEntriesInCurveToPopulateGridItems)
                {
                    continue;
                }

                maps.Items.Add(curve.ItemID);
                if (curve.ItemID == m_MappedItem)
                {
                    maps.SelectedIndex = maps.Items.Count - 1;
                }
            }

            menuStrip.Items.Add(maps);
        }