示例#1
0
        public DSScaleChoice(string supplier, string offered,
            string received, string total,
            long choiceTime, long nextTime,
            FormReadExperiment mainForm,
            ServerConnection serverConnection)
        {
            InitializeComponent();

            experimentRecorder = new AnswerRecorder(FileName.RESULTS_EXPERIMENT, " ");

            offerLabel.Text = offered;
            this.supplier = supplierLabel.Text = supplier;
            realLabel.Text = received;
            omniumQuontityLabel.Text = total;
            this.choiceTime = choiceTime;
            this.nextTime = nextTime;
            this.mainForm = mainForm;
            this.allowClose = false;
            this.serverConnection = serverConnection;

            dsStopWatch.Start();
        }
        public FormReadExperiment()
        {
            InitializeComponent();

            ClientConfiguration configuration = new ClientConfiguration(FileName.CONFIGURATION_CLIENT);

            notificationRecorder = new AnswerRecorder(FileName.RESULTS_EXPERIMENT_NOTIFICATIONS, " ");
            experimentRecorder = new AnswerRecorder(FileName.RESULTS_EXPERIMENT, " ");

            experimentNotificationWatch = new Stopwatch();
            experimentNotificationWatch.Start();

            Console.WriteLine("start!");

            startTimer = new System.Windows.Forms.Timer();
            startTimer.Interval = configuration.GetNotificationFlashTime();
            startTimer.Tick += new EventHandler(StartTimerTick);

            notificationTimer = new System.Windows.Forms.Timer();
            notificationTimer.Interval = configuration.GetNotificationPauseTime() + configuration.GetNotificationFlashTime();
            notificationTimer.Tick += new EventHandler(NotificationTimerTick);

            ExperimentReader reader = new ExperimentReader();
            experimentIterations = reader.GetExperimentData();

            serverConnection = new ServerConnection(configuration);
            serverConnection.Register(FileName.UID.ToString());

            notificationsService = new NotificationsService();
            notificationsService.Daemonize();

            colors = new ColorsList();
            animator = new Animator();

            feedbackLayout.BackColor = Color.LIGHT_ORANGE;

            roundNotificationWatch = new Stopwatch();
            currentIteration = 0;
            omniumQuantity = 0;
            nextBtn.Enabled = true;

            PerformIteration();
        }