예제 #1
0
        public ControlForm(RPN rpn)
        {
            InitializeComponent();
            updateSpeadInfo();

            myRpn = rpn;
            myRpn.directionChanged += this.directionChangedHandler;
            myRpn.stateChanged += this.stateChangedHandler;
            myRpn.frequencyChanged += this.frequencyChangedHandler;
              this.pictureBox12.BringToFront();
            this.pictureBox13.BringToFront();
            this.pictureBox14.BringToFront();
            this.pictureBox15.BringToFront();
            Lines1[3] = pictureBox18;
            Lines1[2] = pictureBox20;
            Lines1[1] = pictureBox22;
            Lines1[0] = pictureBox24;
            Lines2[3] = pictureBox19;
            Lines2[2] = pictureBox21;
            Lines2[1] = pictureBox23;
            Lines2[0] = pictureBox25;

            this.myThread = new Thread(new ThreadStart(this.EventZaloop));
            myThread.IsBackground = true;
            myThread.Start();
        }
예제 #2
0
 public Diagramm(RPN rpn)
 {
     InitializeComponent();
     rpn.frequencyChanged += frequencyChangedHandler;
     rpn.stateChanged += stateChangedHandler;
     this.pictureBox1.BringToFront();
     this.myThread = new Thread(new ThreadStart(this.eventZaloop));
     myThread.IsBackground = true;
     myThread.Start();
 }
예제 #3
0
        internal static int RPN_DELAY = 500; // time in milliseconds per one frequency

        #endregion Fields

        #region Methods

        internal static Color getFreqColor(RPN.Frequency f)
        {
            Color toRet = new Color();
            switch (f) {
                case RPN.Frequency.F1: toRet = Color.Red; break;
                case RPN.Frequency.F2: toRet = Color.Blue; break;
                case RPN.Frequency.F3: toRet = Color.Yellow; break;
                case RPN.Frequency.F4: toRet = Color.Green; break;
            }
            return toRet;
        }
예제 #4
0
 internal static Image getFreqImage(RPN.Frequency f)
 {
     Image toRet = Properties.Resources.f1;
     switch (f)
     {
         case RPN.Frequency.F1: toRet = Properties.Resources.f1; break;
         case RPN.Frequency.F2: toRet = Properties.Resources.f2; break;
         case RPN.Frequency.F3: toRet = Properties.Resources.f3; break;
         case RPN.Frequency.F4: toRet = Properties.Resources.f4; break;
     }
     return toRet;
 }
예제 #5
0
        public BeamForm(RPN rpn)
        {
            InitializeComponent();

            state.sector = this.sector1x105;

            //RPNEvent handlers
            rpn.directionChanged += this.directionChangedHandler;
            rpn.stateChanged += this.stateChangedHandler;
            rpn.modeChanged += this.modeChangedHandler;
            rpn.frequencyChanged += this.frequencyChangedHandler;

            //resize event handler
            this.Resize += this.onResize;

            //thread for calculations
            this.myThread = new Thread(new ThreadStart( this.eventLoop ));
            myThread.IsBackground = true;
            myThread.Start();
        }
예제 #6
0
        static void Main()
        {
            //This method's call enables all graphic in the application
            Application.EnableVisualStyles();

            //Make RPN works
            RPN rpn = new RPN(); //Create an instance
            Thread rpnThread = new Thread(new ThreadStart(rpn.eventLoop));
            rpnThread.IsBackground = true;//Create a thread for RPN
            rpnThread.Start(); //Turn it on; now we can call all methods of RPN

               //Create beamForm and make it visible
            BeamForm beamForm = new BeamForm(rpn);
            beamForm.Show();

            Diagramm timediagramm = new Diagramm(rpn);
            timediagramm.Show();

            ControlForm controlForm = new ControlForm(rpn);

            Application.Run(controlForm);
        }
예제 #7
0
 private void stateChangedHandler(RPN.CompleteRPNState currentState)
 {
     isStateChanged = true;
     isRpnOn = currentState.isActive;
 }
예제 #8
0
 private void frequencyChangedHandler(RPN.CompleteRPNState currentState)
 {
     isFrequencyChanged = true;
     frequency = currentState.currentFrequency;
 }
예제 #9
0
 private void modeChangedHandler(RPN.CompleteRPNState currentState)
 {
     mode = currentState.currentMode;
     isRpnOn = mode == RPN.Mode.off ? false : isRpnOn;
     isModeChanged = true;
 }
예제 #10
0
 private void directionChangedHandler(RPN.CompleteRPNState currentState)
 {
     isDirectionChanged = true;
     beamDirection = currentState.currentDirection;
 }