public SolarLogMonitoringThread(String _URL, ConsoleOutputLogger COL, ConcurrentQueue<SolarLogDataSet> EventQueue, Int32 UpdateTime = 10000)
 {
     URL = _URL;
     SolarLogUpdateTime = UpdateTime;
     ConsoleOutputLogger = COL;
     iQueue = EventQueue;
 }
Exemple #2
0
 public ActorReswitching(XS1Configuration configuration, ConsoleOutputLogger Logger, List<String> BlackList, List<String> OWOList)
 {
     XS1_Configuration = configuration;
     TemporaryBlacklist = BlackList;
     OnWaitOffList = OWOList;
     ConsoleOutputLogger = Logger;
 }
Exemple #3
0
 public XS1MonitoringThread(String _ServerName, ConsoleOutputLogger Logger, String _Username, String _Password, ConcurrentQueue<XS1_DataObject> _Queue)
 {
     ServerName = _ServerName;
     UserName = _Username;
     Password = _Password;
     ConsoleOutputLogger = Logger;
     iQueue = _Queue;
 }
Exemple #4
0
 public MAXMonitoringThread(String _Hostname, Int32 _Port, ConsoleOutputLogger COL, ConcurrentQueue<IDeviceDiffSet> EventQueue, Int32 UpdateTime = 10000)
 {
     Hostname = _Hostname;
     Port = _Port;
     MAXUpdateTime = UpdateTime;
     ConsoleOutputLogger = COL;
     iQueue = EventQueue;
     LastReStoring = DateTime.Now;
 }
Exemple #5
0
 public HttpServer(Int32 HTTP_Port, String HTTP_ListeningIP, String HTTP_DocumentRoot, TinyOnDiskStorage _Storage, XS1Configuration _XS1_Configuration, ConsoleOutputLogger Logger, MAXMonitoringThread _ELVMAXMonitoringThread)
 {
     HTTPServer_Port = HTTP_Port;
     HTTPServer_ListeningIP = HTTP_ListeningIP;
     HTTPServer_DocumentRoot = HTTP_DocumentRoot;
     Storage = _Storage;
     XS1_Configuration = _XS1_Configuration;
     ConsoleOutputLogger = Logger;
     ELVMAXMonitoringThread = _ELVMAXMonitoringThread;
 }
Exemple #6
0
 /// <summary>
 /// Each HTTP processor object handles one client.  If Keep-Alive is enabled then this
 /// object will be reused for subsequent requests until the client breaks keep-alive.
 /// This usually happens when it times out.  Because this could easily lead to a DoS
 /// attack, we keep track of the number of open processors and only allow 100 to be
 /// persistent active at any one time.  Additionally, we do not allow more than 500
 /// outstanding requests.
 /// </summary>
 /// <param name="docRoot">Root-Directory of the HTTP Server</param>
 /// <param name="s">the Socket to work with</param>
 /// <param name="webserver">the "master" HttpServer Object of this Client</param>
 public HttpProcessor(Socket s, String HTTP_DocumentRoot, TinyOnDiskStorage Storage, XS1Configuration _XS1_Configuration, ConsoleOutputLogger Logger, MAXMonitoringThread ELVMAXMonitoring)
 {
     this.s = s;
     HTTPServer_DocumentRoot = HTTP_DocumentRoot;
     JSON_Data = new JSONData(Storage,Logger);
     docRootFile = new FileInfo(HTTPServer_DocumentRoot);
     headers = new Hashtable();
     XS1_Configuration = _XS1_Configuration;
     ConsoleOutputLogger = Logger;
     internal_proxy = new HTTPProxy(ConsoleOutputLogger,ELVMAXMonitoring);
     ELVMAX = ELVMAXMonitoring;
     SensorDataStore = Storage;
 }
Exemple #7
0
        private ConcurrentQueue<XS1_DataObject> XS1_DataQueue; // use a thread safe list like structure to hold the messages coming in from the XS1

        #endregion Fields

        #region Constructors

        public LoggingThread(String _ServerName, ConsoleOutputLogger Logger,TinyOnDiskStorage _actor_store, TinyOnDiskStorage _sensor_store, TinyOnDiskStorage _unknown_store, String _Username, String _Password, Int32 _ConfigurationCacheMinutes)
        {
            actor_data_store = _actor_store;
            sensor_data_store = _sensor_store;
            unknown_data_store = _unknown_store;
            ServerName = _ServerName;
            UserName = _Username;
            Password = _Password;
            ConfigurationCacheMinutes = _ConfigurationCacheMinutes;
            ConsoleOutputLogger = Logger;
            XS1_DataQueue = new ConcurrentQueue<XS1_DataObject>();
            MAX_DataQueue = new ConcurrentQueue<IDeviceDiffSet>();
            SolarLog_DataQueue = new ConcurrentQueue<SolarLogDataSet>();
        }
Exemple #8
0
        public static SolarLogDataSet UpdateSolarLog(String URL, ConsoleOutputLogger COL)
        {
            SolarLogDataSet Output = new SolarLogDataSet();;

            // create a web client and get the data
            String fullURL = "http://"+URL+"/min_cur.js?nocache";

            WebClient client = new WebClient ();

            try
            {
                String SolarLogValue = client.DownloadString(fullURL);

                // hurray, we got a string!
                // let's parse it!

                String[] LbL = SolarLogValue.Replace("\r","").Split(new char[] {'\n'});

                foreach(String _line in LbL)
                {
                    #region Pac
                    if (_line.StartsWith("var Pac="))
                    {
                        Output.Pac = Convert.ToInt32(_line.Replace("var Pac=",""));
                    }
                    #endregion

                    #region aPdc
                    if (_line.StartsWith("var aPdc="))
                    {
                        String firstpart_removed = _line.Replace("var aPdc=new Array(","");
                        Output.aPdc = Convert.ToInt32( firstpart_removed.Remove(firstpart_removed.IndexOf(',')));
                    }
                    #endregion
                }
            }
            catch(Exception e)
            {
                COL.WriteLine("SolarLog Exception: "+e.Message);
                return null;
            }

            return Output;
        }
Exemple #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="xs1_data_logging.SensorCheck"/> class.
 /// </summary>
 public SensorCheck(ConsoleOutputLogger Logger)
 {
     ConsoleOutputLogger = Logger;
 }
Exemple #10
0
 public ScriptingTimerThread(LoggingThread __LoggingThreadInstance, ConsoleOutputLogger Logger)
 {
     _LoggingThreadInstance = __LoggingThreadInstance;
     ConsoleOutputLogger = Logger;
 }
Exemple #11
0
 public ServiceMonitor(ConsoleOutputLogger COL)
 {
     ConsoleOutputLogger = COL;
 }
Exemple #12
0
 public HTTPProxy(ConsoleOutputLogger Logger, MAXMonitoringThread ELVMAXMonitoringThread)
 {
     ConsoleOutputLogger = Logger;
     ELVMAX = ELVMAXMonitoringThread;
 }