public CurvedBarPlotWidget(string name, string group, int row, int column) : base("CurvedBarPlot", name, group, row, column)
        {
            SetSizeRequest(205, 169);

            var box = new TouchGraphicalBox(205, 169);

            box.color        = "grey4";
            box.transparency = 0.1f;
            Put(box, 0, 0);

            label                     = new TouchLabel();
            label.text                = "Plot";
            label.textColor           = "grey3";
            label.WidthRequest        = 199;
            label.textAlignment       = TouchAlignment.Center;
            label.textRender.textWrap = TouchTextWrap.Shrink;
            Put(label, 3, 80);

            bar = new TouchCurvedProgressBar();
            bar.backgroundColor   = "grey3";
            bar.backgroundColor.A = 0.15f;
            bar.curveStyle        = CurveStyle.ThreeQuarterCurve;
            bar.SetSizeRequest(199, 163);
            Put(bar, 3, 3);

            fullScale = 100.0f;

            textBox = new TouchLabel();
            textBox.SetSizeRequest(199, 30);
            textBox.textSize      = 20;
            textBox.text          = "0.0";
            textBox.textColor     = "pri";
            textBox.textAlignment = TouchAlignment.Center;
            Put(textBox, 3, 130);
        }
Beispiel #2
0
        public PowerOutletSlider(int id)
        {
            SetSizeRequest(180, 180);

            ampBar = new TouchCurvedProgressBar();
            ampBar.SetSizeRequest(170, 135);
            ampBar.curveStyle = CurveStyle.ThreeQuarterCurve;
            Put(ampBar, 5, 5);
            ampBar.Show();

            ampText = new TouchLabel();
            ampText.WidthRequest  = 180;
            ampText.textAlignment = TouchAlignment.Center;
            ampText.textRender.unitOfMeasurement = UnitsOfMeasurement.Amperage;
            ampText.text      = "0.0";
            ampText.textSize  = 20;
            ampText.textColor = "pri";
            Put(ampText, 0, 105);
            ampText.Show();

            ss                       = new TouchSelectorSwitch(id, 3, 0, TouchOrientation.Horizontal);
            ss.sliderSize            = MySliderSize.Large;
            ss.WidthRequest          = 170;
            ss.HeightRequest         = 30;
            ss.sliderColorOptions[0] = "grey2";
            ss.sliderColorOptions[1] = "pri";
            ss.sliderColorOptions[2] = "seca";
            ss.textOptions[0]        = "Off";
            ss.textOptions[1]        = "Auto";
            ss.textOptions[2]        = "On";
            Put(ss, 5, 145);
            ss.Show();

            outletName                     = new TouchLabel();
            outletName.textColor           = "grey3";
            outletName.WidthRequest        = 100;
            outletName.textRender.textWrap = TouchTextWrap.Shrink;
            outletName.textAlignment       = TouchAlignment.Center;
            Put(outletName, 40, 67);
            outletName.Show();

            statusLabel               = new TouchLabel();
            statusLabel.text          = "Off";
            statusLabel.textSize      = 20;
            statusLabel.textColor     = "grey4";
            statusLabel.WidthRequest  = 180;
            statusLabel.textAlignment = TouchAlignment.Center;
            Put(statusLabel, 0, 37);
            statusLabel.Show();

            outletSubscriber = new OutputChannelValueSubscriber(OnValueChanged);

            ShowAll();
        }
Beispiel #3
0
        public ChemistryWindow(params object[] options) : base(false)
        {
            sceneTitle = "Chemistry";

            string path = System.IO.Path.Combine(Utils.AquaPicEnvironment, "TestProcedures");

            var d = new DirectoryInfo(path);

            FileInfo[] files = d.GetFiles("*.json");

            testIdx = -1;
            tests   = new List <TestProcedure> ();
            foreach (var file in files)
            {
                try {
                    tests.Add(new TestProcedure(file.FullName));
                } catch (Exception ex) {
                    Logger.AddError(ex.ToString());
                }
            }

            timerProgress = new TouchCurvedProgressBar(
                new TouchColor("grey3"),
                new TouchColor("pri"),
                100.0f);
            timerProgress.SetSizeRequest(250, 175);
            timerProgress.curveStyle = CurveStyle.ThreeQuarterCurve;
            Put(timerProgress, 275, 100);
            timerProgress.Visible = false;

            timerLabel = new TouchLabel();
            timerLabel.WidthRequest  = 200;
            timerLabel.textAlignment = TouchAlignment.Center;
            timerLabel.textSize      = 20;
            Put(timerLabel, 300, 240);
            timerLabel.Visible = false;

            stepButton = new TouchButton();
            stepButton.SetSizeRequest(200, 50);
            stepButton.buttonColor         = "grey2";
            stepButton.text                = "N/A";
            stepButton.ButtonReleaseEvent += OnStepButtonReleased;
            Put(stepButton, 300, 365);
            stepButton.Show();

            resetBtn = new TouchButton();
            resetBtn.SetSizeRequest(200, 50);
            resetBtn.text = "Restart";
            resetBtn.ButtonReleaseEvent += OnResetButtonReleased;
            Put(resetBtn, 510, 365);
            resetBtn.Visible = false;

            skipBtn = new TouchButton();
            skipBtn.SetSizeRequest(200, 50);
            skipBtn.text                = "Skip";
            skipBtn.buttonColor         = "seca";
            skipBtn.ButtonReleaseEvent += OnSkipButtonReleased;
            Put(skipBtn, 90, 365);
            skipBtn.Visible = false;

            nameLabel = new TouchLabel();
            nameLabel.WidthRequest  = 700;
            nameLabel.textSize      = 14;
            nameLabel.textColor     = "seca";
            nameLabel.textAlignment = TouchAlignment.Center;
            Put(nameLabel, 50, 65);
            nameLabel.Show();

            stepLabel = new TouchTextBox();
            stepLabel.SetSizeRequest(620, 75);
            stepLabel.textAlignment = TouchAlignment.Center;
            stepLabel.text          = "Please select a test procedure";
            Put(stepLabel, 90, 280);
            stepLabel.Show();

            actionLabel = new TouchLabel();
            actionLabel.WidthRequest  = 200;
            actionLabel.textAlignment = TouchAlignment.Right;
            Put(actionLabel, 510, 420);
            actionLabel.Show();

            combo = new TouchComboBox();
            foreach (var test in tests)
            {
                combo.comboList.Add(test.name);
            }
            combo.nonActiveMessage   = "Select test";
            combo.WidthRequest       = 235;
            combo.ComboChangedEvent += OnComboChanged;
            Put(combo, 550, 35);
            combo.Show();

            CanFocus       = true;
            KeyPressEvent += EntryKeyPressEvent;

            ExposeEvent += (o, args) => {
                GrabFocus();
            };

            Show();
        }