コード例 #1
0
ファイル: Form1.cs プロジェクト: secretMoi/Wallon
        public void Disconnect_Click(object sender, EventArgs e)
        {
            ControllerConnection.Disconnect();

            panelContainer.Controls.Clear();
            panelContainer.Controls.Add(new Connexion());
        }
コード例 #2
0
        public void SendTelegram(string telegram, ConnectionChannel channel, bool logMessage)
        {
            string ChannelName = "";

            if (ControllerConnection != null && DespatchConnection != null && plcConnected)
            {
                if (channel == ConnectionChannel.Main)
                {
                    ChannelName = Name;
                    ControllerConnection.Send(telegram);
                }
                else if (channel == ConnectionChannel.Despatch)
                {
                    ChannelName = NameDespatch;
                    DespatchConnection.Send(telegram);
                }

                if (logMessage)
                {
                    LogTelegrams(string.Format("{0} ATC<{1}: {2}", DateTime.Now.ToString(), ChannelName, telegram), Color.Black);
                }
            }
            else
            {
                LogTelegrams(string.Format("Error: Cannot send message, controller {0} connection not configured; {1}", ChannelName, telegram), Color.Red);
            }
        }
コード例 #3
0
        public async Task Execute(IJobExecutionContext context)
        {
            JobDataMap           dataMap = context.MergedJobDataMap;
            ControllerConnection controllerConnection = (ControllerConnection)dataMap.Get("controllerConnection");

            ControllerCommands.ProjectorLamp(controllerConnection);
        }
コード例 #4
0
        public async Task Execute(IJobExecutionContext context)
        {
            JobDataMap dataMap = context.MergedJobDataMap;

            ControllerConnection controllerConnection = (ControllerConnection)dataMap.Get("controllerConnection");
            Random random = (Random)dataMap.Get("random");


            ControllerCommands.RandomError(controllerConnection, random);
        }
コード例 #5
0
        public MainWindow()
        {
            InitializeComponent();

            instance = this;

            ControllerConnection.Connect();

            Thread threadLondonUr    = new Thread(new ThreadStart(ControllerUr.London));
            Thread threadKøbenhavnUr = new Thread(new ThreadStart(ControllerUr.København));

            threadLondonUr.Start();
            threadKøbenhavnUr.Start();

            ButtonSalgsstatistik_Click(null, null);
            ControllerPrisBeregner.ComboBoxOpretPostnr(comboboxPrisBeregner_Postnr);

            ControllerCrudEjendom.AddItem(ComboBoxEjendomGarageCarport, ComboBoxEjendomStartPris, ComboBoxEjendomNuværendePris);
        }
コード例 #6
0
ファイル: Connexion.cs プロジェクト: secretMoi/Wallon
        public Connexion()
        {
            InitializeComponent();

            _controllerLocataires = new ControllerLocataires();
            _controllerConnection = new ControllerConnection();

            SetTitre("Connexion");

            SetColors();

            flatTextBoxPassword.IsPassword = true;

            if (ControllerConnection.Disconnected)
            {
                alerte.ThemeValid();
                alerte.Show("Vous avez bien été déconnecté");
                ControllerConnection.Disconnected = false;
            }
        }