コード例 #1
0
 private void KnobClicked(object sender, PinStatusEventArgs e)
 {
     if (e.Enabled)
     {
         Controls.Instance.ButtonUnsubscribe("ScrollerBtn", KnobClicked);
         ProgramManager.StartProgram(applications.ToList()[0]);
     }
 }
コード例 #2
0
 private void OnPinStatusChanged(object sender, PinStatusEventArgs e)
 {
     if (e.Configuration == this.busyPin)
     {
         if (!e.Enabled)
         {
             this.canTransmit.Set();
         }
     }
 }
コード例 #3
0
        private void GlobalConnectionPin_PinStatusChanged(object sender, PinStatusEventArgs e)
        {
            if (e.Configuration.Pin == _batteryUnderChargeGpio)
            {
                Console.WriteLine("Battery charge changed in: {0}", e.Enabled ? "Full, Discharging or Removed" : "Charging");
                _batteryUnderChargeStatus = e.Enabled;

                OnUnderCharge?.Invoke(new UnderChargeEventArgs {
                    Charging = e.Enabled
                });
            }
        }
コード例 #4
0
        private void PinStatusChanged(object sender, PinStatusEventArgs e)
        {
            var connectorPin = e.Configuration.Pin.ToConnector();
            var inputPin     = MapConnectorInputPin(connectorPin);

            if (inputPin != null && CircuitStateChanged != null)
            {
                CircuitStateChanged(e.Enabled, inputPin.Value);
            }
            else
            {
                LogHelper.LogMessage("Pin changed {0}", connectorPin);
            }
        }
コード例 #5
0
ファイル: DateAndTime.cs プロジェクト: kholysa/MMirror
 public void g_Detected(object sender, PinStatusEventArgs e)
 {
     //start fade out timer
     edges++;
     if (edges == 2)
     {
         //t.Enabled = true;
         for (int i = 0; i < 20; i++)
         {
             this.Opacity -= 0.05;
             System.Threading.Thread.Sleep(10);
         }
         this.Close();
     }
 }
コード例 #6
0
        static void g_detected(object sender, PinStatusEventArgs e)
        {
            edges++;
            if (edges == 2 && state == 0)
            {
                while (true)
                {
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    stockView = new stockView();
                    edges     = 0;
                    state     = 1;
                    Application.Run(stockView);


                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    weatherView = new WeatherView();
                    edges       = 0;
                    state       = 2;
                    Application.Run(weatherView);


                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    DateAndTime dt = new DateAndTime();
                    edges      = 0;
                    state      = 0;
                    dt.Visible = true;
                    Application.Run(dt);
                }
            }

            /* else if (edges == 2 && state == 1)
             * {
             *   Application.EnableVisualStyles();
             *   Application.SetCompatibleTextRenderingDefault(false);
             * ;
             * }
             * else if (edges == 2 && state == 2)
             * {
             *   Application.EnableVisualStyles();
             *   Application.SetCompatibleTextRenderingDefault(false);
             *
             * }*/
        }
コード例 #7
0
        private void KnobClicked(object sender, PinStatusEventArgs e)
        {
            if (e.Enabled)
            {
                if (!menuIsShown)
                {
                    ListView menu = new ListView("MainScroller");
                    menu.Width = 32;

                    Label l = new Label("Close", menuFont, CanvasColor.WHITE);

                    menu.Add(l);

                    View = menu;

                    menuIsShown = true;
                }
                else
                {
                    StartProgram();
                }
            }
        }
コード例 #8
0
ファイル: Program.cs プロジェクト: wwkkww1983/RaspberrySharp
 private static void _conPin_PinStatusChanged(object sender, PinStatusEventArgs e)
 {
     Console.WriteLine("Gpio{0}", e.Enabled);
 }