Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var binding = new BasicHttpBinding();
            //var address = new EndpointAddress("http://localhost:8080/SerialSwitch");
            var address = new EndpointAddress("http://192.168.0.16:8080/SerialSwitch");
            Arduino = new ArduinoSelfHostClient(binding, address);
            Arduino = new ArduinoStub(); //This in there so I can work on the skin.
            BrewControl = new BrewController(Arduino);

            CurrentStatus = BrewControl.GetStatus();
            btRims.Thermometer = BrewController.ThermometersName.RIMS;
            btRims.Name = "RIMS";
            btRims.BrewControl = BrewControl;
            btRims.Status = CurrentStatus;
            //btRims.ShowRimsPanel(true);

            btMash.Thermometer = BrewController.ThermometersName.MashTun;
            btMash.Name = "Mash Tun";
            btMash.BrewControl = BrewControl;
            btMash.Status = CurrentStatus;

            btKettle.Thermometer = BrewController.ThermometersName.Kettle;
            btKettle.Name = "Kettle";
            btKettle.BrewControl = BrewControl;
            btKettle.Status = CurrentStatus;

            cdtTimer.BrewControl = BrewControl;
            cdtTimer.Status = CurrentStatus;

            bool tempAlarmActive = (CurrentStatus["TempAlarmActive"] == "1") ? true : false;
            bool timerAlarmActive = (CurrentStatus["TimerAlarmActive"] == "1") ? true : false;

            if (tempAlarmActive || timerAlarmActive)
            {
                //lblMainAlarm.Text = "We have an alarm";
                btnResetAlarm.Checked = true;
                //  soundAlarm();
            }

            //Response.AppendHeader("Refresh", 5 + "; URL=RimsPanel.aspx");
            tmrRefreshStatus.Interval = 150000000;
            tmrRefreshStatus.Enabled = true;

            if (!Page.IsPostBack)
                RefreshButtons();
        }
Ejemplo n.º 2
0
 public BrewController(IArduinoSelfHost inArduino)
 {
     Arduino = inArduino;
 }