public Settings() { this.InitializeComponent(); serialPort = ManipulatorSerialPort.Instance; var SpeedNamesList = new List <string>(); SpeedNamesList.Add("300"); SpeedNamesList.Add("1200"); SpeedNamesList.Add("2400"); SpeedNamesList.Add("4800"); SpeedNamesList.Add("9600"); SpeedNamesList.Add("19200"); SpeedNamesList.Add("38400"); SpeedNamesList.Add("57600"); SpeedNamesList.Add("74880"); SpeedNamesList.Add("115200"); SpeedNamesList.Add("230400"); SpeedNamesList.Add("250000"); foreach (string speedName in SpeedNamesList) { SpeedSeetCombo.Items.Add(speedName); } }
public Points_Editor() { this.InitializeComponent(); serialPort = ManipulatorSerialPort.Instance; pbCanal_A.Minimum = Point.MinPoint.CanA; pbCanal_A.Maximum = Point.MaxPoint.CanA; pbCanal_B.Minimum = Point.MinPoint.CanB; pbCanal_B.Maximum = Point.MaxPoint.CanB; pbCanal_C.Minimum = Point.MinPoint.CanC; pbCanal_C.Maximum = Point.MaxPoint.CanC; pbCanal_D.Minimum = Point.MinPoint.CanD; pbCanal_D.Maximum = Point.MaxPoint.CanD; pbCanal_E.Minimum = Point.MinPoint.CanE; pbCanal_E.Maximum = Point.MaxPoint.CanE; pbCanal_F.Minimum = Point.MinPoint.CanF; pbCanal_F.Maximum = Point.MaxPoint.CanF; EditorUpdate(); loopTimer = new System.Timers.Timer(); loopTimer.Interval = 500; loopTimer.Enabled = false; /// loopTimer.Elapsed += loopTimerEvent; loopTimer.AutoReset = true; //form button }
Task send; //поток для приняти данных //Task execution; //поток для отправки коллекции точек public MainPage() { try { this.InitializeComponent(); ConsoleWrite("Hello word "); programConfig = ProgramConfig.Instance; //Serial port initialize serialPort = ManipulatorSerialPort.Instance; this.components = new System.ComponentModel.Container(); SerialPort sr = this.serialPort; sr = new System.IO.Ports.SerialPort(this.components); this.serialPort.BaudRate = 115200; // this.serialPort.WriteTimeout = 50; this.serialPort.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(this.serialPort_DataReceived); CommonFunction.SetsendMessage(ConsoleWrite); //для доступа к консоли другим Page comboSelectPort.Items.Clear(); GetPortNames(); //загрузить список портов в comboSelectPort // по умолчанию открываем страницу home.xaml myFrame.Navigate(typeof(Home)); TitleTextBlock.Text = "Главная"; //passing Passing.ContextStrategy = new SinPassingStrategy(); Passing.SentPointFunction = serialPort.Write; } catch (Exception e) { ConsoleWrite(e.ToString(), Colors.Red); } }
public Home() { this.InitializeComponent(); serialPort = ManipulatorSerialPort.Instance; }