private void ButtonSignIn_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(textBoxUsername.Text)) { labelNotification.Text = usernameEmpty; } else if (string.IsNullOrWhiteSpace(textBoxPassword.Text)) { labelNotification.Text = passwordEmpty; } else { if (signInViewModel.Authenticate(textBoxUsername.Text, textBoxPassword.Text)) { var cameraWindow = new CameraForm(); cameraWindow.StartPosition = FormStartPosition.Manual; cameraWindow.Location = Location; cameraWindow.Show(); Hide(); } else { labelNotification.Text = userNotFound; } } }
static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); mp_aureus = AureusEdge.CreateAndInitializeAureus(msg); checkLicense(); settingsContent = readFromFile(Settings); //Declare all of the new global variables from above CAMS = new CameraCollection(); defaultAOI = new AOISettings(); email = new EmailSettings(); //Call the function to load everything loadAll(); TempCAMs = CAMS.clone(true); getLicenseNumber(); CM = new CameraMonitor(); camMonitorThread = new System.Threading.Thread(new System.Threading.ThreadStart(CM.monitor)); camMonitorThread.Start(); CF = new CameraForm(); Application.Run(CF); }
void Start() { map = new Minimap(); form = new CameraForm(new Bitmap(128,128)); window = new Thread(this.startThread); window.Start(); }
private void buttonSignInFace_Click(object sender, EventArgs e) { var cameraForm = new CameraForm(true, signInViewModel); cameraForm.StartPosition = FormStartPosition.Manual; cameraForm.Location = Location; cameraForm.Show(); Hide(); }
private async void LabelSignIn_Click(object sender, EventArgs e) { var cameraForm = new CameraForm(); cameraForm.StartPosition = FormStartPosition.Manual; cameraForm.Location = Location; var registerViewModel = new RegisterViewModel(); await registerViewModel.AddUser("49874f70-b7e4-4d58-9ce4-67aa55dbd281", "34d75fd8 - 3f14 - 4e56 - a878 - e397447bd40b"); signInViewModel.Authenticate("49874f70-b7e4-4d58-9ce4-67aa55dbd281", "34d75fd8 - 3f14 - 4e56 - a878 - e397447bd40b"); cameraForm.Show(); Hide(); }
protected override void HandleKeyboardState() { if (Game.IsKeyDown(Keys.O)) { var gameplayCameraValues = Utility.GetGameplayCameraValues(); Scenario.CameraSettings.Cameras.Add(gameplayCameraValues); } if (Game.IsKeyDown(Keys.K)) { var gwenForm = new WeatherForm(Scenario); ShowForm(gwenForm); } if (Game.IsKeyDown(Keys.J)) { Camera.DeleteAllCameras(); } if (Game.IsKeyDown(Keys.NumPad7)) { var gwenForm = new ScenarioForm(Scenario, DatasetAnnotator.RootScenariosDirectory); ShowForm(gwenForm); } if (Game.IsKeyDown(Keys.NumPad9)) { var gwenForm = new CameraForm(Scenario); ShowForm(gwenForm); } if (Game.IsKeyDown(Keys.NumPad1)) { var gwenForm = new PedsForm(Scenario); ShowForm(gwenForm); } if (Game.IsKeyDown(Keys.NumPad3)) { var gwenForm = new PlaceForm(Scenario); ShowForm(gwenForm); } if (Game.IsKeyDown(Keys.NumPad4)) { var gwenForm = new TimeForm(Scenario); ShowForm(gwenForm); } }
public void HandleMsg(string msgName, IMsgSender sender, params object[] args) { // 更新硬件信息 if (msgName == MachineMsg.SETUP_INFO) { OnSetupInfo(); } // 加载程序 else if (msgName == Constants.MSG_LOAD_PROGRAM) { string programPath = args[0] as string; OnLoadProgram(programPath); } // 退出AFM else if (msgName == MsgType.EXIT) { this.Close(); } // 进入主界面 else if (msgName == MsgType.ENTER_MAIN) { OnEnterMainPage(); } // 进入编程界面 else if (msgName == MsgType.ENTER_EDIT) { OnEnterEditPage(); } // 初始化相机 else if (msgName == MachineMsg.INIT_VISION) { //this.CameraCtl.SetupCamera(Machine.Instance.Camera); //this.CameraCtl.UpdateUI(); } // 切换语言 else if (msgName == LngMsg.SWITCH_LNG) { this.Config.Lang = (LanguageType)args[0]; this.SwitchConfig(); this.SaveConfig(); //this.CameraCtl.UpdateUI(); CameraForm cameraForm = FormMgr.GetForm <CameraForm>(); JogForm jogForm = FormMgr.GetForm <JogForm>(); cameraForm.UpdateUI(); jogForm.UpdateUI(); if (!cameraForm.Visible) { cameraForm.Close(); } if (!jogForm.Visible) { jogForm.Close(); } this.ReadLanguageResources(); } //切换了用户或修改了权限表需要更新界面 else if (msgName == MsgConstants.SWITCH_USER || msgName == MsgConstants.MODIFY_ACCESS) { //只有Jog和Camera2个非模态窗口,相机界面无运行时参数,所以只需要更新Jog界面。 JogForm jogForm = FormMgr.GetForm <JogForm>(); jogForm.UpdateUI(); if (!jogForm.Visible) { jogForm.Close(); } } else if (msgName == Domain.MsgType.MSG_FIND_MARK_FIALED) { this.onFindMarkFailed(args[0] as Pattern, args[1] as Mark); } else if (msgName == Domain.MsgType.MSG_BLOBS_FIALED) { this.onFindBlobsFailed(args[0] as Blobs); } else if (msgName == Domain.MsgType.MSG_FIND_BARCODE_FIALED) { if (args[1] is Barcode) { this.onFindBarcodeFailed(args[0] as Pattern, args[1] as Barcode); } else if (args[1] is ConveyorBarcode) { this.onFindBarcodeFailed(args[0] as Pattern, args[1] as ConveyorBarcode); } } }