static void Main(string[] args) { System.Xml.Serialization.XmlSerializer sr = new System.Xml.Serialization.XmlSerializer(typeof(Config)); if (!System.IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory + "config.xml")) { Config config = new Config() {id=1, WirelessComPort = "Com14", TouhPanelComPort = "Com18",IOComPort="Com12" }; sr.Serialize(System.IO.File.Create(AppDomain.CurrentDomain.BaseDirectory + "config.xml"), config); Console.WriteLine("please modify the config.xml"); // Console.ReadKey(); Environment.Exit(-1); } else { config = sr.Deserialize(System.IO.File.OpenRead(AppDomain.CurrentDomain.BaseDirectory + "config.xml")) as Config; if (config == null) { Console.WriteLine("config.xml reading error!"); Environment.Exit(-1); } } controller = new Controller(config.id,config.WirelessComPort,config.TouhPanelComPort,config.IOComPort); }
public ThreadPlaySound(int recordid, int cnt, System.Collections.BitArray Status, TouchPanelManager touch_panel_mgr,Controller controller) { this.recordid = recordid; this.cnt = cnt; this.Status = Status; this.touch_panel_mgr = touch_panel_mgr; this.controller = controller; }
public VoiceRecogition(Controller.MainController.Mapping mapping, MainController controller) { this.controller = controller; this.recogEng = new SpeechRecognitionEngine(); recogEng.SetInputToDefaultAudioDevice(); recogEng.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(speechRecog_success); recogEng.SpeechRecognitionRejected += new EventHandler<SpeechRecognitionRejectedEventArgs>( speechRecog_failure); recogEng.LoadGrammar(CreateSampleGrammar(mapping)); this.start(); }
private void buttonOpenFile_Click(object sender, EventArgs e) { //Console.WriteLine(DataLayer.Dal.GetContent("UTS - kurser.txt")); OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "TXT | *.txt"; if (ofd.ShowDialog() == DialogResult.OK) { //textBoxFile_Name = ofd.FileName.ToString; textBoxFile_Name.Text = ofd.SafeFileName; textBoxFull_File_Name.Text = ofd.FileName; string fileName = textBoxFile_Name.Text; Controller.Controller controller = new Controller.Controller(); Console.WriteLine(ofd.SafeFileName); labelDataResult.Text = controller.GetContent(ofd.SafeFileName); labelDataResult.Text = Controller.Controller.GetHello(); } }
private Grammar CreateSampleGrammar(Controller.MainController.Mapping mapping) { GrammarBuilder grammarBuilder = new GrammarBuilder(mapping.prefix); if (mapping.useDictation) { grammarBuilder.AppendDictation(); } else { Choices choices = new Choices(); foreach (string choice in mapping.list) { choices.Add(choice); } grammarBuilder.Append(choices); } Grammar g = new Grammar(grammarBuilder); g.Name = "Commands"; return g; }
public MainForm(Controller.Controller controller) { initializing = true; logger.Start(); this.controller = controller; //oxy(); InitializeComponent(); this.Text = "AQI Finder - purpleAir v1.93"; GMap.NET.MapProviders.GoogleMapProvider.Instance.ApiKey = AQI_Map.Properties.Settings.Default.key; comboBoxType.DataSource = Enum.GetValues(typeof(AqiPackage.Type)); comboBoxMapType.Items.Add(GMap.NET.MapProviders.GoogleMapProvider.Instance); comboBoxMapType.Items.Add(GMap.NET.MapProviders.GoogleSatelliteMapProvider.Instance); comboBoxMapType.Items.Add(GMap.NET.MapProviders.GoogleTerrainMapProvider.Instance); comboBoxMapType.SelectedIndex = 0; //comboBoxParticleType.Items.Add( new ComboTypeItem( "Raw PM1.0 in µg/m³", (int)AqiPackage.Names.pm_1 ) ); comboBoxParticleType.Items.Add(new ComboTypeItem("US EPA PM2.5 AQI", (int)AqiPackage.Names.PM25)); comboBoxParticleType.Items.Add(new ComboTypeItem("US EPA PM10 AQI", (int)AqiPackage.Names.PM10)); comboBoxParticleType.SelectedIndex = 1; comboBoxTime.Items.Add(new ComboTypeItem("Show Realtime", 0)); comboBoxTime.Items.Add(new ComboTypeItem("10 Minute Average", 10)); comboBoxTime.Items.Add(new ComboTypeItem("30 Minute Average", 30)); comboBoxTime.Items.Add(new ComboTypeItem("60 Minute Average", 60)); comboBoxTime.Items.Add(new ComboTypeItem("One Day Average", 1440)); comboBoxTime.Items.Add(new ComboTypeItem("One Week Average", 10080)); comboBoxTime.SelectedIndex = 1; gmap.ShowCenter = false; GMaps.Instance.Mode = GMap.NET.AccessMode.ServerOnly; gmap.DragButton = MouseButtons.Left; // }
public VolumeTrackBar(Controller.Controller cont) { this.cont = cont; DoubleBuffered = true; }
static void Main(string[] args) { Controller.Controller c = new Controller.Controller(MyView, MyDataModel); DoWork(c); }
public GameBoard(Controller.Controller controller) { _CartList = new List <Cart>(); _ShipList = new List <Ship>(); this.controller = controller; }
static void Main(string[] args) { Controller.Controller controller = new Controller.Controller(); }
/// <summary> /// Write an integer to the sepcified register /// </summary> /// <param name="aRegister">The register to write to. It is the <i>axis specific</i> register</param> /// <param name="aValue">The value to write to aRegister</param> protected void WriteInt(Controller.Registers aRegister, Int32 aValue) { iController.Write(aRegister, aValue); }
/// <summary> /// Get an integer from the sepcified register /// </summary> /// <param name="aRegister">The register to read. It is the <i>axis specific</i> register</param> /// <returns>The read integer</returns> protected Int32 ReadInt(Controller.Registers aRegister) { return iController.Read(aRegister); }
public RoundedTrackBar(Controller.Controller cont) { this.cont = cont; DoubleBuffered = true; }
public AllStepsCommand(String key, String desc, Controller.Controller ctr) : base(key, desc) { this.ctr = ctr; }