Example #1
0
        async private void StartConnector()
        {
            m_GPIOConnector.ChangeGPIOs    += GPIOConnector_ChangeGPIOs;
            m_GPIOConnector.startStreaming += GPIOConnector_startStreaming;
            m_GPIOConnector.stopStreaming  += GPIOConnector_stopStreaming;
            m_GPIOConnector.Failed         += GPIOConnector_stopStreaming;

            m_InputServiceConnectorConfig["HostName"] = m_Environment.HostName;
            m_InputServiceConnectorConfig["Port"]     = m_Environment.Port;

            for (int i = 0; i < m_Banks.InOutBanks.Count; i++)
            {
                GPIOOBank bank = m_Banks.InOutBanks[i];

                foreach (GPIOObjects OutPuts in bank.GPIOBanks)
                {
                    foreach (GPIOObject GPIOObj in OutPuts.GPIOs)
                    {
                        UpdateInputPropertySets(GPIOObj, m_InputServiceConnectorConfig);
                    }
                }
            }
            UpdateState(m_InputServiceConnectorConfig, 1);
            await m_GPIOConnector.startProcessingPackagesAsync(m_InputServiceConnectorConfig, m_OutPutServiceConnectorConfig);
        }
        public bool readGPIOStationEnvironmentDatafromLocalStorage(GPIOEnvironmentConnector StationEnvironment, Windows.Storage.ApplicationDataCompositeValue composite, int ListenerIdx)
        {
            if (m_localStorage == null)
            {
                return(false);
            }
            m_localStorage.SetSourceIDName("StationEnvironment.GPIO", ListenerIdx);


            int  Idx      = -1;
            bool bStoreOk = m_localStorage.readSettingsfromLocalStorage(composite, Idx);

            if (bStoreOk)
            {
                string StringValue;

                int IntValue;

                bool bok = m_localStorage.readStringSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("StationEnvironment.HostName", Idx), out StringValue);
                if (StringValue.Count() > 0)
                {
                    StationEnvironment.HostName = StringValue;
                }



                bok = m_localStorage.readIntegerSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("StationEnvironment.Port", Idx), out IntValue);
                if (IntValue > 0)
                {
                    StationEnvironment.Port = IntValue;
                }



                bok = m_localStorage.readIntegerSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("StationEnvironment.GPIOConnectorEnable", Idx), out IntValue);
                StationEnvironment.GPIOConnectorEnable = Convert.ToBoolean(IntValue);

                for (int i = 0; i < StationEnvironment.GPIOOInOutBanks.InOutBanks.Count; i++)
                {
                    GPIOOBank bank = StationEnvironment.GPIOOInOutBanks.InOutBanks[i];

                    foreach (GPIOObjects OutPuts in bank.GPIOBanks)
                    {
                        foreach (GPIOObject GPIOObj in OutPuts.GPIOs)
                        {
                            string property;
                            bok = m_localStorage.readStringSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName(GPIOObj.GPIOName, Idx), out property);
                            if (bok)
                            {
                                GPIOObj.CreateGPIOObjectByStorageSettings(property);
                            }
                        }
                    }
                }
            }

            return(bStoreOk);
        }
Example #3
0
        void resetAllOutputs_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            UpdateState(m_InputServiceConnectorConfig, 0);
            GPIOOBank bank = m_OutPuts;

            foreach (GPIOObjects OutPuts in bank.GPIOBanks)
            {
                foreach (GPIOObject OutPut in OutPuts.GPIOs)
                {
                    OutPut.SetValue = 0;
                    UpdateInputPropertySets(OutPut, m_InputServiceConnectorConfig);
                }
            }
            UpdateState(m_InputServiceConnectorConfig, 1);
        }
