Ejemplo n.º 1
0
 //close Com port connection
 public void Disconnect()
 {
     if (client == null)
     {
         client = new CommunicationProtocolClient();
         client.Open();
     }
     //close Com port connection
     client.Disconnect();
 }
Ejemplo n.º 2
0
        public bool Connect(string comPortName)
        {
            if (client == null)
            {
                client = new CommunicationProtocolClient();
                client.Open();
            }

            return(client.Connect(comPortName));
        }
Ejemplo n.º 3
0
        private void button2_Click(object sender, EventArgs e)
        {
            client = new TeslaCommunication.CommunicationProtocolClient();
            client.Open();
            updateView();
            timerAlive          = new Timer();
            timerAlive.Interval = 100;
            timerAlive.Tick    += TimerAlive_Tick;
            timerAlive.Start();

            button2.Enabled = false;

            freqChanger1.setEnvoirnment("#1 Несущая", 1, client);
        }
Ejemplo n.º 4
0
        internal void setEnvoirnment(string featureName, int featureNumber, CommunicationProtocolClient client)
        {
            this.client         = client;
            this.groupBox2.Text = featureName;
            this.featureNumber  = featureNumber;
            WindowState ws = WindowState.Load();

            textBoxStart.DataBindings.Add("Text", ws, "FromF" + featureNumber.ToString(), false, DataSourceUpdateMode.OnPropertyChanged);
            textBoxStop.DataBindings.Add("Text", ws, "ToF" + featureNumber.ToString(), false, DataSourceUpdateMode.OnPropertyChanged);
            textBoxPeriod.DataBindings.Add("Text", ws, "CurrentF" + featureNumber.ToString(), false, DataSourceUpdateMode.OnPropertyChanged);
            textBoxDuty.DataBindings.Add("Text", ws, "DutyF" + featureNumber.ToString(), false, DataSourceUpdateMode.OnPropertyChanged);


            updateTrackBarFreqRanges();
            onFreqChange();
        }
Ejemplo n.º 5
0
        public Main()
        {
            string assemblyLoc = GetType().Assembly.Location;
            string configName  = assemblyLoc + ".config";

            AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", configName);
            try
            {
                if (client == null)
                {
                    client = new CommunicationProtocolClient();
                    client.Open();
                }
            }
            catch (Exception ex)
            {
            }
        }
Ejemplo n.º 6
0
        private void buttonService_Click(object sender, RibbonControlEventArgs e)
        {
            try
            {
                if (client.State == System.ServiceModel.CommunicationState.Faulted)
                {
                    client = new CommunicationProtocolClient();
                }
                client.Open();
                timerAlive          = new Timer();
                timerAlive.Interval = 500;
                timerAlive.Tick    += TimerAlive_Tick;
                timerAlive.Start();
            }
            catch (Exception ex)
            {
                showMessage(ex.ToString());
            }

            updateView();
        }
Ejemplo n.º 7
0
 private void ToolBox_Load(object sender, RibbonUIEventArgs e)
 {
     client      = new CommunicationProtocolClient();
     this.Close += ToolBox_Close;
     updateView();
 }