示例#1
0
文件: Plugin.cs 项目: KOpenMOS/Mos
        public void InitPlugin(string[] args)
        {
            // start ..
            Log.Info("InitPlugin() called with args = {0}", (args == null) ? "" : string.Join(", ", args));

            // .. with built-in options
            options = AasxPluginGenericForms.GenericFormOptions.CreateDefault();

            // try load defaults options from assy directory
            try
            {
                // need special settings
                var settings = AasxPluginOptionSerialization.GetDefaultJsonSettings(
                    new[] { typeof(AasxPluginGenericForms.GenericFormOptions), typeof(AasForms.FormDescBase) });

                // base options
                var newOpt =
                    AasxPluginOptionsBase.LoadDefaultOptionsFromAssemblyDir <AasxPluginGenericForms.GenericFormOptions>(
                        this.GetPluginName(), Assembly.GetExecutingAssembly(), settings);
                if (newOpt != null)
                {
                    this.options = newOpt;
                }

                // try find additional options
                this.options.TryLoadAdditionalOptionsFromAssemblyDir <AasxPluginGenericForms.GenericFormOptions>(
                    this.GetPluginName(), Assembly.GetExecutingAssembly(), settings);
            }
            catch (Exception ex)
            {
                Log.Error(ex, "Exception when reading default options {1}");
            }
        }
        public AasxPluginActionDescriptionBase[] ListActions()
        {
            Log.Info("ListActions() called");
            var res = new List <AasxPluginActionDescriptionBase>();

            res.Add(new AasxPluginActionDescriptionBase("get-licenses", "Reports about used licenses."));
            res.Add(new AasxPluginActionDescriptionBase("create-client",
                                                        "Creates a OPC UA client and returns as plain object. Arguments: (string _endpointURL, "
                                                        + "bool _autoAccept, int _stopTimeout, string _userName, string _password)."));
            res.Add(new AasxPluginActionDescriptionBase("read-sme-value",
                                                        "Reads a value and returns as plain object. Arguments: (UASampleClient client, string nodeName, "
                                                        + "int index)."));
            return(res.ToArray());
        }
示例#3
0
 public override async Task <bool> ShowAsync()
 {
     if (ask)
     {
         message += " (y/n, default y): ";
         logger.Info("{0}", message);
         Console.Write(message);
     }
     else
     {
         logger.Info("{0}", message);
         Console.WriteLine(message);
     }
     if (ask)
     {
         // always say yes!
         return(await Task.FromResult(true));
     }
     return(await Task.FromResult(true));
 }
        public void InitPlugin(string[] args)
        {
            // start ..
            Log.Info("InitPlugin() called with args = {0}", (args == null) ? "" : string.Join(", ", args));

            // .. with built-in options
            options = AasxPluginExportTable.ExportTableOptions.CreateDefault();

            // try load defaults options from assy directory
            try
            {
                var newOpt =
                    AasxPluginOptionsBase.LoadDefaultOptionsFromAssemblyDir <AasxPluginExportTable.ExportTableOptions>(
                        this.GetPluginName(), Assembly.GetExecutingAssembly());
                if (newOpt != null)
                {
                    this.options = newOpt;
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex, "Exception when reading default options {1}");
            }
        }
示例#5
0
 public string GetPluginName()
 {
     logger.Info("GetPluginName() = {0}", "Net46AasxServerPlugin");
     return("AasxPluginUaNetServer");
 }
示例#6
0
 public string GetPluginName()
 {
     Log.Info("GetPluginName() = {0}", "MtpViewer");
     return("AasxPluginMtpViewer");
 }
示例#7
0
 public string GetPluginName()
 {
     _log.Info("GetPluginName() = {0}", "AasxPluginKnownSubmodels");
     return("AasxPluginKnownSubmodels");
 }
 public void InitPlugin(string[] args)
 {
     // start ..
     Log.Info("InitPlugin() called with args = {0}", (args == null) ? "" : string.Join(", ", args));
 }
 public string GetPluginName()
 {
     Log.Info("GetPluginName() = {0}", "ImageMap");
     return("AasxPluginImageMap");
 }
示例#10
0
 public string GetPluginName()
 {
     Log.Info("GetPluginName() = {0}", "EmptySample");
     return("EmptySample");
 }