private void SetBigEndianCheckBox() { if (Watches.Count > 1) { // Aggregate state var hasBig = Watches.Any(x => x.BigEndian); var hasLittle = Watches.Any(x => x.BigEndian == false); if (hasBig && hasLittle) { BigEndianCheckBox.Checked = true; BigEndianCheckBox.CheckState = CheckState.Indeterminate; } else if (hasBig) { BigEndianCheckBox.Checked = true; } else { BigEndianCheckBox.Checked = false; } } else if (Watches.Count == 1) { BigEndianCheckBox.Checked = Watches[0].BigEndian; return; } var domain = MemoryDomains.FirstOrDefault(d => d.Name == DomainDropDown.SelectedItem.ToString()) ?? MemoryDomains.MainMemory; BigEndianCheckBox.Checked = domain.EndianType == Emu.MemoryDomain.Endian.Big; }
public void Update() { RunningTotalsDictionary.Clear(); TrackingDays.Clear(); Window.DayControls.Clear(); // update inventory data foreach (var inventoryItem in StaticInventoryTracker.AllInventoryItems) { if (Watches.Any(w => w.MasterID == inventoryItem.MasterID)) { ProductMasterItem keyMasterItem = null; keyMasterItem = StaticInventoryTracker.ProductMasterList.FirstOrDefault( m => m.MasterID == inventoryItem.MasterID); // if master item exists. if (keyMasterItem != null) { RunningTotalsDictionary[keyMasterItem.MasterID] = inventoryItem.Units; } } } // update WiP data foreach (var inventoryItem in StaticInventoryTracker.WiPItems) { if (Watches.Any(w => w.MasterID == inventoryItem.MasterID)) { ProductMasterItem keyMasterItem = null; keyMasterItem = StaticInventoryTracker.ProductMasterList.FirstOrDefault( m => m.MasterID == inventoryItem.MasterID); // if master item exists. if (keyMasterItem != null) { RunningTotalsDictionary[keyMasterItem.MasterID] = inventoryItem.Units; } } } if (CoatingSchedule.CurrentSchedule == null) { return; } foreach (var coatingScheduleLogic in CoatingSchedule.CurrentSchedule.ChildrenLogic) { var day = coatingScheduleLogic as CoatingScheduleDay; AddDay(new TrackingDay(day)); } //foreach (var productMasterItem in Watches) //{ // double currentInv = 0; // var inv = StaticInventoryTracker.InventoryItems.FirstOrDefault(x => x.MasterID == productMasterItem.MasterID); // if (inv != null) // currentInv = inv.Units; // foreach (var trackingDay in TrackingDays) // { // currentInv = trackingDay.AddTracking(productMasterItem, currentInv); // } //} }