Example #1
0
        private void handleIdle(GrainBrainStatus aStatus)
        {
            TimerLabel.IsEnabled = false;

            TempLabel.Content = String.Format("Temperature [C]: -");
            StateLabel.Content = "State - Idle";   
        }
Example #2
0
        private void handleIdle(GrainBrainStatus aStatus)
        {
            TimerLabel.IsEnabled = false;

            TempLabel.Content  = String.Format("Temperature [C]: -");
            StateLabel.Content = "State - Idle";
        }
Example #3
0
        private void handleBoiling(GrainBrainStatus aStatus)
        {

            TimerLabel.IsEnabled = true;


            TempLabel.Content = String.Format("Temperature [C]: {0}", aStatus.Temperature);
            TimerLabel.Content = String.Format("Remaining boil time [min]: {0}", aStatus.RemainingBoilTime);
            if (aStatus.State == BrewStep.Heating)
                StateLabel.Content = "State - Heating";
            else
                StateLabel.Content = "State - Boiling";

        }
Example #4
0
        private void handleBoiling(GrainBrainStatus aStatus)
        {
            TimerLabel.IsEnabled = true;


            TempLabel.Content  = String.Format("Temperature [C]: {0}", aStatus.Temperature);
            TimerLabel.Content = String.Format("Remaining boil time [min]: {0}", aStatus.RemainingBoilTime);
            if (aStatus.State == BrewStep.Heating)
            {
                StateLabel.Content = "State - Heating";
            }
            else
            {
                StateLabel.Content = "State - Boiling";
            }
        }
Example #5
0
        private void handleMashing(GrainBrainStatus aStatus)
        {

            TimerLabel.IsEnabled = false;

            MashProfileList.Clear();
            foreach (GFCalc.Domain.MashProfileStep ms in aStatus.RemainingMashStepList)
            {
                MashProfileList.Add(ms);
            }

            TempLabel.Content = String.Format("Mash temperature [C]: {0}", aStatus.Temperature);
            if (aStatus.State == BrewStep.Heating)
                StateLabel.Content = "State - Heating";
            else
                StateLabel.Content = "State - Mashing";

        }
Example #6
0
        private void handleMashing(GrainBrainStatus aStatus)
        {
            TimerLabel.IsEnabled = false;

            MashProfileList.Clear();
            foreach (GFCalc.Domain.MashProfileStep ms in aStatus.RemainingMashStepList)
            {
                MashProfileList.Add(ms);
            }

            TempLabel.Content = String.Format("Mash temperature [C]: {0}", aStatus.Temperature);
            if (aStatus.State == BrewStep.Heating)
            {
                StateLabel.Content = "State - Heating";
            }
            else
            {
                StateLabel.Content = "State - Mashing";
            }
        }
Example #7
0
        private void handleBrewProcess(GrainBrainStatus status)
        {


            if (status.State == BrewStep.StrikeWaterTempReached)
            {
                //dispatcherTimer.Tick -= brewProcessTimer_Tick;
                dispatcherTimer.IsEnabled = false;

                var swrw = new StrikeWaterReachedWindow();
                swrw.ShowDialog();

                IPAddress ipAddr;
                if (!GrainbrainNetDiscovery.GetGrainBrainAddress(out ipAddr))
                    return;

                string addr = String.Format("{0}:50051", ipAddr);
                Channel ch = new Channel(addr, ChannelCredentials.Insecure);

                McServer.McServerClient cl = new McServer.McServerClient(ch);

                GrainsAddedNotify req = new GrainsAddedNotify();
                Empty resp = cl.GrainsAdded(req);
                ch.ShutdownAsync().Wait();

                //dispatcherTimer.Tick += brewProcessTimer_Tick;
                dispatcherTimer.IsEnabled = true;


            }

            if (status.State == BrewStep.MashDoneStartSparge)
            {
                dispatcherTimer.IsEnabled = false;

                var sdw = new SpargeDoneWindow();
                sdw.ShowDialog();

                IPAddress ipAddr;
                if (!GrainbrainNetDiscovery.GetGrainBrainAddress(out ipAddr))
                    return;

                string addr = String.Format("{0}:50051", ipAddr);

                Channel ch = new Channel(addr, ChannelCredentials.Insecure);

                McServer.McServerClient cl = new McServer.McServerClient(ch);

                SpargeDoneNotify req = new SpargeDoneNotify();
                Empty resp = cl.SpargeDone(req);
                ch.ShutdownAsync().Wait();

                dispatcherTimer.IsEnabled = true;

            }

            if (status.State == BrewStep.BoilDone)
            {
                dispatcherTimer.IsEnabled = false;

                var wcsw = new WortChillerSanitizedWindow();
                wcsw.ShowDialog();

                IPAddress ipAddr;
                if (!GrainbrainNetDiscovery.GetGrainBrainAddress(out ipAddr))
                    return;

                string addr = String.Format("{0}:50051", ipAddr);

                Channel ch = new Channel(addr, ChannelCredentials.Insecure);

                McServer.McServerClient cl = new McServer.McServerClient(ch);

                WortChillerSanitizedDoneNotify req = new WortChillerSanitizedDoneNotify();
                Empty resp = cl.WortChillerSanitizedDone(req);
                ch.ShutdownAsync().Wait();

                dispatcherTimer.IsEnabled = true;
            }

        }