public static bool VerifyLabInfo(LabData data) { BrowserUtilities.SwitchToFrame(); bool retVal = false; try { retVal = !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Lab ID: " + data.LabId)) && !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Laboratory Name: " + data.LaboratoryName)) && !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Company: " + data.Company)) && !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Department: " + data.Department)) && !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Address 1: " + data.Address1)) && !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Address 2: " + data.Address2)) && !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Address 3: " + data.Address3)) && !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("City/Town: " + data.City)) && !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("State/Province: " + data.State)) && !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Zip/Postal Code: " + data.Zip)) && !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("ISO Country: " + data.ISOCountry)) && !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Country: " + data.Country)) && !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Phone: " + data.Phone)) && !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Fax: " + data.Fax)) && !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Lab Status: " + data.LaboratoryStatus)) && !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Contact Person: " + data.ContactPerson)); } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } BrowserUtilities.SwitchToWindow(); return(retVal); }
public static bool IsLabExistInLabsTableOfSite(LabData labData) { try { WebTable_SearchCriteriaItemList list = new WebTable_SearchCriteriaItemList(); list.AddSearchItem(new WebTable_SearchCriteriaItem(0, labData.LabId, TableColumnContentType.Text)); IControl siteRow = WebTableUtilities.Table_FindRow(DL_AddSitePage.ActiveSubTabTable, list, 1); if (siteRow != null) { bool isLabNameExist = WebTableUtilities.HasText(siteRow, 1, labData.LaboratoryName); bool isCompanyExist = WebTableUtilities.HasText(siteRow, 2, labData.Company); bool isdepartmentExist = WebTableUtilities.HasText(siteRow, 3, labData.Department); bool isStatusExist = WebTableUtilities.HasText(siteRow, 6, labData.LaboratoryStatus); new DebugLogGenerator().WriteLog(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, "Lab Name Exists - " + isLabNameExist.ToString() + ",Company Exists - " + isCompanyExist.ToString() + ",Department Exists - " + isdepartmentExist.ToString() + ",Status Exists - " + isStatusExist.ToString()); return(isLabNameExist && isCompanyExist && isdepartmentExist && isStatusExist); } } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }
public void ThenIShouldnotSeeLabDataInLabsTabOfSiteInSitePage(Table table) { LabData data = table.CreateInstance <LabData>(); if (BP_SiteCreationUtilities.IsLabExistInLabsTableOfSite(table.CreateInstance <LabData>())) { ScenarioContext.Current["ActResult"] = "Failed"; } }
private void Load() { MemoryStream stream = new MemoryStream(Convert.FromBase64String(Binary)); BinaryFormatter bf = new BinaryFormatter(); LabData data = (LabData)bf.Deserialize(stream); Lab = data; ThingToSave1 = data.saved; }
public IActionResult Post([FromBody] LabData value) { var validationResult = value.Validate(); if (!validationResult.IsValid) return BadRequest(validationResult.Errors); _memCache.Add(value); return Ok($"{value.ToString()} has been added"); }
private const double Kappa = 903.3; // Intent is 24389/27 // These four vectors are already in xyz space. // http://www.ryanjuckett.com/programming/rgb-color-space-conversion/ public LabProcessor(LabData data) { Vector3 w = data.W.MultiplyScalar(1 / data.W.Y); var mtx = new Matrix3(new Vector3[] { data.R, data.G, data.B }); var inv = mtx.Invert(); var ret = inv.MultiplyVector(w); var vec = mtx.Invert().MultiplyVector(w); var tmp = new Matrix3 { tab = {
public IActionResult Put(Guid id, [FromBody] LabData value) { if (!_memCache.Has(id)) return NotFound("No such"); var validationResult = value.Validate(); if (!validationResult.IsValid) return BadRequest(validationResult.Errors); var previousValue = _memCache[id]; _memCache[id] = value; return Ok($"{previousValue.ToString()} has been updated to {value.ToString()}"); }
public static bool AddLab(LabData lab) { try { BP_LabCreationUtilities.SetLabData(DL_AddLabPage.AddLabTable, lab); Control_ActionUtilities.Click(DL_AddLabPage.SaveButton, String.Empty); return(BP_LabManagementUtilities.IsLabIdExists(lab.LabId)); } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }
public static bool EditLab(String labId, LabData lab) { try { IControl labLink = BP_LabManagementUtilities.GetLabLink(labId); Control_ActionUtilities.Click_PerssEnterKey(labLink, String.Empty); return(BP_LabCreationUtilities.AddLab(lab)); } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }
public IActionResult Post([FromBody] LabData value) { Log.Information("Acquiring team info"); var validationResult = value.Validate(); if (!validationResult.IsValid) { Log.Debug($"Uncorrected data"); return(BadRequest(validationResult.Errors)); } _memCache.Add(value); return(Ok($"{value.ToString()} has been added")); }
// Use this for initialization void Awake() { if (Binary == "") { Lab = new LabData(); Lab.saved = ThingToSave1; GenerateMaze(); Save(); } else { Load(); } }
private void runButton_Click(object sender, EventArgs e) { changeLabels(); switch ((Mode)separationCombobox.SelectedIndex) { case Mode.RGB: processor.Process(pictureBox2, pictureBox3, pictureBox4, new RgbProcessor()); break; case Mode.YCBr: processor.Process(pictureBox2, pictureBox3, pictureBox4, new YCbCrProcessor()); break; case Mode.HSV: processor.Process(pictureBox2, pictureBox3, pictureBox4, new HSVProcessor()); break; case Mode.Lab: LabData lab = null; if (CoordsChanged || (LabPresets)labPresetsCombobox.SelectedIndex == LabPresets.None) { lab = new LabData(double.Parse(Rx.Text), double.Parse(Ry.Text), double.Parse(Gx.Text), double.Parse(Gy.Text), double.Parse(Bx.Text), double.Parse(By.Text), double.Parse(Wx.Text), double.Parse(Wy.Text), double.Parse(gammaTexbox.Text), null); } else { lab = presetDictionary[(LabPresets)labPresetsCombobox.SelectedIndex]; } try { processor.Process(pictureBox2, pictureBox3, pictureBox4, new LabProcessor(lab)); } catch (NonInvertibleMatrixException exception) { MessageBox.Show(exception.Message, "Please change your input."); } break; default: MessageBox.Show("Not implemented", "Sorry"); break; } }
public List <LabData> LabList() { List <LabData> labList = new List <LabData>(); this.Open(); int recordCount = this.RetrieveRecords(); this.MoveFirst(); for (int x = 1; x <= recordCount; x++) { LabData labData = new LabData(this, x); labList.Add(labData); } return(labList); }
public static bool IsLabExistInLabsTableOfMRR(LabData labData) { try { WebTable_SearchCriteriaItemList list = new WebTable_SearchCriteriaItemList(); list.AddSearchItem(new WebTable_SearchCriteriaItem(0, labData.LabId, TableColumnContentType.Text)); list.AddSearchItem(new WebTable_SearchCriteriaItem(1, labData.LaboratoryName, TableColumnContentType.Text)); IControl siteRow = WebTableUtilities.Table_FindRow(DL_Lab_ManageReferenceRanges.LabsTable, list, 1); if (siteRow == null) { return(true); } } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }
public static void SetLabData(IControl labTable, LabData lab) { SetLabFieldData_Text(labTable, "Lab ID: *", lab.LabId); SetLabFieldData_Text(labTable, "Laboratory Name: *", lab.LaboratoryName); SetLabFieldData_Text(labTable, "Company: *", lab.Company); SetLabFieldData_Text(labTable, "Department:", lab.Department); SetLabFieldData_Text(labTable, "Address 1:", lab.Address1); SetLabFieldData_Text(labTable, "Address 2:", lab.Address2); SetLabFieldData_Text(labTable, "Address 3:", lab.Address3); SetLabFieldData_Text(labTable, "City/Town:", lab.City); SetLabFieldData_Text(labTable, "State/Province:", lab.State); SetLabFieldData_Text(labTable, "Zip/Postal Code:", lab.Zip); SetLabFieldData_Dropdown(labTable, "ISO Country: *", lab.ISOCountry); //SetLabFieldData_Text(labTable, "Country:", lab.Country); SetLabFieldData_Text(labTable, "Phone:", lab.Phone); SetLabFieldData_Text(labTable, "Fax:", lab.Fax); SetLabFieldData_Dropdown(labTable, "Laboratory Status: *", lab.LaboratoryStatus); SetLabFieldData_Text(labTable, "Contact Person:", lab.ContactPerson); }
public IActionResult Put(Guid id, [FromBody] LabData value) { Log.Information("Acquiring team info"); Log.Warning("User tried to delete information"); if (!_memCache.Has(id)) { return(NotFound("No such")); } var validationResult = value.Validate(); if (!validationResult.IsValid) { return(BadRequest(validationResult.Errors)); } var previousValue = _memCache[id]; _memCache[id] = value; Log.Debug($"Attempt to put information"); return(Ok($"{previousValue.ToString()} has been updated to {value.ToString()}")); }
private char getConnectedRoomType(char type, int wall) { if (RoomTypes == null) { LabData temp = Lab; Lab = new LabData(); foreach (char ch in new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8' }) { Room(ch); } RoomTypes = Lab; Lab = temp; } List <char> validTypes = new List <char>(); List <int> quads = null; foreach (Cell c in RoomTypes.Cells) { if (c.type == type) { quads = c.quadrants; break; } } foreach (Cell c in RoomTypes.Cells) { if (c.walls[wall] == -1) { if (!quads.Intersect(c.quadrants).Any()) { validTypes.Add(c.type); } } } return(validTypes[0]); }
// Source: // http://www.brucelindbloom.com/index.html?WorkingSpaceInfo.html private static void PopulateLabData() { #region Lab presets var adobeRgb = new LabData(0.6400, 0.3300, 0.2100, 0.7100, 0.1500, 0.0600, 0.31273, 0.32902, 2.2, IluminantPresets.D65); presetDictionary.Add(LabPresets.adobeRGB, adobeRgb); var appleRgb = new LabData(0.6250, 0.3400, 0.2800, 0.5950, 0.1550, 0.0700, 0.31273, 0.32902, 1.8, IluminantPresets.D65); presetDictionary.Add(LabPresets.appleRGB, appleRgb); var sRGB = new LabData(0.6400, 0.3300, 0.3000, 0.6000, 0.1500, 0.0600, 0.31273, 0.32902, 2.2, IluminantPresets.D65); presetDictionary.Add(LabPresets.sRGB, sRGB); var palSecamRGB = new LabData(0.6400, 0.3300, 0.2900, 0.6000, 0.1500, 0.0600, 0.31273, 0.32902, 2.2, IluminantPresets.D65); presetDictionary.Add(LabPresets.PAL_SECAM, palSecamRGB); var ntscRGB = new LabData(0.6700, 0.3300, 0.2100, 0.7100, 0.1400, 0.0800, 0.31006, 0.31615, 2.2, IluminantPresets.C); presetDictionary.Add(LabPresets.NTSC, ntscRGB); var cieRGB = new LabData(0.7350, 0.2650, 0.2740, 0.7170, 0.1670, 0.0090, 0.33333, 0.33333, 2.2, IluminantPresets.E); presetDictionary.Add(LabPresets.cieRGB, cieRGB); #endregion #region Iluminant presets iluminantDictionary.Add(IluminantPresets.C, new IluminantData(0.31006, 0.31615)); iluminantDictionary.Add(IluminantPresets.D50, new IluminantData(0.34567, 0.35850)); iluminantDictionary.Add(IluminantPresets.D65, new IluminantData(0.31273, 0.32902)); iluminantDictionary.Add(IluminantPresets.E, new IluminantData(0.33333, 0.33333)); #endregion }
void SetItemCanvas() { window_width = Screen.width; window_height = Screen.height; GameObject ItemBackground = ItemCanvas.transform.GetChild(0).gameObject; RectTransform rt = ItemBackground.GetComponent <RectTransform> (); float width = window_width / 10; float height = window_height / 10; rt.offsetMin = new Vector2(width, height); rt.offsetMax = new Vector2(-1 * width, -1 * height); width = window_width - width * 2; height = window_height - height * 2; if (SelectFrame == null) { SelectFrame = Instantiate(ItemFrame, ItemBackground.transform); RectTransform rt2 = SelectFrame.GetComponent <RectTransform> (); rt2.anchorMax = new Vector2(0, 0); rt2.anchorMin = new Vector2(0, 0); float framewidth = width / 60; rt2.offsetMax = new Vector2(width / 20 * (SelectedItem % 2 + 1) + (height / 16 * 3 * (SelectedItem % 2 + 1)) + framewidth, (height / 20 * (4 - SelectedItem / 2)) + (height / 16 * 3 * (4 - SelectedItem / 2)) + framewidth); rt2.offsetMin = new Vector2(width / 20 * (SelectedItem % 2 + 1) + (height / 16 * 3 * (SelectedItem % 2)) - framewidth, (height / 20 * (4 - SelectedItem / 2)) + (height / 16 * 3 * (3 - SelectedItem / 2)) - framewidth); } else { RectTransform rt2 = SelectFrame.GetComponent <RectTransform> (); float framewidth = width / 60; rt2.offsetMax = new Vector2(width / 20 * (SelectedItem % 2 + 1) + (height / 16 * 3 * (SelectedItem % 2 + 1)) + framewidth, (height / 20 * (4 - SelectedItem / 2)) + (height / 16 * 3 * (4 - SelectedItem / 2)) + framewidth); rt2.offsetMin = new Vector2(width / 20 * (SelectedItem % 2 + 1) + (height / 16 * 3 * (SelectedItem % 2)) - framewidth, (height / 20 * (4 - SelectedItem / 2)) + (height / 16 * 3 * (3 - SelectedItem / 2)) - framewidth); } for (int i = 0; i < 8; i++) { ShowItemID[i] = -1; } for (int i = 0; i < 8; i++) { int ItemCount = 0; if (ShowItem[i] == null) { GameObject newItem = Instantiate(ItemBack, ItemBackground.transform); RectTransform rt2 = newItem.GetComponent <RectTransform> (); rt2.anchorMax = new Vector2(0, 0); rt2.anchorMin = new Vector2(0, 0); rt2.offsetMax = new Vector2(width / 20 * (i % 2 + 1) + (height / 16 * 3 * (i % 2 + 1)), (height / 20 * (4 - i / 2)) + (height / 16 * 3 * (4 - i / 2))); rt2.offsetMin = new Vector2(width / 20 * (i % 2 + 1) + (height / 16 * 3 * (i % 2)), (height / 20 * (4 - i / 2)) + (height / 16 * 3 * (3 - i / 2))); ShowItem[i] = newItem; ShowItem[i].GetComponent <Image> ().color = new Color32(255, 255, 255, 0); } else { ShowItem[i].GetComponent <RectTransform> ().offsetMax = new Vector2(width / 20 * (i % 2 + 1) + (height / 16 * 3 * (i % 2 + 1)), (height / 20 * (4 - i / 2)) + (height / 16 * 3 * (4 - i / 2))); ShowItem[i].GetComponent <RectTransform> ().offsetMin = new Vector2(width / 20 * (i % 2 + 1) + (height / 16 * 3 * (i % 2)), (height / 20 * (4 - i / 2)) + (height / 16 * 3 * (3 - i / 2))); ShowItem[i].GetComponent <Image> ().color = new Color32(255, 255, 255, 0); } if (!LabMode) { for (int j = 0; j < ItemClass; j++) { if (ItemAmount[j] > 0) { ItemCount++; if (ItemCount > i + 8 * ItemPage && ShowItemID[i] == -1) { ItemData GetItem = GetItemData(j); ShowItem[i].GetComponent <Image> ().sprite = Resources.Load <Sprite> (GetItem.ItemIcon); ShowItem[i].GetComponent <Image> ().color = new Color32(255, 255, 255, 255); ShowItemID[i] = j; } } } } else { if (LabGotten[i + 8 * ItemPage]) { LabData GetLab = GetLabData(i + 8 * ItemPage); ShowItem[i].GetComponent <Image> ().sprite = Resources.Load <Sprite> (GetLab.LabIcon); ShowItem[i].GetComponent <Image> ().color = new Color32(255, 255, 255, 255); ShowItemID[i] = i + 8 * ItemPage; } } } RectTransform rt3 = ItemName.GetComponent <RectTransform> (); rt3.offsetMax = new Vector2(width / 12 * 11, height / 10 * 9); rt3.offsetMin = new Vector2(width / 12 * 5, height / 10 * 7); RectTransform rt4 = ItemInfo.GetComponent <RectTransform> (); rt4.offsetMax = new Vector2(width / 12 * 11, height / 10 * 7); rt4.offsetMin = new Vector2(width / 12 * 5, height / 10 * 1); if (ShowItemID[SelectedItem] != -1) { if (!LabMode) { ItemData GetItem2 = GetItemData(ShowItemID[SelectedItem]); ItemName.GetComponent <TMPro.TextMeshProUGUI> ().text = "[" + GetItem2.ItemName + "]"; ItemInfo.GetComponent <TMPro.TextMeshProUGUI> ().text = GetItem2.ItemInfo; } else { LabData GetLab2 = GetLabData(ShowItemID[SelectedItem]); //LabPage = GetLab2.LabInfo.Length - 1; ItemName.GetComponent <TMPro.TextMeshProUGUI> ().text = "[" + GetLab2.LabName + "]"; //ItemInfo.GetComponent<TMPro.TextMeshProUGUI> ().text = GetLab2.LabInfo[LabPageNow]; ItemInfo.GetComponent <TMPro.TextMeshProUGUI> ().text = ""; foreach (string text in GetLab2.LabInfo) { ItemInfo.GetComponent <TMPro.TextMeshProUGUI> ().text += text + "\n"; } } } else { ItemName.GetComponent <TMPro.TextMeshProUGUI> ().text = ""; ItemInfo.GetComponent <TMPro.TextMeshProUGUI> ().text = ""; } }