Beispiel #1
0
 public ProcessFingerEvent()
 {
     m_GPIOInputs               = new List <GPIOObjectProcess>();
     m_GPIOOutputs              = new List <GPIOObjectProcess>();
     m_AccessRights             = 0;
     m_GPIOEnvironmentConnector = null;
 }
        public void Initialize()
        {
            if (m_Environment.ConnectorSEN0188Enable)
            {
                m_Connector_SEN0188.startStreaming += Connector_SEN0188_startStreaming;
                m_Connector_SEN0188.stopStreaming  += Connector_SEN0188_stopStreaming;

                m_Connector_SEN0188.Failed += Connector_SEN0188_Failed;

                m_Connector_SEN0188.NotifyChangeState += Connector_SEN0188_NotifyChangeState;
            }


            for (int i = 0; i < m_GPIOEnvironmentConnectors.EnvironmentConnectors.Count; i++)
            {
                GPIOEnvironmentConnector con = m_GPIOEnvironmentConnectors.EnvironmentConnectors[i];
                if (con.GPIOConnectorEnable)
                {
                    con.GPIOConnector.ChangeGPIOs    += GPIOConnector_ChangeGPIOs;
                    con.GPIOConnector.startStreaming += GPIOConnector_startStreaming;
                    con.GPIOConnector.stopStreaming  += GPIOConnector_stopStreaming;
                    con.GPIOConnector.Failed         += GPIOConnector_stopStreaming;
                }
            }
        }
