removeLogInput() public static method

Removes a loginput connected to the KeyVariableName and removes it from the server_database.
public static removeLogInput ( string keyName, string srv_db ) : void
keyName string
srv_db string
return void
Example #1
0
        /// <summary>
        ///  Resulting Action of editting the List View.
        ///  1) Edit the List Item
        ///  2) Re-log the item
        ///  3) Edit the Matlab workspace.
        /// </summary>
        /// <param name="name"> The new variable name. (or the same)</param>
        /// <param name="start"> The new start time. (or the same)</param>
        /// <param name="end"> The new end time. (or the same)</param>
        /// <param name="previous"></param>
        public void EditLog(string name, string start, string end, LogInput previous)
        {
            MatlabAccess.removeMatlabVariable(previous.getKeyVariableName());
            if (previous.getKeyVariableName() != name)
            {
                name = MatlabAccess.modifyMatlabName(name);
            }
            if (name == string.Empty)
            {
                name = previous.getKeyVariableName();
            }
            string attName = previous.getAttribute();
            string path    = previous.getPath();
            string elem    = previous.getElement();

            //EDIT LIST VIEW
            if (AFAccess.isAbsoluteTimeString(start, end, previous))
            {
                lv_LogDialog.SelectedItems[0].SubItems[3].Text = start + " = " + end;
                lv_LogDialog.SelectedItems[0].Text             = name;
            }
            else
            {
                AFTimeRange range = new AFTimeRange(start, end);
                lv_LogDialog.SelectedItems[0].SubItems[3].Text = range.ToString();
                lv_LogDialog.SelectedItems[0].Text             = name;
            }


            //EDIT ACTUAL LOG
            LogSystem.removeLogInput(previous.getKeyVariableName(), previous.getServerDatabase());

            //Workspace Edit - remove variable, getNewData
            if (path == "PI.Point")
            {
                string[] info = Regex.Split(previous.getServerDatabase(), "'");
                control.getPIData(attName, info[1], name, start, end, false);
            }
            else
            {
                control.getAFData(previous.getServerDatabase(), attName, name, path, start, end, false);
            }
        }
Example #2
0
        /// <summary>
        ///  Removes the log Input from the LogSystem and the list view.
        /// </summary>
        /// <param name="selected"> Unique variable name of list View Item.</param>
        public void DeleteListItem(string selected)
        {
            LogInput logInput = LogSystem.getLogInput(selected);

            LogSystem.removeLogInput(selected, logInput.getServerDatabase());
        }