public GPIOOInOutBanks GPIOOActiveInOutBanks(IPropertySet property) { GPIOOInOutBanks banks = AllocateActiveGPIOs(property); // GPIOOInOutBanks banks = await Task.Run(() => AllocateActiveGPIOs(property)); return(banks);; }
public async Task <bool> InitializeAsync() { m_GPIOInOutBanks = await GPIOOInOutBanks.GPIOOInOutBanksAsync(m_GPIOInputServiceConnectorConfig); m_Inputs = m_GPIOInOutBanks.InOutBanks[0]; m_OutPuts = m_GPIOInOutBanks.InOutBanks[1]; return(m_GPIOInOutBanks.InOutBanks.Count > 0); }
public void InitializeActiveBanks() { m_GPIOInputServiceConnectorConfig.Clear(); m_ActiveGPIOInOutBanks = m_GPIOInOutBanks.GPIOOActiveInOutBanks(m_GPIOInputServiceConnectorConfig); // m_ActiveGPIOInOutBanks = await GPIOOInOutBanks.GPIOOInOutBanksAsync(m_GPIOInputServiceConnectorConfig); m_ActiveInputs = m_ActiveGPIOInOutBanks.InOutBanks[0]; m_ActiveOutPuts = m_ActiveGPIOInOutBanks.InOutBanks[1]; }
GPIOOInOutBanks AllocateActiveGPIOs(IPropertySet property) { GPIOOInOutBanks GPIOInOutBanks = new GPIOOInOutBanks(""); GPIOOBank m_OutPuts = new GPIOOBank("Outputs"); GPIOOBank m_Inputs = new GPIOOBank("Inputs"); // ObservableCollection<GPIOObjects>m_GPIOOutputs = new ObservableCollection<GPIOObjects>(); GPIOObjects m_GPIOOutputs = new GPIOObjects("GPIOOutPuts"); GPIOObjects m_GPIOInputs = new GPIOObjects("GPIOInPuts"); for (int i = 0; i < m_InOutBanks.Count; i++) { GPIOOBank bank = m_InOutBanks[i]; foreach (GPIOObjects OutPuts in bank.GPIOBanks) { foreach (GPIOObject GPIOObj in OutPuts.GPIOs) { if (GPIOObj.IsEnabled) { switch (GPIOObj.GPIOtyp) { case GPIOObject.GPIOTyp.output: m_GPIOOutputs.GPIOs.Add(GPIOObj); break; case GPIOObject.GPIOTyp.input: m_GPIOInputs.GPIOs.Add(GPIOObj); break; } } } } } if (m_GPIOOutputs.GPIOs.Count > 0) { m_Inputs.GPIOBanks.Add(m_GPIOInputs); } if (m_GPIOOutputs.GPIOs.Count > 0) { m_OutPuts.GPIOBanks.Add(m_GPIOOutputs); } GPIOInOutBanks.InOutBanks.Add(m_Inputs); GPIOInOutBanks.InOutBanks.Add(m_OutPuts); GPIOInOutBanks.createPropertySet(property); return(GPIOInOutBanks); }
public GPIOEnvironmentConnector(string hostName, int Port) { m_HostName = hostName; m_Port = Port; m_GPIOOutPutServiceConnectorConfig = new PropertySet(); m_GPIOInputServiceConnectorConfig = new PropertySet(); m_GPIOConnector = new GPIOConnector(); m_GPIOInOutBanks = null; m_ActiveGPIOInOutBanks = null; m_OutPuts = null; m_Inputs = null; m_ActiveOutPuts = null; m_ActiveInputs = null; m_GPIOConnectorEnable = false; m_GPIOConnecorInitialized = false; }
public StationEnvironment() { m_HostName = "localhost"; m_Port = 3005; m_serDev = new SerDevice("COM1"); m_Connector_SEN0188 = new Connector_SEN0188(); m_SEN0188SQLite = new SEN0188SQLite(); m_FingertEventDatabase = new FingertEventDatabase(); m_SensorOutPutServiceConnectorConfig = new PropertySet(); m_SensorInputServiceConnectorConfig = new PropertySet(); m_GPIOOutPutServiceConnectorConfig = new PropertySet(); m_GPIOInputServiceConnectorConfig = new PropertySet(); m_GPIOInputServiceConnectorConfig.Add("HostName", PropertyValue.CreateString("WilliRaspiPlus")); m_GPIOInputServiceConnectorConfig.Add("Port", PropertyValue.CreateInt32(3005)); m_GPIOInputServiceConnectorConfig.Add("UpdateState", PropertyValue.CreateInt32(0)); m_GPIOInOutBanks = null; m_ConnectorSEN0188Enable = false; m_GPIOEnvironmentConnectors = new GPIOEnvironmentConnectors(); m_ConfigProcessItems = new ConfigProcessItems(m_GPIOEnvironmentConnectors); m_ProcessorGPIOEvents = new ProcessorGPIOEvents(this); m_SensorConnecorInitialized = false; m_GPIOConnecorInitialized = false; m_SensorInitialized = false; m_IsLoggedIn = false; m_isAuthorized = false; m_user = null; m_PeriodicTimerDelFingerEvents = null; m_EventHistoryinDays = 14; // 14 Tage }
public async void GetDataAsync() { //readImages (); var dbPath = await FileCopy.GetFingerDataBaseFolder(); var dbPathEvent = await FileCopy.GetFingerEventDataBaseFolder(); m_SEN0188SQLite.DBDataBasePath = dbPath; m_FingertEventDatabase.DBDataBaseName = dbPathEvent; m_SEN0188SQLite.InitializeDatabase(); m_FingertEventDatabase.InitializeDatabase(); m_SEN0188SQLite.GetDataSets(); m_GPIOInOutBanks = await GPIOOInOutBanks.GPIOOInOutBanksAsync(m_GPIOInputServiceConnectorConfig); await m_GPIOEnvironmentConnectors.InitializeAsync(); }
async public Task <GPIOOInOutBanks> GPIOOActiveInOutBanksAsync(IPropertySet property) { GPIOOInOutBanks banks = await Task.Run(() => AllocateActiveGPIOs(property)); return(banks);; }
static GPIOOInOutBanks Allocate(IPropertySet property) { GPIOOInOutBanks m_GPIOInOutBanks = new GPIOOInOutBanks(""); // m_Banks = new List<GPIOOBank>(); GPIOOBank m_OutPuts = new GPIOOBank("Outputs"); GPIOOBank m_Inputs = new GPIOOBank("Inputs"); // ObservableCollection<GPIOObjects>m_GPIOOutputs = new ObservableCollection<GPIOObjects>(); GPIOObjects m_GPIOOutPut5V = new GPIOObjects("GPIOOutPut.5V"); m_GPIOOutPut5V.GPIOs.Add(new GPIOObject("GPIO", GPIOObject.GPIOTyp.output, 17, 0, 0)); m_GPIOOutPut5V.GPIOs.Add(new GPIOObject("GPIO", GPIOObject.GPIOTyp.output, 27, 0, 0)); m_GPIOOutPut5V.GPIOs.Add(new GPIOObject("GPIO", GPIOObject.GPIOTyp.output, 23, 0, 0)); m_GPIOOutPut5V.GPIOs.Add(new GPIOObject("GPIO", GPIOObject.GPIOTyp.output, 22, 0, 0)); GPIOObjects m_GPIOOutPut3V3 = new GPIOObjects("GPIOOutPut.3V3"); m_GPIOOutPut3V3.GPIOs.Add(new GPIOObject("GPIO", GPIOObject.GPIOTyp.output, 13, 0, 0)); m_GPIOOutPut3V3.GPIOs.Add(new GPIOObject("GPIO", GPIOObject.GPIOTyp.output, 19, 0, 0)); m_GPIOOutPut3V3.GPIOs.Add(new GPIOObject("GPIO", GPIOObject.GPIOTyp.output, 11, 0, 0)); m_GPIOOutPut3V3.GPIOs.Add(new GPIOObject("GPIO", GPIOObject.GPIOTyp.output, 21, 0, 0)); GPIOObjects m_GPIOOutPutOC = new GPIOObjects("GPIOOutPut.OpenCol. "); m_GPIOOutPutOC.GPIOs.Add(new GPIOObject("GPIO", GPIOObject.GPIOTyp.output, 4, 0, 0)); m_GPIOOutPutOC.GPIOs.Add(new GPIOObject("GPIO", GPIOObject.GPIOTyp.output, 10, 0, 0)); m_GPIOOutPutOC.GPIOs.Add(new GPIOObject("GPIO", GPIOObject.GPIOTyp.output, 9, 0, 0)); m_GPIOOutPutOC.GPIOs.Add(new GPIOObject("GPIO", GPIOObject.GPIOTyp.output, 16, 0, 0)); m_OutPuts.GPIOBanks.Add(m_GPIOOutPut5V); m_OutPuts.GPIOBanks.Add(m_GPIOOutPut3V3); m_OutPuts.GPIOBanks.Add(m_GPIOOutPutOC); GPIOObjects GPIOInputs5V = new GPIOObjects("GPIOInputs.4Bank"); GPIOInputs5V.GPIOs.Add(new GPIOObject("GPIO", GPIOObject.GPIOTyp.input, 15, 0, 0)); GPIOInputs5V.GPIOs.Add(new GPIOObject("GPIO", GPIOObject.GPIOTyp.input, 14, 0, 0)); GPIOInputs5V.GPIOs.Add(new GPIOObject("GPIO", GPIOObject.GPIOTyp.input, 12, 0, 0)); GPIOInputs5V.GPIOs.Add(new GPIOObject("GPIO", GPIOObject.GPIOTyp.input, 20, 0, 0)); GPIOObjects GPIOInputs5V8 = new GPIOObjects("GPIOInputs.8Bank"); GPIOInputs5V8.GPIOs.Add(new GPIOObject("GPIO", GPIOObject.GPIOTyp.input, 26, 0, 0)); GPIOInputs5V8.GPIOs.Add(new GPIOObject("GPIO", GPIOObject.GPIOTyp.input, 25, 0, 0)); GPIOInputs5V8.GPIOs.Add(new GPIOObject("GPIO", GPIOObject.GPIOTyp.input, 24, 0, 0)); GPIOInputs5V8.GPIOs.Add(new GPIOObject("GPIO", GPIOObject.GPIOTyp.input, 5, 0, 0)); GPIOObjects GPIOInputs5V4 = new GPIOObjects("GPIOInputs.8Bank"); GPIOInputs5V4.GPIOs.Add(new GPIOObject("GPIO", GPIOObject.GPIOTyp.input, 6, 0, 0)); GPIOInputs5V4.GPIOs.Add(new GPIOObject("GPIO", GPIOObject.GPIOTyp.input, 7, 0, 0)); GPIOInputs5V4.GPIOs.Add(new GPIOObject("GPIO", GPIOObject.GPIOTyp.input, 8, 0, 0)); GPIOInputs5V4.GPIOs.Add(new GPIOObject("GPIO", GPIOObject.GPIOTyp.input, 18, 0, 0)); m_Inputs.GPIOBanks.Add(GPIOInputs5V); m_Inputs.GPIOBanks.Add(GPIOInputs5V8); m_Inputs.GPIOBanks.Add(GPIOInputs5V4); m_GPIOInOutBanks.InOutBanks.Add(m_Inputs); m_GPIOInOutBanks.InOutBanks.Add(m_OutPuts); m_GPIOInOutBanks.createPropertySet(property); return(m_GPIOInOutBanks); }
public async void GetDataAsync() { //readImages (); m_GPIOInOutBanks = await GPIOOInOutBanks.GPIOOInOutBanksAsync(m_GPIOInputServiceConnectorConfig); }