Ejemplo n.º 1
0
        public override void Start()
        {
            //Using "Sensor:" to indicate clearly in the log where this line came from.
            logger.Log("Sensor:Started: {0} ", ToString());


            SensorDBService sensorService = new SensorDBService(logger, this);

            serviceHost = new SafeServiceHost(logger, typeof(ISensorContract), sensorService, this, Constants.AjaxSuffix, moduleInfo.BaseURL());
            serviceHost.Open();

            appServer = new WebFileServer(moduleInfo.BinaryDir(), moduleInfo.BaseURL(), logger);


            //........... instantiate the list of other ports that we are interested in
            accessibleSensorPorts = new List <VPort>();

            //..... get the list of current ports from the platform
            IList <VPort> allPortsList = GetAllPortsFromPlatform();

            if (allPortsList != null)
            {
                ProcessAllPortsList(allPortsList);
            }

            this.receivedMessageList = new Queue <string>();


            //gAlertEmailAddress = GetPrivateConfSetting("NotificationEmail");
            gHome_Id = GetConfSetting("HomeId");

            //location to save information
            Directory.CreateDirectory(moduleInfo.WorkingDir());

            //#########test to see if insert (to db) operation works###############
            for (int i = 1; i < 10; i++)
            {
                WriteToDB("_test_", i);
            }
            //#####################################################################
        }
Ejemplo n.º 2
0
        public override void Start()
        {
            //Using "Sensor:" to indicate clearly in the log where this line came from.
            logger.Log("Sensor:Started: {0} ", ToString());
           

            SensorDBService sensorService = new SensorDBService(logger, this);
            serviceHost = new SafeServiceHost(logger, typeof(ISensorContract), sensorService, this, Constants.AjaxSuffix, moduleInfo.BaseURL());
            serviceHost.Open();

            appServer = new WebFileServer(moduleInfo.BinaryDir(), moduleInfo.BaseURL(), logger);


            //........... instantiate the list of other ports that we are interested in
            accessibleSensorPorts = new List<VPort>();

            //..... get the list of current ports from the platform
            IList<VPort> allPortsList = GetAllPortsFromPlatform();

            if (allPortsList != null)
                ProcessAllPortsList(allPortsList);

            this.receivedMessageList = new Queue<string>();
             

            //gAlertEmailAddress = GetPrivateConfSetting("NotificationEmail");
            gHome_Id = GetConfSetting("HomeId");

            //location to save information
            Directory.CreateDirectory(moduleInfo.WorkingDir());

            //#########test to see if insert (to db) operation works###############
            for (int i = 1; i < 10;i++ )
                WriteToDB("_test_", i);
            //#####################################################################
 
        }