public void SetConfiguration(PluginV1 cf)
 {
     textBox4.Text  = cf.STORAGE[ConfigurationDictionary._STORAGE_USER_ID].ToString();
     textBox1.Text  = cf.STORAGE[ConfigurationDictionary._STORAGE_BOT_PATH].ToString();
     textBox2.Text  = cf.STORAGE[ConfigurationDictionary._STORAGE_BOT_SAVE_PATH].ToString();
     textBox5.Text  = cf.STORAGE[ConfigurationDictionary._STORAGE_BOT_DEFAULT_ANSWER_MESSAGE].ToString();
     comboBox1.Text = cf.STORAGE[ConfigurationDictionary._STORAGE_BOT_DEFAULT_LANGUAGE].ToString();
     textBox8.Text  = cf.STORAGE[ConfigurationDictionary._STORAGE_BOT_ROBOTTYPE].ToString();
     textBox7.Text  = cf.STORAGE[ConfigurationDictionary._STORAGE_BOT_RESPONSE_VARIABLE].ToString();
     ucScriptResponseSynbot.Value = cf.STORAGE[ConfigurationDictionary._STORAGE_BOT_RESPONSE_SCRIPT_VALUE].ToString();
     ucScriptResponseSynbot.XML   = cf.STORAGE[ConfigurationDictionary._STORAGE_BOT_RESPONSE_SCRIPT_XML].ToString();
     checkBox3.Checked            = Convert.ToBoolean(cf.STORAGE[ConfigurationDictionary._STORAGE_BOT_FLAG_SPEAK_RESPONSE]);
     checkBox1.Checked            = Convert.ToBoolean(cf.STORAGE[ConfigurationDictionary._STORAGE_BOT_FLAG_SPEAK_EZB]);
     checkBox2.Checked            = Convert.ToBoolean(cf.STORAGE[ConfigurationDictionary._STORAGE_BOT_FLAG_EXEC_BOTCOMMAND]);
     textBox10.Text         = cf.STORAGE[ConfigurationDictionary._STORAGE_SYNBOTSERVER_IPADRESS].ToString();
     textBox11.Text         = cf.STORAGE[ConfigurationDictionary._STORAGE_SYNBOTSERVER_TCPPORT].ToString();
     ucScriptBotStart.Value = cf.STORAGE[ConfigurationDictionary._STORAGE_BOT_START_SCRIPT_VALUE].ToString();
     ucScriptBotStart.XML   = cf.STORAGE[ConfigurationDictionary._STORAGE_BOT_START_SCRIPT_XML].ToString();
     ucScriptBotStop.Value  = cf.STORAGE[ConfigurationDictionary._STORAGE_BOT_STOP_SCRIPT_VALUE].ToString();
     ucScriptBotStop.XML    = cf.STORAGE[ConfigurationDictionary._STORAGE_BOT_STOP_SCRIPT_XML].ToString();
     textBox17.Text         = cf.STORAGE[ConfigurationDictionary._STORAGE_BOT_WELCOME_MESSAGE].ToString();
     textBox16.Text         = cf.STORAGE[ConfigurationDictionary._STORAGE_BOT_INIT_EVENT].ToString();
     textBox6.Text          = cf.STORAGE[ConfigurationDictionary._STORAGE_BOT_BEFORE_STOP_EVENT].ToString();
     checkBox4.Checked      = Convert.ToBoolean(cf.STORAGE[ConfigurationDictionary._STORAGE_BOT_FLAG_FULLLOG]);
 }
        public PluginV1 GetConfiguration()
        {
            PluginV1 cf = new PluginV1();

            cf.STORAGE.AddOrUpdate(ConfigurationDictionary._STORAGE_USER_ID, textBox4.Text);
            cf.STORAGE.AddOrUpdate(ConfigurationDictionary._STORAGE_BOT_PATH, textBox1.Text);
            cf.STORAGE.AddOrUpdate(ConfigurationDictionary._STORAGE_BOT_SAVE_PATH, textBox2.Text);
            cf.STORAGE.AddOrUpdate(ConfigurationDictionary._STORAGE_BOT_DEFAULT_ANSWER_MESSAGE, textBox5.Text);
            cf.STORAGE.AddOrUpdate(ConfigurationDictionary._STORAGE_BOT_DEFAULT_LANGUAGE, comboBox1.Text);
            cf.STORAGE.AddOrUpdate(ConfigurationDictionary._STORAGE_BOT_ROBOTTYPE, textBox8.Text);
            cf.STORAGE.AddOrUpdate(ConfigurationDictionary._STORAGE_BOT_RESPONSE_VARIABLE, textBox7.Text);
            cf.STORAGE.AddOrUpdate(ConfigurationDictionary._STORAGE_BOT_RESPONSE_SCRIPT_VALUE, ucScriptResponseSynbot.Value);
            cf.STORAGE.AddOrUpdate(ConfigurationDictionary._STORAGE_BOT_RESPONSE_SCRIPT_XML, ucScriptResponseSynbot.XML);
            cf.STORAGE.AddOrUpdate(ConfigurationDictionary._STORAGE_BOT_FLAG_SPEAK_RESPONSE, checkBox3.Checked);
            cf.STORAGE.AddOrUpdate(ConfigurationDictionary._STORAGE_BOT_FLAG_SPEAK_EZB, checkBox1.Checked);
            cf.STORAGE.AddOrUpdate(ConfigurationDictionary._STORAGE_BOT_FLAG_EXEC_BOTCOMMAND, checkBox2.Checked);
            cf.STORAGE.AddOrUpdate(ConfigurationDictionary._STORAGE_SYNBOTSERVER_IPADRESS, textBox10.Text);
            cf.STORAGE.AddOrUpdate(ConfigurationDictionary._STORAGE_SYNBOTSERVER_TCPPORT, textBox11.Text);
            cf.STORAGE.AddOrUpdate(ConfigurationDictionary._STORAGE_BOT_START_SCRIPT_VALUE, ucScriptBotStart.Value);
            cf.STORAGE.AddOrUpdate(ConfigurationDictionary._STORAGE_BOT_START_SCRIPT_XML, ucScriptBotStart.XML);
            cf.STORAGE.AddOrUpdate(ConfigurationDictionary._STORAGE_BOT_STOP_SCRIPT_VALUE, ucScriptBotStop.Value);
            cf.STORAGE.AddOrUpdate(ConfigurationDictionary._STORAGE_BOT_STOP_SCRIPT_XML, ucScriptBotStop.XML);
            cf.STORAGE.AddOrUpdate(ConfigurationDictionary._STORAGE_BOT_WELCOME_MESSAGE, textBox17.Text);
            cf.STORAGE.AddOrUpdate(ConfigurationDictionary._STORAGE_BOT_INIT_EVENT, textBox16.Text);
            cf.STORAGE.AddOrUpdate(ConfigurationDictionary._STORAGE_BOT_BEFORE_STOP_EVENT, textBox6.Text);
            cf.STORAGE.AddOrUpdate(ConfigurationDictionary._STORAGE_BOT_FLAG_FULLLOG, checkBox4.Checked);
            return(cf);
        }
