コード例 #1
0
ファイル: analyticConsole.cs プロジェクト: gorangrubic/imbWEM
        /// <summary>
        /// Method of menu option CrawlerComment (key:crawlerComment). <args> expects param: comment:String;signatureSufix:String;appendSufix:Boolean;
        /// </summary>
        /// <param name="args"><seealso cref="aceOperationArgs"/> requered parameters:  comment:String;signatureSufix:String;appendSufix:Boolean;</param>
        /// <remarks>
        /// <para>It will add comment line into crawler settings and set signature sufix that is used for experiment session crawler signature</para>
        /// <para>Use this command to add text about specific customizations made to the crawler instance</para>
        /// <para>Message if item disabled: (disabled)</para>
        /// </remarks>
        /// <seealso cref="aceOperationSetExecutorBase"/>
        public void aceOperation_configCrawlerComment(aceOperationArgs args)
        {
            string comment        = args.Get <string>("comment");
            string signatureSufix = args.Get <string>("signatureSufix");
            bool   appendSufix    = args.Get <bool>("appendSufix");

            response.log("CrawlerComment with comment=" + comment + ", signatureSufix =" + signatureSufix + ", appendSufix=" + appendSufix + ".");

            state.crawler.settings.Comment = state.crawler.settings.Comment.addLine(comment);
            if (appendSufix)
            {
                state.crawler.settings.SignatureSufix = state.crawler.settings.SignatureSufix.add(signatureSufix, "|");
            }
            else
            {
                state.crawler.settings.SignatureSufix = signatureSufix;
            }
        }
コード例 #2
0
ファイル: analyticConsole.cs プロジェクト: gorangrubic/imbWEM
        /// <summary>
        /// Method of menu option CrawlerSet (key:crawlerSet). <args> expects param: par:String;newValue:Double;debug:Boolean;
        /// </summary>
        /// <param name="args"><seealso cref="aceOperationArgs"/> requered parameters:  par:String;newValue:Double;debug:Boolean;</param>
        /// <remarks>
        /// <para>It will pharse the parameters and change crawler configuration from default settings to specified ones</para>
        /// <para>Use this command to change configuration of the current crawler</para>
        /// <para>Message if item disabled: (disabled)</para>
        /// </remarks>
        /// <seealso cref="aceOperationSetExecutorBase"/>
        public void aceOperation_configCrawlerSet(aceOperationArgs args)
        {
            string par           = args.Get <string>("par");
            double newValue      = args.Get <double>("newValue");
            bool   appendComment = args.Get <bool>("appendComment");

            bool changed = false;

            if (state.crawler == null)
            {
                response.log("No current crawler specified");
            }

            var pi = state.crawler.getProperty(par);

            if (pi == null)
            {
                response.log("ERROR: Parameter [" + par + "] not found at crawler [" + state.crawler.name + "]");
            }
            else
            {
                double oldValue = state.crawler.imbGetPropertySafe(par, 0).imbConvertValueSafeTyped <double>();
                state.crawler.imbSetPropertyConvertSafe(pi, newValue);

                double curValue = state.crawler.imbGetPropertySafe <double>(pi);

                changed = (newValue != curValue);

                if (changed)
                {
                    response.log("Parameter [" + par + $"] not changed [old:{oldValue}] [in:{newValue}] [final:{curValue}] {state.crawler.name}");
                }
                else
                {
                    response.log($"Parameter [{par}] changed from {oldValue} to {newValue} at crawler [{state.crawler.name}]");
                    state.crawler.settings.Comment        = state.crawler.settings.Comment.addLine($"[{par}] set to: {newValue}  (def: {oldValue})");
                    state.crawler.settings.SignatureSufix = state.crawler.settings.SignatureSufix.add($"{par}{newValue}", "|");
                }
            }
        }
コード例 #3
0
ファイル: analyticConsole.cs プロジェクト: gorangrubic/imbWEM
        /// <summary>
        /// Method of menu option pageIndex (key:pageIndex). <args> expects param: operation:indexPageTableOperation;sourceFile:String;debug:Boolean;
        /// </summary>
        /// <param name="args"><seealso cref="aceOperationArgs"/> requered parameters:  operation:indexPageTableOperation;sourceFile:String;debug:Boolean;</param>
        /// <remarks>
        /// <para>It will propt for secondary command if not specified by parameters</para>
        /// <para>Performs management operations over page index data table</para>
        /// <para>Message if item disabled: (disabled)</para>
        /// </remarks>
        /// <seealso cref="aceOperationSetExecutorBase"/>
        public void aceOperation_runpageIndex(aceOperationArgs args)

        {
            indexPageTableOperation operation = args.Get <indexPageTableOperation>("operation");

            string sourceFile = args.Get <string>("sourceFile");
            bool   ok         = false;
            string sufix      = "";

            if (state.sampleList.Any())
            {
                sufix = " (Active sample: " + state.sampleList.Count + ")";
            }
            if (operation == indexPageTableOperation.none)
            {
                operation = aceTerminalInput.askForEnum <indexPageTableOperation>("Select indexPage operation to perform", indexPageTableOperation.none);
            }
            if (operation == indexPageTableOperation.loadReviewedTable)
            {
                if (!File.Exists(imbWEMManager.index.folder.pathFor(sourceFile)))
                {
                    var files = imbWEMManager.index.folder.findFiles("*.xlsx|*.csv", SearchOption.TopDirectoryOnly, true);
                    sourceFile = aceTerminalInput.askForOption("Select data table file for operation: " + operation.ToString() + "", files.First(), files, null).toStringSafe();
                }

                ok = File.Exists(imbWEMManager.index.folder.pathFor(sourceFile));
            }
            else
            {
                ok = aceTerminalInput.askYesNo("Are you sure to: " + operation.ToString() + "? " + sufix, false);
            }

            if (ok)
            {
                imbWEMManager.index.ExecuteIndexPageOperation(operation, sourceFile, state.sampleList, output);
            }
        }
コード例 #4
0
ファイル: analyticConsole.cs プロジェクト: gorangrubic/imbWEM
 /// <summary>
 /// Method of menu option ImportSample (key:importSample). <args> expects param: word:String;steps:Int32;debug:Boolean;
 /// </summary>
 /// <param name="args"><seealso cref="aceOperationArgs"/> requered parameters:  word:String;steps:Int32;debug:Boolean;</param>
 /// <remarks>
 /// <para>It loads specified txt file found in the console project and loads domains specified there into state sample list</para>
 /// <para>Importing domain sample list from txt file</para>
 /// <para>Message if item disabled: (disabled)</para>
 /// </remarks>
 /// <seealso cref="aceOperationSetExecutorBase"/>
 public void aceOperation_defineImportSample(aceOperationArgs args)
 {
     workspace.sampleAcceptAndPrepare(args.Get <string>("filename"), args.Get <bool>("fileHasPriority"), args.Get <string>("group_tags"), args.Get <int>("limit"), args.Get <int>("skip"), indexDomainContentEnum.none, indexPageEvaluationEntryState.none, args.Get <string>("samplename"));
 }