Inheritance: System.Windows.Forms.Form
Esempio n. 1
0
        public DeviceForm()
        {
            devInfo.DevForm = this;
            connectInfo.BDA = "00:00:00:00:00:00";
            connectInfo.Handle = 0;
            connectInfo.AddrType = 0;
            disconnectInfo.BDA = "00:00:00:00:00:00";
            disconnectInfo.Handle = 0;
            disconnectInfo.AddrType = 0;
            Connections.Clear();
            commMgr.InitCommManager();
            msgLogForm = new MsgLogForm(this);
            commSelectForm = new CommSelectForm();

            InitializeComponent();

            Text = FormMain.ProgramTitle + FormMain.ProgramVersion;
            threadMgr = new ThreadMgr(this);
            sendCmds = new SendCmds(this);
            attrData.sendAutoCmds = false;
            attributesForm = new AttributesForm(this);
            devTabsForm = new DeviceTabsForm(this);

            LoadUserInitializeValues();
            LoadUserSettings();

            sendCmds.DisplayMsgCallback = new DeviceForm.DisplayMsgDelegate(DisplayMsg);

            threadMgr.txDataOut.DeviceTxDataCallback = new DeviceForm.DeviceTxDataDelegate(DeviceTxData);
            threadMgr.txDataOut.DisplayMsgCallback = new DeviceForm.DisplayMsgDelegate(DisplayMsg);
            threadMgr.rxDataIn.DeviceRxDataCallback = new DeviceForm.DeviceRxDataDelegate(DeviceRxData);
            threadMgr.rxTxMgr.HandleRxTxMessageCallback = new DeviceForm.HandleRxTxMessageDelegate(HandleRxTxMessage);

            dspTxCmds.DisplayMsgCallback = new DeviceForm.DisplayMsgDelegate(DisplayMsg);
            dspTxCmds.DisplayMsgTimeCallback = new DeviceForm.DisplayMsgTimeDelegate(DisplayMsgTime);
            attributesForm.DisplayMsgCallback = new DeviceForm.DisplayMsgDelegate(DisplayMsg);
            msgLogForm.DisplayMsgCallback = new DeviceForm.DisplayMsgDelegate(DisplayMsg);
            devTabsForm.DisplayMsgCallback = new DeviceForm.DisplayMsgDelegate(DisplayMsg);

            threadMgr.Init(this);

            msgLogForm.TopLevel = false;
            msgLogForm.Parent = plLog;
            msgLogForm.Visible = true;
            msgLogForm.Dock = DockStyle.Fill;
            msgLogForm.ControlBox = false;
            msgLogForm.ShowIcon = false;
            msgLogForm.FormBorderStyle = FormBorderStyle.None;
            msgLogForm.StartPosition = FormStartPosition.Manual;
            msgLogForm.Show();

            devTabsForm.TopLevel = false;
            devTabsForm.Parent = plUserTabs;
            devTabsForm.Visible = true;
            devTabsForm.Dock = DockStyle.Fill;
            devTabsForm.ControlBox = false;
            devTabsForm.ShowIcon = false;
            devTabsForm.FormBorderStyle = FormBorderStyle.None;
            devTabsForm.StartPosition = FormStartPosition.Manual;
            devTabsForm.Show();

            attributesForm.TopLevel = false;
            attributesForm.Parent = plAttributes;
            attributesForm.Visible = true;
            attributesForm.Dock = DockStyle.Fill;
            attributesForm.ControlBox = false;
            attributesForm.ShowIcon = false;
            attributesForm.FormBorderStyle = FormBorderStyle.None;
            attributesForm.StartPosition = FormStartPosition.Manual;
            attributesForm.Show();
        }