Пример #1
0
        /// <summary>
        /// Devuelve una instancia de ControlPanelEditor.
        /// </summary>
        public PanelEditorControl()
        {
            InitializeComponent();

            _panel   = null;
            _library = null;
            // _system = null;
            _mode = PanelModes.Empty;
        }
Пример #2
0
/**
 * @param modeToGet: The mode of the panel that is desired
 * @return Panel in PanelList with mode that is equal to <modeToGet>. If none are found, returns null.
 * @details Allows the user to get a Panel by its PanelMode value
 */
    public static Panel GetPanelByMode(PanelModes modeToGet)
    {
        foreach (Panel current in PanelList)
        {
            if (current.PanelMode == modeToGet)
            {
                return(current);
            }
        }
        return(null);
    }
Пример #3
0
        /// <summary>
        /// Devuelve una instancia de ControlPanelEditor.
        /// </summary>
        public PanelEditorControl(OTCPanel Panel, OTCLibrary Library)
        {
            InitializeComponent();

            _panel   = Panel;
            _library = Library;
            // _system = null;
            _mode = PanelModes.Design;

            Redraw();
        }
Пример #4
0
        /// <summary>
        /// Devuelve una instancia de ControlPanelEditor.
        /// </summary>
        public PanelEditorControl(OTCLibrary Library, OTCSystem System)
        {
            InitializeComponent();

            _panel   = null;
            _library = Library;
            // _system = System;
            _mode = PanelModes.Empty;

            Redraw();
        }
Пример #5
0
    public Panel(Vector2f size, Vector2f position, PanelModes modeRef)
    {
        PanelShape = new RectangleShape(size);
        PanelShape.OutlineColor     = new Color(0, 0, 0);
        PanelShape.FillColor        = FillColor_Inactive;
        PanelShape.OutlineThickness = 2;
        PanelShape.Origin           = new Vector2f(PanelShape.GetLocalBounds().Width / 2f, PanelShape.GetLocalBounds().Top);
        PanelShape.Position         = position;

        PanelMode = modeRef;
        IsActive  = false;
        PanelList.Add(this);
    }
Пример #6
0
            /// <summary>
            /// Инициализация (создание/размещение) дочерних элементов управления
            /// </summary>
            /// <param name="listTEC">Список ТЭЦ</param>
            /// <param name="listDiagnosticParameter">Список с параметрами диагностики (БД конфигурации)</param>
            /// <param name="listDiagnosticSource">Список контролируемых источников данных (БД конфигурации)</param>
            private void initialize(List <TEC> listTEC
                                    , List <DIAGNOSTIC_PARAMETER> listDiagnosticParameter
                                    , ListDiagnosticSource listDiagnosticSource)
            {
                int i = -1;
                ListDiagnosticParameter listDiagParam;
                ListDiagnosticSource    listDiagSrc;

                InitComponents();
                // 1 DataGridView(Модес-Центр) + на каждую ТЭЦ по DataGridView -6 шт(Модес-Терминал)
                m_arPanels = new PanelModes[listTEC.Count + 1];
                // добавляем 'DataGridView' Modes-Centre - подготовка конфигурациооных списков
                i             = 0;
                listDiagParam = new ListDiagnosticParameter(listDiagnosticParameter.FindAll(item => { return(item.m_name_shr == @"Modes-Centre"); }));
                listDiagParam = new ListDiagnosticParameter(listDiagParam.OrderBy(item => item.m_id));
                listDiagSrc   = new ListDiagnosticSource(listDiagnosticSource.FindAll(item => { return(item.m_description == @"Modes-Centre"); }));
                listDiagSrc   = new ListDiagnosticSource(listDiagSrc.OrderBy(item => item.m_id_component));
                // добавляем 'DataGridView' Modes-Centre - создание панели
                m_arPanels[i] = new PanelModes(listTEC, listDiagParam, listDiagSrc);
                // добавляем 'DataGridView' Modes-Centre - размещение панели
                this.Controls.Add(m_arPanels[i], 0, 0); this.SetRowSpan(m_arPanels[i], 2);

                //Для массива панелей
                for (i = 1; i < m_arPanels.Length; i++)
                {
                    if (m_arPanels[i] == null)
                    {
                        // добавляем 'DataGridView' Modes-Terminal - подготовка конфигурациооных списков
                        listDiagParam = new ListDiagnosticParameter(listDiagnosticParameter.FindAll(item => { return(item.m_name_shr == @"Modes-term"); }));
                        listDiagParam = new ListDiagnosticParameter(listDiagParam.OrderBy(item => item.m_id));
                        listDiagSrc   = new ListDiagnosticSource();
                        foreach (DIAGNOSTIC_SOURCE diagSrc in listDiagnosticSource)
                        {
                            // "-1", т.к. начинали с "1"
                            foreach (TECComponent comp in listTEC[i - 1].ListTECComponents)
                            {
                                if ((comp.IsGTP == true) &&
                                    (diagSrc.m_id_component == comp.m_id))
                                {
                                    listDiagSrc.Add(diagSrc);
                                }
                                else
                                {
                                    ;
                                }
                            }
                        }
                        listDiagSrc = new ListDiagnosticSource(listDiagSrc.OrderBy(item => item.m_id_component));
                        // добавляем 'DataGridView' Modes-Terminal - создание панели
                        m_arPanels[i] = new PanelModes(new List <TEC>()
                        {
                            listTEC[i - 1]
                        }, listDiagParam, listDiagSrc);
                        // добавляем 'DataGridView' Modes-Terminal - размещение панели
                        this.Controls.Add(m_arPanels[i], ((i - 1) % (COUNT_LAYOUT_COLUMN - 1)) + 1, (i - 1) / (COUNT_LAYOUT_COLUMN - 1));
                    }
                    else
                    {
                        ;
                    }
                }

                //try {
                //    IEnumerable<DIAGNOSTIC_SOURCE> enumModes = (from r in m_listDiagnosticSource
                //        where r.m_id >= (int)INDEX_SOURCE.MODES && r.m_id < (int)INDEX_SOURCE.TASK
                //        orderby r.m_id
                //        select new DIAGNOSTIC_SOURCE()
                //        {
                //            m_id = r.m_id
                //            , m_name_shr = r.m_name_shr
                //            , m_id_component = r.m_id_component
                //            , m_description = r.m_description
                //        }).Distinct();

                //    foreach (var item in enumModes)
                //        if (item.m_description.Equals(@"Modes-Centre") == true)
                //            createItemModesCentre();
                //        else
                //            createItemModesTerminal(item.m_id);
                //} catch (Exception e) {
                //    Logging.Logg().Exception(e, @"", Logging.INDEX_MESSAGE.NOT_SET);
                //}
            }
