private void SetupLogfile()
		{
			if (chkAutoLog.Checked)
			{

				string logPath = Path.Combine(Application.StartupPath, "Logs");
				if (!Directory.Exists(logPath))
					Directory.CreateDirectory(logPath);
				logPath = Path.Combine(logPath, DateTime.Today.ToString("yyyy-MM-dd"));
				if (!Directory.Exists(logPath))
					Directory.CreateDirectory(logPath);
				LogFile = Path.Combine(logPath, "Log_" + DateTime.Now.ToString("HH\\hmm\\mss\\s") + ".log.xml");
			}
			
			if (bbLogFile != (string)txtLogFile.Tag)
			{
				if (tbsw != null)
				{
					tbsw.Close();
				}
				tbsw = new XmlTextBoxStreamWriter(txtOutputLog, bbLogFile, 1024);
				//tbsw.LogFileVerbosityThreshold = (int)nudVerbosityLogFile.Value;
				tbsw.VerbosityThreshold = (int)nudVerbosity.Value;
				log = new LogWriter(tbsw);
				if(blackboard != null)
					blackboard.Log = log;
			}
		}
		private void SetupBlackboard()
		{
			SetupLogfile();
			tbsw = new XmlTextBoxStreamWriter(txtOutputLog, bbLogFile, 1024);
			tbsw.AppendDate = true;
			log = new LogWriter(tbsw);
			processManager = new ModuleProcessManager(log);
			txtOutputLog.Clear();
			lvwRedirectionHistory.Items.Clear();
			txtOutputLog.AppendText("Loading Blackboard\r\n");
			blackboard = Blackboard.FromXML(ConfigFile, log);
			blackboard.VerbosityLevel = 1;
			//blackboard = Blackboard.FromXML("bb.xml");
			LoadPlugins();
			interactionTool.Blackboard = blackboard;
			SetupBlackboardModules();
			SetupBlackboardEvents();
			//tcLog.Enabled = true;
			BlackboardControlsEnabled = true;
			txtOutputLog.AppendText("Blackboard loaded\r\n");
			
			if(chkAutostart.Checked)
			Start();
		}