/// <summary> /// The constructor. /// </summary> public Robot() { serial_port = new SerialPort(); serial_port.BaudRate = 115200 / 4; serial_port.DataBits = 8; serial_port.Parity = Parity.None; serial_port.StopBits = StopBits.One; serial_port.ReadTimeout = 500; serial_port.WriteTimeout = 500; serial_port.Handshake = Handshake.None; API = new NXT.API.API(this); DeviceInfo = new DeviceInfo(this); InPort1 = new InPort(this); InPort1.Number = 0; InPort2 = new InPort(this); InPort2.Number = 1; InPort3 = new InPort(this); InPort3.Number = 2; InPort4 = new InPort(this); InPort4.Number = 3; OutPortA = new OutPort(this); OutPortA.Number = 0; OutPortB = new OutPort(this); OutPortB.Number = 1; OutPortC = new OutPort(this); OutPortC.Number = 2; OutPortAll = new OutPort(this); OutPortAll.Number = 0xFF; }
public async Task <IEnumerable <SessionDM> > GetSessions() { var api = new API.API(); var sessions = await api.GetSessions(); if (sessions != null) { return(ConvertSessions(sessions)); } else { return(null); } }
public DownResourceViewModel(DownResource win) { SelectProductCommand = new RelayCommand <string>((x) => { selectWin(x); }); SelectedCategoryCommand = new RelayCommand <CategoryTextImage>((x) => { API.API selfApi = new API.API(); _ = selfApi.UpdateLocalFiles(x); }); SelectedMaterialCategoryCommand = new RelayCommand <CategoryTextImage>(x => { API.API selfApi = new API.API(); _ = selfApi.UpdateLocalFilesByMaterial(x); }); this.win = win; }
/// <summary> /// The constructor. /// </summary> public Robot(string address, string user, string password) { web_client = new WebClientTimeOut(); web_client.BaseAddress = address; web_client.Credentials = new NetworkCredential(user, password); web_client.Proxy = null; web_client.TimeOut = 2000; API = new Rovio.API.API(this); Drive = new Drive(this); Camera = new Camera(this); IRSensor = new IRSensor(this); NavigationSensor = new NavigationSensor(this); }
public Robot(string address, string user, string password) { web_client = new WebClientTimeOut(); web_client.BaseAddress = address; web_client.Credentials = new NetworkCredential(user, password); web_client.Proxy = null; web_client.TimeOut = 2000; API = new Rovio.API.API(this); }
public async Task <IEnumerable <Sponsor> > GetSponsors() { var api = new API.API(); return(await api.GetSponsors()); }