Пример #7
0
 private void lnkShowConfiguration_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     PanelMode = PanelModes.Configuration;
 }
Пример #8
0
 private void lnkBackToBrowser_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     PanelMode = PanelModes.WebBrowser;
 }
Пример #9
0
 public void showSettingsPanel()
 {
     PanelMode = PanelModes.Configuration;
 }
Пример #10
0
        public void showHome(bool isClosing)
        {
            // Do we have a valid web server address?
             if (m_ServerDetails.WebClientURL == "")
             {
            // No - show the configuration UI
            PanelMode = PanelModes.Configuration;
             }
             else
             {
            // Yes - navigate to the home template
            string theURI = string.Format(@"{0}{1}myAlfresco?p=&e=doc", m_ServerDetails.WebClientURL, m_TemplateRoot);
            // We don't prompt the user if the document is closing
            string strAuthTicket = m_ServerDetails.getAuthenticationTicket(!isClosing);
            /**
             * Long ticket fix - the encoded ticket is 2426 characters long, therefore has to be sent
             * as an HTTP header to avoid the IE6 and IE7 2048 character limit on a GET URL
             */
            string strAuthHeader = "";
            if ((strAuthTicket != "") && (strAuthTicket != "ntlm"))
            {
               if ((Uri.EscapeDataString(strAuthTicket).Length + theURI.Length)  > 1024)
               {
                  strAuthHeader = "ticket: " + strAuthTicket;
               }
               else
               {
                  theURI += "&ticket=" + strAuthTicket;
               }
            }
            if ((strAuthTicket == "") && !isClosing)
            {
               PanelMode = PanelModes.Configuration;
               return;
            }

            if (m_ClearSession)
            {
               m_ClearSession = false;
               InternetSetOption(0, INTERNET_OPTION_END_BROWSER_SESSION, null, 0);
            }

            if (!isClosing || (strAuthTicket != ""))
            {
               webBrowser.ObjectForScripting = this;
               UriBuilder uriBuilder = new UriBuilder(theURI);
               webBrowser.Navigate(uriBuilder.Uri.AbsoluteUri, null, null, strAuthHeader);
               PanelMode = PanelModes.WebBrowser;
            }
             }
        }
