Exemple #1
0
        public StationEnvironment()
        {
            m_HostName      = "localhost";
            m_Port          = 3005;
            m_GPIOConnector = new GPIOConnector();
            m_OutPutServiceConnectorConfig = new PropertySet();
            m_InputServiceConnectorConfig  = new PropertySet();
            m_InputServiceConnectorConfig.Add("HostName", PropertyValue.CreateString("WilliRaspiPlus"));
            m_InputServiceConnectorConfig.Add("Port", PropertyValue.CreateInt32(3005));
            m_InputServiceConnectorConfig.Add("UpdateState", PropertyValue.CreateInt32(0));

            m_GPIOOInOutBanks = null;
        }
Exemple #2
0
 async public void getDataAsync()
 {
     m_GPIOOInOutBanks = await GPIOOInOutBanks.GPIOOInOutBanksAsync(m_InputServiceConnectorConfig);
 }
Exemple #3
0
        static async public Task <GPIOOInOutBanks> GPIOOInOutBanksAsync(IPropertySet property)
        {
            GPIOOInOutBanks banks = await Task.Run(() => Allocate(property));

            return(banks);;
        }
Exemple #4
0
        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.OpenCollector ");

            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_OutPuts.createPropertySet(property);
            //   m_Inputs.createPropertySet(property);

            m_GPIOInOutBanks.InOutBanks.Add(m_Inputs);
            m_GPIOInOutBanks.InOutBanks.Add(m_OutPuts);
            m_GPIOInOutBanks.createPropertySet(property);
            return(m_GPIOInOutBanks);
        }