Beispiel #3
0
        public ProcessprFingerEvents(StationEnvironment Environment)
        {
            m_EventQueue = new Queue <ProcessFingerEvent>();



            m_Environment       = Environment;
            m_Connector_SEN0188 = m_Environment.SensorConnector;

            m_ConfigProcessItems = m_Environment.ConfigProcessItems;

            m_GPIOEnvironmentConnectors = m_Environment.GPIOEnvironmentConnectors;

            m_SEN0188SQLite = m_Environment.SEN0188SQLite;

            m_FingertEventDatabase = m_Environment.FingertEventDatabase;

            m_Connector_SEN0188.NotifyChangeState += Connector_SEN0188_NotifyChangeState;

            for (int i = 0; i < m_GPIOEnvironmentConnectors.EnvironmentConnectors.Count; i++)
            {
                GPIOEnvironmentConnector con = m_GPIOEnvironmentConnectors.EnvironmentConnectors[i];
                if (con.GPIOConnectorEnable)
                {
                    con.GPIOConnector.ChangeGPIOs += GPIOConnector_ChangeGPIOs;
                }
            }

            m_SensorID = "";
        }
        async private void GPIOConnector_stopStreaming(object sender, string args)
        {
            {
                await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() =>
                { // your code should be here
                    GPIOConnector GPIOcon = sender as GPIOConnector;

                    GPIOEnvironmentConnector con = this.m_GPIOEnvironmentConnectors.getGPIOOConnectorByGPIOConnector(GPIOcon);
                    if (con != null)
                    {
                        con.GPIOConnecorInitialized = false;
                    }

                    m_Environment.GPIOConnecorInitialized = m_GPIOEnvironmentConnectors.GPIOConnecorInitialized;
                    //
                    con.stopConnector();

                    if (args.Length > 0)
                    {
                        var messageDialog = new MessageDialog(args);
                        await messageDialog.ShowAsync();
                    }
                });
            }
        }
 public void stopConnectors()
 {
     for (int i = 0; i < EnvironmentConnectors.Count; i++)
     {
         GPIOEnvironmentConnector con = EnvironmentConnectors[i];
         con.stopConnector();
     }
 }
        public async Task <GPIOEnvironmentConnector> addConnector()
        {
            GPIOEnvironmentConnector con1 = new GPIOEnvironmentConnector("localhost", 3005);
            await con1.InitializeAsync();

            m_GPIOEnvironmentConnectors.Add(con1);
            return(con1);
        }
 public void InitializeActiveBanks()
 {
     for (int i = 0; i < EnvironmentConnectors.Count; i++)
     {
         GPIOEnvironmentConnector con = EnvironmentConnectors[i];
         con.InitializeActiveBanks();
         con.ActiveGPIOInOutBanks.readImages();
     }
 }
        public void resetAllOutputs()
        {
            for (int i = 0; i < EnvironmentConnectors.Count; i++)
            {
                GPIOEnvironmentConnector con = EnvironmentConnectors[i];

                con.resetAllOutputs();
            }
        }
 public ProcessGPIOEvents(ProcessGPIOEvents right)
 {
     m_Ident                    = right.m_Ident;
     m_GPIOInputs               = new List <GPIOObjectProcess>(right.m_GPIOInputs);
     m_GPIOOutputs              = new List <GPIOObjectProcess>(right.m_GPIOOutputs);
     m_AccessRights             = right.m_AccessRights;
     m_GPIOEnvironmentConnector = right.m_GPIOEnvironmentConnector;
     m_InputState               = right.m_InputState;
     m_FlankTicks               = right.m_FlankTicks;
 }
 public ProcessGPIOEvents(string Ident)
 {
     m_Ident                    = Ident;
     m_GPIOInputs               = new List <GPIOObjectProcess>();
     m_GPIOOutputs              = new List <GPIOObjectProcess>();
     m_AccessRights             = 0;
     m_GPIOEnvironmentConnector = null;
     m_InputState               = inputState.waitforInitFlank;
     //   m_LookFor = null;
     m_FlankTicks = 0;
 }
 public GPIOEnvironmentConnector getGPIOOConnectorByGPIOConnector(GPIOConnector connnector)
 {
     for (int i = 0; i < EnvironmentConnectors.Count; i++)
     {
         GPIOEnvironmentConnector con = EnvironmentConnectors[i];
         if (con.GPIOConnector == connnector)
         {
             return(con);
         }
     }
     return(null);
 }
 public GPIOEnvironmentConnector getGPIOOConnectorByOutputPropertySet(IPropertySet propertys)
 {
     for (int i = 0; i < EnvironmentConnectors.Count; i++)
     {
         GPIOEnvironmentConnector con = EnvironmentConnectors[i];
         if (con.GPIOOutPutServiceConnectorConfig == propertys)
         {
             return(con);
         }
     }
     return(null);
 }
 public GPIOEnvironmentConnector getGPIOOConnectorByHostName(string name)
 {
     for (int i = 0; i < EnvironmentConnectors.Count; i++)
     {
         GPIOEnvironmentConnector con = EnvironmentConnectors[i];
         if (con.HostName == name)
         {
             return(con);
         }
     }
     return(null);
 }
 public void deleteConnector(GPIOEnvironmentConnector todeletecon)
 {
     for (int i = 0; i < m_GPIOEnvironmentConnectors.Count; i++)
     {
         GPIOEnvironmentConnector con = m_GPIOEnvironmentConnectors[i];
         if (todeletecon == con)
         {
             con.stopConnector();
             m_GPIOEnvironmentConnectors.RemoveAt(i);
             break;
         }
     }
 }
        async private void GPIOConnector_startStreaming(object sender, Windows.Networking.Sockets.StreamSocket args)
        {
            await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            { // your code should be here
                GPIOConnector GPIOcon = sender as GPIOConnector;

                GPIOEnvironmentConnector con = this.m_GPIOEnvironmentConnectors.getGPIOOConnectorByGPIOConnector(GPIOcon);
                if (con != null)
                {
                    con.GPIOConnecorInitialized = true;
                }

                m_Environment.GPIOConnecorInitialized = m_GPIOEnvironmentConnectors.GPIOConnecorInitialized;
            });
        }
        public void DeInitialize()
        {
            //     m_Connector_SEN0188.NotifyChangeState -= Connector_SEN0188_NotifyChangeState;

            m_Connector_SEN0188.startStreaming     -= Connector_SEN0188_startStreaming;
            m_Connector_SEN0188.stopStreaming      -= Connector_SEN0188_stopStreaming;
            m_Connector_SEN0188.NotifyChangeState  -= Connector_SEN0188_NotifyChangeState;
            m_Connector_SEN0188.Failed             -= Connector_SEN0188_Failed;
            m_Environment.SensorConnecorInitialized = false;

            for (int i = 0; i < m_GPIOEnvironmentConnectors.EnvironmentConnectors.Count; i++)
            {
                GPIOEnvironmentConnector con = m_GPIOEnvironmentConnectors.EnvironmentConnectors[i];
                if (con.GPIOConnectorEnable)
                {
                    con.GPIOConnector.ChangeGPIOs    -= GPIOConnector_ChangeGPIOs;
                    con.GPIOConnector.startStreaming -= GPIOConnector_startStreaming;
                    con.GPIOConnector.stopStreaming  -= GPIOConnector_stopStreaming;
                    con.GPIOConnector.Failed         -= GPIOConnector_stopStreaming;
                    con.GPIOConnecorInitialized       = false;
                }
            }
        }
Beispiel #17
0
 public GPIOObjectProcess()
 {
     m_GPIOObject = null;
     m_GPIOEnvironmentConnector = null;
 }