Пример #11
0
        public void showDocumentDetails()
        {
            string relativePath = "";

             // Do we have a valid web server address?
             if (m_ServerDetails.WebClientURL == "")
             {
            // No - show the configuration UI
            PanelMode = PanelModes.Configuration;
             }
             else
             {
            m_ServerDetails.DocumentPath = m_WordApplication.ActiveDocument.FullName;
            relativePath = m_ServerDetails.DocumentPath;

            if (relativePath.Length > 0)
            {
               if (!relativePath.StartsWith("/"))
               {
                  relativePath = "/" + relativePath;
               }
               // Strip off any additional parameters
               int paramPos = relativePath.IndexOf("?");
               if (paramPos != -1)
               {
                  relativePath = relativePath.Substring(0, paramPos);
               }
            }
            string theURI = string.Format(@"{0}{1}documentDetails?p={2}&e=doc", m_ServerDetails.WebClientURL, m_TemplateRoot, relativePath);
            string strAuthTicket = m_ServerDetails.getAuthenticationTicket(true);
            /**
             * Long ticket fix - the encoded ticket is 2426 characters long, therefore has to be sent
             * as an HTTP header to avoid the IE6 and IE7 2048 character limit on a GET URL
             */
            string strAuthHeader = "";
            if ((strAuthTicket != "") && (strAuthTicket != "ntlm"))
            {
               if ((Uri.EscapeDataString(strAuthTicket).Length + theURI.Length) > 1024)
               {
                  strAuthHeader = "ticket: " + strAuthTicket;
               }
               else
               {
                  theURI += "&ticket=" + strAuthTicket;
               }
            }
            if (strAuthTicket == "")
            {
               PanelMode = PanelModes.Configuration;
               return;
            }

            if (m_ClearSession)
            {
               m_ClearSession = false;
               InternetSetOption(0, INTERNET_OPTION_END_BROWSER_SESSION, null, 0);
            }

            webBrowser.ObjectForScripting = this;
            UriBuilder uriBuilder = new UriBuilder(theURI);
            webBrowser.Navigate(uriBuilder.Uri.AbsoluteUri, null, null, strAuthHeader);
            PanelMode = PanelModes.WebBrowser;
             }
        }
Пример #12
0
 private void lnkShowConfiguration_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     PanelMode = PanelModes.Configuration;
 }
Пример #13
0
 private void lnkBackToBrowser_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     PanelMode = PanelModes.WebBrowser;
 }
Пример #14
0
 public void showHome(bool isClosing)
 {
     // Do we have a valid web server address?
      if (m_ServerDetails.WebClientURL == "")
      {
     // No - show the configuration UI
     PanelMode = PanelModes.Configuration;
      }
      else
      {
     // Yes - navigate to the home template
     string theURI = string.Format(@"{0}{1}myAlfresco?p=&e=doc", m_ServerDetails.WebClientURL, m_TemplateRoot);
     // We don't prompt the user if the document is closing
     string strAuthTicket = m_ServerDetails.getAuthenticationTicket(!isClosing);
     if (strAuthTicket != "")
     {
        theURI += "&ticket=" + strAuthTicket;
     }
     if (!isClosing || (strAuthTicket != ""))
     {
        webBrowser.ObjectForScripting = this;
        UriBuilder uriBuilder = new UriBuilder(theURI);
        webBrowser.Navigate(uriBuilder.Uri.AbsoluteUri);
        PanelMode = PanelModes.WebBrowser;
     }
      }
 }
Пример #15
0
 public void showDocumentDetails(string relativePath)
 {
     // Do we have a valid web server address?
      if (m_ServerDetails.WebClientURL == "")
      {
     // No - show the configuration UI
     PanelMode = PanelModes.Configuration;
      }
      else
      {
     if (relativePath.Length > 0)
     {
        if (!relativePath.StartsWith("/"))
        {
           relativePath = "/" + relativePath;
        }
        // Strip off any additional parameters
        int paramPos = relativePath.IndexOf("?");
        if (paramPos != -1)
        {
           relativePath = relativePath.Substring(0, paramPos);
        }
     }
     string theURI = string.Format(@"{0}{1}documentDetails?p={2}&e=doc", m_ServerDetails.WebClientURL, m_TemplateRoot, relativePath);
     string strAuthTicket = m_ServerDetails.getAuthenticationTicket(true);
     if (strAuthTicket != "")
     {
        theURI += "&ticket=" + strAuthTicket;
     }
     webBrowser.ObjectForScripting = this;
     UriBuilder uriBuilder = new UriBuilder(theURI);
     webBrowser.Navigate(uriBuilder.Uri.AbsoluteUri);
     PanelMode = PanelModes.WebBrowser;
      }
 }