static void Main(string[] args) { GPIOControl.SetLed(GPIOControl.Mode.StandBy); Thread.Sleep(10); GenericScenario scenario = new GenericScenario(); scenario.Start(); }
public virtual void Start() { GPIOControl.SetLed(GPIOControl.Mode.Reflexion); tts = new CognitiveAccess(); stt = new RecognitionCognitive(); smsHandler = new SMSHandler(); soundPlayer = new SoundPlayer(); GPIOControl.SetLed(GPIOControl.Mode.StandBy); //tts.Say("Bonjour, je suis Loic"); ScenarioOne one = new ScenarioOne(stt, tts, smsHandler, soundPlayer); one.Start(); ScenarioTwo two = new ScenarioTwo(stt, tts, smsHandler, soundPlayer); two.Start(); }
public override void Start() { GPIOControl.SetLed(GPIOControl.Mode.Reflexion); LogControl.Write("[SCENARIO 2] : Start"); GPIOControl.SetLed(GPIOControl.Mode.StandBy); string response = WaitSMS(); GPIOControl.SetLed(GPIOControl.Mode.Speak); tts.Say(response); soundPlayer.Play(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + "/say.wav"); string toSend = "\"" + Listen() + "\""; smsHandler.SendSMS("+41789476812", toSend); GPIOControl.SetLed(GPIOControl.Mode.Reflexion); Thread.Sleep(1000); GPIOControl.SetLed(GPIOControl.Mode.StandBy); }
private async void btnDelete_Click(object sender, RoutedEventArgs e) { if (lsvUser.SelectedItem == null) { await InfoDialog.ShowOK("请选择需要删除指纹信息的人员。"); return; } if ((lsvUser.SelectedItem as custPerDisplayItem).FID != "") { if (await InfoDialog.ShowYesNo("确定删除指定人员的指纹信息吗?") == ContentDialogResult.Secondary) { return; } await GPIOControl.PowerOnFingerprintPower( ); try { // Delete from fingerprint device fgRemoveFingerprint cmd = new fgRemoveFingerprint(Convert.ToUInt16((lsvUser.SelectedItem as custPerDisplayItem).FID.Trim( ))); CommonResult ret = await FingerprintDevice.Execute(cmd); // Update compare file await StorageControl.UpdateFIDByPID((lsvUser.SelectedItem as custPerDisplayItem).PID, string.Empty); await LoadFingprinterInfo( ); } catch (Exception ex) { throw new CommonResult(ResultCode.GN_SYS_ERROR, ex.Message); } finally { GPIOControl.PowerOffFingerprintPower( ); } } else { await InfoDialog.ShowOK("指定的人员没有记录指纹信息。"); } }
public override void Start() { LogControl.Write("[SCENARIO 1] : Start"); //Vérifie si ya un appel a l'aide string response = Listen(); tts.Say("Je suis en train de contacter des secours..."); soundPlayer.Play(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + "/say.wav"); GPIOControl.SetLed(GPIOControl.Mode.Reflexion); Thread.Sleep(1000); //smsHandler.SendSMS("+41786268658", response); smsHandler.SendSMS("+41789476812", response); response = WaitSMS(); GPIOControl.SetLed(GPIOControl.Mode.Speak); tts.Say(response); soundPlayer.Play(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + "/say.wav"); GPIOControl.SetLed(GPIOControl.Mode.Help); Thread.Sleep(10000); }
private void Dialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args) { GPIOControl.PowerOffFingerprintPower( ); }
private async void Dialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args) { await GPIOControl.PowerOnFingerprintPower( ); DoCollect( ); }