Пример #3
0
        public override void SetConfiguration(PluginV1 cf)
        {
            if (!ARC.Scripting.ScriptManager.DoesExecutorExist(Text))
            {
                var s = ARC.Scripting.ScriptManager.GetExecutor(Text);
                s.OnDone   += S_OnDone;
                s.OnError  += S_OnError;
                s.OnResult += S_OnResult;
                s.OnStart  += S_OnStart;
            }

            cf.SCRIPTS.AddIfNotExist(Config.ConfigTitles.SCRIPT_BUTTON_PRESSED, new ARC.Config.Sub.Reusable.ScriptDefinition());

            cf.STORAGE.AddIfNotExist(Config.ConfigTitles.BAUD_RATE_SERIAL, EZ_B.Uart.BAUD_RATE_ENUM.Baud_115200);
            cf.STORAGE.AddIfNotExist(Config.ConfigTitles.BAUD_RATE_UART, 115200);
            cf.STORAGE.AddIfNotExist(Config.ConfigTitles.BAUD_RATE_PC, 115200);
            cf.STORAGE.AddIfNotExist(Config.ConfigTitles.EZB_SERIAL_PORT, EZ_B.Digital.DigitalPortEnum.D0);
            cf.STORAGE.AddIfNotExist(Config.ConfigTitles.EZB_UART_PORT, 0);
            cf.STORAGE.AddIfNotExist(Config.ConfigTitles.PC_COM_PORT, string.Empty);
            cf.STORAGE.AddIfNotExist(Config.ConfigTitles.CONNECTION_TYPE, Config.ConfigTitles.PortTypeEnum.HW_UART);
            cf.STORAGE.AddIfNotExist(Config.ConfigTitles.SENSOR_POLL_TIME_MS, 500);
            cf.STORAGE.AddIfNotExist(Config.ConfigTitles.NMS_POSITION_DATA, true);

            try {
                init();
            } catch (Exception ex) {
                Invokers.SetAppendText(tbLog, true, ex.Message);
            }

            base.SetConfiguration(cf);
        }
