void SetupActions() { grid1.Visibility = Visibility.Visible; Category cat = item != null ? item.Category : null; //each bin represents a category of cleaning TargetBin = vm.getBin(cat, assemblyInfo); if (TargetBin == null ) { if (cat != null) MessageBox.Show(string.Format("Bin not found for category {0}", item.Category.Name)); else MessageBox.Show(string.Format("Bin not found for customer {0} Call Manager!", assemblyInfo.CustomerID)); return; } Action.Text = "Place in Lighted bin"; logger.Info("turn on bin light" + TargetBin.PhidgetSlot.ToString()); if (ifKit.Attached) { turnoffLights(); //in case on is in the wrong state ifKit.outputs[TargetBin.PhidgetSlot] = true; } vm.bReceivedAlready = false; Wizard.Visibility = Visibility.Hidden; if (vm.BCSMode) { if (item.Category.ID != 11) //do not save next day info as next time the item might NOT be next day vm.SaveItem(item); } else { GSS gssItem = new GSS() { CreationDate = DateTime.Now, bin = TargetBin.PhidgetSlot, BarCode = TargetBin.BarCode }; vm.SaveItemGSS(gssItem); } }
public void Update() { if (GSS.KeyState.IsKeyDown(Keys.Enter)) { GSS.startTime(); GSS.RState = RenderState.World; } }
//a piece of laundry has been dropped into a bin, the index tells us which one void PhidgitController_InputChange(object sender, Phidgets.Events.InputChangeEventArgs e) { logger.Info(string.Format("input change {0}", e.Index)); int slot = e.Index; if (TargetBin == null) { this.Dispatcher.Invoke(new Action(delegate() { ClearItemFields(); Errormsg.Text = "Target slot unknown ... Please rescan item"; ErrorTxt.Visibility = Visibility.Visible; })); return; } //is item in the right slot if (slot != TargetBin.PhidgetSlot) { this.Dispatcher.Invoke(new Action(delegate() { Errormsg.Text = "Please place item in right bin"; ErrorTxt.Visibility = Visibility.Visible; })); } else { this.Dispatcher.Invoke(new Action(delegate() { //this event is fired multiple times if (vm.bReceivedAlready == false) { ErrorTxt.Visibility = Visibility.Hidden; logger.Info("write possibile changes to database"); if (vm.BCSMode) { if (item.Category.ID != 11) //do not save next day info as next time the item might NOT be next day) { vm.SaveItem(item); } } else { GSS gssItem = new GSS() { CreationDate = DateTime.Now, bin = TargetBin.PhidgetSlot, BarCode = TargetBin.BarCode }; vm.SaveItemGSS(gssItem); } ClearItemFields(); CustomerName.Text = ""; } vm.PhidgitController.outputs[TargetBin.PhidgetSlot] = false; vm.bReceivedAlready = true; })); } }
public void AddGlobalStateSwitcher <GSS>() where GSS : BaseGlobalStateSwitcher <T> { if (!HasGlobalStateSwitcherType <GSS>()) { GSS stateSwitcher = Activator.CreateInstance(typeof(GSS)) as GSS; _globalStateSwitchers.Add(typeof(GSS), stateSwitcher); stateSwitcher.Activate(this); } }
public void SaveGssItem(GSS gss) { logger.Info(string.Format("SaveItem {0}", gss.ID)); OnTheSpot.EFStuff.GSS dbItem = new OnTheSpot.EFStuff.GSS() { barcode = gss.BarCode, bin = gss.bin, time = gss.CreationDate, temp3 = "temp" }; db.GSSes.Add(dbItem); db.SaveChanges(); }
public void Update(GameTime gameTime) { if (!battleTransition) { worldCharacter.Update(gameTime); } worldMovement(); //WorldMapAnimation worldMapAnimation(gameTime); _autoElements.Update(gameTime); _sunColor = GSS.getSunPositionColor(); }
public void Draw() { GSS.SpriteBatch.Draw(GetTexture(CharacterAnimationRow), CharacterRectangle, Color.White); if (GSS.DebugMode) { GSS.SpriteBatch.Draw(GetTexture(0), new Rectangle( CharacterActiveTileX, CharacterActiveTileY, EngineSettings.TileSize, EngineSettings.TileSize ), Color.White); } DebugConsole.WriteLine($"GameTime {GSS.GetTime():dd-mmm-yyyy HH:mm:ss}"); }
public void Update(GameTime gameTime) { if (!battleTransition) { worldCharacter.Update(gameTime); } WorldMovement(); //WorldMapAnimation WorldMapAnimation(gameTime); _autoElements.Update(gameTime); _sunColor = GSS.GetSunPositionColor(); SceneWorker.AttemptSceneChange(worldCharacter.GetCenterTilePosition()); }
} // Data to be passed on a Service Request // A description of the data from four points of view. public AttrData(byte Val, GSS acc, bool Ignore, int Order, Prop Data, Prop Data2 = null, Prop Data3 = null) { this.Val = Val; this.HasSet = acc == GSS.Set || acc == GSS.GetSet; this.HasGet = acc == GSS.Get || acc == GSS.GetSet; this.HasService = acc == GSS.Service; this.Ignore = Ignore; this.Order = Order; // This is what the data looks like in the printer this.Data = Data; if (this.HasService) { this.Service = Data2; } else { this.Get = Data2; this.Set = Data3; } }
internal void Draw() { GSS.SpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.AnisotropicClamp, DepthStencilState.DepthRead, RasterizerState.CullNone); for (int x = 0; x < cityTilemap.Width; x++) { for (int y = 0; y < cityTilemap.Height; y++) { uint col = cityTilemap.GetColor(x, y).PackedValue; if (SceneMaps.Tiles.ContainsKey(col)) { GSS.SpriteBatch.Draw(SceneMaps.Tiles[col], new Rectangle(x * EngineSettings.TileSize, y * EngineSettings.TileSize, EngineSettings.TileSize, EngineSettings.TileSize), GSS.GetSunPositionColor()); } } } GSS.SpriteBatch.End(); }
public void Update() { if (GSS.Controlls.Confirm()) { switch (activeButton) { case 0: //Easy case 1: //Medium GSS.StartTime(); GSS.World.LoadWorld(); GSS.RenderState = RenderState.World; break; default: throw new InvalidManuSelectionException(GSS.RenderState, activeButton); } GSS.StartTime(); GSS.RenderState = RenderState.World; Dispose(true); } else if (GSS.Controlls.Up(true)) { activeButton++; if (activeButton == Buttons.Length) { activeButton = 0; } } else if (GSS.Controlls.Down(true)) { activeButton--; if (activeButton == -1) { activeButton = Buttons.Length - 1; } } }
public List <User> GetProjectUsers() { try { var allSids = GSS.ReadIdentity(SearchFactor.AccountName, string.Format(@"[{0}]\Project Valid Users", ProjectInfo.Name), QueryMembership.Expanded); IEnumerable <Identity> members = GSS.ReadIdentities(SearchFactor.Sid, allSids.Members, QueryMembership.None) .Where(a => a.Type == IdentityType.WindowsUser); return (members.Select( member => new User() { UserName = member.AccountName, DisplayName = member.DisplayName }) .OrderBy(n => n.DisplayName) .ToList()); } catch (Exception ex) { return(new List <User>()); } }
//a piece of laundry has been dropped into a bin, the index tells us which one void PhidgitController_InputChange(object sender, Phidgets.Events.InputChangeEventArgs e) { logger.Info(string.Format("input change {0}", e.Index)); int slot = e.Index; if (TargetBin == null) { this.Dispatcher.Invoke(new Action(delegate() { ClearItemFields(); Errormsg.Text = "Target slot unknown ... Please rescan item"; ErrorTxt.Visibility = Visibility.Visible; })); return; } //is item in the right slot if (slot != TargetBin.PhidgetSlot) { this.Dispatcher.Invoke(new Action(delegate() { Errormsg.Text = "Please place item in right bin"; ErrorTxt.Visibility = Visibility.Visible; })); } else this.Dispatcher.Invoke(new Action(delegate() { //this event is fired multiple times if (vm.bReceivedAlready == false) { ErrorTxt.Visibility = Visibility.Hidden; logger.Info("write possibile changes to database"); if (vm.BCSMode) { if (item.Category.ID != 11) //do not save next day info as next time the item might NOT be next day) vm.SaveItem(item); } else { GSS gssItem = new GSS() { CreationDate = DateTime.Now, bin = TargetBin.PhidgetSlot, BarCode = TargetBin.BarCode }; vm.SaveItemGSS(gssItem); } ClearItemFields(); CustomerName.Text = ""; } vm.PhidgitController.outputs[TargetBin.PhidgetSlot] = false; vm.bReceivedAlready = true; })); }
void SetupActions() { grid1.Visibility = Visibility.Visible; Category cat = item != null ? item.Category : null; if (vm.BCSMode) TargetBin = vm.getBin(cat, assemblyInfo); else TargetBin = vm.getBinGSS(cat, assemblyInfo); if (TargetBin == null) { if (cat != null) MessageBox.Show(string.Format("Bin not found for category {0}", item.Category.Name)); else MessageBox.Show(string.Format("Bin not found for customer {0} Call Manager!", assemblyInfo.CustomerID)); return; } Action.Text = "Place in Lighted bin"; logger.Info("turn on bin light" + TargetBin.PhidgetSlot.ToString()); if (vm.bSimulatePhigetsMode == false) { turnoffLights(); //in case on is in the wrong state vm.PhidgitController.outputs[TargetBin.PhidgetSlot] = true; } vm.bReceivedAlready = false; Wizard.Visibility = Visibility.Hidden; if (vm.BCSMode) { if (item.Category.ID != 11) //do not save next day info as next time the item might NOT be next day vm.SaveItem(item); } else { GSS gssItem = new GSS() { CreationDate = DateTime.Now, bin = TargetBin.PhidgetSlot, BarCode = TargetBin.BarCode }; vm.SaveItemGSS(gssItem); } }