Ejemplo n.º 1
0
        private static void Main()
        {
            Log.Logger = new LoggerConfiguration()
                         .MinimumLevel.Debug()
                         .WriteTo.Console()
                         .WriteTo.File("logs\\myapp.txt", rollingInterval: RollingInterval.Day)
                         .CreateLogger();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var model    = new SickODController();
            var mainForm = new ClientUserInterfaceView();

            _ = new ClientUserInterfacePresenter(mainForm, model);

            Application.Run(mainForm);
        }
Ejemplo n.º 2
0
        private SickODController controller; // TODO: Loose couple. Use Interface.

        public ClientUserInterfacePresenter(ClientUserInterfaceView mainView, SickODController mainController)
        {
            controller = mainController;

            #region Register UI events

            //Register UI Events
            mainView.Startup                      += StartSerialPort;
            mainView.Shutdown                     += ShutdownSerialPort;
            mainView.Reset                        += ResetSerialPort;
            mainView.PingDevice                   += PingSerialPort;
            mainView.DtoSingleMeasure             += DtoSingleMeasure;
            mainView.DtoContinuousMeasureToggle   += DtoContinuousMeasureToggle;
            mainView.Q2ContinuousMeasureToggle    += Q2ContinuousMeasureToggle;
            mainView.Q2DisplayStatus              += Q2DisplayStatus;
            mainView.Q2HiDisplayStatus            += Q2HiDisplayStatus;
            mainView.Q2LoDisplayStatus            += Q2LoDisplayStatus;
            mainView.Q2SetDistanceToDefault       += Q2SetDistanceToDefault;
            mainView.Q2HiSetDistance              += Q2HiSetDistance;
            mainView.Q2LoSetDistance              += Q2LoSetDistance;
            mainView.AveragingDisplaySetting      += AveragingDisplaySetting;
            mainView.AveragingSetSpeedToSlow      += AveragingSetSpeedToSlow;
            mainView.AveragingSetSpeedToMedium    += AveragingSetSpeedToMedium;
            mainView.AveragingSetSpeedToFast      += AveragingSetSpeedToFast;
            mainView.MfOnOffToggle                += MfOnOffToggle;
            mainView.MfDisplaySetting             += MfDisplaySetting;
            mainView.MfFunctionToLaserOff         += MfFunctionToLaserOff;
            mainView.MfFunctionToTrigger          += MfFunctionToTrigger;
            mainView.MfFunctionToExternalTeach    += MfFunctionToExternalTeach;
            mainView.AlarmDisplaySetting          += AlarmDisplaySetting;
            mainView.AlarmSetBehaviorToClamp      += AlarmSetBehaviorToClamp;
            mainView.AlarmSetBehaviorToHold       += AlarmSetBehaviorToHold;
            mainView.BitRateDisplaySetting        += BitRateDisplaySetting;
            mainView.BitRateSet                   += BitRateSet;
            mainView.SetStartingControlCharacter  += SetStartingControlCharacter;
            mainView.SetEndingControlCharacter    += SetEndingControlCharacter;
            mainView.WriteControlCharactersToggle += WriteControlCharactersToggle;
            mainView.TrimControlCharactersToggle  += TrimControlCharactersToggle;
            mainView.WriteLoggingToggle           += WriteLoggingToggle;
            mainView.ReadLoggingToggle            += ReadLoggingToggle;

            #endregion Register UI events
        }