Пример #1
0
 static public ProtocolWindow GetProtocolWindow()
 {
     if (protocolWindow == null)
     {
         protocolWindow = new ProtocolWindow();
     }
     return(protocolWindow);
 }
Пример #2
0
        public MainWindow()
        {
            InitializeComponent();
            ConnectionMode connectionMode = new ConnectionMode(parameters);

            connectionMode.ShowDialog();
            protocolWindow      = ProtocolWindow.GetProtocolWindow();
            dataLink            = new DataLink(parameters.ByteStream);
            dataLink.DataRcvd  += DataRxd;
            dataLink.DataSent  += DataTxd;
            lblRootName.Content = parameters.RootName;

            /*
             * if (parameters.BroadcastIds.Count > 0)
             * {
             *  foreach (var s in parameters.BroadcastIds)
             *  {
             *      lstController.Items.Add("Broadcast:" + s);
             *  }
             * }
             */
            lstController.Items.Add("Controller:" + parameters.ControllerID);
            remoteConctrollerLinks[parameters.ControllerID] =
                new RemoteControllerLink(parameters, dataLink);

            tabMsgFrmId = new TextBox[6] {
                tbMsgFrmId1, tbMsgFrmId2, tbMsgFrmId3, tbMsgFrmId4, tbMsgFrmId5, tbMsgFrmId6
            };
            tabMsgFrmOnTime = new TextBox[6] {
                tbMsgFrmOnTime1, tbMsgFrmOnTime2, tbMsgFrmOnTime3, tbMsgFrmOnTime4, tbMsgFrmOnTime5, tbMsgFrmOnTime6
            };
            tabPlanF_M_Mode = new ComboBox[6] {
                cbPlanFrmMsg1, cbPlanFrmMsg2, cbPlanFrmMsg3, cbPlanFrmMsg4, cbPlanFrmMsg5, cbPlanFrmMsg6
            };
            tabPlanF_M_Id = new TextBox[6] {
                tbPlanFMId1, tbPlanFMId2, tbPlanFMId3, tbPlanFMId4, tbPlanFMId5, tbPlanFMId6
            };
            tabPlanStart = new TextBox[6] {
                tbPlanStartTime1, tbPlanStartTime2, tbPlanStartTime3, tbPlanStartTime4, tbPlanStartTime5, tbPlanStartTime6
            };
            tabPlanStop = new TextBox[6] {
                tbPlanStopTime1, tbPlanStopTime2, tbPlanStopTime3, tbPlanStopTime4, tbPlanStopTime5, tbPlanStopTime6
            };
            tabPlanWeekdays = new CheckBox[7] {
                cbSun, cbMon, cbTue, cbWed, cbThu, cbFri, cbSat
            };
            for (int i = 0; i < 6; i++)
            {
                tabPlanF_M_Mode[i].Items.Add("Frame");
                tabPlanF_M_Mode[i].Items.Add("Message");
            }

            cbFrmFont.ItemsSource          = Enum.GetNames(typeof(ConstCode.FrameFont));
            cbFrmFont.SelectedIndex        = 0;
            cbFrmConspicuity.ItemsSource   = Enum.GetNames(typeof(ConstCode.ConspicuityDevices));
            cbFrmConspicuity.SelectedIndex = 0;

            lblFrmFont.Visibility    = Visibility.Hidden;
            cbFrmFont.Visibility     = Visibility.Hidden;
            btnFrmLoadImg.Visibility = Visibility.Hidden;
            spPalette.Visibility     = Visibility.Hidden;

            btnRefreshStatus_Click(null, null);
        }