Пример #4
0
        public void SetConfiguration(PluginV1 cf)
        {
            _cf = cf;

            CustomConfig customConfig = (CustomConfig)cf.GetCustomObjectV2(typeof(CustomConfig));

            foreach (Servo.ServoPortEnum port in Enum.GetValues(typeof(Servo.ServoPortEnum)))
            {
                if (port >= Servo.ServoPortEnum.V1 && port <= Servo.ServoPortEnum.V99)
                {
                    clbPorts.Items.Add(port, customConfig.VirtualPorts.Contains(port));
                }
            }

            ucUseHardwareUART.Checked = Convert.ToBoolean(cf.STORAGE[ConfigTitles.USE_HARDWARE_UART]);
            cbHardwareUArt.Items.Add(0);
            cbHardwareUArt.Items.Add(1);
            cbHardwareUArt.Items.Add(2);

            cbHardwareUArt.SelectedItem = cf.STORAGE[ConfigTitles.HARDWARE_PORT];

            ucUseComPort.Checked = Convert.ToBoolean(cf.STORAGE[ConfigTitles.USE_COM_PORT]);
            foreach (var port in System.IO.Ports.SerialPort.GetPortNames())
            {
                cbComPort.Items.Add(port);
            }

            cbComPort.SelectedItem = cf.STORAGE[ConfigTitles.COM_PORT].ToString();

            if (cbComPort.Items.Count == 0)
            {
                ucUseComPort.Enabled = false;
            }
        }
Пример #5
0
        public override void SetConfiguration(PluginV1 cf)
        {
            EZ_Builder.Scripting.VariableManager.SetVariable("$TwitterScreenName", string.Empty);
            EZ_Builder.Scripting.VariableManager.SetVariable("$TwitterMessage", string.Empty);
            EZ_Builder.Scripting.VariableManager.SetVariable("$TwitterSuccess", false);

            base.SetConfiguration(cf);
        }
Пример #6
0
        public override void SetConfiguration(PluginV1 cf)
        {
            ARC.Scripting.VariableManager.SetVariable(_VariableIsRunning, false);

            base.SetConfiguration(cf);

            updateRecordingControls();
        }
Пример #7
0
        public ConfigForm(PluginV1 config)
        {
            this.InitializeComponent();
            this.pluginV1 = config;

            this.Setting1TextBox.Text         = config.STORAGE.GetKey(ConfigKeys.Setting1, string.Empty).ToString();
            this.Setting2TextBox.Text         = config.STORAGE.GetKey(ConfigKeys.Setting2, string.Empty).ToString();
            this.UseSomethingCheckBox.Checked = Convert.ToBoolean(config.STORAGE.GetKey(ConfigKeys.UseSomething, false));
        }
Пример #8
0
        public void SetConfiguration(PluginV1 cf, FormMain formMain)
        {
            _cf       = cf;
            _formMain = formMain;

            tbResponseVariable.Text = cf.STORAGE[ConfigTitles.RESPONSE_VARIABLE].ToString();

            ucScriptResponse.Value = cf.STORAGE[ConfigTitles.RESPONSE_SCRIPT].ToString();
            ucScriptResponse.XML   = cf.STORAGE[ConfigTitles.RESPONSE_XML].ToString();

            lblConfigFolder.Text = cf.STORAGE[ConfigTitles.CONFIG_ROOT_FOLDER].ToString();
        }
Пример #9
0
        public override void SetConfiguration(PluginV1 cf)
        {
            cf.STORAGE.AddIfNotExist(ConfigTitles.RESPONSE_VARIABLE, "$BotResponse");
            cf.STORAGE.AddIfNotExist(ConfigTitles.RESPONSE_SCRIPT, string.Empty);
            cf.STORAGE.AddIfNotExist(ConfigTitles.RESPONSE_XML, string.Empty);
            cf.STORAGE.AddIfNotExist(ConfigTitles.CONFIG_ROOT_FOLDER, EZ_Builder.Common.CombinePath(EZ_Builder.Constants.PLUGINS_FOLDER, cf._pluginGUID));

            EZ_Builder.Scripting.VariableManager.SetVariable(cf.STORAGE[ConfigTitles.RESPONSE_VARIABLE].ToString(), string.Empty);

            if (_bot == null)
            {
                try {
                    string configRootFolder = cf.STORAGE[ConfigTitles.CONFIG_ROOT_FOLDER].ToString();

                    string aimlFolder = EZ_Builder.Common.CombinePath(configRootFolder, "aiml");

                    string configFolder = EZ_Builder.Common.CombinePath(configRootFolder, "config");

                    string settingsFile = EZ_Builder.Common.CombinePath(configRootFolder, "config", "Settings.xml");

                    EZ_Builder.Invokers.SetAppendText(tbLog, false, "Loading AIM configuration... ");

                    _bot                   = new AIMLbot.Bot();
                    _bot.PathToAIML        = aimlFolder;
                    _bot.PathToConfigFiles = configFolder;
                    _bot.loadSettings(settingsFile);
                    _bot.loadAIMLFromFiles();
                    _bot.isAcceptingUserInput = true;
                    _bot.WrittenToLog        += _bot_WrittenToLog;

                    _user = new AIMLbot.User("DJ", _bot);

                    EZ_Builder.Invokers.SetAppendText(tbLog, true, "Success!");
                } catch (Exception ex) {
                    EZ_Builder.Invokers.SetAppendText(tbLog, true, ex.ToString());
                }
            }

            base.SetConfiguration(cf);
        }
 public override void SetConfiguration(PluginV1 cf)
 {
     base.SetConfiguration(cf);
 }