Пример #1
0
        public frmMain()
        {
            // Configure Logging.

            PMSFactory = new PMSInterfaceFactory();
            PMSFactory.PMSInterfaceType = IntaMate.Properties.Settings.Default.InterfaceAPI;

            TCP = new TCPServer(IPAddress.Any, Convert.ToInt32(IntaMate.Properties.Settings.Default.ListenPort), PMSFactory);

            InitializeComponent();

            this.noneToolStripMenuItem.Tag     = NLog.LogLevel.Off;
            this.debugToolStripMenuItem.Tag    = NLog.LogLevel.Debug;
            this.traceToolStripMenuItem.Tag    = NLog.LogLevel.Trace;
            this.infoToolStripMenuItem.Tag     = NLog.LogLevel.Info;
            this.warningsToolStripMenuItem.Tag = NLog.LogLevel.Warn;
            this.errorsToolStripMenuItem.Tag   = NLog.LogLevel.Error;
            this.fatalToolStripMenuItem.Tag    = NLog.LogLevel.Fatal;
            UpdateOnlineLoggingLevel();

            List <NLog.LogLevel> MyList = new List <LogLevel>();

            MyList.Add(NLog.LogLevel.Off);
            MyList.Add(NLog.LogLevel.Debug);
            MyList.Add(NLog.LogLevel.Trace);
            MyList.Add(NLog.LogLevel.Info);
            MyList.Add(NLog.LogLevel.Warn);
            MyList.Add(NLog.LogLevel.Error);
            MyList.Add(NLog.LogLevel.Fatal);
            MyList.Sort();

            cbAPI.Items.Clear();
            cbAPI.Items.AddRange(Enum.GetNames(typeof(PMSInterfaceFactory.e_PMSInterfaceType)));

            cbTransport.Items.Clear();
            cbTransport.Items.AddRange(Enum.GetNames(typeof(e_IOType)));

            cbMsgType.Items.Clear();
            cbMsgType.Items.AddRange(Enum.GetNames(typeof(e_PMSMSGType)));

            TCP.Start();
            Online();
            UpdateOnlineLoggingLevel();
        }
Пример #2
0
 public TCPServer(IPAddress inserverAddress, int inport, PMSInterfaceFactory inAPI)
 {
     serverAddress = inserverAddress;
     port          = inport;
     PMSFactory    = inAPI;
 }