Example #4
0
        private void ProcessPropertysFromGPIOConnector(IPropertySet propertys)
        {
            for (int i = 0; i < m_Banks.InOutBanks.Count; i++)
            {
                GPIOOBank bank = m_Banks.InOutBanks[i];

                foreach (GPIOObjects OutPuts in bank.GPIOBanks)
                {
                    foreach (GPIOObject GPIOObj in OutPuts.GPIOs)
                    {
                        UpdateOutputPropertySets(GPIOObj, propertys);
                    }
                }
            }
        }
 public Configuration()
 {
     this.InitializeComponent();
     m_Connector_SEN0188         = null;
     m_FingertEventDatabase      = null;
     m_SEN0188SQLite             = null;
     m_Environment               = null;
     m_listOfDevices             = new ObservableCollection <FingerPrintSensor_SEN0188.SerDevice>();
     m_Sensoroutputconfigoptions = null;
     m_Sensorinputconfigoptions  = null;
     //   m_serDev = null;
     m_SettingsToStorage = null;
     m_OutPuts           = null;
     m_Inputs            = null;
     // m_Banks = null;
     m_GPIOEnvironmentConnectors = null;
     ListAvailablePorts();
     m_AccessBitsCollection = DBDataSetAccessRight.getAccessBitsCollection();
 }
Example #6
0
        private GPIOObject getGPIOPinByName(string Name)
        {
            for (int i = 0; i < m_Banks.InOutBanks.Count; i++)
            {
                GPIOOBank bank = m_Banks.InOutBanks[i];

                foreach (GPIOObjects OutPuts in bank.GPIOBanks)
                {
                    foreach (GPIOObject OutPut in OutPuts.GPIOs)
                    {
                        if (String.Compare(OutPut.PinName, Name) == 0)
                        {
                            return(OutPut);
                        }
                    }
                }
            }



            return(null);
        }
Example #7
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (e.Parameter is GPIODashboard.App)
            {
                GPIODashboard.App AppEnvironment = e.Parameter as GPIODashboard.App;


                if (AppEnvironment != null)
                {
                    m_Environment = AppEnvironment.Environment;
                    m_InputServiceConnectorConfig  = m_Environment.InputServiceConnectorConfig;
                    m_OutPutServiceConnectorConfig = m_Environment.OutPutServiceConnectorConfig;
                    m_Banks         = m_Environment.GPIOOInOutBanks;
                    m_GPIOConnector = m_Environment.Connector;
                    m_Inputs        = m_Banks.InOutBanks[0];
                    m_OutPuts       = m_Banks.InOutBanks[1];
                    m_Banks.readImages();
                    StartConnector();
                }
            }
            base.OnNavigatedTo(e);
        }
        public bool writeGPIOStationEnvironmenttoLocalStorage(GPIOEnvironmentConnector StationEnvironment, Windows.Storage.ApplicationDataCompositeValue composite, int ListenerIdx)
        {
            if (m_localStorage == null)
            {
                return(false);
            }

            m_localStorage.SetSourceIDName("StationEnvironment.GPIO", ListenerIdx);


            int Idx = -1;

            bool bok = m_localStorage.writeSettingsToLocalStorage(composite, Idx);

            bok = m_localStorage.writeStringSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("StationEnvironment.HostName", Idx), StationEnvironment.HostName);
            bok = m_localStorage.writeIntegerSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("StationEnvironment.Port", Idx), StationEnvironment.Port);

            bok = m_localStorage.writeIntegerSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("StationEnvironment.GPIOConnectorEnable", Idx), Convert.ToInt32(StationEnvironment.GPIOConnectorEnable));



            for (int i = 0; i < StationEnvironment.GPIOOInOutBanks.InOutBanks.Count; i++)
            {
                GPIOOBank bank = StationEnvironment.GPIOOInOutBanks.InOutBanks[i];

                foreach (GPIOObjects OutPuts in bank.GPIOBanks)
                {
                    foreach (GPIOObject GPIOObj in OutPuts.GPIOs)
                    {
                        string property = GPIOObj.getPropertyforStorageSettings();
                        bok = m_localStorage.writeStringSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName(GPIOObj.GPIOName, Idx), property) && bok;
                    }
                }
            }



            return(bok);
        }