예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EquipmentPort"/> class.
        /// </summary>
        /// <param name="commProvider">The communication provider.</param>
        public EquipmentPort(ICommProvider commProvider)
        {
            _commProvider = commProvider;
            _commProvider.RemoteCommandRun += OnRemoteCommandRun;
            _commProvider.VariableChanged  += OnVariableChanged;
            _commProvider.Initialize();

            _heartbeatTimer.Interval = 5000;
            _heartbeatTimer.Elapsed += HeartbeatElapsed;

            LastHeartbeat = DateTime.Now;
        }
예제 #2
0
        void Terminal_TerminalEvent(ICommProvider sender, TerminalEventArgs e)
        {
            switch (e.EventType)
            {
            case EventTypeCodes.Connected:
                Buffer.PrintString("Connected");
                Buffer.NewLine();
                break;

            case EventTypeCodes.Disconnected:
                Buffer.PrintString("Disconnected: ");
                Buffer.PrintString(e.Message);
                Buffer.NewLine();
                break;
            }
        }
예제 #3
0
파일: NoModem.cs 프로젝트: whble/crterm
 void _transport_DataReceived(ICommProvider sender, byte[] Data)
 {
     ReceiveData(Data);
 }
예제 #4
0
파일: NoModem.cs 프로젝트: whble/crterm
 void _transport_TerminalEvent(ICommProvider sender, TerminalEventArgs e)
 {
     onTerminalEvent(e.EventType, e.Message);
 }
예제 #5
0
파일: FrameBuffer.cs 프로젝트: whble/crterm
 void Terminal_ColorEvent(ICommProvider sender, Common.ColorEventArgs e)
 {
 }
예제 #6
0
파일: FrameBuffer.cs 프로젝트: whble/crterm
        void Terminal_CursorEvent(ICommProvider sender, Common.CursorEventArgs e)
        {
            switch (e.CursorCommand)
            {
            case CursorCommandCodes.None:
                break;

            case CursorCommandCodes.Goto:
                CursorRow = e.Row;
                CursorCol = e.Col;
                break;

            case CursorCommandCodes.Up:
                CursorRow--;
                break;

            case CursorCommandCodes.Down:
                CursorRow++;
                break;

            case CursorCommandCodes.Left:
                CursorCol--;
                break;

            case CursorCommandCodes.Right:
                CursorCol++;
                break;

            case CursorCommandCodes.PageUp:
                break;

            case CursorCommandCodes.PageDown:
                break;

            case CursorCommandCodes.LineStart:
                break;

            case CursorCommandCodes.LineEnd:
                break;

            case CursorCommandCodes.Insert:
                break;

            case CursorCommandCodes.Delete:
                break;

            case CursorCommandCodes.BackSpace:
                if (CursorCol == 0)
                {
                    CursorRow--;
                    CursorCol = Columns - 1;
                    SetChar(' ');
                }
                else
                {
                    CursorCol--;
                }
                break;

            case CursorCommandCodes.ScreenHome:
                CursorCol = 0;
                CursorRow = 0;
                break;

            case CursorCommandCodes.ClearScreen:
                Clear();
                break;

            case CursorCommandCodes.Return:
                CursorCol = 0;
                break;

            default:
                break;
            }
        }
예제 #7
0
파일: FrameBuffer.cs 프로젝트: whble/crterm
 void Terminal_TextReceived(ICommProvider sender, string Text)
 {
     PrintString(Text);
 }
예제 #8
0
파일: FrameBuffer.cs 프로젝트: whble/crterm
 void Terminal_DataReceived(ICommProvider sender, byte[] Data)
 {
 }
예제 #9
0
 void _terminal_TextReceived(ICommProvider sender, string Text)
 {
     FixString.Text = Text;
 }
예제 #10
0
 void Modem_TerminalEvent(ICommProvider sender, TerminalEventArgs e)
 {
     onTerminalEvent(e);
 }
예제 #11
0
 void Modem_DataReceived(ICommProvider sender, byte[] Data)
 {
     ReceiveData(Data);
 }