Пример #1
0
 /// Set sequence parameters. Throws error if parameter in wrong range.
 /// Note: Errorhandling could also be implemented in SequenceParameters class.
 /// <param name="parameters">Look: SequenceParameters </param>
 public void setParams(SequenceParameters parameters)
 {
     if (parameters.impregnationTime < 0 || parameters.impregnationTime > 60)
     {
         Err("Impregnation time must be between 0 and 60");
     }
     else if (parameters.cookingTime < 0 || parameters.cookingTime > 100)
     {
         Err("Cooking time must be between 0 and 100");
     }
     else if (parameters.cookingTemperature < 20 || parameters.cookingTemperature > 80)
     {
         Err("Cooking temperature must be between 20 and 80");
     }
     else if (parameters.cookingPressure < 0 || parameters.cookingPressure > 350)
     {
         Err("Cooking pressure must be between 0 and 350");
     }
     else if (parameters.gain < 0 || parameters.gain > 1)
     {
         Err("Gain must be between 0 and 1,0");
     }
     else if (parameters.integrationTime < 0 || parameters.integrationTime > 1)
     {
         Err("Integration time must be between 0 and 1,0");
     }
     else
     {
         this.parameters = parameters;
         return;
     }
 }
Пример #2
0
        public MainWindow()
        {
            InitializeComponent();
            controller = new Controller(this);
            parameters = new SequenceParameters();
            state      = new SortedDictionary <string, dynamic>();

            GREEN       = new SolidColorBrush();
            GREEN.Color = Colors.GreenYellow;
            RED         = new SolidColorBrush();
            RED.Color   = Colors.OrangeRed;
        }
Пример #3
0
        /// Constructor

        /** Takes the main window as a parameter. Window is used to send update calls for GUI
         */
        public Controller(MainWindow window)
        {
            this.window        = window;
            client             = null;
            listener           = new Listener(window);
            URL                = SIMULATOR_URL;
            parameters         = null;
            ImpregnationThread = new Thread(() => {});
            BlackLiquorThread  = new Thread(() => {});
            WhiteLiquorThread  = new Thread(() => {});
            CookingThread      = new Thread(() => {});
            DischargeThread    = new Thread(() => {});
        }