示例#1
0
        private void radioButtonBAC1_Click(object sender, EventArgs e)
        {
            // switch to BAC1

            _bnm.BACnetManagerClose();

            inside_socket = new OurSocket(_apm, 0xBAC1);

            IPEPDestination = new myIPEndPoint(IPAddress.Broadcast, 0xBAC1);

            _bnm = new BACnetManager(_apm, inside_socket, BACnetEnums.SERVER_DEVICE_ID, IPEPDestination);

            BACnetInteropApp.Properties.Settings.Default.BACnetPort = 0xBAC1;
            BACnetInteropApp.Properties.Settings.Default.Save();
        }
示例#2
0
        public MainForm()
        {
            InitializeComponent();

            IPEPDestination = new myIPEndPoint(IPAddress.Broadcast, defaultPort);

            // Change the radio buttons to match the default

            switch (defaultPort)
            {
            case 0xBAC0:
                inside_socket = new OurSocket(_apm, defaultPort);
                // todo, we cannot update the radiobuttons yet because they will close and reopen bnm, and that is not defined yet....
                this.radioButtonBAC0.Checked = true;
                this.radioButtonBAC1.Checked = false;
                break;

            case 0xBAC1:
                inside_socket = new OurSocket(_apm, defaultPort);
                this.radioButtonBAC1.Checked = true;
                this.radioButtonBAC0.Checked = false;
                break;

            default:
                // todo-panic here
                break;
            }

            _bnm = new BACnetManager(_apm, inside_socket, BACnetEnums.SERVER_DEVICE_ID, IPEPDestination);

            TreeViewDevices.ShowNodeToolTips = true;
            _apm.treeViewUpdater             = new DeviceTreeView(_apm, TreeViewDevices);
            _apm.bnm = _bnm;

            // backgroundWorkerApplication.RunWorkerAsync();
        }