public AdministratorViewModel() { rfid = new Rfid(); rfid.InitializeReader(RfidReadSomething); Potvrda = new RelayCommand <object>(potvrdi); }
private void toolStripMenuItemRfidChange_Click(object sender, EventArgs e) { Rfid.Close(); FormRfidConnect formRfidConnect = new FormRfidConnect(); formRfidConnect.ShowDialog(); }
public AdministratorViewModel(AdministratorView p) { NavigationService = new NavigationService(); admin_view = p; KorisniciAdmin = new ObservableCollection <Korisnik>(); KorisniciAdmin.Clear(); using (var db = new KorisnikDbContext()) { foreach (Korisnik k in db.Korisnici) { if (k.KorisnikId != Korisnik_iz_pocetne.KorisnikId) { KorisniciAdmin.Add(k); } } } IzbrisiKorisnika = new RelayCommand <object>(izbrisiKorisnika); PostaviZaAdmina = new RelayCommand <object>(postaviZaAdmina); PrikaziDetaljeKorisnik = new RelayCommand <object>(prikaziDetaljeKorisnik); rfid = new Rfid(); rfid.InitializeReader(RfidReadSomething); }
//使用settings,连接到指定的reader(s)上,并根据settings进行配置reader(s) private void scanItem_connect_click(object sender, EventArgs e) { Log.WriteLog(LogType.Trace, "come in scanItem_connect_click"); if (gstSettings != null) { scanItem_chgOper(Macro.SCANITEM_OPR_CONNECTING); ((Form1)this.Parent.Parent.Parent.Parent).scan = true; //if (!Rfid.reader_connectReader(gstSettings.StoreID, gstSettings.SettingsID, impinjrev, ir_handler_readTag, null, null, false)) if (!Rfid.reader_connectReader(gstSettings.StoreID, gstSettings.SettingsID, impinjrev, gstBQue, null, null, null, false)) { Log.WriteLog(LogType.Error, "error to call reader_connectReader"); scanItem_chgOper(Macro.SCANITEM_OPR_NOTCONNECT); ((Form1)this.Parent.Parent.Parent.Parent).scan = false; return; } scanItem_chgOper(Macro.SCANITEM_OPR_CONNECTED); } else { MessageBox.Show("The Store selected does not have a setting set, please go to the Select Setting page and choose a setting!", "", MessageBoxButtons.OKCancel); } }
public PlacanjeViewModel() { CreateUplata = new Uplata(); rfid = new Rfid(); rfid.InitializeReader(RfidReadSomething); NavigationServis = new NavigationService(); PotvrdaUplate = new RelayCommand <object>(potvrda, mozeLiPotvrditi); }
public PutovanjeViewModel(Pocetna p) { Br = 0; this.Parent = p; rfid = new Rfid(); rfid.InitializeReader(RfidReadSomething); Dalje = new RelayCommand <object>(podaci, mozeLiSeNastaviti); }
public void Put(string id, [FromBody] Rfid value) { _refidRepository.Update(value); //var item = _refidRepository.GetByCode(id); //if(item != null) //{ //} }
private void pictureBoxRfid_MouseDown(object sender, MouseEventArgs e) { if (Rfid.isOpen()) { contextMenuStripRfidOpen.Show(pictureBoxRfid, pictureBoxRfid.Location.X - 85, pictureBoxRfid.Location.Y - 58); } else { FormRfidConnect formRfidConnect = new FormRfidConnect(); formRfidConnect.ShowDialog(); } }
private void scanItem_stop_click(object sender, EventArgs e) { Log.WriteLog(LogType.Trace, "come in scanItem_stop_click"); bExportPdf.Enabled = true; cbStore.Enabled = true; DialogResult res = MessageBox.Show("You are about to stop scanning, Click OK to Stop Scanning, or Cancel!", "", MessageBoxButtons.OKCancel); if (DialogResult.OK == res) { bStart.Enabled = false; bStop.Enabled = false; bConnect.Enabled = true; lStop.Visible = true; lStop.Text = "Stopping..."; #if false for (int i = 0; i < impinjrev.Count; i++) { impinjrev[i].ir_stopRead(); impinjrev[i].ir_disconnect(); } #else if (Rfid.reader_disconnect(impinjrev)) { lStop.Text = "Stopped and Disconnected..."; } else { Log.WriteLog(LogType.Error, "error to call Rfid.reader_disconnect"); lStop.Text = "error to stopped and disconnected from reader"; return; } #endif lConnect.Visible = false; lStart.Visible = false; ((Form1)this.Parent.Parent.Parent.Parent).scan = false; busy = false; bBack.Enabled = true; //清空业务队列的资源 gstBQue.stRList.Clear(); gstBQue.stWList.Clear(); gstBQue.stTagDic.Clear(); gstBQue.stDeduplicateDic.Clear(); } }
private void DisplayRfid(bool open) { if (open) { pictureBoxRfid.Image = Properties.Resources.rfid_open; toolTipRfid.ToolTipIcon = ToolTipIcon.Info; toolTipRfid.SetToolTip(pictureBoxRfid, "RFID подключен (" + Rfid.GetPortName() + ")"); } else { pictureBoxRfid.Image = Properties.Resources.rfid_close; toolTipRfid.ToolTipIcon = ToolTipIcon.Error; toolTipRfid.SetToolTip(pictureBoxRfid, "RFID отключен"); } }
protected override void WndProc(ref Message m) { base.WndProc(ref m); if (m.WParam.ToInt32() == Class.USB.DBT_DEVICEARRIVAL) { if (!Rfid.isOpen()) { Rfid.OpenLast(); } else { Rfid.CheckOpen(); } } if (m.WParam.ToInt32() == Class.USB.DBT_DEVICEREMOVECOMPLETE) { Rfid.CheckOpen(); } }
private void scanItem_start_click(object sender, EventArgs e) { Log.WriteLog(LogType.Trace, "come in scanItem_start_click"); scanItem_chgOper(Macro.SCANITEM_OPR_STARTING); if (Rfid.reader_start_read(ref impinjrev, ir_handler_readTag, ir_handler_writeTag, ir_reader_checkTag)) { scanItem_chgOper(Macro.SCANITEM_OPR_STARTED); } else { Log.WriteLog(LogType.Error, "error to call reader_start2read"); scanItem_chgOper(Macro.SCANITEM_OPR_NOTSTARTED); } return; }
//Instancia un nuevo DocumentClient para establecer la conexion con CosmosDB private async Task GetStartedDemo(string indata) { //crea un nuevo cliente y establece la conexion con el Azure CosmosDB this.client = new DocumentClient(new Uri(EndpointUri), PrimaryKey); //Crea una base de datos dentro de CosmosDB en caso esta no haya sido creada, llamda LibrosDB await this.client.CreateDatabaseIfNotExistsAsync(new Database { Id = "LibrosDB" }); //Crea una Coleccion de documentos en la base de datos LibrosDB en caso no haya sido creada, la coleccion se llamara RfidCollection await this.client.CreateDocumentCollectionIfNotExistsAsync(UriFactory.CreateDatabaseUri("LibrosDB"), new DocumentCollection { Id = "RfidCollection" }); //crea una entidad llamada rfid que almacenara el codigo Rfid escaneado y un estado Rfid documento = new Rfid { Id = indata, Estado = false }; //Llamada al metodo de crear documento en caso no exista, pasando como paramero la BD. la coleccion y el objeto RFID await this.CreateRfidDocumentIfNotExists("LibrosDB", "RfidCollection", documento); }
private void button1_Click(object sender, EventArgs e) { int iStoreId, iSettingId; int iStoreIdx, iSettingIdx; string sStoreName; Log.WriteLog(LogType.Trace, "come button1_Click"); iStoreIdx = comboBoxStore.SelectedIndex; iStoreId = listS[iStoreIdx].StoreID; sStoreName = listS[iStoreIdx].StoreName; iSettingIdx = comboBox1.SelectedIndex; iSettingId = listSet[iSettingIdx].SettingsID; Log.WriteLog(LogType.Trace, "goto test connect machine[" + iStoreId + "] settings[" + iSettingId + "] readers."); if (!Rfid.reader_connectReader(iStoreId, iSettingId, impinjrev, null, null, null, null, true)) { Log.WriteLog(LogType.Error, "error to call reader_connectReader"); } return; }
//tarea que crea el documento en caso no exista private async Task CreateRfidDocumentIfNotExists(string databaseName, string collectionName, Rfid rfid) { await this.client.CreateDocumentAsync(UriFactory.CreateDocumentCollectionUri(databaseName, collectionName), rfid); this.WriteToConsoleAndPromptToContinue("Se ha registrado correctamente el Rfid: {0}", rfid.Id); }
/// <summary> /// Initializes a new instance of the /// <see cref="StudentPiER.StudentCode"/> class. /// </summary> /// <param name='robot'> /// The Robot to associate with this StudentCode /// </param> public StudentCode(Robot robot) { this.robot = robot; this.stopwatch = new Stopwatch(); this.stopwatch.Start(); this.useRfid = true; if (this.useRfid) { this.rfid = new Rfid(robot); } this.leftMotor = new GrizzlyBear(robot, Watson.Motor.M0); this.rightMotor = new GrizzlyBear(robot, Watson.Motor.M1); this.sonar = new AnalogSonarDistanceSensor(robot, Watson.Analog.A5); this.leftEncoder = new GrizzlyEncoder(1, leftMotor, robot); this.rightEncoder = new GrizzlyEncoder(1, rightMotor, robot); }
private void toolStripMenuItemCloseRfid_Click(object sender, EventArgs e) { Rfid.Close(); }
private void Button_Start_Click(object sender, RoutedEventArgs e) { Rfid.TagsReported += Rfid_TagsReported; Rfid.BeginRead(); }
private void FormMain_FormClosed(object sender, FormClosedEventArgs e) { Ssh.AppClose(); Rfid.AppClose(); }
/// <summary> /// Initializes a new instance of the /// <see cref="StudentPiER.StudentCode"/> class. /// </summary> /// <param name='robot'> /// The Robot to associate with this StudentCode /// </param> public StudentCode(Robot robot) { Debug.Print("hello"); this.robot = robot; this.stopwatch = new Stopwatch(); this.stopwatch.Start(); this.useRfid = true; if (this.useRfid) { this.rfid = new Rfid(robot); } this.leftMotor = new GrizzlyBear(robot, Watson.Motor.M0); this.rightMotor = new GrizzlyBear(robot, Watson.Motor.M1); this.gearbox = new GrizzlyBear(robot, Watson.Motor.M2, 0, 100, true); this.sonar = new AnalogSonarDistanceSensor(robot, Watson.Analog.A5); this.doorController = new MicroMaestro(robot, 12); this.motorDoor = new ServoMotor(robot, doorController,0,2400,9600); this.leftEncoder = new GrizzlyEncoder(10, leftMotor, robot); this.rightEncoder = new GrizzlyEncoder(10, rightMotor, robot); }