public void setDistanceUnit(TypeDistanceUnitKnownValues new_value) { TypeDistanceUnit new_full_value = new TypeDistanceUnit(); Debug.Assert(new_value != TypeDistanceUnitKnownValues.DistanceUnit__none); new_full_value.in_known_list = true; new_full_value.list_value = new_value; setDistanceUnit(new_full_value); }
public string getDistanceUnitAsString() { TypeDistanceUnit result = getDistanceUnit(); if (result.in_known_list) { return(stringFromDistanceUnit(result.list_value)); } else { return(result.string_value); } }
public void setDistanceUnit(string chars) { TypeDistanceUnitKnownValues known = stringToDistanceUnit(chars); TypeDistanceUnit new_value = new TypeDistanceUnit(); if (known == TypeDistanceUnitKnownValues.DistanceUnit__none) { new_value.in_known_list = false; new_value.string_value = chars; } else { new_value.in_known_list = true; new_value.list_value = known; } setDistanceUnit(new_value); }
protected override void handle_result(string result) { TypeDistanceUnitKnownValues known = stringToDistanceUnit(result); TypeDistanceUnit new_value = new TypeDistanceUnit(); if (known == TypeDistanceUnitKnownValues.DistanceUnit__none) { new_value.in_known_list = false; new_value.string_value = result; } else { new_value.in_known_list = true; new_value.list_value = known; } handle_result(new_value); }
public void setDistanceUnit(TypeDistanceUnit new_value) { flagHasDistanceUnit = true; storeDistanceUnit = new_value; }
private void fromJSONDistanceUnit(JSONValue json_value, bool ignore_extras) { Debug.Assert(json_value != null); JSONStringValue json_string = json_value.string_value(); if (json_string == null) { throw new Exception("The value for field DistanceUnit of RobotMoveCommandJSON is not a string."); } TypeDistanceUnit the_open_enum = new TypeDistanceUnit(); switch (json_string.getData()[0]) { case 'c': if ((String.Compare(json_string.getData(), 1, "entimeter", 0, 9, false) == 0) && (json_string.getData().Length == 10)) { the_open_enum.in_known_list = true; the_open_enum.list_value = TypeDistanceUnitKnownValues.DistanceUnit_centimeter; goto open_enum_is_done; } break; case 'f': if ((String.Compare(json_string.getData(), 1, "oot", 0, 3, false) == 0) && (json_string.getData().Length == 4)) { the_open_enum.in_known_list = true; the_open_enum.list_value = TypeDistanceUnitKnownValues.DistanceUnit_foot; goto open_enum_is_done; } break; case 'i': if ((String.Compare(json_string.getData(), 1, "nch", 0, 3, false) == 0) && (json_string.getData().Length == 4)) { the_open_enum.in_known_list = true; the_open_enum.list_value = TypeDistanceUnitKnownValues.DistanceUnit_inch; goto open_enum_is_done; } break; case 'm': switch (json_string.getData()[1]) { case 'e': if ((String.Compare(json_string.getData(), 2, "ter", 0, 3, false) == 0) && (json_string.getData().Length == 5)) { the_open_enum.in_known_list = true; the_open_enum.list_value = TypeDistanceUnitKnownValues.DistanceUnit_meter; goto open_enum_is_done; } break; case 'i': if ((String.Compare(json_string.getData(), 2, "llimeter", 0, 8, false) == 0) && (json_string.getData().Length == 10)) { the_open_enum.in_known_list = true; the_open_enum.list_value = TypeDistanceUnitKnownValues.DistanceUnit_millimeter; goto open_enum_is_done; } break; default: break; } break; case 'y': if ((String.Compare(json_string.getData(), 1, "ard", 0, 3, false) == 0) && (json_string.getData().Length == 4)) { the_open_enum.in_known_list = true; the_open_enum.list_value = TypeDistanceUnitKnownValues.DistanceUnit_yard; goto open_enum_is_done; } break; default: break; } the_open_enum.in_known_list = false; the_open_enum.string_value = json_string.getData(); open_enum_is_done :; setDistanceUnit(the_open_enum); }
protected override void handle_result(TypeDistanceUnit result) { top.value.Add(result); }
protected override void handle_result(TypeDistanceUnit result) { //@@@ Debug.Assert(!have_value); have_value = true; value = result; }
protected abstract void handle_result(TypeDistanceUnit result);